[RPi5] Build process to get Kodi

  • Back in Dec 2023, I had some success in building Kodi for Raspberry 5 with all necessary HW acceleration for HEVC. Worked like a charm for 2 years.
    Now that I lost that build, I am trying to rebuild it following the same steps already discussed here.

    Unfortunately this doesn't seem to work with LibreELEC 12.0.2 and going back on the master history to Dec 2023 doesn't work either for some reason.

    The key blockers are these:

    1. MESA drivers: I follow this package.mk to fetch the right version (25.1.1). Then I go to this patch directory. Strangely, a patch that was present in the past is missing, so when I build. Is it possible that MESA now by defaults consolidates all drivers (including v3d and vc4) into one library called libgallium-25.1.1.so?
    2. ffmpeg build: I follow this package.mk and I'm very careful to build with all flags that are necessary for this to run on a Raspberry Pi 5 (--disable-mmal --enable-sand and all other necessary ones for libdrm, libudev, etc.). I build on a patched 7.1.1, where the patches are taken from here, but it seems that ffmpeg-001-v4l2-drmprime.patch and ffmpeg-001-v4l2-request.patch are consolidated into ffmpeg-001-rpi.patch. Is that the case?

    Then I build Kodi as per this package.mk with all patches reported there.

    When I play HEVC unfortunately I get stuttering video and I keep thiking there is something wrong with libdrm (I also tried building this from source), mesa driver or ffmpeg not enabling the v3d, vc4 drivers and the HW acceleration.

    chewitt Any idea?

  • Code
    PROJECT=RPi DEVICE=RPi5 ARCH=aarch64 make image

    Or if you really do need to build an image .. start by building the current HEAD commit for either LE12 or master (LE13) branches. It all works. There is no need to muck about with package versions and patches.

  • Oh I didn't realize it was fully supported! Damn! so you mean I should just be able to build Kodi with all internal dependencies without having to build and patch ffmpeg and mesa before?

  • Oh I just realized you may have been talking about LibreELEC. The reason I'm rebuilding Kodi is the same as 2 years ago.
    I cannot install a LibreELEC image. I need Kodi as a standalone app, and I need to launch it on my RaspiOS (debian-based).
    I have waaaay to much stuff running on my RPi5 for me to rely on LibreELEC+docker container on it.

  • LE(13) and RPiOS use the same Linux 6.12.y LTS kernel source so you shouldn't need to touch that. All the mesa patches are long upstreamed by Igalia (on behalf of RPi devs) so just use a recent version. Kodi and ffmpeg still requires downstream patches, as you'll find in our repo. The various build options are in the package.mk files, as you found. Beyond that, I've little experience with compiling Kodi outside our buildsystem so I can't really advise.

    popcornmix does RPiOS not have an appropriately patched Kodi (and ffmpeg) version to use out-of-box?