AsKaGeeK / romcollectionbrowser

Automatically exported from code.google.com/p/romcollectionbrowser
GNU General Public License v2.0
0 stars 0 forks source link

Problems running Emulators on Raspberry Pi #136

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am running xbmc and romcollectionbrowser in my Raspberry Pi (using the Xbian 
distro, although it seems to happen in other distros for the Raspberry Pi). 
This may be caused due to the lack of X11 on that system. "Solo mode" doesn't 
minimize or close xbmc, so the result is the same.

What steps will reproduce the problem?
1. Turn on the computer, enter Rom collection browser in xbmc.
2. Select any game (I tried with a few SNES games). "Launch game <game name>" 
appears on the bottom left corner.
3. Nothing else happens. I can still browse and "launch" games in 
Romcollectionbrowser. Sometimes I can hear the music of the game on the 
background, but I cannot see it.

What is the expected output? What do you see instead?
The game should play at fullscreen. Instead, I find myself in the plugin, 
browsing games.

What version of the product are you using? On what operating system?
XBMC version: 12 Alpha 7
Romcollectionbrowser version: 1.0.8 
Operating system: Xbian Alpha 2

Original issue reported on code.google.com by marcpal...@gmail.com on 25 Nov 2012 at 12:04

GoogleCodeExporter commented 8 years ago
Can you show me a log file after launching a game?

Strange thing is that you hear the music playing. That sounds like the emulator 
is launched in background. No idea how to get control about that.

Original comment by maloep on 2 Dec 2012 at 11:53

GoogleCodeExporter commented 8 years ago
Sure. Here it is. I only tried to play a SNES game, but I assume other systems 
would have the same issue.

As I said, I can hear the game music on the background, but the image keeps 
showing the Rom Collection Browser.

Original comment by marcpal...@gmail.com on 2 Dec 2012 at 1:21

Attachments:

GoogleCodeExporter commented 8 years ago
Update: While I was writing the previous message, XBMC's screensaver went on 
(screensaver mode: Dim), and I could see the game and xbmc at the same time, as 
if xbmc were transparent. As soon as I pressed a key on my keyboard, XBMC 
returned to its normal state and I couldn't see the game any longer.

Original comment by marcpal...@gmail.com on 2 Dec 2012 at 1:28

GoogleCodeExporter commented 8 years ago
Sorry, I can't see anything obvious from this log. Everything seems to be 
correct and as you say the emulator is launched correctly. The only problem is 
the layering of the windows. I am afraid that is something that has to be asked 
to somebody who knows the raspberry pi architecture.

Do you have the same problem with launching other applications too? You could 
just fake the emu cmd and launch any other application instead. Just to sse if 
it works.

And maybe there are some other settings in XBMC or Xbian that influence the way 
the windows are handled. But here I am out of the game, sorry. Just let me know 
if you find out anything, should be interesting for others as well.

Original comment by maloep on 2 Dec 2012 at 2:05

GoogleCodeExporter commented 8 years ago
I think Issue 113 and this one are the same. In the past I tried to launch 
another program (a web browser) from the "advanced launcher" plug-in, with the 
same results, but I didn't mention it as I don't know if both plugins work the 
same way. I'll try to report the bug to Xbian's developers.

PS: There's an error on the title. It should be "emulator runs on the 
background", no the foreground

Original comment by marcpal...@gmail.com on 2 Dec 2012 at 2:56

GoogleCodeExporter commented 8 years ago

Original comment by maloep on 13 Dec 2012 at 11:59

GoogleCodeExporter commented 8 years ago

Original comment by maloep on 22 Dec 2012 at 12:43

GoogleCodeExporter commented 8 years ago
Issue 137 has been merged into this issue.

Original comment by maloep on 22 Dec 2012 at 12:43

GoogleCodeExporter commented 8 years ago

Original comment by maloep on 22 Dec 2012 at 12:44

GoogleCodeExporter commented 8 years ago
Hi!

Have you managed to get this working?
I have the same issue, I am launching an xserver app from xbmc. The application 
is being launched, but it is behind XBMC's window. XBMC runs in the framebuffer 
on Raspberry PI. Maybe there is a way to hide XBMC and set control to X.

Andrei

Original comment by andrei.istodorescu@gmail.com on 16 Mar 2013 at 3:07

