[RELEASE] "Arcade Browser" (Emulator ROMS browser) Script for Linux
#31
Quote:It looks like XBMC starts too fast before the emulator is totally shut down.

I thought this, too. But this also happens when I don't start the emulator: xbmc gets killed with the -9 option and isn't able to start again inside the bash script. I have to terminate the script with Ctrl+C and then it is no problem to start xbmc.

This has nothing to do with your script. I only thought that someone else had similar problems with restarting xbmc. Maybe I will start a new thread for this.

I can't get the non-solo version working. Do I have to reset something after changing this option? I deleted the .xml-files but this doesn't help. I also expected some "if solo then..."-logic inside your script but could not find it...
Reply
#32
malte Wrote:I also expected some "if solo then..."-logic inside your script but could not find it...
Ow no! Sad
You're right, it's not there. I am sure I wrote this functionality. I used it with a NES emulator. But I cannot find it. I probably had a new version on my old media center but I formatted the drive after it became corrupted.

This really pisses me off.

Like I said some posts back, I just don't have time to dive into it, but I think I meant something like this:

replace from line 375
Code:
        cmd = re.escape(HOMEDIR)+'applaunch.sh '+cmd
        # OF zoiets:
        #params = {'app' : emu[app], 'path': romdir, 'rom': filename}
        #cmd = '%(app)s %(path)s/%(rom)s' % params

        self.txtDesc.setText('Launching '+rom+' ...')
        #self.txtDesc.setText('Launching '+cmd+' ...') # debug

        # Backup original autoexec.py
        autoexec = SCRIPTUSR+'/autoexec.py'
        self.doBackup(autoexec)

        # Write new autoexec.py
        fh = open(autoexec,'w') # truncate to 0
        fh.write("import xbmc\n")
        fh.write("xbmc.executescript('"+HOMEDIR+"default.py')\n")
        fh.close()

        # Remember selection
        self.saveState()

with
Code:
        # OF zoiets:
        #params = {'app' : emu[app], 'path': romdir, 'rom': filename}
        #cmd = '%(app)s %(path)s/%(rom)s' % params

        self.txtDesc.setText('Launching '+rom+' ...')
        #self.txtDesc.setText('Launching '+cmd+' ...') # debug

        if (emu['solo'] == True):
            # Backup original autoexec.py
            autoexec = SCRIPTUSR+'/autoexec.py'
            self.doBackup(autoexec)

            # Write new autoexec.py
            fh = open(autoexec,'w') # truncate to 0
            fh.write("import xbmc\n")
            fh.write("xbmc.executescript('"+HOMEDIR+"default.py')\n")
            fh.close()

            # Remember selection
            self.saveState()

            # Launch solo
            cmd = re.escape(HOMEDIR)+'applaunch.sh '+cmd

Untested. My current media center also doesn't work. Sad I hope it works.
If it does, change VERSION = "0.2b2" to VERSION = "0.2b3". Smile

Keep in mind though, you'll hardly ever want to launch an emulator non-solo because running xbmc in the background rips on performance and sometimes has other issues.
You might want to try this in applaunch.sh:

replace
Code:
# 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
with
Code:
# 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 2

# Done? Restart XBMC
xbmc
Try Xubuntu. It's the new Ubuntu.
Reply
#33
Redsandro Wrote:You do know Arcade Browser is linux only, right?



well tbh I had no idea, so this means I can't use this with windows? (I have windows OS and windows version of XBMC)

a little bit OT: you guys know of any good plugin, like this one, out there for windows users?
Reply
#34
Well what I didn't expect and what surprises me is that you said this:
reta Wrote:I got the romlist working, all roms are there and listed properly..
So, it works in Windows? Everything except launching? That means it's pretty portable and it should be able to work with minor adaption.

Try adding the changes from my previous post to malte and then launch roms with solo=false and I guess noescape=true and try the path both escaped and unescaped in emulators.ini. I would experiment some if I had the time and a working MC. Solo=false (if fixed, see above) literally launches the command from the emulators.ini and skips the linux-only shellscript.

If the listing, browsing and choosing works like you said then I am positive it could be made to work with windows easily.
Try Xubuntu. It's the new Ubuntu.
Reply
#35
ok version 0.2b3 is working;-)

I had to change the line
Code:
if (emu['solo'] == True):

to:
Code:
if (emu['solo'] == 'true'):

Otherwise the solo part did not work anymore. I had no performance issues, even epsxe was running smoothly with xbmc in the background. But uae started some games in windowed mode instead of fullscreen.

That forced me to go back to my original problem and I already found a workaround.

In FEH.py the error occurs in badDirectRendering and after that in badColorDepth:
Code:
def badDirectRendering():
    out = os.popen("glxinfo | grep \"direct rendering\"", 'r')
    line = out.read()
    direct = "Yes" not in line    
    out.close()
    return direct

