RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    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

    LEDSpicer and Emulationstation Issue

    Scheduled Pinned Locked Moved Help and Support
    ledspiceremulationstatioprofiles
    12 Posts 5 Posters 1.0k 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.
    • J
      joesnow81 @mitu
      last edited by

      @mitu said in LEDSpicer and Emulationstation Issue:

      Most likely the emitter command should be specificed as absolute path, it might not be in $PATH.

      Aside from that, overriding the runcommand might not be the best approach, RetroPie provides the ability to run things before and after the emulator is launched - using the same parameters as runcommand : https://retropie.org.uk/docs/Runcommand/#runcommand-onstart-and-runcommand-onend-scripts. You might want to use the onstart/onend scripts to call LEDSpicer instead of replacing runcommand in EmulationStation's configuration.

      Ah yes, that totally makes sense. I was just following the wiki for LEDSpicer but I will check out the onstart and onend scripts as an alternative.

      My other struggle is trying to get the service to start on boot up. If I run sudo service ledspicerd start then it runs as expected but I can't seem to get it to run on boot up. I'm a linux noob so am still continuing my google searches on this one.

      1 Reply Last reply Reply Quote 0
      • J
        joesnow81
        last edited by

        So I created the following runcommand-onstart.sh file in opt/retropie/configs/all and all is working great.

        #!/usr/bin/env bash
        
        # Get system name
        system=$1
        emulator=$2
        rom=$3
        command=$4
        
        # rom_bn receives $rom excluding everything from the first char to the last slash '/'
        rom_bn="${rom##*/}"
        
        # rom_bn receives $rom_bn excluding everything from the last char to the first dot '.'
        rom_bn="${rom_bn%.*}"
        
        # Write to Runcommand Log to test
        echo "I succesfully ran ON START" >> $HOME/start.log
        echo "$system" >> $HOME/start.log
        echo "$emulator" >> $HOME/start.log
        echo "$rom" >> $HOME/start.log
        echo "$command" >> $HOME/start.log
        echo "$rom_bn" >>$HOME/start.log
        
        # Call emitter and pass variable
        emitter LoadProfileByEmulator "$rom_bn" $system  > /dev/null 2>&1
        

        Just to tidy up my profiles that are game specific I stripped off the path and file extension from the rom path to create the $rom_bn. In order to pass through the games that have spaces and characters in, the $rom_bn has to be wrapped in " " when called by the emitter command.

        As a test I also added the lines to write to a log file each variable just to make sure I was getting the correct information to pass through.

        This is my runcommand-onend.sh

        #!/usr/bin/env bash
        
        # Write to Runcommand Log
        echo "I succesfully ran ON exit" >> $HOME/test.log
        echo "$system" >> $HOME/exit.log
        echo "$emulator" >> $HOME/exit.log
        echo "$rom" >> $HOME/exit.log
        
        # Call Emitter to end profile
        emitter FinishAllProfiles  > /dev/null 2>&1
        

        Again just to test I had some bits write to a log file.

        Everything is working perfectly and I've learnt loads about the file structure and writing simple scripts by just trying to get this working so thanks to all the contributors.

        F 1 Reply Last reply Reply Quote 0
        • T
          TwistedPixels
          last edited by TwistedPixels

          Thanks man this helped me a lot. Trying to get LEDSpicer up and running.
          The one problem I've run into is that the ledspicerd service seems to stop running when I launch a game.

          It boots up, service is running and default profile loads fine, then when I launch a game nothing.
          The logs are working so the run command-onstart and onend are working, but the emitter command seems to do nothing.

          I try loading a profile through ssh and nothing happens. I have to send the command to start the service and then it kicks back into life.

          Not sure what I'm doing wrong here, do you have any idea?
          How do you start the service? I just used the optional run as root at boot from the installation instructions.

          1 Reply Last reply Reply Quote 0
          • T
            TwistedPixels
            last edited by

            Update: I've figured out that the service is running properly. It's just the LoadProfileByEmulator command that's failing. It just stops everything. I've tried putting in rom profiles, player profiles. Nothing loads even the default profile.

            It all works beautifully if I use LoadProfile $system instead, which leads me to believe there's a problem with the LoadProfileByEmulator.

            If anyone has any insight please let me know!

            F 1 Reply Last reply Reply Quote 0
            • F
              fadangalini @TwistedPixels
              last edited by

              @twistedpixels

              I've been trying to get this working this week but don't know why it won't.
              Grateful for any ideas to try!

              I'm trying the below:
              emitter LoadProfile $system > /dev/null 2>&1
              But the profile doesn't change...

              If I change it to:
              emitter LoadProfile n64
              it works fine...

              and in the test log, under system it clearly reads n64
              so does anyone have an idea??

              By the way, what does ' > /dev/null 2>&1' mean? this is all new to me.

              Thanks.

              F 1 Reply Last reply Reply Quote 0
              • F
                fadangalini @fadangalini
                last edited by

                @fadangalini

                Ok, so I've got it working!! had to change the command to:
                emitter LoadProfile "$1" > /dev/null 2>&1

                Still don't know what > /dev/null 2>&1 does...

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @fadangalini
                  last edited by

                  @fadangalini said in LEDSpicer and Emulationstation Issue:

                  Still don't know what > /dev/null 2>&1 does...

                  This instructs the shell to redirect any program output (text that might be printed on the screen) to /dev/null, which basically discards any output text (errors or regular info)./dev/null is a special file which discards anything that's written to it.

                  F 1 Reply Last reply Reply Quote 0
                  • F
                    fadangalini @mitu
                    last edited by

                    @mitu

                    Thanks mitu. I'm learning slowly!

                    1 Reply Last reply Reply Quote 0
                    • F
                      fadangalini @joesnow81
                      last edited by

                      @joesnow81
                      Hi, I'm trying to get the rom specific part to work.

                      With the line below nothing happens.
                      emitter LoadProfileByEmulator "$rom_bn" $system > /dev/null 2>&1

                      I was having a play and changing $system to $1 would load the system specific profile. The new line is below:
                      emitter LoadProfileByEmulator "$rom_bn" $1 > /dev/null 2>&1

                      But it isn't loading the rom specific profile I created, just the system.

                      Does the system specific profile have to be in a particular location?
                      I've put it in a couple of places to try but it doesn't load. It is named exactly the same as the rom. I've put it in the following:

                      /usr/local/share/ledspicer/profiles
                      and
                      /usr/local/share/ledspicer/profiles/megadrive

                      Any ideas greatly appreciated, Thanks

                      W 1 Reply Last reply Reply Quote 0
                      • W
                        wtstreetglow1 @fadangalini
                        last edited by

                        @fadangalini Did you end up getting this working? If so, could you provide me with some enlightenment. Thank you, I will begin this process this coming weekend.

                        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.