Using xboxdrv with mame4all/advmame
-
Here is what the xboxdrv command looks like (this is for a different controller than I normally use so I'm still tinkering, but the basic retropad one isn't much different and has the same results):
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >/dev/null \ --evdev /dev/input/by-id/usb-ShanWan_ZD_Game_For_Windows-event-joystick \ --silent \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --evdev-absmap ABS_X=x1,ABS_Y=y1 --evdev-keymap BTN_THUMB=b,BTN_THUMB2=a,BTN_TRIGGER=y,BTN_TOP=x,BTN_BASE4=start,BTN_BASE3=back,BTN_TOP2=lb,BTN_PINKIE=rb \ --dpad-as-button \ --ui-axismap lt=void,rt=void \ --ui-buttonmap tl-void,tr-void,guide=void \ --ui-axismap x1=REL_X:10,y1=REL_Y10,x2=void,y2=void &
I should caution that the absmap doesn't handle the right analog yet on this pad and I didn't redo the keymap section for this pad yet (that's what I had for the regular retropad I was using before), but this command does run and sets up the device, which then tests out properly in
evtest
. But any time I usexboxdrv
for any reason, mame4all doesn't see the device.I tried AdvanceMAME 3 as well. Basically all the same issues, and it too doesn't see the stick after running xboxdrv but sees it fine otherwise. Annoyingly, the analog settings in AdvanceMAME don't seem to let me turn off autocentering even though the option is there, although I think I get why: the emulator is seeing my analog stick as an absolute position of the yoke, whereas what I'm trying to do is make it use relative position instead. Absolute position works dreadfully in this game because you can't make fine movements with the analog stick without a lot of practice.
I guess a simpler variation on this question is: Is there any way to get mame4all or advmame to see the analog position as relative rather than absolute? But regardless I'd like to know why xboxdrv seems to not get along with either emulator at all.
Update: I managed to get relative controls with the dpad in advmame by finding the right game-specific input settings. On my regular retropad that might work out okay. It's not really great for control but it's better in some ways than it was.
-
@lummox-jr
--detatch-kernel-driver \
should be--detach-kernel-driver \
. Change that and test, I think. -
@spud11 That's just a typo I made while making the post. I typed it in on my computer while looking at my TV screen.
The xboxdrv command is running successfully, so I know there's nothing syntactically wrong with the options. I think the problem is something in mame4all/advmame's configuration.
-
Another part of this, I think, is that I need to drop the dead zone to something way lower. I know xboxdrv will help with that, once I can figure out how to get the driver talking to advmame.
BTW, I looked at the
advmame.rc
file, and this is what I have for the devices:device_joystick auto device_keyboard raw device_mouse auto
With that setting I find it odd that xboxdrv's mouse mapping isn't being noticed. But I'm still convinced the problem is those two emulators.
I should also note that I've got xboxdrv working for the Atari 800 emulator so I know this isn't simply a problem with xboxdrv or runcommand itself. It's these specific emulators that aren't seeing the xboxdrv-created device.
-
@lummox-jr What does the
/dev/shm/runcommand.log
show after using either mame4all or Advance Mame? -
@spud11 This is the contents of the file:
xboxdrv: no process found
That's from the killall command. Next is the
sudo xboxdrv
command above (not bothering to retype that here, although I did change from>/dev/null
to>>/dev/shm/runcommand.log
), then:xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/ Copyright C 2008-2011 Ingo Ruhnke <grumbel@gmail.com> Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details. Your Xbox/Xbox360 controller should now be available as: /dev/input/js1 /dev/input/event3 Press Ctrl+C to quit Parameters: Executing: /opt/retropie/emulators/advmame/bin/advmame "starwars" Shutdown complete
So as you see there's absolutely zero information about why advmame can't see the gamepad or the keyboard/mouse events it fires.
-
@mediamogul Any new thoughts?
-
I've been away from my setup since Saturday night and I need to look at a few of my maps to compare them. I'll be sure to touch base sometime tomorrow.
-
@lummox-jr Are you able to copy and paste rather than type everything from scratch? It's just a little bit harder to troubleshoot as I'm not sure whether it is a typo or whether it's actually a mistake in your
runcommand-onstart
.
Anyway:--ui-axismap x1=REL_X:10,y1=REL_Y10
I think it should read:
--ui-axismap X1=REL_X:10,Y1=REL_Y:10 \
The
X1
andY1
should be capitalised. -
@lummox-jr said in Using xboxdrv with mame4all:
I find it odd that xboxdrv's mouse mapping isn't being noticed.
While I don't have any experience with mame4all, I know that AdvanceMAME tries to automatically arrange the mouse index and many times sets the wrong one when you have multiple mice. Setting the mouse index manually doesn't work either because the index set by the system often varies as well. I handle this by assigning mouse0, mouse1 and mouse2 indexes to the various arcade options manually in
advancemame.rc
, which looks like:input_map[p1_dialx] mouse[0,x] mouse[1,x] mouse[2,x] input_map[p1_dialy] mouse[0,y] mouse[1,y] mouse[2,y] input_map[p1_paddlex] mouse[0,x] mouse[1,x] mouse[2,x] input_map[p1_paddley] mouse[0,y] mouse[1,y] mouse[2,y] input_map[p1_pedalgas] mouse[0,y] mouse[1,y] mouse[2,y] input_map[p1_stickx] mouse[0,x] mouse[1,x] mouse[2,x] input_map[p1_sticky] mouse[0,y] mouse[1,y] mouse[2,y] input_map[p1_trackballx] mouse[0,x] mouse[1,x] mouse[2,x] input_map[p1_trackbally] mouse[0,y] mouse[1,y] mouse[2,y]
-
@mediamogul I could give the mouse thing a try. I'll do so later and post an update let you know. (Usually I do not have a mouse plugged in, since I haven't needed it since the initial setup.) However since the xboxdrv keyboard output also isn't seen, I think there's probably more to the problem than that. Mapping select/back to a key like 5 so it can trigger the coin slot does not work any more than the mouse stuff has.
@spud11 Sadly copying and pasting is not an option. Because of the way my network is configured I can't use SCP/SFTP to reach the Pi from my Windows desktop. However I'm absolutely positive that there is no need to capitalize x1 or y1 in the --ui-axismap option; I got that part of the command directly from mediamogul's configuration guide, where x1 and y1 are lowercase.
-
@lummox-jr said in Using xboxdrv with mame4all:
However since the xboxdrv keyboard output also isn't seen, I think there's probably more to the problem than that.
While you're setting the mice options, try also setting:
device_keyboard raw
-
@mediamogul I made the suggested changes for mouse input in advmame.rc, but to no avail. Also,
device_keyboard
was already set to raw. The emulator takes input from the actual keyboard but doesn't respond to simulated keypresses from xboxdrv. -
Very strange. And you say other xboxdrv maps are working in other emulators? Try changing:
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >/dev/null
to
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >> /dev/shm/runcommand.log 2>&1
Then launch a game, exit the game and check
/dev/shm/runcommand.log
to see if there are any errors. -
This post is deleted! -
@mediamogul I had changed the
> /dev/null
to>>/dev/shm/runcommand.log
already, but I added the2>&1
just now. There's no change. xboxdrv is creating the virtual device like it's supposed to, and AdvanceMAME is not seeing any of its output--no stick, no mouse events, no keyboard events.[edit] And yes, xboxdrv does work in other emulators--or at least in the Atari 800 emulator(the non-RetroArch one). mame4all and advmame, not so much.
-
I have to admit, I'm almost at a loss. I know that AdvanceMAME will only use devices it discovers at launch, so perhaps the xboxdrv keyboard is being created slightly afterward for some reason. Try changing:
advmame = "/opt/retropie/emulators/advmame/bin/advmame %BASENAME%"
to
advmame = "sleep 2; /opt/retropie/emulators/advmame/bin/advmame %BASENAME%"
in
/opt/retropie/configs/mame-advmame/emulators.cfg
and see if that makes any difference. -
@mediamogul I added
sleep 2
right in runcommand-onstart.sh after the xboxdrv command, and no such luck. Both mame4all and advmame are completely oblivious to any keyboard/mouse/stick output from xboxdrv.The sad part is I can get this semi-working without xboxdrv, but the analog control snaps back and although the D-pad works now with the mapping I did, it's still hard to control via the D-pad. Besides, I still would like the option of using xboxdrv for other configuration issues down the road.
-
@mediamogul My
advancemame.rc
settings are almost the same as your's, but I include mouse3 settings as well.While trawling through that file, I did see these settings which are set to auto:
input_map[p1_mousex] auto
andinput_map[p1_mousey] auto
.I haven't changed these at all because everything is working on my system, but perhaps @Lummox-JR could change these to:
input_map[p1_mousex] mouse[0,x] mouse[1,x] mouse[2,x] mouse[3,x] input_map[p1_mousey] mouse[0,y] mouse[1,y] mouse[2,y] mouse[3,y]
And see if that has any effect.
-
@lummox-jr Although I'm not using mame4all, I am using lr-mame2000 which uses the same mame romset so I'd assume that core would work with Star Wars.
I also use xboxdrv for my libretro/retroarch cores and, on my system, xboxdrv works fine with lr-mame2000, albeit I'm not mimicking a mouse with it.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.