Skip to content

RPi4: switch to KMS driver and enable v4l2 HEVC decoding#4288

Merged
CvH merged 10 commits intoLibreELEC:masterfrom
HiassofT:le10-rpi4-v4l2
Jun 20, 2020
Merged

RPi4: switch to KMS driver and enable v4l2 HEVC decoding#4288
CvH merged 10 commits intoLibreELEC:masterfrom
HiassofT:le10-rpi4-v4l2

Conversation

@HiassofT
Copy link
Member

@HiassofT HiassofT commented Apr 1, 2020

This is very WIP, meant for early testing only. Lots of rough edges and stuff missing so you have been warned :-)

Note: #4286 is also needed to get the kernel KMS driver patches

@HiassofT
Copy link
Member Author

RPi kernel now supports setting the CMA memory size via DT, I've updated the PR to use that in distroconfig.txt instead of the earlier cmdline approach.

Being able to change it via (distro)config.txt makes things a lot easier for us as changes can be rolled out via updates).

As some 4k HEVC files didn't seem to play with 256MB CMA I've kept the 512MB default for now, we can probably reduce it to 384MB or so later (needs some extensive testing though)

@HiassofT
Copy link
Member Author

HiassofT commented Jun 2, 2020

I've cleaned things up a bit, popcornmix's WIP KMS linux and kodi changes are now included as patches and I dropped the experimental alsa-lib patches for now. Common kernel config changes are now in the 5.4 kernel PR #4399

I've archived the previous version here https://github.com/HiassofT/LibreELEC.tv/tree/le10-rpi4-v4l2-v1 in case we need some stuff later (eg alsa-lib iec958 formatter changes).

To build you need the current kodi bump PR #4350 , linux bump PR #4399 and for matching kodi addons also PR #4349

I've updated my le10-rpi4-v4l2-test-full branch which includes all of these https://github.com/HiassofT/LibreELEC.tv/tree/le10-rpi4-v4l2-test-full

@HiassofT HiassofT force-pushed the le10-rpi4-v4l2 branch 2 times, most recently from b1e1f1a to 8fddfa6 Compare June 3, 2020 18:24
@HiassofT HiassofT force-pushed the le10-rpi4-v4l2 branch 4 times, most recently from 12cb364 to c1c8242 Compare June 16, 2020 22:48
HiassofT added 10 commits June 19, 2020 14:28
The default 256MB CMA memory can be too small for 4k HEVC decoding.

Signed-off-by: Matthias Reichl <[email protected]>
H264 V4L2 decoder needs a bit of GPU memory, the default of 76 MB is
enough. H265 V4L2 decoder and vc4/v3d kms drivers all use CMA memory.

Signed-off-by: Matthias Reichl <[email protected]>
Signed-off-by: Matthias Reichl <[email protected]>
@HiassofT HiassofT marked this pull request as ready for review June 19, 2020 12:54
@HiassofT
Copy link
Member Author

I've cleaned up the kodi patch, dropped the ffmpeg patches (which aren't needed there, as we already have that separately, for ffmpeg) and kept only what's really useful:

"0001-popcornmix-DVDVideoCodecDRMPRIME-Increase-thread-count-for-hevc.patch" should probably go upstream, the other two are temporary workarounds (disable H264 decoding because of seek issue and try to hide vc4 kms issue with pixel shift).

ffmpeg is the biggest WIP area, the patch is huge and actually we only need a small part of it - the v4l2 hevc request stuff. Hopefully this can be simplified and/or merged with our v4l2 request patches in the future.

There are still several bits missing but I think the changes are now in a state where they can be merged intto master.

@CvH CvH merged commit fe5853d into LibreELEC:master Jun 20, 2020
@HiassofT HiassofT deleted the le10-rpi4-v4l2 branch January 16, 2021 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants