MisterTea / MAMEHub

Netplay-capable multi-machine emulator
http://www.mamehub.com
118 stars 29 forks source link

absence of ../hash/mameROMs.xml.gz causing NPEs (I think). #3

Closed victort closed 11 years ago

victort commented 11 years ago

hi,

having this problem on both Raspbian (ARM6) and Debian (x86_64).

after submitting MAMEhub creds at login screen, getting an error dialog reading:

An exception has occured and has been logged. Returning to login screen

in ErrorLog.txt is the message:

java.io.FileNotFoundException: ../hash/mameROMs.xml.gz (No such file or directory)
com.mamehub.client.audit.GameAuditor.audit(GameAuditor.java:222)
com.mamehub.client.audit.GameAuditor.run(GameAuditor.java:105)
java.lang.Thread.run(Thread.java:679)

And, the exception as seen from the terminal (on Debian/x86_64):

[19:59:15,543  INFO RpcEngine.java:397] executing login request 
SERVER RECEIVED: this is a test
SERVER RECEIVED: this is a test
SERVER RECEIVED: this is a test
SERVER RECEIVED: this is a test
SERVER RECEIVED: this is a test
SERVER RECEIVED: this is a test
SERVER RECEIVED: this is a test
SERVER RECEIVED: this is a test
SERVER RECEIVED: this is a test
SERVER RECEIVED: this is a test
[19:59:15,979  INFO UDPReflectionServer.java:68] Shutting down
[19:59:17,679  INFO UDPReflectionServer.java:54] Server shutting down
jar:file:/home/mprov/Bombing_Ground/mamehub/MAMEHub/Client/target/MAMEHubClient-0.0.1-SNAPSHOT.jar!/MAMEHub.png
BUFFERED IMAGE: 248 248
[19:59:18,767  INFO MainFrame.java:392] Adding mainframe window
[19:59:18,785  INFO MainFrame.java:1329] UPDATED WITH 0 (0) VALUES
CHAT STATUS CHANGED: ONLINE
[19:59:19,042  INFO PortOpener.java:89] Remote device updated: D-Link Corporation DNS-343 103
[19:59:19,043  INFO PortOpener.java:89] Remote device updated: D-Link Corporation DNS-343 103
[19:59:19,043  INFO PortOpener.java:89] Remote device updated: D-Link Corporation DNS-343 103
[19:59:19,043  INFO PortOpener.java:89] Remote device updated: D-Link Corporation DNS-343 103
[19:59:19,043  INFO PortOpener.java:89] Remote device updated: D-Link Corporation DNS-343 103
May 8, 2013 7:59:20 PM com.mamehub.client.utility.ClientDatabaseEngine <init>
INFO: CREATING NEW DATABASE ENGINE
May 8, 2013 7:59:20 PM com.mamehub.client.utility.ClientDatabaseEngine <init>
INFO:  db dir: .//MAMEHubAuditDB6 db file.//MAMEHubAuditDB6/db
[19:59:20,939  INFO HashScanner.java:220] Cleaing old reverse-map
[19:59:20,996  INFO HashScanner.java:291] Starting scan..
[19:59:20,997  INFO HashScanner.java:300] Finished reading file headers.
[19:59:20,997  INFO HashScanner.java:319] Finished scanning
[19:59:20,997  INFO HashScanner.java:322] Committed all changes
[19:59:20,997  INFO GameAuditor.java:175] Parsing MAME roms
May 8, 2013 7:59:21 PM com.mamehub.client.utility.ClientDatabaseEngine wipeDatabase
INFO: WIPING OLD DATABASE
May 8, 2013 7:59:21 PM com.mamehub.client.utility.ClientDatabaseEngine wipeDatabase
INFO: ./MAMEHubAuditDB6/db.t
May 8, 2013 7:59:21 PM com.mamehub.client.utility.ClientDatabaseEngine wipeDatabase
INFO: ./MAMEHubAuditDB6/db.d.0
May 8, 2013 7:59:21 PM com.mamehub.client.utility.ClientDatabaseEngine wipeDatabase
INFO: ./MAMEHubAuditDB6/db.i.0
java.io.IOException: java.io.FileNotFoundException: ../hash/mameROMs.xml.gz (No such file or directory)
at com.mamehub.client.audit.GameAuditor.audit(GameAuditor.java:222)
at com.mamehub.client.audit.GameAuditor.run(GameAuditor.java:105)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.FileNotFoundException: ../hash/mameROMs.xml.gz (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at java.io.FileInputStream.<init>(FileInputStream.java:96)
at com.mamehub.client.audit.RomParser.process(RomParser.java:74)
at com.mamehub.client.audit.GameAuditor.audit(GameAuditor.java:176)
... 2 more
java.lang.NullPointerException
at com.mamehub.client.utility.ClientDatabaseEngine.getOrCreateHashMap(ClientDatabaseEngine.java:197)
at com.mamehub.client.audit.GameAuditor.getMameRomInfoMap(GameAuditor.java:331)
at com.mamehub.client.MameHubEngine.getMameRomInfo(MameHubEngine.java:231)
at com.mamehub.client.MainFrame.getGameDescription(MainFrame.java:1335)
at com.mamehub.client.MainFrame.updateJoinGameList(MainFrame.java:1312)
at com.mamehub.client.MainFrame.<init>(MainFrame.java:922)
at com.mamehub.client.login.LoginDialog.loginComplete(LoginDialog.java:374)
at com.mamehub.client.login.LoginDialog$6.actionPerformed(LoginDialog.java:305)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6288)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2045)
at java.awt.Component.dispatchEventImpl(Component.java:4649)[19:59:21,221  INFO RpcEngine.java:211] RPC ENGINE TERMINATED
at java.awt.Container.dispatchEventImpl(Container.java:2103)
at java.awt.Component.dispatchEvent(Component.java:4475)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4297)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
at java.awt.Container.dispatchEventImpl(Container.java:2089)
at java.awt.Window.dispatchEventImpl(Window.java:2587)
at java.awt.Component.dispatchEvent(Component.java:4475)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:675)
at java.awt.EventQueue.access$300(EventQueue.java:96)
at java.awt.EventQueue$2.run(EventQueue.java:634)
at java.awt.EventQueue$2.run(EventQueue.java:632)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
at java.awt.EventQueue$3.run(EventQueue.java:648)
at java.awt.EventQueue$3.run(EventQueue.java:646)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:645)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
[19:59:21,348  INFO UDPReflectionServer.java:29] SERVER: Waiting for packet
[19:59:21,348  INFO LoginDialog.java:89] Adding intro dialog
[19:59:23,800  INFO MainFrame.java:400] Removing mainframe window
victort commented 11 years ago

