xboxdrv works in FE / shell but not emulator
-
I tried resetting EM back to defaults and re-adding controllers. Again they work great in EM but not in emulators.
So I have the real device on js0, xboxdrv creates the new version on js1. I can tell EM is configuring the new one because the name is slightly different. Seems select is the only button that ever works.
I'm unsure if "udev" is right type when using this (from wiki seems to be) I tried sdl and made no difference.
Using jstest on js0 and js1 they do return different values.
-
Your map appears to be in order and it's executing without error. What emulators are you trying to use with this? If they are RetroArch cores, make sure that the virtualized xboxdrv controller is selected as player one, otherwise RetroArch will want to use your the controller's original mapping by default.
-
I tried stella and mame, both same result. It's unclear to me how to make sure it's selected as player one in retroarch but I see the virtualized name (different than real device) in the lower left at start and I tried using the joystick-selection add-on to name them and force it, still no dice. I
I may just start with latest 4.1 image and build it over again. I see some comments in other threads about latest kernel not working with xboxdrv.
-
@markg said in xboxdrv works in FE / shell but not emulator:
I may just start with latest 4.1 image and build it over again. I see some comments in other threads about latest kernel not working with xboxdrv.
I don't think there's any reason to start over. I believe the kernel incompatibility only applies when using xboxdrv as a driver for an actual Xbox controller. You can set the controller order by going to the "Configuration Editor" in the RetroPie menu of Emulation Station. From there, navigate to "Configure Basic libretro Emulator Options", then "Configure Default Options For All libretro Emulators" and finally "Choose Joypad Order".
-
@mediamogul awesome, thanks so much. Seems the joytstick-selector i compiled/used didn't do what I was expecting at the retroarch level but that did!
I added my 2nd controller which is to be setup differently and it was bound to the handler my first one was which was strange. Is there a way to force that binding, or is it just based on order you turn on the joysticks? (sorry for jumping topics here)
-
@markg said in xboxdrv works in FE / shell but not emulator:
it was bound to the handler my first one was which was strange.
I'm not sure I know what you mean here. Could you elaborate?
-
@mediamogul it seems that the device number (js0 or js1) is determined by the order you start the devices. In the xboxdrv configuration you have to specify the event number that's bound to that. So if I have two xboxdrv processes running, one for each of my controllers (xbox and snes30) If I don't turn them on in right order before that process runs they will bind to the wrong configuration file. I was wondering if there is a way to query the device name to determine if it's running as js0 or js1 and use that in the shell script that launches xboxdrv. I guess I could go to the extreme of using some awk/sed to take output of cat /proc/bus/input/devices and look at device names to determine the right handler.
-
OK, I see what you're saying. Ideally, the best way to bind a config to a controller is it's event entry at
/dev/input/by-id/*
. However, not all controllers report an ID and I take it that's why you're using the event number in your mapping example above. Fortunately, I haven't had to deal with this much myself. I've been lucky in that all of the controllers I have an interest in using for RetroPie report an ID. Albeit "extreme", I do really like the solution you're proposing to query the event number. I'd be very interested to hear how you implement it fully if you choose to do so. -
@mediamogul Ah... Thanks, think this was an RTFM thing. I was going from the recipe page on wiki and the instructions on the event name and I got to thinking "number". Re-reading it now I've changed to use by-id/name and that fixes issue of binding orders to event number that change. Thanks so much!
The four way restrictor is a big difference.... I may try to change the analog stick to work like digital and see if that works even better for a 4-way substitute.
-
Glad to see it's working.
The four way restrictor is a big difference.
I love that feature! You'll never get your best score in 'Pac-Man' without something like it.
-
@mediamogul so I did notice that the bluetooth controller never shows up on /dev/input/by-id ls command - but it does show up if I do cat on /proc/bus/input/devices. Expected?
-
It's not uncommon, Bluetooth or otherwise. I believe it's up to the manufacturer to program in an event ID into the firmware.
-
So this works for finding a controller by event ID dynamically
cat /proc/bus/input/devices |grep -A 10 "SNES"|grep Handlers|cut -d'=' -f2|cut -d' ' -f1
Which I used to find the SNES Controller that doesn't show up with other command, then you can dynamically do assignments with the resulting event number.
I seem to have noticed if I pick my newly named "4-way SNES" controller but have a default SNES controller setup in my retroarch-joypads (one 4 way and one from initial setup) it uses the wrong one. I removed the original one and working fine but makes me wonder about how to use this controller two different ways with retroarch (use in "normal" mode and with xboxdrv) if something in retroarch is looking at this other configuration file.
-
@mediamogul the one issue I still have is what you gave me that fixed things doesn't "stick". So the thing I HAVE to do to get an xboxdrv mapped controller to work is to pick it in the retroarch configuration as joy1 and joy2 and magic, it works. However when I unplug controller or disconnect bluetooth it seems those settings are "lost" and I have to go back in there and manually fix them again (they read "unset"). I kinda assumed these settings were just in a retroarch config file and not going to change. Is there a different place I should put this to make it more permanent? I see there is a enable plug/play option - maybe turn that off since I want to make it static? Thanks for any pointers with your help I'm so close to having this 100%!
-
@markg said in xboxdrv works in FE / shell but not emulator:
Is there a different place I should put this to make it more permanent?
This setting can be hardcoded in
/opt/retropie/configs/all/retroarch.cfg
. The entry you're looking for is:input_player1_joypad_index = "x"
Something else that comes to mind and is completely untested by myself is that this setting could be altered alongside xboxdrv launching, so as to accommodate individual mappings and controllers on-the-fly. Try at your own risk, but something like this might work well:
sed -i 's/input_player1_joypad_index = "*"/input_player1_joypad_index = "1"/g' /opt/retropie/configs/all/retroarch.cfg
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.