Failure to boot with xboxdrv initialisation in rc.local
-
Try to run the command as
nohup opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-Teensyduino_Keyboard_Mouse_Joystick_12700840-if03-event-joystick \ --silent \ --detach-kernel-driver \ ....
without the ending
&
. Since it runs from/etc/rc.local
, it doesn't need to usesudo
, all commands there are run asroot
. Run the command first from the command line to check that it works, and then add it to/etc/rc.local
. -
Thanks very much for the quick response!
Sadly if I remove the
&
and changesudo
tonohup
, then I get the following response when running the command from the terminal:nohup: ignoring input and appending output to 'nohup.out'
Just to check if this changed the boot behaviour I also edited
rc.local
to this format and tried to boot. The same message appears in the boot log and the system still hangs at the same point. -
The message shown is normal, it's not an error.
Do you have anything else in/etc/rc.local
? Can you post its entire content here ? -
@mitu The rest of my
rc.local
file is still default:#!/bin/sh -e #/etc/rc.local # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. # Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi nohup /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-Teensyduino_Keyboard_Mouse_Joystick_12700840-if03-event-joystick \ --silent \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --calibration x1=-28343:0:21192,y1=-24257:0:22384,x2=-28343:0:23320,y2=-24768:0:25107 --mimic-xpad \ --dpad-as-button \ --device-name "ApplePi Controller" \ --evdev-absmap ABS_RZ=x1,ABS_Z=y1,ABS_Y=x2,ABS_X=y2 --evdev-keymap BTN_BASE=dd,BTN_PINKIE=du,BTN_BASE2=dl,BTN_BASE3=dr,BTN_TRIGGER=a,BTN_TOP=b,BTN_THUMB2=y,BTN_THUMB=x,BTN_BASE4=start,BTN_TOP2=back \ --ui-axismap lt=void,rt=void \ --ui-buttonmap tr=void,tl=void,lb=void,rb=void,guide=void \ exit 0
-
Remove the
\
from the last line of thexboxdrv
command, since there's no additional&
on the next line there's no need for a line continuation. -
Tried removing the extra line continuation
\
, but still the same problem I'm afraid.I'm going to try reducing the command to barebones as possible and see if there is any particular parameter which is the cause.
If you have any further suggestions I would be keen to hear them though. Thanks again for your advice so far.
EDIT:
I removed the --deadzone-trigger, --deadzone, --force-feedback, --calibration, --ui-axismap and --ui-buttonmap parameters, but the problem still persists. -
Just a thought, although I may be way off here:
When I run the command through the terminal it gives the message:
Your Xbox/Xbox360 controller should now be available as: /dev/input/js3 /dev/input/event7 Press Ctrl-C to quit
It then doesn't return to the terminal unless an interrupt (
ctrl+c
) is given. Could it be that the start up process is locked waiting for this interrupt? -
@Applepie2 said in Failure to boot with xboxdrv initialisation in rc.local:
Could it be that the start up process is locked waiting for this interrupt?
Maybe, though I'd expect using either
&
ornohup
to fix this, since they send the process to run in the background.Now that I have a PI available, I've tried to run the command and I think you've missed a line continuation after the
--evdev-absmap
parameter... --device-name "ApplePi Controller" \ --evdev-absmap ABS_RZ=x1,ABS_Z=y1,ABS_Y=x2,ABS_X=y2 ...
should be
--device-name "ApplePi Controller" \ --evdev-absmap ABS_RZ=x1,ABS_Z=y1,ABS_Y=x2,ABS_X=y2 \
Try adding the missing
\
and run the command again from/etc/rc.local
. -
Added the missing the line continuation and checked all other lines to ensure there were no other
\
missing.Sadly still hangs at the same place.
-
@Applepie2 you had one more line continuation missing (for the
--calibration
param), but I assume you found it and fixed it.
What happens if you run the command directly, instead of using/etc/rc.local
? E.g.nohup sudo xboxdrv ...
- do you get the control back or it's still blocking the input ? -
If I run it directly, then it does return control.
-
I don't see why it wouldn't work also in
/etc/rc.local
. As an alternative, try adding it to the autostart script in/opt/retropie/configs/all/autostart.sh
, beforeemulationstation
is run. Try with:sudo xboxdrv --.. --ui-buttonmap tr=void,tl=void,lb=void,rb=void,guide=void \ & emulationstation #auto
-
I've tried moving the command to the autostart script
autostart.sh
, and although I now boot successfully, I don't think the command is running successfully as the controller seems to still be behaving as it was before mapping, and when loading games it still references the "Teensyduino_Keyboard_Mouse_Joystick" rather than "ApplePi Controller".I've double checked all the spelling, line continuations and everything seems fine.
My command hasn't changed, except I replaced the
nohup opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
with just
sudo xboxdrv \
And I added the extra line continuation
\
and final&
back in.Is
sudo xboxdrv
enough of a path from the autostart script? -
@Applepie2 said in Failure to boot with xboxdrv initialisation in rc.local:
Is sudo xboxdrv enough of a path from the autostart script?
No, you need to add the full path to
xboxdrv
. -
Added the full path and checked the command was correct again and see no noticeable errors.
It still doesn't appear to be running the command successfully though as the controller is still being recognised as Teensyduino_Keyboard_Mouse_Joystick. Is there anyway to get a verbose output from the
autostart.sh
script, so I can see what is actually happening? -
@Applepie2 You can comment out the
emulationstation #auto
line and see the output of the command on the terminal, just after the boot. You can also redirect the output of the command to a log file and inspect the log file.sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv 1>&2 2>/home/pi/xboxdrv.log \ .... # the rest of the xboxdrv command parameters #emulationstation #auto
-
@mitu I've tried both options you mentioned above and I see the success message print in the terminal saying that the controller is mapped tojs3
, and the log remains empty. This leads me to believe that the command is running successfully.However, the controller still seems to be seen by emulationstation/retroarch as "Teensyduino_Keyboard_Mouse_Joystick".If I go into the terminal and check withls /dev/input/js*
then onlyjs0
,js1
andjs2
are shown. Equally if I try to runjstest
onjs3
then it says (as expect based on the previous command)No such file or directory
.Is there any reason that the command would appear to run successfully but NOT actually map the controls?Thank you again so much for your advice, sorry for taking up your time!
EDIT:
I've found a typo in the command (I'm gonna blame tiredness for missing it last night). I had used a-
instead of a_
on one of the button mappings. The command is now certainly running and I am able to boot into emulationstation. However now my controller doesn't work at all in emulationstation. If I runjstest
onjs3
though it is working perfectly and everything is mapped as expected. Do I need to somehow assign a different primary controller, or register the controller with emulationstation somehow? -
@Applepie2 said in Failure to boot with xboxdrv initialisation in rc.local:
Do I need to somehow assign a different primary controller, or register the controller with emulationstation somehow?
EmulationStation doesn't have the notion of a 'Primary Controller', it will receive inputs from all (supported/known) controllers.
Runemulationstation
with the--debug
parameter and post the log, it should show the controller(s) it detects. Try to configure the gamepad and then exit (pressF4
).In addition to the log from EmulationStation, please post the output of
cat /proc/bus/input/devices
afterxboxdrv
has been started. -
@mitu For the emulationstation log I get:
Dec 22 12:56:27 lvl3: SystemView:getViewElements() Dec 22 12:56:27 lvl3: fireEvent: system-select c64 gotostart Dec 22 12:56:27 lvl2: Added known joystick 'Teensyduino Keyboard/Mouse/Joystick' (instance ID: 0, device index: 0). Dec 22 12:56:27 lvl2: Added known joystick 'Teensyduino Keyboard/Mouse/Joystick (instance ID: 1, device index: 1). Dec 22 12:56:29 lvl2:Added unconfigured joystick 'ApplePi Controller' (GUID:030000005e0400008e02000010010000, instance ID: 2, device index: 2).
For the output of
cat /proc/bus/input/devices
I get a list of all my devices, which includes the registered 'ApplePi Controller':I: Bus=0003 Vendor=045e Product=028e Version=0110 N: Name="ApplePi Controller" P: Phys= S: Sysfs=/devices/virtual/input/input25 U: Uniq= H: Handlers=event3 js3 B: PROP=0 B: EV=20000b B: KEY=7cdb03c0 0 0 0 0 0 0 0 0 0 B: ABS=3f B: FF=1 3f870000 0 0
As a side note, at the moment I am manually typing these outputs out for you, is there a simple way for me to be able to copy and paste the whole logs?
-
After reading the log myself I guessed that I hadn't reconfigured the controller properly in emulationstation, so after redoing the configuration everything is working great.
Thanks so much for all the help, problem is solved!
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.