happens with both openjdk-7-jre and sun-java6-jre

jeremyblow commented 11 years ago

Same issue for me on Raspberry Pi. Clean install.

wheezy-armel sun jdk-7u21-linux-arm libswt-gtk-3-jni apache-maven-3.0.5

But mostly posting this just to say I'm on a Raspberry Pi. ... No.. I'm ona boaaaaat.

(load average: 2.49, 3.94, 3.64)

MisterTea commented 11 years ago

Thanks for finding this out. If you git pull and then go to the Client directory and run

mvn package

and then

java -jar target/MAMEHubClient-0.0.1-SNAPSHOT.jar

it should be able to read the hashes in the hash directory.

jeremyblow commented 11 years ago

Found the hash dir and missing mameROMs.xml.gz in the http://10ghost.net/MAMEHubDownloads/MAMEHub2_Linux32_0.6.zip package, which I imagine is a stable release. Is what is here on github a fork, current dev version, or other?

MisterTea commented 11 years ago

Its a copy :-D On May 10, 2013 12:02 AM, "Jeremy Blow" notifications@github.com wrote:

Found the hash dir and missing mameROMs.xml.gz in the http://10ghost.net/MAMEHubDownloads/MAMEHub2_Linux32_0.6.zip package, which I imagine is a stable release. Is what is here on github a fork, current dev version, or other?

