Not sure if you know off hand how well does an Allwinner H6 running LE Matrix and HEVC? I know there are issues with Amlogic and HEVC currently but is Allwinner development more stable?
Allwinner H6 HEVC?
-
hieppo -
February 10, 2022 at 2:50 PM -
Thread is Unresolved
-
-
Best to ask the Allwinner devs. I have some Allwinner boards in my collection but they are mostly gathering dust.
-
hieppo At this time, very well. Recently, two HEVC fixes were merged, which will land in LE 10.0.2. However, HEVC already decodes correctly for me, even without those two fixes.
What are your requirements? Note that 10-bit HEVC also works, but it's decoded and rendered as 8-bit. I'm working on this, but it will take a while to make whole pipeline 10-bit.
-
hieppo At this time, very well. Recently, two HEVC fixes were merged, which will land in LE 10.0.2. However, HEVC already decodes correctly for me, even without those two fixes.
What are your requirements? Note that 10-bit HEVC also works, but it's decoded and rendered as 8-bit. I'm working on this, but it will take a while to make whole pipeline 10-bit.
Thanks for the information. I was looking at a cheap H6 box but was sure if I should add another useless box to my inventory of Android box.
H264 is perfect for all boxes. My main concern is playing HEVC. I have several S905x 1GB RAM boxes. I tried LE Amlogic but it can't do 4K 10bit files. My S912 box has 4K pixelation issue and can't seek 1080p and lower resolution.
So as long as I don't play 4K or play 1080p and lower from beginning to end. It is good.
So compared to Amlogic, how is the Allwinner solution? Does it have the same issue? If not what other playing issue does it have?
-
No, issues are not the same. 4K 10-bit decoding works, but as I said, colours are not 100% correct, because it's rendered as 8-bit. I'm working on this.
I doubt you'll find any 1 GB RAM H6 box. Lowest specs are 2 GB and that's already enough. Note that most boxes use 100 Mbit ethernet for some reason. Also worth considering is wifi. Most chips are not supported, but at least for 3 most popular modules, drivers are WIP. Last but not least, only 2 distinct H6 boxes are supported by LE - Tanix TX6 and Beelink GS1. Most of cheap boxes on market will be compatible with Tanix TX6 image. However, they will probably have different IR remote keymap, which will make them impossible to wake from sleep via IR and of course, you'll have to set up your own IR keymap for navigating.
-
Guess nothing is perfect. If I can pick up a free or cheap Allwinner, I will play around.
-
I got H6 Beelink GS1, using it daily for a last few weeks with 1080p TV, so can give some feedback.
It’s certainly usable, smooth hardware playback 1080p60 8bit for all three relevant codecs H.264/HEVC/VP9. No problems seeking videos.
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.
4K60 is probably only realistic with HEVC, both H.264 and VP9 hardware decoders seem to only handle 4K30. Had to increase kernel CMA memory reservation while trying 4K60 10bit HEVC, defaults are too low.
Now, some some bugs and annoyances:
Hardware deinterlaced videos tend to stuck after resuming from pause, need to seek to get them going again.
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.
H6 still needs algorithmdirtyregions=0 set in Kodi, otherwise any video will stutter.
HDMI CEC seems to be very stable and usable now. But I had to disable it, because Panfrost GPU drivers ability to sleep is still semi-broken, every second or third attempt to suspend fails, so TV gets woken up by CEC, etc.
Crust co-processor firmware rocks as well, this box consumes pretty much zero watts in sleep. If Panfrost will let you to suspend it, that is
H6 box can also be configured to support pretty much any IR remote, including wakeup button if you bother to rebuild Crust. I certainly did, reused big comfortable remote from old mediaplayer.
Theoretically, if display output stack gets some upgrades, H6 can become as capable video player as RPI4: 4K60 with 10bits and HDR should be real.
-
Thanks offbeat for the great feedback. It gives me hope since it seems Allwinner abilities currently ahead of Amlogic. S912 with panfrost should be as good but i go l guess dev is a bit behind.
Btw any Allwinner boxes had gigabit LAN
-
I have a T95 Max box currently that I'm running with the nightly Tanix TX6 images, and in regards to HEVC all my files up to 4k30 play fine, but most 4k60 files struggle for me at the moment.
-
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 you have video sample which causes out of CMA memory issue, I would appreciate if you can provide it to me.
Two HEVC 4K@60 samples, one seems to be 8-bit, another is 10-bit. Both captured from NASA UHD TV channel, free-to-air on Hotbird 13E satellite.
H6 can't play any of these with default CMA settings, partially decodes first frame, green screen rest, kernel log full of cma errors. No more errors after booting with cma=1024M, but playback isn't smooth. Also, for some reason Kodi switches from 60p to 30p output after a second of playback.I'm outputing to 1080p60 TV, so there is some downscaling involved as well.
Code
Display More[ 51.564148] cma: cma_alloc: reserved: alloc failed, req-size: 3038 pages, ret: -12 [ 51.564222] ------------[ cut here ]------------ [ 51.564226] WARNING: CPU: 3 PID: 856 at mm/page_alloc.c:5346 __alloc_pages+0x624/0xc3c [ 51.564254] Modules linked in: 8021q garp stp mrp llc rfkill hantro_vpu(C) v4l2_vp9 dwmac_sun8i sunxi_cir v4l2_h264 crct10dif_ce panfrost gpu_sched sun50i_di videobuf2_vmalloc fuse [ 51.564312] CPU: 3 PID: 856 Comm: VideoPlayer Tainted: G C 5.16.5 #1 [ 51.564322] Hardware name: Beelink GS1 (DT) [ 51.564329] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 51.564337] pc : __alloc_pages+0x624/0xc3c [ 51.564342] lr : __dma_direct_alloc_pages+0x15c/0x1a4 [ 51.564362] sp : ffff800009bbb7d0 [ 51.564364] x29: ffff800009bbb7d0 x28: 000000000000000c x27: 0000000000000001 [ 51.564372] x26: ffff00000c254090 x25: ffff00000c254028 x24: ffff00000190ec10 [ 51.564380] x23: ffff8000080be248 x22: 0000000000bde000 x21: 0000000000000cc1 [ 51.564388] x20: 0000000000bde000 x19: ffff00000190ec10 x18: 0000000000000020 [ 51.564396] x17: 6572202c73656761 x16: 702038333033203a x15: 657a69732d716572 [ 51.564404] x14: 202c64656c696166 x13: ffff8000094109f8 x12: 00000000000003e7 [ 51.564412] x11: 000000000000014d x10: ffff8000094689f8 x9 : 00000000fffff000 [ 51.564420] x8 : 0000000000000000 x7 : ffff8000094689f8 x6 : 0000000000000000 [ 51.564428] x5 : 0000000000000001 x4 : 000000000000003f x3 : 0000000000000000 [ 51.564436] x2 : ffff00000719b500 x1 : 0000000000000000 x0 : 0000000000000cc1 [ 51.564444] Call trace: [ 51.564449] __alloc_pages+0x624/0xc3c [ 51.564456] __dma_direct_alloc_pages+0x15c/0x1a4 [ 51.564462] dma_direct_alloc+0x6c/0x310 [ 51.564469] dma_alloc_attrs+0x78/0xe0 [ 51.564475] vb2_dc_alloc+0x98/0x16c [ 51.564493] __vb2_queue_alloc+0x190/0x450 [ 51.564498] vb2_core_create_bufs+0x110/0x354 [ 51.564503] vb2_create_bufs+0x15c/0x1f0 [ 51.564507] v4l2_m2m_ioctl_create_bufs+0x44/0x50 [ 51.564521] v4l_create_bufs+0x98/0xdc [ 51.564532] __video_do_ioctl+0x174/0x3d0 [ 51.564537] video_usercopy+0x220/0x6ec [ 51.564543] video_ioctl2+0x14/0x20 [ 51.564548] v4l2_ioctl+0x3c/0x60 [ 51.564553] v4l2_compat_ioctl32+0x88/0xb0 [ 51.564559] __arm64_compat_sys_ioctl+0x140/0x16c [ 51.564569] invoke_syscall+0x44/0x110 [ 51.564581] el0_svc_common.constprop.0+0x40/0xe0 [ 51.564587] do_el0_svc_compat+0x18/0x30 [ 51.564593] el0_svc_compat+0x14/0x4c [ 51.564608] el0t_32_sync_handler+0x88/0x11c [ 51.564615] el0t_32_sync+0x15c/0x160 [ 51.564625] ---[ end trace 925325d3669239df ]--- [ 51.564649] cedrus 1c0e000.video-codec: dma alloc of size 12443648 failed [ 51.573792] cma: cma_alloc: reserved: alloc failed, req-size: 3038 pages, ret: -12 [ 51.573845] cedrus 1c0e000.video-codec: dma alloc of size 12443648 failed [ 51.576929] cma: cma_alloc: reserved: alloc failed, req-size: 1024 pages, ret: -12 [ 51.577346] cma: cma_alloc: reserved: alloc failed, req-size: 3038 pages, ret: -12
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
Cherry picked iommu commit, xtest.patch doesn't apply, probably something already in master.
-
Cherry picked iommu commit, xtest.patch doesn't apply, probably something already in master.
Yes, just remove this chunk: https://github.com/jernejsk/Libre….patch#L98-L106
-
Quick test of iommu commit:
1) Kodi starts with a few drm_gem errors, but keeps running
Code
Display More[ 17.546100] ------------[ cut here ]------------ [ 17.546117] WARNING: CPU: 3 PID: 738 at drivers/gpu/drm/drm_gem.c:1054 drm_gem_mmap_obj+0x158/0x170 [ 17.546140] Modules linked in: 8021q garp stp mrp llc rfkill dwmac_sun8i hantro_vpu(C) sunxi_cir crct10dif_ce v4l2_vp9 v4l2_h264 sun50i_di panfrost gpu_sched videobuf2_vmalloc fuse [ 17.546181] CPU: 3 PID: 738 Comm: kodi.bin Tainted: G C 5.16.5 #1 [ 17.546186] Hardware name: Beelink GS1 (DT) [ 17.546190] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 17.546196] pc : drm_gem_mmap_obj+0x158/0x170 [ 17.546200] lr : drm_gem_mmap_obj+0x78/0x170 [ 17.546204] sp : ffff800009d03bb0 [ 17.546207] x29: ffff800009d03bb0 x28: ffff000002250a80 x27: 0000000000000008 [ 17.546214] x26: 00000000ea902000 x25: ffff000006313730 x24: ffff0000061cdf18 [ 17.546222] x23: ffff000003516a00 x22: ffff000006dc6800 x21: 0000000000000000 [ 17.546229] x20: ffff000006313730 x19: ffff0000061db000 x18: 0000000000000000 [ 17.546237] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000002 [ 17.546244] x14: 0000000000069f42 x13: 0000000000000001 x12: 0000000000000000 [ 17.546251] x11: 00000000ea902000 x10: 00000000eb0eb000 x9 : 00000000000007e9 [ 17.546259] x8 : 0000000000000001 x7 : 0000000000000012 x6 : ffff800076950000 [ 17.546266] x5 : ffff800009d03990 x4 : ffff8000095274c0 x3 : 0000000000000000 [ 17.546273] x2 : 0000000000000000 x1 : ffff000003443500 x0 : 00000000100000fb [ 17.546281] Call trace: [ 17.546284] drm_gem_mmap_obj+0x158/0x170 [ 17.546289] drm_gem_mmap+0x12c/0x200 [ 17.546293] mmap_region+0x388/0x574 [ 17.546300] do_mmap+0x2c8/0x49c [ 17.546304] vm_mmap_pgoff+0xd8/0x100 [ 17.546312] ksys_mmap_pgoff+0x194/0x1d4 [ 17.546316] __arm64_compat_sys_aarch32_mmap2+0x1c/0x24 [ 17.546324] invoke_syscall+0x44/0x110 [ 17.546329] el0_svc_common.constprop.0+0x40/0xe0 [ 17.546334] do_el0_svc_compat+0x18/0x30 [ 17.546339] el0_svc_compat+0x14/0x4c [ 17.546348] el0t_32_sync_handler+0x88/0x11c [ 17.546354] el0t_32_sync+0x15c/0x160 [ 17.546360] ---[ end trace daa0f7c2d1a9e063 ]--- [ 19.070650] ------------[ cut here ]------------
2) Some HEVC videos give iommu faults, requiring reboot. Uploaded F1.x265.2160p50.ts sample to GDrive at the link above.
Code[ 111.890421] sun50i-iommu 30f0000.iommu: Page fault for 0x000000000000e000 (master 1, dir rd) [ 111.890445] IOMMU: Level 1 page error [ 113.890831] cedrus 1c0e000.video-codec: frame processing timed out!
3) VP9 10bit videos are failing with iommu fault as well
Code
Display More[ 363.631608] sun50i-iommu 30f0000.iommu: Page fault for 0x00000000f17ff000 (master 5, dir rd) [ 363.631651] IOMMU: Level 2 page error [ 365.661445] hantro_watchdog:119: frame processing timed out! [ 367.677482] hantro_watchdog:119: frame processing timed out! [ 369.697446] hantro_watchdog:119: frame processing timed out! [ 371.713483] hantro_watchdog:119: frame processing timed out! [ 373.725456] hantro_watchdog:119: frame processing timed out! [ 375.741441] hantro_watchdog:119: frame processing timed out! [ 375.743783] sun50i-iommu 30f0000.iommu: TLB Flush timed out! [ 375.746577] sun50i-iommu 30f0000.iommu: TLB Flush timed out! [ 375.749433] sun50i-iommu 30f0000.iommu: TLB Flush timed out! [ 375.752228] sun50i-iommu 30f0000.iommu: TLB Flush timed out! [ 375.754967] sun50i-iommu 30f0000.iommu: TLB Flush timed out! [ 375.757727] sun50i-iommu 30f0000.iommu: TLB Flush timed out!
-
There is a reason why I didn't PR those changes yet Although VP9 worked for me.
-
Although VP9 worked for me.
Yeah, 8bit VP9 is fine, only 10bit one faults iommu. Uploaded crashing sample just in case, COSTA.RICA.vp9.1080p60.HDR.mkv.
But I know 10bit isn't there yet on master too. -
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.
-
offbeat you can try this patch to make VP9 10-bit work (downscaled to 8-bit): http://ix.io/3Qje
-
can try this patch to make VP9 10-bit work (downscaled to 8-bit)
Tested this patch on both master(cma=1024M) and iommu branch.
Looking good, not a single error in logs!
Works for every 8bit and 10bit VP9 sample I've got, all from Youtube anyway.
10bit HDR plays with washed out colors, but thats probably expected, H6 HDMI hardware tonemapping most likely isn't implemented yet.Also tested bare decoding speed with ffmpeg commandline:
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.I'd say this VP9 fix patch should go to master, nice job!
-