Kodi Community Forum
[RELEASE] Rom Collection Browser - Browse and launch emulator game ROMs - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Game Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=291)
+---- Thread: [RELEASE] Rom Collection Browser - Browse and launch emulator game ROMs (/showthread.php?tid=70115)



- bmfrosty - 2010-08-02

ok. Modified config.xml from the testdata and put it in the right place. Probably need to modify command lines for launching snes games. Then I need to figure out how to add more collections - is there a way to do that in RCB, or do I need to hand edit config.xml?


- bmfrosty - 2010-08-02

made applaunch.sh +x Still not starting anything.. Hrm...


- bmfrosty - 2010-08-02

Code:
15:28:08 T:2967161712 M:1368596480  NOTICE: RCB_INFO: cmd: \/home\/bmfrosty\/\.xbmc\/addons\/Rom\ Collection\ Browser/applaunch.sh /usr/bin/zsnes -m "/home/bmfrosty/Testdata V0.5/Collection V3/Roms/Super Mario Kart.smc"
15:28:08 T:3054950272 M:1367396352   DEBUG: CAnnouncementManager - Announcement: ApplicationStop from xbmc
15:28:08 T:3054950272 M:1367396352  NOTICE: Storing total System Uptime
15:28:08 T:3054950272 M:1367396352  NOTICE: Saving settings
15:28:08 T:3054950272 M:1367412736  NOTICE: stop all
15:28:08 T:3054950272 M:1367412736   DEBUG: NetworkMessage - Signaling network services to stop
15:28:08 T:3054950272 M:1367412736  NOTICE: ES: Stopping event server
15:28:08 T:3054950272 M:1367412736   DEBUG: CZeroconfAvahi::doRemoveService named: servers.jsonrpc
15:28:08 T:3054950272 M:1367412736   DEBUG: NetworkMessage - Waiting for network services to stop
15:28:08 T:3054950272 M:1367412736  NOTICE: stopping zeroconf publishing

Looks a little better. Now resets XBMC.

This bit - /bmfrosty\/\.xbmc\/a - seems to be escaping . in .xbmc. Seems like it may be wrong. Not sure on how to fix.

EDIT: Nevermind that last bit. I edited helper.py with the absolute path and it's still doing the same thing. It may be a problem with applaunch.sh at this point, and I really don't know what to do about that.

I'm going to see if I can figure out if zsnes executes though.


- bmfrosty - 2010-08-02

As far as I can tell, zsnes does not execute.

I changed this:


<emulatorCmd>touch ~/blahblahblah.blah</emulatorCmd>

When I try and start a rom, blahblahblah.blah doesn't get created. I don't know what I need to change in applaunch.sh, so I'm reluctant to try.


- bmfrosty - 2010-08-02

I don't think it's escaping out the spaces.

I modified it like this:

Code:
bmfrosty@XBMCLive:~/.xbmc/addons/Rom Collection Browser/resources/database$ cat ../../applaunch.sh
#!/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?
sleep 1
if pidof xbmc.bin; then
        pidof xbmc.bin|xargs kill # 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 pidof xbmc.bin; then
        pidof xbmc.bin|xargs kill -9 # Force immediate kill
        echo "Shutdown hard"
fi

echo "$@" >> /home/bmfrosty/launcher.txt

# 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 3


# Done? Restart XBMC
xbmc
and launcher.txt looks like this with several different variations of emulatorcmd:

Code:
bmfrosty@XBMCLive:~/.xbmc/addons/Rom Collection Browser/resources/database$ cat ~/launcher.txt
/usr/bin/zsnes -m /home/bmfrosty/Testdata V0.5/Collection V3/Roms/Super Mario Kart.smc
/usr/bin/zsnes -m /home/bmfrosty/Testdata V0.5/Collection V3/Roms/Super Mario Kart.smc
/usr/bin/zsnes -m /home/bmfrosty/Testdata V0.5/Collection V3/Roms/Super Mario Kart.smc
bmfrosty@XBMCLive:~/.xbmc/addons/Rom Collection Browser/resources/database$