— Reply to this email directly or view it on GitHubhttps://github.com/MisterTea/MAMEHub/issues/3#issuecomment-17707051 .

jeremyblow commented 11 years ago

Heya MisterTea...

Just wanted to report (in this dead and closed issue) that your commit resolved that issue. And, also, the lobby finally loaded on my Raspberry Pi.... but took 2 days for the Audit to complete! haha. :-)

I moved over to the Sun JDK 8 prerelease for arm/hardfloat. Much faster than OpenJDK on the rPi on the heavy tasks (maybe 5x to 10x speedup).

Anyway, thought you'd get a kick outa the info.

JB

MisterTea commented 11 years ago

Awesome!! Does MAME work on the raspberry pi?

I'm going to open source the MAME changes pretty soon.

On Sun, May 12, 2013 at 12:56 PM, Jeremy Blow notifications@github.comwrote:

Heya MisterTea...

Just wanted to report (in this dead and closed issue) that your commit resolved that issue. And, also, the lobby finally loaded on my Raspberry Pi.... but took 2 days for the Audit to complete! haha. :-)

I moved over to the Sun JDK 8 prerelease for arm/hardfloat. Much faster than OpenJDK on the rPi on the heavy tasks (maybe 5x to 10x speedup).

Anyway, thought you'd get a kick outa the info.

JB

— Reply to this email directly or view it on GitHubhttps://github.com/MisterTea/MAMEHub/issues/3#issuecomment-17784238 .

jeremyblow commented 11 years ago

So far, I've only worked on mamehub. I'm going to give csmame/mame a go later this evening. I'll let you know how it goes.

Cool, looking forward it!

JB

MisterTea commented 11 years ago

If you could share a pic of your pi running mamehub, that would be awesome!

jeremyblow commented 11 years ago

Shirley..

MAMEHub on rPi Imgur

CPU eventually settles down. Player state changes peg it for about 15-30 seconds.

MisterTea commented 11 years ago

Hey,

Now that the emulator is open sourced, would it be possible to get the entire thing working on a pi?

jeremyblow commented 11 years ago

Totally. Our rag-tag fugitive team is hacking on it. CSMame first. Mamehub is a bear on rPi... we'll need to dig in to the internals to see where the bottlenecks are (Java vs. mamehub processes).

jeremyblow commented 11 years ago

Here's what we are facing. At the versions of MAME that CSMame is using, ARM support is non-trivial. The forks, advanceMAME and MAME4ALL seem to have moved forward and will build on ARM, but are such a step backwards as far as the emulator version, and offer no hope of compatibility with CSMame. Could we plow through and get it to work, probably, but it'd end up being yet another port of MAME, and, I'm guessing it would take a MAME dev 1/100th the time to fix the problems.

There was one guy who seems to have gotten MAME to build on a cubox. His patch to MAME was pretty large. But, cubox is ARMv7 and the rPi is ARMv6, which is also a non-trivial issue.

There is much speculation out there stating that it's a lost cause anyway because the rPi is under-powered for modern MAME. Somewhat annoying because it's all speculation, I'm pretty certain nobody has been able to even try it. Certainly they are not considering the perf improvements MAME has encountered as a result of its c++ overhaul. Will it still be underpowered, I don't know, I believe it's an open question.

MisterTea commented 11 years ago

Hey Jeremy,

Are you sure about ARM support in current versions? I compiled the latest version of MAME for ARM a few years back with only a few hiccups. I also built MAME 0.146 for android without too much trouble and that's ARM. I'm pretty sure we could get a raspberry pi build of CSMAME without too much trouble.

IIRC, I had to change all of the dynamic_cast<..> functions to use C++ polymorphism, but that was the only problem.

On Tue, Jun 11, 2013 at 5:31 PM, Jeremy Blow notifications@github.comwrote:

Here's what we are facing. At the versions of MAME that CSMame is using, ARM support is non-trivial. The forks, advanceMAME and MAME4ALL seem to have moved forward and will build on ARM, but are such step backwards as far as the emulator version, and offer no hope of compatibility with CSMame. Could we plow through and get it to work, probably, but it'd end up being yet another port of MAME, and, I'm guessing it would take a MAME dev 1/100th the time to fix the problems.