GoogleCodeExporter commented 8 years ago
Actually no, I still have the same issue. I haven't tried much, though...

Original comment by marcpal...@gmail.com on 18 Mar 2013 at 9:07

GoogleCodeExporter commented 8 years ago
Not yet. I received my Pi and got Openelec installed but had no time to go any 
further. I hope I will have some more time to dig into this soon.

Original comment by maloep on 19 Mar 2013 at 8:58

GoogleCodeExporter commented 8 years ago
Somebody at stmlabs forum seems to have found a solution. I did not yet try 
this myself but maybe it helps:

http://forum.stmlabs.com/showthread.php?tid=2603&pid=59263#pid59263

Original comment by maloep on 16 Apr 2013 at 9:29

GoogleCodeExporter commented 8 years ago
I'll try it later when I get home. I'll post my results here.

Original comment by marcpal...@gmail.com on 16 Apr 2013 at 10:33

GoogleCodeExporter commented 8 years ago
I've been unsuccessfully trying to make it work. It seems that these scripts 
are only made for Raspbmc, while I'm using xbian. Basically the script closes 
xbmc, launches the emulator, and reloads xbmc once you're done. 

I modified the script to suit my needs, and I've managed to launch a game, but 
it doesn't respond to my keyboard. I'll keep trying...

Original comment by marcpal...@gmail.com on 17 Apr 2013 at 8:43

GoogleCodeExporter commented 8 years ago
I've managed to get something working. The problem was that when you kill xbmc 
from within the shell script, it also terminates the script itself, so the last 
half of the script does not run. For some reason, using the bash "detach" 
command in applaunch.sh did not solve the problem. Starting from the scripts 
from the stmlabs post, I changed applaunch.sh to use the "screen" command to 
launch stop.sh in a detached shell. I also modified stop.sh to relaunch the 
joystick drivers for the emulator, but those not using xboxdrv may not need 
that step.

Original comment by Ben.Hillery on 24 Jul 2013 at 2:01

GoogleCodeExporter commented 8 years ago
Could you please post your files once you get it working?

Original comment by marcpal...@gmail.com on 24 Jul 2013 at 9:18

GoogleCodeExporter commented 8 years ago
By setting the the "solo mode" flag in config.xml, and using these startup 
scripts, I am able to launch an emulator from RCB and return to XBMC/RCB when 
the emulator finishes. Control via keyboard works fine.  I'm running Xbian 1.0 
Beta 1.  Note that in applaunch.sh, you may have to change the path to match 
the location of your stop.sh .

Original comment by Ben.Hillery on 25 Jul 2013 at 2:16

Attachments:

GoogleCodeExporter commented 8 years ago
I have tried your version of applaunch.sh without success. I am also using 
Xbian 1.0 (beta 5). When I launch a game, I can see in the logs that RCB tries 
to launch a command like this: 
'/home/xbian/.xbmc/userdata/addon_data/script.games.rom.collection.browser/scrip
tfiles/applaunch.sh /home/xbian/RetroPie/emulators/RetroArch/retroarch -L 
/home/xbian/RetroPie/emulatorcores/pcsx_rearmed/libretro.so 
"/home/xbian/RetroPie/roms/psx/Crash Bandicoot/Crash Bandicoot.bin"'

But nothing happens. If I launch this command without the applaunch.sh, the 
emulator starts (in the background), so there must be something wrong with 
either applaunch.sh or the emulator command. Could you share your config.xml 
file to see if I am doing something wrong? 

Thanks

Original comment by marcpal...@gmail.com on 27 Jul 2013 at 9:51

GoogleCodeExporter commented 8 years ago
I've attached my config.xml file. The easiest way to debug this is to paste the 
command line from the log (including the applaunch.sh part) into an ssh session 
and see what happens. If it's getting hung up on a login prompt, it's probably 
because you need to add xbmc to the sudoers file. For reference, here is the 
command from my xbmc log:

/home/xbian/.xbmc/userdata/addon_data/script.games.rom.collection.browser/script
files/applaunch.sh "/home/xbian/RetroPie/emulators/RetroArch/retroarch" -L 
/home/xbian/RetroPie/emulatorcores/pocketsnes-libretro/libretro.so 
--appendconfig /home/xbian/RetroPie/configs/all/retroarch.cfg 
/home/xbian/classickong.zip

