Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Autostart libretro emulator with rom at boot (fast way)?



  • I tried to start the single libretro emulator with rom at boot, via opt / retropie / config / all / autostart.sh and it works fine but the boot process is pretty long about 15 seconds.
    Is it possible to achieve autostart in some other way so that the boot process is faster than this?
    I have tried to start that same (eg. cap32_libretro) emulator with /opt/retropie/supplementary/runcommand/runcommand.sh 0 SYS amstradcpc ~ /RetroPie/roms/amstradcpc/romname, through the rc.local script but it will not work, just drop out to the command prompt.
    Interestingly, if i start some non libretro emulator directly in rc.local (without runcommand.sh), then the autostart is successful and twice as fast, about 8-10 seconds.
    Is there a way to start the libretro emulator with runcommand.sh in a similar way?

    I use latest RetroPie, with Rpi2.


  • Global Moderator

    @retrofan You'll have to time your boot and eliminate the bottlenecks. The autostart script will be started after a certain systemd target is reached (i.e. multi-user), but rc.local will start much earlier. The fact that some emulator starts from rc.local is a coincidence - the emulators are configured for the user pi, if the configuration files are not found, it will fail - like you noticed for the Libretro based emulators.

    Some tips for speeding up boot times

    • disable wait for network in raspi-config
    • disable the Samba shares
    • disable the network altogether
    • disable/remove the usbmount service
    • disable the splash service
    • use systemd-analyze to see where the boot process stalls and which services take the most time to run (hint: it's the network and samba services).


  • @mitu

    Thank you for reply and explanation, thats exactly what you described.
    If I wait enough, then I can run libretro emulators.
    I was hoping to get started faster, but it looks like it will not be possible in this case.
    I will try with systemd-analyze but I think I will have to wait for these additional 5-6 seconds for libretro emulators to make the autostart successful.


  • Global Moderator

    @retrofan said in Autostart libretro emulator with rom at boot (fast way)?:

    I was hoping to get started faster, but it looks like it will not be possible in this case.

    There's no magic bullet here, you'll have to find the bottlenecks in the boot and work around/eliminate them.



  • @mitu

    Yes, I did what you said and I succeeded to lower boot time to 11 seconds for libretro emulator but only through autostart.sh.
    However, non-libretro emulators still starts about 5 seconds faster through the rc.local script and I dont know what else I could do here.
    It seems runcommand is a problem, because for some reason it refuses to start through rc.local properly...



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.