RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    kodi & emulationstation back to back

    Scheduled Pinned Locked Moved Ideas and Development
    kodiestationretropie config
    1 Posts 1 Posters 366 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mdx
      last edited by

      Hi,

      I'd like to share a /opt/retropie/configs/all/autostart.sh configuration from some time back that enabled running kodi & emulationstation back to back. Since I've switched to systemd since and I haven't used it in a while, it's included as is.

      The idea was if a joypad is plugged in, launch emulationstation after kodi quits, otherwise just quit to console. Quitting emulationstation with a joypad plugged in would bring up kodi.

      The problems here as I recall was ensuring the console remains viewable after the depth and resolution changes by kodi, hence the depth tricks before launching emulationstation:

      The script requires cec-utils & fbset packages installed.

      # la /opt/retropie/configs/all/autostart.sh
      -rwxr-xr-x 1 pi pi 732 Apr 25  2020 /opt/retropie/configs/all/autostart.sh
      # cat /opt/retropie/configs/all/autostart.sh 
      export VT_SHELL_PID=$$
      while :; do
        ORIGINAL_DEPTH=$(fbset | head -3 | tail -1 | cut -d " " -f 10)
        kodi-standalone
        if [ -c /dev/input/js0 -o -c /dev/input/event0 ]; then
          echo as | cec-client -s -d 1 >/dev/null &
          tvservice -p
          sleep 5
          fbset -depth 8 >/dev/null 2>&1
          fbset -depth $ORIGINAL_DEPTH >/dev/null 2>&1
          emulationstation
        else
          break
        fi
      done
      kill -9 $VT_SHELL_PID
      
      # We will be closing Kodi programmatically to launch EmulationStation, but we won't want the shell to exit
      #while :; do
      #  sleep 60
      #done
      #kodi-standalone #auto
      #emulationstation #auto
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      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.