The error occurs at out.close(). I don't know what happens when xbmc is started from the bash script but It seems to have problems with stream handling or something like this. Never did anything with python so this is just a guess.

My workaround is this (in badDirectRendering and in badColorDepth):
Code:
try:
        out.close()    
    except IOError:
    line = ""
The line = "" is just some dummy code and should be something like "do nothing". If anyone knows how to do this the right way please let me know.
Reply
#36
Cool! 'true' is a string where True is a bit, neater code would be to get the latter one to work but somewhere I messed it up. The annoying thing is 0.2b3 used to exist and work but I didn't take care of it. I am ashamed. Anyway, nice that it works!

I hope to get a new version out sometime after I graduate. Who knows.

About FEH, looks like it checks for openGL support of direct-rendering, which is not there. I guess ignoring the error makes XBMC run in software mode? Which is annoying if you - like me - use old computers to do stuff like 'media centering'. You won't notice it if you have a high-end computer.

Or you don't have glx installed. try glxinfo at the command line.

I know topfs2 knows this stuff. Maybe he can come along. Smile

topfs2 Wrote:FEH.py is a safety tool we have wich we run prior to starting XBMC which will check if XBMC is capable to run on the system and gives an error message if it won't work, i.e if you don't have Hardware support for OpenGL.
Try Xubuntu. It's the new Ubuntu.
Reply
#37
No, I don't think it is the graphic environment. If I do a "glxinfo | grep 'direct rendering'" in the bash script before starting xbmc it outputs "direct rendering: Yes". So everything should be fine.

For me it looks like "os.popen("glxinfo | grep \"direct rendering\"", 'r')" is opening a stream to stdout and tries to close it later on with "out.close()". And that does not work inside the bash script. That's what I guess as a python noob.

But I am wondering why nobody else has this problem. This way of restarting xbmc seems to be quite common. With this above mentioned workaround everything is working fine but I think it is not the best way to this.
Reply
#38
Redsandro Wrote:Well what I didn't expect and what surprises me is that you said this:
So, it works in Windows? Everything except launching? That means it's pretty portable and it should be able to work with minor adaption.

Try adding the changes from my previous post to malte and then launch roms with solo=false and I guess noescape=true and try the path both escaped and unescaped in emulators.ini. I would experiment some if I had the time and a working MC. Solo=false (if fixed, see above) literally launches the command from the emulators.ini and skips the linux-only shellscript.

If the listing, browsing and choosing works like you said then I am positive it could be made to work with windows easily.

It actually works! Thanks a lot mate!

I have a question though, since I run xbmc on my secondary screen, the emulator starts on my primary screen.. and since this probably isn't too easy to set up in the code somehow I managed to create a shortcut for fceux that starts the emulator up on the right screen. However, the app="" line then must be directed to something else than a .exe file, and I guess that ain't possible right now?

If I get this line working it will solve my problem:
app="C:\\ProgramData\\Realtime Soft\\UltraMon\\ShellShortcuts\\fceux.umshortcut" fceu "G:\\Emulators\\roms\\nes\\%ROM%"

Is there a possibility for the script to just open that .umshortcut file instead of the executable (.exe)? Is it easy to change... and... would you be a sport and give me a hint or a line of code or something to make it possible? Would be really nice of you!

Thanks in advance!
Reply
#39
Now, that I got everything working I made some slight changes to your script to fit my needs:

- use game names instead of file names and multi-rom support

Main change is support for multi rom games. A lot of amiga games include several adf-files. UAE is able to load up to four of them at a time. So I made some changes to the creation of the xml files to show only the first one of the files as game and pass the rest of the files as parameter to UAE (or any other emulator that supports that feature).

If you are interested in this modifications you can view the modified default.py here: http://pastebin.com/f5baa6323 (changes in getConfig, listRoms, bootRom and buildRomList). If you like this ideas you can take it into your main script, of course.

You will have to make some changes to your default.ini and maybe to your file names, too. Example config for uae looks like this (only modified lines):
Code:
app=uae {-%I% "%ROMPATH%%ROM%"}
diskprefix=_Disk
The part in the {}-brackets will be repeated if neccessary, otherwise the brackets will be removed. %I% will be replaced with the current file number (zero-based).

The modified xml will look like this:
Code:
<rom filename="Lemmings 2_Disk1.adf" game="Lemmings 2">
    <description>
        No Description.
    </description>
    <subrom filename="Lemmings 2_Disk2.adf" game="Lemmings 2"/>
    <subrom filename="Lemmings 2_Disk3.adf" game="Lemmings 2"/>
</rom>
First file name remains unchanged. Other file names will be added as subrom-entries. This will only work if there is the diskprefix in the file name.

