For anyone interested in running two (or more?) "cabinets" off of one system, and/or setting up Linux for mame, here's what I did:
(note, this guide assumes you know how to move around, and install anything missing in linux (i.e. brctl, ifconfig, etc..)
Linux Setup:Install your Linux of choice (I decided to go with Ubuntu; (I'm using Debian as my desktopOS))
apt install mame
roms go in /usr/local/share/games/mame/roms/
copy some roms in the above folder (as zip files), and copy the CHD directories into that folder as well (retaining the directory, so /usr/local/share/games/mame/roms/sf2049se/ contains the CHD and such).
I'm using this, kind of long directory as it's the default for mame, and allows other users (other than root) to access these games, all config overrides are done in the user's directory, including additional roms if you'd like.
Run mame... it should work.
Single Computer, two players (Linux MultiSeat setup)Now the fun part... MultiSeat; you'll need two video cards for this (can't use a single card with multiple outputs... I wish... well.. theres xephyr, but that's a long twisty road).
look at all the devices that "seat0" owns, which is basically, everything in the system.
loginctl seat-status seat0
pipe the above command through grep to find "drm", which are usually the video cards. You'll have card0 and card1. Lets give the second card to seat1, your pci location will vary, on mine:
loginctl attach seat1 /sys/devices/pci0000:00/0000:00:12.0/drm/card1
For my setup, I used a USB hub, and connected keyboard, mouse, 2nd A-PAC, and a USB audio device to it, so I could then just assign that hub to seat1 (Player 2)
example that worked for me:
loginctl attach seat1 /sys/devices/pci0000:00/0000:00:2.0/usb1 (just keyboard, I couldnt find a second mouse)
Create the users, setup autologin, and auto run:create two users; I created "player1" and "player2".
I could not get autologin to work with gdm3 (default), so I installed lightdm:
apt install lightdm
switch default to lightdm when prompted
edit /etc/lightdm/lightdm.conf.d/10-autologin.conf:
[Seat:seat0]
autologin-user=player1
[Seat:seat1]
autologin-user=player2
Next, reboot, and cross your fingers. When the system comes back up, you should have what LOOKS like two mirrored screens. Move the mouse on one, and see that the other is unaffected. Go ahead and run mame. The other monitor stays at a desktop. On the other keyboard/mouse, run mame on that session as well.
You should now have mame running twice. To make things easier, we'll just setup to run mame as soon as the user "logs in", although, we enabled auto-login anyway...
create the file ~/.xprofile for each user, and just have a single statement in it of "mame &" (which will launch mame in background, allowing the script to exit cleanly).
(Ideally, instead of running mame, run your front-end of choice, but I havn't gotten that far yet)
Networking:OMG, this was painful!
Mame looks for tun devices on linux as "tap-mess-<uid>-0" where <uid> is the userid that has access to that device. Since both instances of mame are on the same computer, I don't need to talk to the network really, so I can cheat and create the two interfaces, and bridge them together.
Based on information at
https://wiki.mamedev.org/index.php/Driver:Apollo#How_to_set_the_network_capabilities and snippets from
http://forum.arcadecontrols.com/index.php?topic=161667.0 to setup the game itself, I was able to get it to work.
Here's what I came up with for my networking script:
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/all/proxy_arp
chmod 666 /dev/net/tun
##Player1
ip -f link tuntap add dev tap-mess-1001-0 mode tap user player1 pi
ip link set tap-mess-1001-0 up arp on
ifconfig tap-mess-1001-0 192.168.1.1
##Player2
ip -f link tuntap add dev tap-mess-1002-0 mode tap user player2 pi
ip link set tap-mess-1002-0 up arp on
ifconfig tap-mess-1002-0 192.168.1.2
brctl addbr br0
brctl addif br0 tap-mess-1001-0
brctl addif br0 tap-mess-1002-0
ifconfig br0 up
I put the above script in /etc/rc.local then enabled rc-local in systemd.
note, interfaces will show NO-CARRIER until mame actually opens them up.
BTW, I verified network play using SanFrancisco Rush 2049 Special Edition.. NOT Ridge Racer.. Ridge/Rave Racer networking is still a WIP as of this writing.
More on this stuff as I continue. Jury is still out on if I'll keep this setup, or switch to virtual machines, or use windows, or what...