Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news


Author Topic: Help with running mame in X  (Read 7283 times)

0 Members and 1 Guest are viewing this topic.


  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:February 17, 2017, 03:42:01 am
  • I want to build my own arcade controls!
Help with running mame in X
« on: February 16, 2017, 01:58:17 am »
Hello, my name is Erik.

I have spent the last week in hairpulling frustration trying to get this to run.
I built my mame cabinett back in 2009 and it has been running DOS until now. 1 month
ago the motherboard and the ide hdd died and i decided to uppgrade. It ran hot and was using to much power any way.
So i bought a "sapphire pure white e-350" motherboard with an integrated amd e350 apu.

So now i need to switch to linux because this motherboard will not run Dos and i don't like the boot-time
and the look of running windows in the background.
First of i installed xubuntu minimal. Then i installed all the libraries for running advancemame (libsdl2-dev, alsa and so on) and
the drivers for the integrated  Radeon HD 6310 graphics.
Then i compiled advancemame and advancemenu.

I have a 16/10 24" LCD monitor in my cabinet.
Then i try to run advancemame and start messing with the framebuffer and it just won't run. No screen, no device and
so on. Reading on the internet i find out two things. X seems easier and reliable and most of the advice available is useless
to me as i am running ubuntu 16.10 which uses systemd instead of init. So lots of tips are useless as the files these tips
refeer to don't even exists (example : no xorg.conf, no rc.local, no ....)

So i install "xserver-xorg-video-ati". I write a .xinitrc (just contains the word advmenu) file for the user (arcade) and run startx.
I get sound but i also get a black screen. I can hear when i switch games in advmenu but i see nothing.
So i install xfce, remove the .xinitrc and run startx. Success, i get a desktop. From there i find out that X thinks i have two screens
because the motherboard has VGA and DVI. It places the secondary screen of to the left of my monitor.
So i jump back into the TTY and rewrite the .xinitrc to this.

xrandr --output VGA-0 --off & advmenu

Then i run startx and presto i have advmenu on screen with sound. Buuuuut, the screen is set to the monitors max resolution of 1920x1200.
This runs way to slow on the integrated graphics and is pointless as there are no arcade games close to this resolution.
So i jump back out into the TTY and rewrite the .xinitrc to this

xrandr --output VGA-0 --off & xrandr --output DVI-0 --mode 640x480 & advmenu

The i run startx and JAY, advmenu is running at 640x480, fullscreen and works fine. So now i start a game, disaster.... The game starts
and runs fine but it is off center. And it is different from one game to the next. Som games just show the top left corner down in the
bottom right corner of the screen. Som prefer the other corner up to the left. I just get about a fourth of the games visuals on screen. On top
of that all input freezes up. The keyboard and arcade controlls stop working as soon as i start the game. The game runs halfway of screen
but does not respond to input. I have to jump to another TTY and kill the advmame process and when i return i am back in advmenu again with functional

Sooo, what do i do now?
How do i get advancemame to run on the available 640x480 screen that i supplied? What makes it start halfway of screen when advmenu runs fine on
that same screen?

Do you need more info to help? Logs? Configs? Screenshots?
I have spent one week getting this far so please help me. I am going out of my mind. That it would be this hard to get a computer
to start at 640x480 and run things in that resolution? I have already compromised on running games in their intended resolutions and
i have also given upp all hope on having any crt effects. I just want the thing to run at 640x480. Stretch or shrink all games to that resolution and just work.

Thankful for ANY help that you can offer.
« Last Edit: February 16, 2017, 02:01:33 am by noldor »


  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:February 17, 2017, 03:42:01 am
  • I want to build my own arcade controls!
Re: Help with running mame in X
« Reply #1 on: February 17, 2017, 02:57:10 am »
Anyone interested in a solution to this? I thought i would share the solution in case someone comes here looking for an answer.
The solution was to use a window manager to trap advancemame. I used Matchbox because it only has 1 window at a time and is suuuuper easy to setup and use.

A secondary problem was that sometimes the windowmanager started before xrandr had set the resolution to 640x480 and this was resolved by adding some sleep time
so that they start in order.
The final .xinitrc looks like this and works without fault.   ;D
Remember that i turn of VGA because i use DVI and don't want 2 screens.  ;)

xrandr --output VGA-0 --off & sleep 5 & xrandr --output DVI-0 --mode 640x480 & sleep 5 & matchbox-window-manager & sleep 5 & advmenu


  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1154
  • Last login:April 13, 2023, 05:31:03 pm
  • penguin poker
    • StickFreaks
Re: Help with running mame in X
« Reply #2 on: March 03, 2017, 04:48:42 am »
The single ampersand notation you're using means "background".  So for example:

command1 & command2 & command3

Means command1 will execute and background, and command2 will instantly start, even if command1 hasn't finished yet.  Ditto with command3.  These can all end up running in parallel typically (particularly on modern, fast machines).  So if command2 relies on command1 having done something to completion, things can go wrong.

If you want a second command to execute conditionally based on the successful execution (exit code 0) of the first, you need a double ampersand:

command1 && command2 && command3

If you want a command to execute on the conditional failure of the previous command, use the "exclusive or" notation:

command1 || command2

If you want a command to execute after another has completed regardless of success or failure, use a semicolon:

command1 ; command2 ; command3


  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 50
  • Last login:January 27, 2020, 09:41:31 am
Re: Help with running mame in X
« Reply #3 on: March 28, 2017, 12:19:52 pm »
Is there some special reason you're using AdvanceMAME instead of current Linux MAME? :)