XBOXDRV Guidance Needed
-
Well, I'm just glad I got it working. I had the buttonmap bits wrong. Initially, I had it set to
BTN_NORTH=KEY_X,BTN_SOUTH=KEY_C
etc, where infact I needed to have it as
x=KEY_X, a=KEY_C
etc. So you're configuring the long name "evdev" controls, to a short name XBOXDRV one. Then you configure the keymap to be the
shortname=actual control
. I was trying to uselong name=actual control
. Once I figured that last bit out, everything started working like it should have. -
Bingo, bango, bongo! All in all, you moved through every troubleshooting method I could have recommended. Temporarily removing
>dev/null
, for example, is a great way to uncover what issues you're having. As complicated as it can get, xboxdvr is pretty verbose about it's errors, which makes solving them pretty easy. -
@mediamogul Not knowing much about Linux (learning more each day!) and various terminal commands, I don't even know what that
>dev/null
command does. The>
bit looks like something to redirect output, like in DOS/Command Prompt in Windows when you want to say create a text file of a directory listing (dir > list.txt
). So my theory is saying we're basically displaying any output generated on the devices (null meaning all). I'm probably way off though. :)I'll give you a chance to troubleshoot something for me... My system runs all emulators and games fine until after I run Streets of Rage Remix. Once I return back to ES and try to run a different game, nothing happens. I get the RunCommand screen, then it returns to ES. If I reboot the system, everything is working again. Here's my runcommand.log:
Parameters: Executing: pushd /opt/retropie/ports/sorr; ./bgdi-330 ./SorR.dat; popd /opt/retropie/ports/sorr /home/pi /home/pi
So something with my modified launch script is getting mucked up. I don't have that
pushd
thing in the script at all, so I don't know where that's coming from.
For the records.. this is my "working" launching script:
sudo killall xboxdrv sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-©Microsoft_Xbox_360_Wireless_Receiver_for_Windows_E1594E70-event-joystick \ --detach-kernel-driver \ --silent \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --dpad-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RX=x2,ABS_RY=y2,ABS_Z=lt,ABS_RZ=rt \ --evdev-keymap BTN_SOUTH=a,BTN_EAST=b,BTN_NORTH=x,BTN_WEST=y,BTN_TL=lb,BTN_TR=rb,BTN_THUMBL=tl,BTN_THUMBR=tr,BTN_MODE=guide,BTN_SELECT=back,BTN_START=start,BTN_TRIGGER_HAPPY3=du,BTN_TRIGGER_HAPPY4=dd,BTN_TRIGGER_HAPPY1=dl,BTN_TRIGGER_HAPPY2=dr \ --ui-buttonmap x=KEY_X,a=KEY_C,b=KEY_V,lb=KEY_A,Y=KEY_S,rb=KEY_D \ --ui-buttonmap guide=KEY_B,start=KEY_ENTER,back=KEY_ESC \ --ui-buttonmap du=KEY_UP,dd=KEY_DOWN,dl=KEY_LEFT,dr=KEY_RIGHT \ -- \ "/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "sorr" ""
-
Rather than going round and round on the cause, this might be a great opportunity to try the simpler method I had in mind earlier. It's also a much cleaner approach and shouldn't cause the type of conflicts you're currently experiencing. If you're game, go ahead and restore your launch script to the way it was before and add the following to
/opt/retropie/configs/all/runcommand-onstart.sh
:if [ "$1" = "sorr" ] then sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-©Microsoft_Xbox_360_Wireless_Receiver_for_Windows_E1594E70-event-joystick \ --detach-kernel-driver \ --silent \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --dpad-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RX=x2,ABS_RY=y2,ABS_Z=lt,ABS_RZ=rt \ --evdev-keymap BTN_SOUTH=a,BTN_EAST=b,BTN_NORTH=x,BTN_WEST=y,BTN_TL=lb,BTN_TR=rb,BTN_THUMBL=tl,BTN_THUMBR=tr,BTN_MODE=guide,BTN_SELECT=back,BTN_START=start,BTN_TRIGGER_HAPPY3=du,BTN_TRIGGER_HAPPY4=dd,BTN_TRIGGER_HAPPY1=dl,BTN_TRIGGER_HAPPY2=dr \ --ui-buttonmap x=KEY_X,a=KEY_C,b=KEY_V,lb=KEY_A,Y=KEY_S,rb=KEY_D \ --ui-buttonmap guide=KEY_B,start=KEY_ENTER,back=KEY_ESC \ --ui-buttonmap du=KEY_UP,dd=KEY_DOWN,dl=KEY_LEFT,dr=KEY_RIGHT \ & fi
Then add the following to
/opt/retropie/configs/all/runcommand-onend.sh
:sudo killall xboxdrv
When I get some free time to sit down with it, I want to add this simpler and cleaner method to the guide, replacing the steps you had to work through.
-
Ok let me work through this a moment... so runcommand will actually run through the
onstart
script first.. then if it identifies that the command being launched issorr
then it will execute the script to launch the driver.. then it returns to runcommand to launch the game.. then when it finishes, it will run through theonend
script to make sure the driver has been completely removed.Sound about right? Seems simple enough to do.
-
Sound about right?
More or less, yessir.
runcommand-onstart.sh
always runs when a port/emulator is launched. The if /else statement we're adding to it then looks for $1 (see below) to be "sorr". If it is, it will run the xboxdrv command. The addition toruncommand-onend.sh
just breaks it all down afterward, leaving you with your base controller settings. Other variables that can be added to the if / else statement for a variety of other situations are:- $1 - the system (eg: atari2600, nes, snes, megadrive, fba, etc).
- $2 - the emulator (eg: lr-stella, lr-fceumm, lr-picodrive, pifba, etc).
- $3 - the full path to the rom file.
- $4 - the full command line used to launch the emulator.
-
My
onstart
file has this in it already:# the line below is needed to use the joystick selection by name method bash "/opt/retropie/supplementary/joystick-selection/js-onstart.sh" "$@"
would I move that down and put the
if
statements above it since the bash doesn't have any? -
Ok, that didn't work. I can confirm all my other games still work after rebooting, but when I try to launch SORR, it just goes back to the ES screen. It also looks like I lost my runcommand dialog box.
-
How can I test to see if the new changes are working? How do I pass a defined variable into a terminal entry? Something like
bash /opt/retropie/configs/all/runcommand-onstart.sh $1=sorr
Without some kind of observable interaction, I can't track down the problem. -
Paste your full
runcommand-onstart.sh
for a look. I assumed "sorr" is the name of the system, but since it's a port rather than a system, perhaps it's got a different naming convention.Try changing
if [ "$1" = "sorr" ]
to
if [ "$4" = "/path/to/executable" ]
-
I think I might have it cracked... by using the runcommand.log, I identified potential issues. Using some intelligence, I fixed them. The first issue is that in my post of the working script, for some reason the device listed as
--evdev /dev/input/by-id/usb-©Microsoft_Xbox_360_Wireless_Receiver_for_Windows_E1594E70-event-joystick \
. TheÂ
part shouldn't be there. So I corrected that. That got me a little further. Then I was getting an error about line 24 or something. I checked, and it was the start of the BASH line. So I swapped theIF
entry to the bottom, under the joystick-selection bash. That got things moving. Then I was getting an error about an unexpected END OF FILE. I had taken out the&
line you included, because when I compared it to my WORKING script, I didn't have it. I added that line back in, and now things look like they might be ok. As another part of testing, I took out the--silent \
line, so I need to add that back in. More testing coming up, but it looks I might have cracked it. The game loads and exists, and I can play an NES game right afterward (where it was closing out immediately before). -
Confirmed working!
/opt/retropie/configs/all/runcommand-onstart.sh contents:
# the line below is needed to use the joystick selection by name method bash "/opt/retropie/supplementary/joystick-selection/js-onstart.sh" "$@" if [ "$1" = "sorr" ] then sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-©Microsoft_Xbox_360_Wireless_Receiver_for_Windows_E1594E70-event-joystick \ --detach-kernel-driver \ --silent \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --dpad-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RX=x2,ABS_RY=y2,ABS_Z=lt,ABS_RZ=rt \ --evdev-keymap BTN_SOUTH=a,BTN_EAST=b,BTN_NORTH=x,BTN_WEST=y,BTN_TL=lb,BTN_TR=rb,BTN_THUMBL=tl,BTN_THUMBR=tr,BTN_MODE=guide,BTN_SELECT=back,BTN_START=start,BTN_TRIGGER_HAPPY3=du,BTN_TR$ --ui-buttonmap x=KEY_X,a=KEY_C,b=KEY_V,lb=KEY_A,Y=KEY_S,rb=KEY_D \ --ui-buttonmap guide=KEY_B,start=KEY_ENTER,back=KEY_ESC \ --ui-buttonmap du=KEY_UP,dd=KEY_DOWN,dl=KEY_LEFT,dr=KEY_RIGHT \ -- \ & fi
/opt/retropie/configs/all/runcommand-onend.sh contents:
sudo killall xboxdrv
Seems like loading games take maybe a second longer now though, as the scripts check to see if the command being launched is
sorr
or not, but that's ok. Now I just have to wait for my controllers to arrive so I can do it all over again with them!Ps: Is it possible to hide the bits where it's loading the driver, and then at the end when it says "Shutdown complete"?
-
@hansolo77 said in XBOXDRV Guidance Needed:
Confirmed working!
Great to hear.
Is it possible to hide the bits where it's loading the driver, and then at the end when it says "Shutdown complete"?
Try changing:
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
To:
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
Then changing:
sudo killall xboxdrv
To:
sudo killall > /dev/null 2>&1 xboxdrv
-
I'm making another SD card backup, then I'll try that. :)
I'd like to keep this thread open for a few more days, as I know I'll have some difficulties getting the Sega controllers working once they arrive. Can you maybe give me a head start on where to begin? I know the basic steps will require me to identify the location in Linux for each controller, and then their individual default mappings (might be the same, just different locations on the /dev/). Remapping isn't hard to do either now that I know how. But how do I go about setting up the script to launch multiple instances of the driver, so I can have 2 players simultaneously? And there's also the requirement of having the Xbox controller working as well. I assume, since we're not restricted to the RetroPad limitations, we can have 2 controllers mapped to player 1 this way? At least in the case where SORR can map to keyboard inputs (I actually have a keyboard attached, and the Xbox controller, so I know that's at least 2 controllers both capable of controlling 1 player). Can this also be used for RetroArch? My ultimate goal, now that I have the opened possibilities is to:
- Have the Xbox controller be setup as my primary controller
- Have my NES pads be available in RetroArch if I ever feel nostalgic, but not need to do any kind of special configuring before hand.. just plug it in, XBD is already configured, and off I go
- Have my SEGA pads also be available in the same way
- Have my ATARI Joysticks also available
- Be able to just plug in and go, and have XBOXDRV already have the assignments ready, without needing to run joystick-selector.
Is this all possible? How about some tips? :)
-
@hansolo77 said in XBOXDRV Guidance Needed:
how do I go about setting up the script to launch multiple instances of the driver
Just place a semicolon after the
&
from your first xboxdrv command, followed by the next xboxdrv command.Can this also be used for RetroArch?
Yessir
Is this all possible? How about some tips?
All of that is possible. You'll just need to create the various if / else statements as you need them and make sure that the desired controllers are plugged in before a game is launched.
-
You and me buddy... we're best friends of the XBOXDRV now. :) I've got tomorrow off, I think I'll try and at least get some gaming in. Maybe try and tackle a bit of NES controllers, but I think I need to hold off before my brain mushes. lol
PS - Those added commands you gave me worked great at hiding all the outputted text. Thanks again!
-
@hansolo77 said in XBOXDRV Guidance Needed:
You and me buddy... we're best friends of the XBOXDRV now.
I'd suggest we get t-shirts printed, but there's no use in making everyone else jealous.
Thanks again!
Not a problem. I'm glad it all worked out.
-
What a great thread!!
@hansolo77 thank you for reporting your progress because a new user will fall into the same pits :)
@mediamogul In my opinion you are the most helpfull member of this community!
-
Wow, thank you for the compliment. Helping out here in the limited areas I'm able to has the added benefit of keeping me in practice for my own issues. In that way, you could argue that it's a purely selfish endeavor. I'm also slowly trying to learn the mother's maiden name of every user here so that I can clean out their bank accounts and disappear without suspicion like Keyser Söze.
On a completely unrelated note, what was the name of your first pet again?
-
Moving forward a little bit... and my first hurdle..
I'm using a Raphnet.net NES to USB adapter (converts 2 standard NES plugs (mounted to an NES case) to USB wire to plug into the Pi internally). Going through the process, the system only identifies it as 1 name, 2 separate events/js#s. When I go to identify the
by-id
, I only have 1 listing for an event-joystick...usb-raphnet.net_nes2usb_1228-event-joystick
. When I go through theevtest
routines, both controllers are reporting the exact same codes. So the only distinguishing difference between the 2 is that they have different event and joystick numbers. Will that cause a problem? How do I map that? Would this be where I input the event number instead (ie;/dev/input/event4
)? Wouldn't that cause a problem if the event #'s change?
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.