- malte - 2010-08-02

I see you have been busySmile

Quote:Ok. So it looks like Dharma wants includes.xml in skins/Default/720p - so I copied that over from another skin, and copied over the PAL files from rombrowser. It seems to be getting further.

Thats weird. On all systems that I tried until now it was ok to ignore the 720p folder. There is still no problem in Dharma on windows with it. I started developing on a 15" TV so I decided to make an 800x600 UI. Always wanted to fill the gap but had no time until now.


Quote:ok. Modified config.xml from the testdata and put it in the right place. Probably need to modify command lines for launching snes games. Then I need to figure out how to add more collections - is there a way to do that in RCB, or do I need to hand edit config.xml?

Planned for the next version (always NEXT versionTongue). I know, configuration is a pain atm but I will try to get this easier when I feel that the import, browse, launch workflow is stable enough.


About launching games:

1. Did you see that testdata.zip does not contain roms (at least no SNES because there are no freeware roms that I could ship with it)? There are just some empty placeholder files to get the import done and to show some artwork. Maybe your tests will work if you replace one of the files with a working rom with the same name.
2. There are two ways of launching: solo and non-solo mode (useEmuSolo in config.xml). Solo mode uses the applaunch.sh that kills xbmc, launches the emulator and then restarts xbmx (you need to make it executable, but it seems that you have already). I like the non-solo mode more because it just minimizes XBMC and launches the emulator side by side. I had trouble with this configuration with some emulators so I use both modes depending on the emulator.

If you are able to launch an emulator with a rom file on the command line the same line should work in RCB (replace rom file with %ROM% of course). If you think that escaping the command could be a problem you could try to disable it: escapeCommand in config.xml.

Thanks for spending so much time to get this up n running. I hope you won't regret itSmile

Cheers,
malte


- bmfrosty - 2010-08-02

malte Wrote:Thats weird. On all systems that I tried until now it was ok to ignore the 720p folder. There is still no problem in Dharma on windows with it. I started developing on a 15" TV so I decided to make an 800x600 UI. Always wanted to fill the gap but had no time until now.
Interesting. Something to put on the to-do list then I guess. That part is functional as is right now, even if it isn't pretty.
Quote:Planned for the next version (always NEXT versionTongue). I know, configuration is a pain atm but I will try to get this easier when I feel that the import, browse, launch workflow is stable enough.
Ah. OK. I guess I can stop trying to figure out the button combination for now.
Quote:About launching games:

1. Did you see that testdata.zip does not contain roms (at least no SNES because there are no freeware roms that I could ship with it)? There are just some empty placeholder files to get the import done and to show some artwork. Maybe your tests will work if you replace one of the files with a working rom with the same name.
My Super Mario Kart is special:

bmfrosty@XBMCLive:~/Testdata V0.5/Collection V3/Roms$ ls -aFl Super\ Mario\ Kart*
-rw-r--r-- 1 bmfrosty bmfrosty 524800 2005-12-22 20:39 Super Mario Kart.smc
-rwxr-xr-x 1 bmfrosty bmfrosty 355471 2010-08-01 15:16 Super Mario Kart (U) [!].zip*
bmfrosty@XBMCLive:~/Testdata V0.5/Collection V3/Roms$

Quote:2. There are two ways of launching: solo and non-solo mode (useEmuSolo in config.xml). Solo mode uses the applaunch.sh that kills xbmc, launches the emulator and then restarts xbmx (you need to make it executable, but it seems that you have already). I like the non-solo mode more because it just minimizes XBMC and launches the emulator side by side. I had trouble with this configuration with some emulators so I use both modes depending on the emulator.
In some testing with launching mednafen from executor, I found that leaving XBMC running causes me some problems, especially since I use NES controllers to navigate XBMC. applaunch.sh is probably the way for me.
Quote:If you are able to launch an emulator with a rom file on the command line the same line should work in RCB (replace rom file with %ROM% of course). If you think that escaping the command could be a problem you could try to disable it: escapeCommand in config.xml.
I'll look into that one. It may be the key.


