Posts by jernej

    The Display only features DVI out in so I use an adapter to get a hdmi cable connected. How could I manually force the correct resolution?

    What kind of adapter is that? I tested native DVI monitors in the past, but I didn't noticed any issues. Forcing correct resolutions is a bit tricky unless it's standard (720p or 1080p). If it's not, you have to find useful edid somewhere, create initrd from it, add it on SD card partition and update pxeconfig to load that initrd and add kernel parameter to use it. I've never done it, so I don't know exact steps.

    Actually I have no wlan0 device at all, running iw wlan0 scan doesn't work therefor.

    Your box either doesn't have same wifi as mine X2 or they rerouted some traces. I suggest you open up the box and check which wifi module is used.

    I just tested wifi on my X2. Driver loads ok and I see wifi networks listed in LibreELEC settings. However, after some time they all disappeared. After running iw wlan0 scan over ssh, they appeared again and stayed there. I have no idea whose fault that is.

    1024x768 resolution almost always means that EDID couldn't be read. I tested many non-standard resolutions on H3 and they worked, unless there was some issue with clocks, but that shouldn't happen anymore.

    In any case, provide outputs of following commands:

    pastekodi

    cat /sys/kernel/debug/clk/clk_summary

    edid-decode /sys/class/drm/card0-HDMI-A-1/edid

    offbeat I converted NASA.x265.2160p60.ts to mkv with following command:

    Code
    ffmpeg -i NASA.x265.2160p60.ts -c:v copy -c:a copy NASA.x265.2160p60.mkv

    I can confirm that TS file indeed produces iommu errors but mkv with same data does not.

    I already observed issues with TS files in the past, usually because they start in the middle of the stream, with B or P frames. Converting it to matroska takes care that stream starts with a key frame.

    So as far as I can tell, there are three issues:

    1. slow decoding loop in ffmpeg

    2. rendering issue, probably DRM driver needs some improvement, possibly around YUV scaler (workaround is to use EGL rendering)

    3. Cedrus needs to be more resilient to stream errors (mostly missing references for B and P frames)

    I guess I'll only PR frequency fixes and leave iommu branch for now. I think it's more important to finish 10-bit HDMI output support and after that, add proper 10-bit output from Cedrus and Hantro (for VP9). EDIT: and of course proper VP9 10-bit support.

    Thanks for report. Can you check if switching rendering method from "Direct to plane" to "EGL" avoids iommu issues? It does for me, at least for some videos.

    EDIT: Actually, if ffmpeg decoding with -f null - works, I think issue might be in display driver or misreporting actual buffer information, like size or stride.

    offbeat this patch http://ix.io/3QwZ should improve VP9 decoding speed and hopefully lower issues with Cedrus based decoding. It turns out that Android box is running VP9 core on much higher frequency and Cedrus on slightly lower. While at least in Cedrus case it doesn't seem much, it can be just enough to avoid issues. Let me know if this makes VP9 4k 30fps fast enough for you. I would also like to know if HDR works for you.

    Can test on modern HDR capable monitor if needed, but guess not much point until H6 HDMI driver gains ability to send HDR metadata to display.

    That ability exists for some time now and it works for HEVC videos, didn't test VP9 yet (I heard HDR metadata is packed differently in VP9 streams). However, colours are still off - HDR is usually connected with 10-bit output, which isn't implemented yet.

    EDIT: one IOMMU issue is probably fixed with https://www.spinics.net/lists/kernel/msg4055249.html

    EDIT2: above patch indeed fixes kernel warning and H6 indeed sends HDR info to display when playing your Costa Rica VP9 10-bit HDR demo, I updated my iommu branch, if you're interested

    I'd say this VP9 fix patch should go to master, nice job!

    Thanks for testing! This is just a quick hack and it uses more memory than necessary for 8-bit videos (unconditional buf_size *= 2;). I'll make proper patch series soon, hopefully over next weekend.

    10bit HDR plays with washed out colors, but thats probably expected, H6 HDMI hardware tonemapping most likely isn't implemented yet.

    I suppose you're testing this on non-HDR capable screen? During writing 10-bit HDMI output support, I noticed that HW does proper downscale from 10-bit to 8-bit, but that is probably just averaging. There is HW for applying HDR tonemapping, but I have no idea how to use it nor how to integrate it in DRM framework.

    Typical 4K 8bit VP9 decodes at ~32 FPS, and 4K 10bit HDR is slower at ~24FPS. Probably ffmpeg decode path isn't 100% optimized yet.
    Allwinner datasheet only promises "VP9 Profile 0/2 4K@30fps", so 4K@60 most likely isn't achievable on H6.

    Yeah, ffmpeg is not optimized yet. As I said before, adopting RPi HEVC approach should yield more performance, but that probably won't happen soon.

    Tested this patch on both master(cma=1024M) and iommu branch.

    Looking good, not a single error in logs!

    We can't afford to set CMA so high, some boards only have 1 GiB of RAM. But I'm glad IOMMU doesn't report any issue. This means my quick patch is sound.

    Log shows that TV was properly detected (all resolutions are listed) and you even played video. Make another log, this time make sure it's created "during" the issue, e.g. when you only hear sound effects but Kodi is not visible.

    I'm not sure what needs to be done in order for kernel to pick up edid file. FAT partition is mounted to /flash, so proper line would be /flash/edid.bin, but then kernel might request file before /flash is even mounted... Anyway, reading EDID should not be problem even if TV is turned off. Try with only video=HDMI-A-1:D

    That's actually a good clue! This means some buffer is too small. With a little extra debug output, it shouldn't be that hard to figure which one. Well, there are some additional registers to set, but hopefully, that's all.

    there is a merged commit "Add analogue audio driver to Allwinner H6" for the 5.4 kernel.

    Analogue audio is not implemented there. However, I know where confusion comes from. H6 contains AC200 IC integrated alongside SoC. AC200 is responsible for several things, like Ethernet PHY for fast ethernet and also analogue audio. So patches mentions audio, but only functionality really implemented there is Ethernet PHY.

    offbeat if you have video sample which causes out of CMA memory issue, I would appreciate if you can provide it to me. However, this should soon become issue of the past, I'm working for some time now on fixing all IOMMU issues and once fixed, Cedrus will use normal memory allocator instead of CMA. Interestingly, IOMMU is great debugging tool. If there is access outside of designated buffer, it complains. This already allowed me to fix some Cedrus bugs. Anyway, if you want to see current progress (some H264 videos and HW deinterlacing doesn't work), you can check https://github.com/jernejsk/LibreELEC.tv/commits/iommu

    GPU suspend issue is really unfortunate, but no panfrost developer on IRC seems to be particularly interested in fixing that (at least at time of asking some time ago). I looked into this quickly, but it's way over my head, GPU drivers are not my cup of tea.

    HDMI output can randomly drop out for a second, both during playback and in menu. Probably some output timings issues, since sometimes (rare though) TV gets confused and refuses to display certain Hz videos, requiring on/off cycle, which never happened outputing from my other STBs.

    I went over BSP HDMI driver code many times now and I believe everything is as it should be with latest nightly images, except maybe some minor HDMI PHY settings. I haven't experience any HDMI related issue for a long time. I learned the hard way that HDMI signal quality also depends on board design. During development of H616 HDMI driver I didn't have any luck of getting 4k output on OrangePi Zero2 board. It turns out, 4k also doesn't work with BSP kernel image. However, on H616 TV box, everything work as expected.

    H6 still needs algorithmdirtyregions=0 set in Kodi, otherwise any video will stutter.

    I don't experience that, not sure why.

    10bit HEVC plays just fine, 10bit VP9 isn’t really working yet (decodes to garbled pixels). Can’t vouch for colors, most likely TV only gets 8bit for now.

    True on all counts. VP9 driver is pretty new, nobody really worked on 10-bit support. I did a quick check, but nothing stands out. It needs detailed analysis. 10-bit HDMI output is being worked on.

    Note that ffmpeg decoding loop is not optimized for speed, ideally RPi ffmpeg code for HEVC should be reused (it uses same interface as Cedrus) since it was already improved for speed. Also HEVC supports AFBC "compression", which makes memory accesses more efficient and that translates to higher decoding speed. Needless to say, that also needs to be added.

    So, H6 still has a lot of untapped potential. Many issues/missing features are being worked on, but currently I'm busier than expected, so progress is slow. Some issues are not addressed at all, mostly because I don't experience them, so any kind of detailed analysis is impossible.

    if I start my PineA64 (or any other PC) before the TV turn on, I cannot see the Kodi interface, instead I see the last terminal message in the up left corner and the LibreElec logo in the center.

    This is probably Kodi issue, not LE. At this point it would be interesting to know if Kodi is running (output of top) and information provided by pastekodi

    I've tried to use edid.bin inside FAT partition and andd commands inside the extlinux.conf file, but the Pine64 does not start, and I got a critical error.

    You have to be much more specific than that. What exactly did you write, what edid.bin file did you use, what error did you get?

    I've tried to use the command getedid create but I got the error getedid: command not found.

    what are you trying to do with that command?