LibreElec Kodi + Lakka RetroArch

  • hello schmecks,

    When you run retroarch command standalone, remember firt to set up LD_LIBRARY_PATH environment variable for the shell you are using (that means to set it up any time you login back).

    (I forgot to mention it before, sorry)

    Something like:

    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/storage/retroarch/lib

    Now run the command:

    ldd /storage/retroarch/retroarch | grep "not found"

    After copy first batch, you could see extra dependencies needed by the libraries you just copied.

    I would recommend you to only copy what is not already present on LibreElec, I would prefer native OS libraries.


    Another thing you could try, is to specify Lakka image "/usr/lib", in your case I think it is: "/media/root/usr/lib", so it will be something likes:

    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/media/root/usr/lib

    And then try running ldd like:

    ldd /storage/retroarch/retroarch | grep "/media"

    And whatever cames from the image is what you need to copy.

  • So is it possible with this method to also add Emulation Station Desktop Edition (ES-DE), so one could launch ES-DE from kodi and inside ES-DE could launch games in retroarch? How would one go about it?

  • Hello there,

    You could try to copy the binary and needed libraries, maybe it would work, a few point to take in mind:

    * Lakka is a branch of LibreElec, so they share the build system and most of the dynamic libraries. That is why just copying the binary works.

    * It is systemd who brings down Kodi and up Retroarch, the command is run from favorites.

    Sounds easy? sometimes it is, who knows, good luck!

  • Did anyone manage to get this running with a LibreELEC Piers nightly build? I upgraded 2 days ago from LE12 and it seems that under the hood something changed and now it will immediatelly restart kodi.

    Oh Rpi4b btw.

  • Hello there,

    I would recommend you to login through ssh, stop kodi service and run retroarch command using verbose flags, that should give you an idea whats is going on. I think commands involved are around this thread.

  • I did that and the output is as follows:

    Code
    LibreELEC:~/retroarch # ./retroarch -v --log-file retroarch.log
    ./retroarch: error while loading shared libraries: libavcodec.so.60: cannot open shared object file: No such file or directory

    I assume its because Lakka doesn't yet provide a build based on the latest LibreELEC Nightly as its base and asks for an outdated libavcodec? I assume on LE13 Nightlys its V61 already and not V60 any more?

    Edited once, last by Arokhaerr (May 28, 2025 at 4:07 PM).