OSMC forum
RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - Printable Version

+- OSMC forum (http://forum.osmc.tv)
+-- Forum: Raspbmc (/forumdisplay.php?fid=6)
+--- Forum: Raspbmc Users Forum (/forumdisplay.php?fid=7)
+--- Thread: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) (/showthread.php?tid=2603)

Pages: 1 2 3 4 5


RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - davidh2k - 09-05-2012 12:22 AM

Hello Forum,

I've managed to get the RetroPie working (it's not really hard thanks to http://petrockblog.wordpress.com/2012/07/22/retropie-setup-an-initialization-script-for-retroarch-on-the-raspberry-pi/), but only if I launch it from the command line.

If I try to launch it from the Rom Collection Browser the Emulator is starting, but XBMC gets shrinked to a quarter size and hangs into the left upper corner. Controll is still in XBMC, not the Emulator. (A lot of frustration was put here, because its complicated to launch RetroArch. Will explain that later...)

So i tried to use the "solo mode". All i get here is the Message "Launch Game [...]" in the lower left corner. XBMC freezes and cannot be restarted via sudo initctl stop/start, but needs to be killed via htop or so.

I tried to debug the applaunch.sh wich is used by the Rom Collection Browser, but i don't have the knowledge to pimp this script up to the point that it may need. All i found out so far is, that the "restart xbmc" command at of the script needs to be changed to "sudo initctl start xbmc".
But may someone can take a look at the script and find out whats wrong for raspbmc here.

applaunch.sh
Code:
#!/bin/bash
# App Launch script - Temporarily quit XBMC to launch another program
# Tx to rodalpho @ # http://xbmc.org/forum/showthread.php?t=34635
# By Redsandro     2008-07-07
# By ryosaeba87    2010-08-24
# Updated:        2010-08-24
#     Added support for MacOSX


# Check for agruments
if [ -z "$*" ]; then
    echo "No arguments provided."
    echo "Usage:"
    echo "launcher.sh [/path/to/]executable [arguments]"
    exit
fi


case "$(uname -s)" in
    Darwin)
        XBMC_PID=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $1}')
        XBMC_BIN=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $5}')
        ;;
    Linux)
        XBMC_PID=$(pidof xbmc.bin)
        XBMC_BIN="xbmc"
        ;;    
    *)
        echo "I don't support this OS!"
        exit 1
        ;;
esac


# Is XBMC running?
if [ -n $XBMC_PID ]
then
    kill $XBMC_PID # Shutdown nice
    echo "Shutdown nice"
else
    echo "This script should only be run from within XBMC."
    exit
fi

# Wait for the kill
# sleep


# Is XBMC still running?
if [ -n $XBMC_PID ]
then
        kill -9 $XBMC_PID # Force immediate kill
    echo "Shutdown hard"    
fi

echo "$@"

# Launch app - escaped!
"$@"


# SOMETIMES xbmc starts too fast, and on some hardware if there is still a millisecond of sound being used, XBMC starts witout sound and some emulators say there is a problem with the sound hardware. If so, remove comment:
#sleep 1


# Done? Restart XBMC
$XBMC_BIN &


Configuring the Rom Collection Browser (for SNES)

When you add a Rom Collection you need to set the path to the RetroArch emulator:

Code:
[i]/home/pi/RetroPie/RetroArch-Rpi/retroarch[/i]

Here comes the special part:
When you set the emulator command(s) you must add this before "%ROM%":

Code:
[i]-L /home/pi/RetroPie/emulatorcores/pocketsnes-libretro/libretro.so[/i]

Do not put this into command into "", like "%ROM%".
You must add this command because the RetroArch works like a Plugin handler. The RetroArch alone cannot emulate anything. For everey Emulator you need the equivalent Plugin (libretro.so for SNES).

As the rom folder i would suggest that you use

Code:
[i]/home/pi/RetroPie/roms/snes/[/i]

A Little sidenote: Don't add too much roms for testing as it will take a long time to scratch the artwork for each rom.

--

Remember that you have to set up each Emulator individually.
So at this point you can run all the emulators you have set up, but if normal or solo mode, theire are problems we need to figure out.
Who wants to help?

PS: I only tried SNES so far, but its running really well, except for audio at the moment.

I will maintain this first post to keep the tutorial up to date.

MfG David


RE: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - raliand - 09-05-2012 08:24 AM

Hi David,
Excellent work!
I am not an expert, but may be you can try and play with "run levels" in linux to get better switching between XBMC and RertoPie.
You can look at the last post here http://forum.stmlabs.com/showthread.php?tid=478&page=2

Regards


RE: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - Liquidream - 09-05-2012 01:34 PM

Nice one David!

I too was seeing this weird behaviour when trying to use RomBrowser (Emulator showing in a small window).
So I will be VERY interested to hear of a solution to this. Particularly one that allows me to exit the game and get back to the list.

