Solution for xboxdrv triggers not working with teensy controller
mud2005 last edited by
The problem: Using xboxdrv with a custom teensy controller the trigger buttons would not register when setting up the controls in emulationstation.
I tried everything to fix this issue to no avail, by pure luck I found the solution.
Apparently order matters for some options in xboxdrv, when my config had this:
--dpad-as-button \ --trigger-as-button \ --mimic-xpad \
The triggers didn't work, but with:
--mimic-xpad \ --dpad-as-button \ --trigger-as-button \
They suddenly worked perfectly.
Also when I was first setting up the teensy without xboxdrv the analog sticks wouldn't register in emulationstation, the fix for that was to use xboxdrv and specifically the calibrate option, here is my complete config:
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-Teensyduino_Teensy_Flight_Sim_Controls_4843040-if02-event-joystick \ --silent \ --detach-kernel-driver \ --deadzone 4000 \ --calibration x1=-20800:0:20800,y1=-22300:0:22700,x2=-20000:0:22600,y2=-18400:0:23900 \ --mimic-xpad \ --dpad-as-button \ --trigger-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2 \ --evdev-keymap BTN_THUMB=a,BTN_THUMB2=b,BTN_TRIGGER=x,BTN_TOP=y,BTN_BASE=lb,BTN_PINKIE=rb,BTN_BASE5=tl,BTN_BASE6=tr,BTN_BASE3=back,BTN_BASE4=start,BTN_DEAD=du,KEY_#301=dd,KEY_#300=dl,KEY_#302=dr,BTN_TOP2=lt,BTN_BASE2=rt \
I used jstest to get the values for calibration, see this page for complete instructions: https://github.com/RetroPie/RetroPie-Setup/wiki/Universal-Controller-Calibration-&-Mapping-Using-xboxdrv
Side note, if you are building a custom controller I dont recommend the analog sticks available w/ breakout boards such as the kind they sell at Adafruit, they have a huge deadzone, I found some better analog modules from mouser, but they dont have a breakout board so you have to use perfboard and wire them manually, which is pretty easy.
I felt the need to post this info just in case it helps anyone else putting together a custom retropie handheld that runs into these issues, as it took me a few days to work all this out.
Thank for sharing - is there any specific model you used for this setup ? I'm thinking of adding this info to the Xboxdrv doc page for more visibility and I'd like to mention the exact model of the controller.
mud2005 last edited by mud2005
I used a teensy 3.2 with an xbox(ish) setup, the only difference being the r2 and l2 are buttons not analog triggers. This would also apply to the teensy LC which is similar.
Here's a couple pics of the handheld I made, I'm just getting the controls working and all the emulators setup and having a blast!