McTurbo Posted April 27 Share Posted April 27 I've compiled mainline kernel 6.6 which runs well on my OrangePi/RK3399. The only problem left is getting H.264 decoding working. Unfortunately, when I query /dev/video1 which is the node created by the hantro-vpu driver, only MPEG2 and VP8 are shown as supported codecs for decoding. No H.264, even though I've read many places that the mainline hantro driver supports H.264. Has anyone else had this problem? Is there something else I need to do to get this working? 0 Quote Link to comment Share on other sites More sharing options...
Werner Posted April 27 Share Posted April 27 Just a pure guess but have you tried a more recent userspace like noble or trixie? Maybe the kernel isn't the issue but the software accessing it. 0 Quote Link to comment Share on other sites More sharing options...
McTurbo Posted April 27 Author Share Posted April 27 I'm using vl42-ctl to query the kernel directly through ioctls, so these decoders should show. The only other thing is no more than 2 nodes are created: /dev/video0 and /dev/video1. Could it be a udev thing? 0 Quote Link to comment Share on other sites More sharing options...
McTurbo Posted April 27 Author Share Posted April 27 Turns out it was a device tree problem. After updating the device tree, I can see the nodes set up by the mainline Rockchip hantro-vpu and rkvdec modules: /dev/video0: rockchip-rga /dev/video1: hantro-vpu (encoder) /dev/video2: hantro-vpu (decoder) /dev/video3: rkvdec 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted April 27 Share Posted April 27 4 hours ago, McTurbo said: hantro-vpu driver, only MPEG2 and VP8 are shown as supported codecs for decoding. No H.264 Since userspace cannot sensibly select between two decoder instances of the same type, the H.264 hanto decoder is usually disabled for the rk3399 and the H.264 rkvdec is preferred. videoX-infos-nanopc-t4.log 0 Quote Link to comment Share on other sites More sharing options...
McTurbo Posted April 27 Author Share Posted April 27 (edited) 1 hour ago, usual user said: Since userspace cannot sensibly select between two decoder instances of the same type, the H.264 hanto decoder is usually disabled for the rk3399 and the H.264 rkvdec is preferred. Thanks. Just to be clear, that's the rkvdec from staging drivers, right? It overrides hantro for H.264? Oh and I'm assuming the reason hantro H.264 is disabled is rkvdec offers better performance. Is that right? Edited April 27 by McTurbo 0 Quote Link to comment Share on other sites More sharing options...
jock Posted May 1 Share Posted May 1 On 4/27/2024 at 8:44 AM, McTurbo said: Thanks. Just to be clear, that's the rkvdec from staging drivers, right? It overrides hantro for H.264? Oh and I'm assuming the reason hantro H.264 is disabled is rkvdec offers better performance. Is that right? rkvdec does not technically "override" hantro h.264: hantro and rkvdec are two totally different devices and both are exposed by v4l2 framework to userspace. It's up to the user application to choose the preferred device. Ffmpeg, which is perhaps the most common user application around, has no way to choose the v4l2 device for h.264. The workaround to force ffmpeg to use rkvdec (yes, because it is more performant) was to avoid declaring hantro as capable of h.264, sto the only left h.264 decoder is rkvdec. edit: and yes, rkvdec is in the kernel staging directory, plus armbian has a patch to enable h.265 decoding too 0 Quote Link to comment Share on other sites More sharing options...
McTurbo Posted May 9 Author Share Posted May 9 On 5/1/2024 at 5:34 AM, jock said: avoid declaring hantro as capable of h.264, sto the only left h.264 decoder is rkvdec. Where is this done? Is this done in the source for the hantro module? If I wanted to experiment by enabling the hantro H.264 decoder, how would I do that? On 5/1/2024 at 5:34 AM, jock said: armbian has a patch to enable h.265 decoding too Is this the same patch used by LibreELEC? I have H.264 decoding working, so I definitely want to try this. 0 Quote Link to comment Share on other sites More sharing options...
jock Posted May 10 Share Posted May 10 17 hours ago, McTurbo said: Where is this done? Is this done in the source for the hantro module? If I wanted to experiment by enabling the hantro H.264 decoder, how would I do that? Definitely, if you look at the kernel source code you can enable the codec 17 hours ago, McTurbo said: Is this the same patch used by LibreELEC? I have H.264 decoding working, so I definitely want to try this. Yes, it is. I think it is in the kernel mailing list, so it is something that is already floating around and eventually will be merged. 0 Quote Link to comment Share on other sites More sharing options...
McTurbo Posted May 10 Author Share Posted May 10 Thanks so much for your help! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.