There was one guy who seems to have gotten MAME to build on a cubox. His patch to MAME was pretty large. But, cubox is ARMv7 and the rPi is ARMv6, which is also a non-trivial issue.

There is much speculation out there stating that it's a lost cause anyway because the rPi is under-powered for modern MAME. Somewhat annoying because it's all speculation, I'm pretty certain nobody has been able to even try it. Certainly they are not considering the perf improvements MAME has encountered as a result of its c++ overhaul. Will it still be underpowered, I don't know, I believe it's an open question.

— Reply to this email directly or view it on GitHubhttps://github.com/MisterTea/MAMEHub/issues/3#issuecomment-19301069 .

jeremyblow commented 11 years ago

Hey, that's encouraging. Can't imagine much has changed since .146. Surprised haven't found anyone doing it yet. Do you happen remember your build environment? I may be missing something basic. I've been building either via qemu'd raspbian, chrooted cross compiling on deb 7 64 as armv6 (gcc version 4.6.3 (Debian 4.6.3-14+rpi1)), or straight cross via gcc linaro-4.7.-2013.01 / crosstool-ng w/ arm-unknown-linux-gnueabi.

MisterTea commented 11 years ago

I don't remember the build environment, but if you give me instructions on how you are building it, I can work through the errors myself. I've been working with the MAME codebase for awhile On Jun 11, 2013 10:19 PM, "Jeremy Blow" notifications@github.com wrote:

Hey, that's encouraging. Can't imagine much has changed since .146. Surprised haven't found anyone doing it yet. Do you happen remember your build environment? I may be missing something basic. I've been building either via qemu'd raspbian, chrooted cross compiling on deb 7 64 as armv6 (gcc version 4.6.3 (Debian 4.6.3-14+rpi1)), or straight cross via gcc linaro-4.7.-2013.01 / crosstool-ng w/ arm-unknown-linux-gnueabi.

— Reply to this email directly or view it on GitHubhttps://github.com/MisterTea/MAMEHub/issues/3#issuecomment-19307348 .

jeremyblow commented 11 years ago

That'd be excellent. My MAME exposure is just about one month. :-) Plus I only dig into C++ when troubleshooting stuff. Chrooted is probably the quickest path, here are my build steps. Note this also includes using directfb / cubox patch at the bottom, which is optional but moved me further along.

Grab Raspbian

wget http://mirrors.rit.edu/rpi/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip

Grab qemu

sudo apt-get install qemu qemu-user qemu-user-static qemu-system

The raspbian image is a little too cozy, only couple hundred MB free. Expand it to 4GB.

unzip 2013-02-09-wheezy-raspbian.zip
qemu-img resize 2013-02-09-wheezy-raspbian.img +2G

Raspbian will have boot problems via qemu unless we prevent preloading some libraries. Mount the second partition in the image so we can make some changes.

mkdir raspbian_root
sudo mount 2013-02-09-wheezy-raspbian.img -o offset=62914560 ./raspbian_root

sudo vi ./raspbian_root/etc/ld.so.preload and comment out the first line. You should end up with:

#/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so

We need to make a another change to udev so we can expand the partition via raspi-config. Create sudo vi ./raspbian_root/etc/udev/rules.d/90-qemu.rules and add the folllwing:

KERNEL=="sda", SYMLINK+="mmcblk0"
KERNEL=="sda?", SYMLINK+="mmcblk0p%n",

Great. Go ahead and umount the img.

sudo umount ./raspbian_root

Next, we'll boot up the image, run a quick fsck, reboot, and expand the second partition. Boot the image:

wget http://xecdesign.com/downloads/linux-qemu/kernel-qemu
qemu-system-arm -kernel kernel-qemu \
  -cpu arm1176 \
  -m 256 \
  -M versatilepb \
  -no-reboot \
  -serial stdio \
  -append "root=/dev/sda2 panic=1" \
  -hda ./2013-02-09-wheezy-raspbian.img

