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 asruncommand
: 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 replacingruncommand
in EmulationStation's configuration. -
@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 asruncommand
: 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 replacingruncommand
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.
-
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.
-
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. -
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!
-
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.
-
Ok, so I've got it working!! had to change the command to:
emitter LoadProfile "$1" > /dev/null 2>&1Still don't know what > /dev/null 2>&1 does...
-
@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. -
Thanks mitu. I'm learning slowly!
-
@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>&1I 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>&1But 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/megadriveAny ideas greatly appreciated, Thanks
-
@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.
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.