As you point out, it appears (to me at least) that RomBrowser is very slow, seemingly due to the artwork being displayed. If this issue can ever be resolved (& TBH, it's kind of an issue with XBMC in general), then I think I may finally have a usable "Retro Media Centre" Smile

If I find anything useful, I shall post it here, but unfortunately, I am very much a Linux newbie. Blush


RE: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - davidh2k - 09-05-2012 04:53 PM

Hi guys,

first of all, thanks for the appreciation.

@raliand: This looks doable, but two things i have in my mind right now are bothering me.

First, I think that you have to use the EmulationStation via the advanced launcher, which leaves the nice GUI of the Rom Collection Browser unused.
Second, how do you get back from the EmulationStation? Without the use of a Keyboard you end up in the command line with no way back. Even if you would use LXDE as mentioned in the tutorial, you have at least to use a mouse.

Maybe it is possible to implement it right away in the Rom Collection browser (Switching Runlevel, starting the Emulator) but even then, when you close the emulator, you're stuck at the command line!

Any thoughts?

MfG David


RE: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - raliand - 09-06-2012 09:40 AM

Hi David,
I am a bit out of my depth again, but isn't it possible to modify the applaunch.sh (the parts where it stops and starts xbmc) to switch the run levels?
So in the example instead of running LXDE you run the emulator and when it exits the applaunch script switches back to XMBC.

Regards


RE: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - davidh2k - 09-06-2012 01:58 PM

Just a little Update:

In the past four hours i tried it several ways.
I tried to add the runlevel switch into both the actual and the old applaunch.sh from >2010.
I tried to use "initctl" in the applaunch.sh, and if started from the RCB, nothing happens (only freeze) - XBMC is stopped and the applaunch command is started as proven by htop. But the xbmc windows does not dissapear!
If i catch the command that RCB is sending from the xbmc.log and insert it via PuTTY its working! But, i have no acces via local keyboard. So i cannot play or exit the Emulator. If I kill the emulator via htop XBMC starts again.

I also tried to launch EmulationStation/via applaunch.sh and RetroArch/via applaunch.sh, but all iam getting here is a "restart" of xbmc.

At the moment iam running out of ideas, because i don't know why the script works from command line, but not from xbmc itself, or why xbmc is not closing correctly.

Here is the updated (edited old, from >2010) applaunch.sh

Code:
#!/bin/bash
# App Launch script - Temporarily quit XBMC to launch another program
# Tx to rodalpho @ # http://xbmc.org/forum/showthread.php?t=34635
# By Redsandro  2008-07-07
# Updated:              2008-02-28


# Check for agruments
if [ -z "$*" ]; then
        echo "No arguments provided."
        echo "Usage:"
        echo "launcher.sh [/path/to/]executable [arguments]"
        exit
fi



# Is XBMC running?
if pidof xbmc.bin; then
#       sudo init 4
#        pidof xbmc.bin|xargs kill # Shutdown nice
sudo initctl stop xbmc
        echo "Shutdown nice"
else
        echo "This script should only be run from within XBMC."
        exit
fi

# Wait for the kill
#sleep 1



# Is XBMC still running?
#if pidof xbmc.bin; then
#        pidof xbmc.bin|xargs kill -9 # Force immediate kill
#        echo "Shutdown hard"
#fi

echo "$@"

# Launch app - escaped!
"$@"


# SOMETIMES xbmc starts too fast, and on some hardware if there is still a millisecond of sound being used, XBMC starts witout sound and some emulators say there is a problem with the sound hardware. If so,$
#sleep 1


# Done? Restart XBMC
#xbmc
#sudo init 5
sudo initctl start xbmc

MfG David


RE: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - Slow Dog - 09-06-2012 10:46 PM

Hi David,

I've got littleto add, but I'm pleased to find someone else has already engaged in the same thing as me.

I'd previously got to the same stage as you with Xbian - working from command line, but not from within XBMC, when I borked the whole image trying to get my controller working. I've switched to RaspBMC in the hope that it'll be different. There are certainly fewer hoops to jump through (Xbian doesn't have a pi user, and ftp needed setting up), and I'm making backups as I go.

The question I'd pose is: have you successfully launched *anything* using the app launcher? I've only tried RetroPie and Mame (on Xbian), and failed with both. Is there anything we could try to prove whether the fault is with the app launcher in general, rather than RetroPie in particular?


RE: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - davidh2k - 09-07-2012 12:27 PM

I doubt that it is the applauncher.sh, because it IS working from command line.
But i really don't know why it behaves different if launched from withing xbmc.

Sad

MfG David


RE: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - davidh2k - 09-18-2012 07:37 PM

*push*


RE: RetroPie (working) - How to get Rom Collection Browser working? (Emulators!) - oneadvent - 09-18-2012 10:11 PM

bumping so i will get updates as this project progresses.

Would like to see an easy ssh script download to setup and install the whole shebang since we know what everyone is working on.