This is my first piece of python code so it will need some review. But until now (after 30 minutes testing;-)) I did not find any errors with launching games. I have a very small rom collection, maybe it will have problems with bigger ones.

I hope it is ok to post my changes here.

regards,
malte
Reply
#40
Hi, sorry for the late reply! Since some stuff changed on the forum, I don't get notifications on replies to this topic anymore, even though I am subscribed. I added a new subscribtion, maybe that will fix it. Smile

I came across this topic again while looking for answers. I forgot about it because I've happily been using Arcade Browser on Ubuntu 9.04 before and now on Ubuntu 10.04. But when I started it on my old MC (Xubuntu 9.10) because my computer was busy, the script went very bad and slow again. But so do other scripts! I seriously wonder what's with the Xubuntu setup that causes this.

Anyway it still works perfect on a good configuration. And if I ever ever find the time, I'm gonna want to make a few updates.

Until then, I hope it's still sufficient. Smile

malte Wrote:I hope it is ok to post my changes here.
Yes, perfect! Thanks.

Fortunately for me, the multi-ROM games I use so far (Neo-Geo etc) are packaged in single .ZIP files used by the emulator.
I might want to take your advise into consideration though. I used to play that Dune game, I think on Amiga, a loong time ago. But those very old ROMs are on a busted hard drive and they are not so easy to come by as they used to be. I think it was on three disks.

reta Wrote:Is there a possibility for the script to just open that .umshortcut file instead of the executable (.exe)? Is it easy to change... and... would you be a sport and give me a hint or a line of code or something to make it possible? Would be really nice of you!
I never heard of that. What is .umshortcut and how does it effectively work?
Have you figured something out already? Gimme some information about it and I'll look into it when I have some time.
Try Xubuntu. It's the new Ubuntu.
Reply
#41
redsandro Wrote:Hi, sorry for the late reply! Since some stuff changed on the forum, I don't get notifications on replies to this topic anymore, even though I am subscribed. I added a new subscribtion, maybe that will fix it.

Ok. I thought that you have been too busy to reply and to work on your script in this time. As I wanted to add lots of other changes I decided to build a new script from scratch (http://forum.xbmc.org/showthread.php?tid=70115). But I took some ideas from your original script. I hope this is ok (mentioned in the source: http://code.google.com/p/romcollectionbr...default.py).

Any interest in joining forces?

Regards,
malte
Reply
#42
Wow that's pretty nice what you did there.

I'm glad my ideas could kickstart your browser. Thanks for mentioning my name in the source. Did you replace the xml "database" with sqlite? Sounds interesting, but on first glance I cannot find it in the default.py or gui.py on google code. Am I missing something or just not looking good enough?

I think your browser is very modern while mine is kind of old skool if you know what I mean. You seem to have a fair amount of time, I have so little. For that reason, I think I should best implement the few features I have in mind to Arcade Browser, and maybe use your suggestion to add multi-rom support if I cannot find a way to pack my old multiroms. Perhaps if in the end the take on rom browsing seems to be different enough we can link to each other in source or docs as different takes attract different users.

Any descent update will be delayed anyway because of work, soon I'm going on holiday and after probably change jobs. And I also have this video encoder CLI I'm working on. Smile
Try Xubuntu. It's the new Ubuntu.
Reply
#43
Can I use it with Windows ?
Reply
#44
With AB, not yet, Linux only. That's something I want to implement first because my fastest computer runs Windows now.
So a new version will probably support Windows.

As for Malte's fork of AB, I'm not sure, he'll probably reply soon!
Try Xubuntu. It's the new Ubuntu.
Reply
#45
redsandro Wrote:Did you replace the xml "database" with sqlite? Sounds interesting, but on first glance I cannot find it in the default.py or gui.py on google code.

Yes, I used sqlite. There is an additional module gamedatabase that provides database access. It is used like this (in gui.py and helper.py): Game(self.gdb).getAll()


Quote:You seem to have a fair amount of time
I had some time at the beginning of the year. But now I have to find the little holes in real life againSmile


Quote:I think I should best implement the few features I have in mind to Arcade Browser, and maybe use your suggestion to add multi-rom support if I cannot find a way to pack my old multiroms.
Sure. You can use everything that I posted in your thread and everything that I already implemented in the new script. I took your original launchEmu method and made some changes that it will run on Windows and xbox, too. Maybe you could revert these changes to your script if you like.


Edit: No, my fork does not run on Windows, too. But it should be easy to adapt this code to your script (because its taken from thereSmile): http://code.google.com/p/romcollectionbr.../helper.py (have a look at launchEmu)
Reply

Logout Mark Read Team Forum Stats Members Help
[RELEASE] "Arcade Browser" (Emulator ROMS browser) Script for Linux0