Problem with xboxdrv and alt-config command using parsec under RetroPie
-
Hey everybody,
I´m new to this forum and have a problem for which I couldn´t find a solution so far, so I am posting this here in hope that someone can help.Let me start with a short introduction: I´m using Retropie 4.3 for a portable gaming console-project on a Raspberry Pi 3B with the official 7” touchscreen and an Adafruit Powerboost 1000C with an attached circuit following the github tutorial of craic computing for the Power-management and an Adafruit I2S Stereo-DAC for sound output to some headphones.
As controllers for this I have a pair of Joycons connected to the Pi via a Mayflash Magic NS-Stick. This seemed to be a viable solution since I did a little web research and Bluetooth connection and configuration of both controllers working as one seemed a little bit too tricky to me, since I´m quite a newbie to Linux and the RasPi. Fortunately this solution worked quite well on first attempt.
As next step I wanted to implement the possibility of keyboard and mouse controls via the Joycons, so I worked with the great xboxdrv-tutorial found on GitHub and this link. After some trial and error I got a configuration running with an alt-config and a cfg-file that worked well (see below my modified rc.local file).#!/bin/sh -e # sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --config /opt/retropie/configs/xbox1.txt \ sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-20d6_MAGIC-NS-event-joystick \ --silent \ --detach-kernel-driver \ --deadzone 4000 \ --trigger-as-button \ --device-name "My Controller" \ --evdev-absmap ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y,ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2 \ --evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_TL=lt,BTN_TR=rt,BTN_TR2=guide,BTN_THUMBL=back,BTN_MODE=start,BTN_SELECT=tl,BTN_START=tr \ --alt-config /usr/local/xbox_mouse.cfg \ & exit 0
This is the used config file which was originally used for my stratagus config:
#Stratagus Key configuration [xboxdrv] silent=true deadzone=4000 dpad-as-button=true trigger-as-button=true [ui-axismap] x1=REL_X:10 y1=REL_Y:-10 y2=KEY_UP:KEY_DOWN x2=KEY_LEFT:KEY_RIGHT [ui-buttonmap] a=BTN_LEFT b=BTN_RIGHT x=KEY_B y=KEY_W [ui-buttonmap] rb=cycle-key-named:groups:KEY_1:KEY_2:KEY_3:KEY_4:KEY_5:KEY_6:KEY_7:KEY_8:KEY_9:KEY_0 lb=cycle-key-ref:groups tl=KEY_LEFTALT tr=KEY_I [ui-buttonmap] rt=KEY_LEFTSHIFT lt=KEY_LEFTCTRL [ui-buttonmap] dd=KEY_F10 #dr=KEY_2 #dl=KEY_3 #du=KEY_4 [ui-buttonmap] start=KEY_ENTER back=KEY_ESC #guide=BTN_MODE # EOF #
So far so good. Now to my Problem:
As I went on with the project, I wanted to implement game-streaming via Parsec according to this tutorial. This worked out as well, but it seemed to have switched several buttons and axes on the virtual gamepad that is emulated from parsec on the host pc (Win 10). In addition the Y-axis from the left stick is inverted and dpad right and left seem to trigger the same buttons as L3 and R3. Before reassigning all buttons manually with buttonmap and axismap commands (and thus destroying my working config for the other emulators, plus I don´t know how to solve the problem with dpad L/R and L3/R3 triggered simultaneously) a tried some other things and deleted my custom gamepad name as posted above (very creative, I know 😉) back and added the following instead since I read in one of the xboxdrv-tutorials linked above that it would help to recognize the controller correctly as a Xbox-Controller:--mimic-xpad-wireless \
However after doing this RetroPie wouldn´t recognize my Controller correctly as a Xbox 360 Wireless Controller, instead it only seems to recognize the original Magic NS-Stick. Strangely I don´t see any error message at startup, the driver seems to load regularly. After some playing around with xboxdrv, I found that it still works when I leave out the alt-config section. Using this in parsec now works and I get the correct button and axismappings for the virtual gamepad, but I cannot use the alternative mouse/keyboard config.
I tried a workaround in which I first added parsec to the ports section and then used the runcommand-onstart/onend scripts for the driver-config only to be started with parsec according to the xboxdrv-tutorial using the following section:#!/bin/sh if [[ "$1" == "parsecstream" ]]; then sudo killall > /dev/null 2>&1 xboxdrv sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \ --evdev /dev/input/by-id/usb-20d6_MAGIC-NS-event-joystick \ --silent \ --detach-kernel-driver \ --deadzone 4000 \ --mimic-xpad-wireless \ --evdev-absmap ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y,ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2 \ --evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_TL=lt,BTN_TR=rt,BTN_TR2=guide,BTN_THUMBL=back,BTN_MODE=start,BTN_SELECT=tl,BTN_START=tr \ --axismap -Y1=Y1 \ --alt-config /usr/local/xbox_mouse.cfg \ & fi
To make things even stranger it seems that when using this script and switching to the alternative keyboard/mouse config, everything works in parsec, but as soon as I am in "gamepad mode" and press any gamepad-button (except guide for mode-switching) or move any stick I get strange screen-flickering on the touchscreen and none of the gamepad inputs are recognized on the host pc. This even happens if I change from display to a HDMI-connected screen, here I even have several seconds without signal/image. If I leave out the alt-config line here, it works just fine as well with correctly assigned buttons like described above. So I have the feeling I´m just inches away from solving the problem, but so far I haven´t figured out, what goes wrong here :(
Before I forget to mention, while trying this, I connected the Pi to an external Power Source (Official RasPi power supply with 2A supply current) via the Powerboost 1000C to avoid any power shortages.I would be really grateful if anyone has any idea about his.
-
@dukenukular Perhaps try:
--mimic-xpad \
instead of--mimic-xpad-wireless \
. -
Hi,
I just tried that, it has the same effect.
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.