- bmfrosty - 2010-08-02

With escapeCommand true or false, the launcher.txt that I'm created gets populated the same way.

It's midnight. Going to bed.


- malte - 2010-08-02

Quote:Ah. OK. I guess I can stop trying to figure out the button combination for now.

Maybe this is misleading. config.xml is not read at runtime. You have to press "Import Settings" if you make changes to config.xml (Then the content of config.xml will be imported to DB). Maybe this is also the problem with trying out different escapeCommand-Configurations?

But I have to check this part of code again. In your first example it looks like it only escapes the invoke of the applaunch.sh but not the parameters passed to it. But I never had problems with it like this.


Quote:In some testing with launching mednafen from executor, I found that leaving XBMC running causes me some problems, especially since I use NES controllers to navigate XBMC. applaunch.sh is probably the way for me.

You could try the following:
1. open a shell
2. run xbmc from this shell
3. launch RCB
4. launch an SNES game
5. Now you should see the output of applaunch.sh in the shell. Right?

Maybe this helps with narrowing down that issue.


And one last idea: What does your emuCmd look like? Do you use something like this (with "" around %ROM%)?
Code:
zsnes -m "%ROM%"



- bmfrosty - 2010-08-02

I will start importing the configs every time I make changes here on out. It didn't occur to me that I would need to re-import them. Could you set it up in a future version so that it checks the file date of config.xml every time it starts, and if it changes offer to re-import?

I'll run through these scenarios when I get home from work this evening.


- bmfrosty - 2010-08-03

One more feature request. Can I have variables so that I can pass the X and Y FS resolution that XBMC is running at to the command line? It would be really useful in mednafen to have mednafen adapt to different televisions based on the XBMC settings.


- bmfrosty - 2010-08-03

@malte

Did you just throw a 0.5.3 on the repository?


- bmfrosty - 2010-08-03

Ok. This is starting to make some sort of sense. It works just fine when I start a WM before I start xbmc. On the other hand, if XBMC is the window manager it doesn't work. Probably because zsnes wants xbmc to be the window manager. Dingdingding.


- bmfrosty - 2010-08-03

I think the end point here may be to stick a window manager in before xbmc. It may also be worth recruiting further help from some of the LIVE gurus or other developers. There may be a workaround somewhere without having to resort to a window manager.


- malte - 2010-08-03

bmfrosty Wrote:It didn't occur to me that I would need to re-import them. Could you set it up in a future version so that it checks the file date of config.xml every time it starts, and if it changes offer to re-import?

In a later relase I want to read the xml on the fly and replace the Import Settings completely. Or make it available as settings dialog. But as a first shot I could do it like you suggested.

Quote:One more feature request. Can I have variables so that I can pass the X and Y FS resolution that XBMC is running at to the command line? It would be really useful in mednafen to have mednafen adapt to different televisions based on the XBMC settings.

On my list now.


Quote:Did you just throw a 0.5.3 on the repository?

Yes, I hope I have not been not too hasty. But as we got this pysqlite thing through the door I thought that we have solved all Dharma related trouble. What we have now seems to be more Live related.

There is only one change to 0.5.1/2 on the software side: After import settings I backup config.xml to the users addon_data dir because I read that XBMC flushes the complete addon directory when you update an addon.

What I forgot before submitting it to the repo was one little patch that could make sense to Live users (see details below).

Quote:I think the end point here may be to stick a window manager in before xbmc. It may also be worth recruiting further help from some of the LIVE gurus or other developers. There may be a workaround somewhere without having to resort to a window manager.

Maybe we should go back on the non-solo route again. There was another Live user here in this thread who had trouble with launching games from Live. He had another error so I did not think it could be related to your problem. Maybe you could have a look at this page if this fits in your scenario (needs a code change but it seems that you are familiar with your editorSmile): http://forum.xbmc.org/showthread.php?p=533890#post533890. The line to change is now 167.

Maybe I will submit this patch as an update for 0.5.x but it is already included in 0.6.x that is nearly feature complete now but just not Dharma ready.