On the launched vm, you'll see some file system errors, when you get to the shell you can fix them with fsck. Make sure you're in the pi shell and not on your local system!

fsck /dev/sda2  # Say yes to prompt
exit

You should be exited out of qemu, relaunch the vm again:

qemu-system-arm -kernel kernel-qemu \
  -cpu arm1176 \
  -m 256 \
  -M versatilepb \
  -no-reboot \
  -serial stdio \
  -append "root=/dev/sda2 panic=1" \
  -hda ./2013-02-09-wheezy-raspbian.img

When you get to the shell, login (username pi, password raspberry). Launch raspi-config using sudo raspi-config. A menu should load. Choose the option to "expand file system". When it's finished, choose Finish and say yes to reboot. Qemu should exit. Relaunch qemu again as done in the previous step to allow resize2fs to resize the partition. When it's done booting, login and sudo halt. Exit qemu when system is halted.

From here, we're ready to chroot the img. First mount it back up:

sudo mount 2013-02-09-wheezy-raspbian.img -o offset=62914560 ./raspbian_root

Next, chroot the mount.

sudo chroot ./raspbian_root

From here, most things will work. You won't have /proc, /sys or /dev, but for building this seems to mostly be a cosmetic issue. If it truly concerns you, you can mount bind your system's proc/sys/dev, but this makes me uncomfortable and probably not necessary. If you need to exit out at any time just exit and umount ./raspbian_root.

On to MAME.

Some deps, some may not be needed, but were added while troubleshooting.

sudo apt-get update
sudo apt-get install qt4-dev-tools
sudo apt-get install libgtk2.0-dev
sudo apt-get install libgconf2-dev
sudo apt-get install libasound2-dev
sudo apt-get install libsdl1.2-dev
sudo apt-get install libfontconfig1-dev
sudo apt-get install libexpat1-dev
sudo apt-get install libflac-dev
sudo apt-get install libportmidi-dev
sudo apt-get install libdirectfb-bin  # possibly optional
sudo apt-get install libdirectfb-dev  # possibly optional
sudo apt-get install g++
sudo apt-get install zlib-bin
sudo apt-get install libjpeg8
sudo apt-get install libportmidi0
sudo apt-get install unzip expat

Get MAME

mkdir /home/pi/mame
cd /home/pi/mame
wget http://mamedev.thiswebhost.com/releases/mame0148s.zip
unzip mame0148s.zip
unzip mame.zip

From here, you can make normally. Using -jwhatever to build if you have the cores is fine while chrooted.

I've been looking at this guy's patch for cubox and playing with directfb. Moved me further along, but also may have moved me backwards.

wget -O mame0148.pkg.tgz http://www.solid-run.com/phpbb/download/file.php?id=46
tar -zxvf mame0148.pkg.tgz
patch -p1 < mame0148.pkgbuild/mame0148.cubox.jan21.patch 

make -j9 OSD=directfb NOWERROR=1

That's it so far. A few of us who are interested this generally hang out in IRC. E-mail me if you want the server/channel info.

Kewl. Looking forward.

jeremyblow commented 11 years ago

oh hey now. Just saw Dave Spencer post on your g+. Do you work with him? I worked with him at his start-up a long long time ago in a land far far away called Santa Monica. If u see him tell him I say hello! :-)

MisterTea commented 11 years ago

I used to work with him, but I still see him from time to time. I'll let him know you said hi!

On Wed, Jun 12, 2013 at 12:36 AM, Jeremy Blow notifications@github.comwrote:

oh hey now. Just saw Dave Spencer post on your g+. Do you work with him? I worked with him at his start-up a long long time ago in a land far far away called Santa Monica. If u see him tell him I say hello! :-)

— Reply to this email directly or view it on GitHubhttps://github.com/MisterTea/MAMEHub/issues/3#issuecomment-19310711 .

jeremyblow commented 11 years ago

That's really cool. I learned a LOT from Dave. Thx!

MisterTea commented 11 years ago

Hey Jeremy: The MAMEHub GUI is MUCH faster now, I bet it will run pretty smoothly on a raspberry pi.