Original comment by Ben.Hillery on 28 Jul 2013 at 12:53

Attachments:

GoogleCodeExporter commented 8 years ago
Incidentally, here is the bottom of my /etc/sudoers file, which you can edit 
using the command "sudo visudo" :

xbian ALL=NOPASSWD:ALL
xbmc ALL=NOPASSWD:ALL

Original comment by Ben.Hillery on 28 Jul 2013 at 1:03

GoogleCodeExporter commented 8 years ago
How do you make the commands "sudo start" and "sudo stop" in stop.sh work? I 
get "sudo: start: command not found".

(my applaunch.sh and config.xml were fine, I'm pretty sure that the problem is 
in "stop.sh")

Also, when I start the emulator using the "openvt" command, I get: 

"tvservice-client: No supported modes returned for group CEA in 
[vc_tv_hdmi_get_supported_modes_new] tvservice-client: No supported modes 
returned for group DMT in [vc_tv_hdmi_get_supported_modes_new]"

PS: somehow, I've been able to launch and play a game couple of times, but I've 
tried so many things and I don't remember exactly what I have done... I'll 
continue tomorrow

Original comment by marcpal...@gmail.com on 28 Jul 2013 at 2:13

GoogleCodeExporter commented 8 years ago
The problem isn't starting stop.sh, it's finishing stop.sh. If applaunch.sh 
does not succeed in detaching stop.sh, then stop.sh will behave erratically, as 
it will die whenever xbmc quits. The only way I found I could get a successful 
detach was by using the "screen" command in applaunch.sh. In stop.sh, I found 
that the initctl command was ineffective at getting xbmc to relinquish the 
controls. I used the "sudo stop xbmc" command in order to get my xbox 360 
wireless controllers to work.

Also, I'm not aware of an "Xbian 1.0 (beta 5)". Did you mean Xbian 1.0 alpha 5? 
If you are running alpha 5, that would explain why the "stop xbmc" command 
isn't working. You need to upgrade to a beta-stage version of Xbian.

Original comment by Ben.Hillery on 28 Jul 2013 at 4:21

GoogleCodeExporter commented 8 years ago
I think the real key here is that applaunch.sh is getting called as a child 
process of xbmc for some reason. If RCB's "solo mode" would run "applaunch.sh" 
as an independent process, I'll bet the original applaunch.sh would work.

Original comment by Ben.Hillery on 28 Jul 2013 at 4:35

GoogleCodeExporter commented 8 years ago
Ok! It was a matter of upgrading Xbian to the latest version (Xbian 1.0 beta 
1.1 right now). Now I can start and play games and go back to xbmc when done.

Thank you very much!

Original comment by marcpal...@gmail.com on 28 Jul 2013 at 9:59

GoogleCodeExporter commented 8 years ago
I have been using this plugin from my raspberry pi for a week and I didn't have 
any other problem.

I would like to point out a couple of things, though. It may be necessary to 
manually install alsa in order to hear sound in some emulators. The 
/etc/sudoers file must be edited as it has been said in this thread. Also, some 
emulators require root permissions in order to run, so I had to add the "sudo" 
command inside the launching parameter in applaunch.sh. 

Once done that, RCB seems to be working properly. As for me, this issue can be 
marked as solved.

Original comment by marcpal...@gmail.com on 3 Aug 2013 at 11:50

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hi I'm using Xbian 1.0 Beta 2, RCB 2.0.10 and AdvanceMAME, and none of the 
above methods work.
I had it working only with run levels:

1._______________________
edit /etc/init/xbmc.conf to have XBMC shut down at level 4. Comment two lines 
and add these:

#start on started xbmc-preload and started dbus and (stopped xbian-net or 
xbian-nowait)
#stop on runlevel [06]
start on started xbmc-preload and started dbus and (stopped xbian-net or 
xbian-nowait) or runlevel [235]
stop on runlevel [!235]

2._______________________
add a "standard" init.d script "/etc/init.d/advance" for advmame and advmenu: 

#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          advance
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     4
# Default-Stop:      0 1 2 3 5 6
# Short-Description: Start or stop advmenu and advmame.
### END INIT INFO

NAME=advmenu
DAEMON=/usr/local/bin/$NAME
USER=root
STOP_TIMEOUT=30

export PATH="${PATH:+$PATH:}/sbin"

[ -x $DAEMON ] || exit 0

[ -e /etc/default/$NAME ] && . /etc/default/$NAME

. /lib/lsb/init-functions

start_daemon () {
    if [ $ENABLE_DAEMON != 1 ]; then
        log_progress_msg "(disabled)"
                log_end_msg 255 || true
    else
        FILE=/home/xbian/.romMame

        if [ -f $FILE ];
        then
           value="sudo /usr/local/bin/advmame `cat $FILE`"
           log_daemon_msg "Starting advmenu" "$value"
           rm $FILE
           openvt -wsfl -- $value
           init 5
        else
           sudo openvt -c 1 -sfl -- sudo /usr/local/bin/advmenu
        fi
                log_end_msg 0
    fi
}

case "$1" in
    start)
        log_daemon_msg "Starting advmenu" "$NAME"
        start_daemon
        ;;
    stop)
        log_daemon_msg "Stopping advmenu" "$NAME"
        sudo killall advmame
        sudo killall advmenu
        log_end_msg 0
        ;;
    reload)
        log_daemon_msg "Reloading advmenu" "$NAME"
        sudo killall advmenu
        sudo killall advmame
        start_daemon
        log_end_msg 0
        ;;
    restart|force-reload)
        log_daemon_msg "Restarting advmenu" "$NAME"
        sudo killall advmame
        sudo killall advmenu
        start_daemon
        log_end_msg 0
        ;;
    status)
        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
        ;;
    *)
        log_action_msg "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}" || true
        exit 2
        ;;
esac

exit 0

3._______________________
execute the following commands to give permissions and have advmame and advmenu 
run at level 4, and stop at all the other levels:

sudo chmod a+x /etc/init.d/advance
sudo update-rc.d advance start 80 4 . stop 20 0 1 2 3 5 6 .

4._______________________
execute "sudo visudo" to comment the last line and add the other two:

#xbian ALL=(ALL) NOPASSWD: /usr/local/sbin/xbian-config, /sbin/halt, 
/sbin/reboot, /usr/bin/splash
xbian ALL=(ALL) NOPASSWD:ALL
xbmc ALL=(ALL) NOPASSWD:ALL

5._______________________
create a file to be launched by RCB as the executable for the MAME collection:

vi /home/xbian/appAdvance.sh

and paste the following code:

#!/bin/bash

echo $1 >/home/xbian/.romMame
sudo init 4

6._______________________
give permissions:

sudo chmod a+x /home/xbian/appAdvance.sh

7._______________________
Install Rom Collection Browser and create a MAME collection, choosing 
/home/xbian/appAdvance.sh as executable.

this works for me.
ciao

Original comment by umba...@gmail.com on 27 Dec 2013 at 10:36

GoogleCodeExporter commented 8 years ago
I upgraded my xbian version to 1.0 beta 2 (the latest at this moment), which 
broke everything (as expected). I also took the opportunity to update my 
retropie installation.

I've been able to make things work again this way:

1) add xbmc to sudoers file:
Edit /etc/sudoers and add these two lines at the end:

xbian ALL=NOPASSWD:ALL
xbmc ALL=NOPASSWD:ALL

2) install ALSA:
sudo apt-get update && sudo apt-get install alsa

3) To add the alsa module to load at boot time:
Edit /etc/modules and add this line at the end:

snd-bcm2835

4) You probably need to edit the config.xml (at 
.xbmc/userdata/addon_data/script.games.rom.collection.browser/config.xml) to 
change the emulator path (<emulatorcmd> section) for each emulator from:

/home/xbian/RetroPie/emulators/RetroArch/retroarch

to:

/home/xbian/RetroPie/emulators/RetroArch/installdir/bin/retroarch

5) Reboot, open Rom Collection Browser, and enjoy!

PS: sometimes you will not be able to edit the config.xml file if xbmc is 
running. You can always do "killall xbmc.bin" if that's a problem.

for #29, I havn't tried your method, but as I understand, it implies creating a 
service for each emulator console, right? I think my solution is simpler if you 
play with many different emulators.

Original comment by marcpal...@gmail.com on 2 Jan 2014 at 11:00

GoogleCodeExporter commented 8 years ago
Has anyone gotten this to work for OpenElec Pi?

Original comment by brad.sta...@gmail.com on 20 May 2014 at 2:46