Open Kazatel opened 6 years ago
I tried additional options to find out mapping like Big Picture , SDL2 Gamepad Tool
Big picture "SDL_GamepadBind" "03000000491900000204000000000000,gamepadplus,a:b0,b:b1,y:b4,x:b3,start:b11,back:b10,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b8,righttrigger:b9,
SDL2 Gamepad Tool 49190204000000000000504944564944,NGDS,a:b0,b:b1,x:b3,y:b4,back:b10,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.0,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:a5,righttrigger:b9,platform:Windows,
Looks like , my linux bindings should be correct, however, DPAD buttons are not working.
I found irtimmer post in https://github.com/irtimmer/moonlight-embedded/issues/519
D-Pad issue is fixed in commit dd23c70
However I'm not sure if this can help me and how to apply the fix.
Please provide the following info.
_NVidia Geforce Experience version: 3.11.0.73 Moonlight Embedded version: 2.4.4 Moonlight Embedded source: not sure Moonlight Embedded running on:Raspberry Pi 3 **Moonlight Embedded running on distribution :Raspbian jessie
**Verbose output
-verbose
of Moonlight Embedded: moonlight stream -1080 -fps 30 192.168.0.110 -verbose Moonlight Embedded 2.4.4 (EMBEDDED;ALSA;PI) Connect to 192.168.0.110... NVIDIA GeForce GTX 760 x2, GFE 3.11.0.73 (gs_04_02_23124921, 7.1.402.0) Platform Raspberry Pi (Broadcom) Loading mappingfile /usr/share/moonlight/gamecontrollerdb.txt Detected GamepadPlus (0500000049190000020400001b010000) on /dev/input/event2 as GamepadPlus Mapping for GamepadPlus (0500000049190000020400001b010000) on /dev/input/event2 is incorrect Stream 1920 x 1080, 30 fps, 10000 kbps Initializing platform...done Resolving host name...done Starting RTSP handshake...done Initializing control stream...done Initializing video stream...done Initializing audio stream...done Initializing input stream...done Starting control stream...done Starting video stream...done Starting audio stream...done Starting input stream...done Returning RTP packet queued for too long Received OOS audio data (expected 7916, but got 7917) Control stream received disconnect event Loss Stats: Transaction failed: 11 Stopping input stream...done Stopping audio stream...done Stopping video stream...done Stopping control stream...done Cleaning up input stream...done Cleaning up audio stream...done Cleaning up video stream...done Cleaning up control stream...done Cleaning up platform...doneHello,
I am newbie in linux, so please correct me if I am wrong, I have spent some time and looking for solution how to map my gamepads, since there was no response in big picture at all. Gamepads are working fine in retropie but not in streaming.
So far I found something and moved forward, sharing my experience.
1) How to find gamepad GUID. install sdl2-jstest - https://github.com/Grumbel/sdl-jstest
Usage: sdl2-jstest [OPTION] -l, --list Search for available joysticks and list their properties
~ $ sdl2-jstest -l Found 1 joystick(s)
Joystick Name: 'GamepadPlus' Joystick GUID: 0500000049190000020400001b010000 <<<<<<<<<here you go Joystick Number: 0 Number of Axes: 7 Number of Buttons: 159 Number of Hats: 1 Number of Balls: 0 GameController: not a gamepad
2) how to find mapping I guess there is difference in drivers and mapping, so depend if you are using udev of sdl drivers. special difference is that udev is seeing DPAD as "axes" and sdl as "hat"
to find proper event# cat /proc/bus/input/devices
I: Bus=0005 Vendor=1949 Product=0402 Version=011b N: Name="GamepadPlus" P: Phys=b8:27:eb:21:c0:1e S: Sysfs=/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:12/0005:1949:0402.0022/input/input36 U: Uniq=a7:0e:21:50:63:25 H: Handlers=kbd event2 js0 <<<<<<<<<<<<<<< B: PROP=0 B: EV=1f B: KEY=3f 3007f 0 0 0 0 483ffff 17aff32d bf544446 0 ffff0000 1 130f93 8b17c000 677bfa d9415fed 9ed680 4400 0 10000002 B: REL=40 B: ABS=1 30627 B: MSC=10
to find mapping I used "evtest" ~ $ evtest /dev/input/event2 Input driver version is 1.0.1 Input device ID: bus 0x5 vendor 0x1949 product 0x402 version 0x11b Input device name: "GamepadPlus" Supported events: Event type 0 (EV_SYN) . . . Properties: Testing ... (interrupt to exit) Event: time 1513255717.945550, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001 Event: time 1513255717.945550, type 1 (EV_KEY), code 304 (BTN_SOUTH), value 1 Event: time 1513255717.945550, -------------- EV_SYN ------------ Event: time 1513255718.070576, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001 Event: time 1513255718.070576, type 1 (EV_KEY), code 304 (BTN_SOUTH), value 0 Event: time 1513255718.070576, -------------- EV_SYN ------------ Event: time 1513255720.411835, type 3 (EV_ABS), code 17 (ABS_HAT0Y), value -1 Event: time 1513255720.411835, -------------- EV_SYN ------------ Event: time 1513255720.525511, type 3 (EV_ABS), code 17 (ABS_HAT0Y), value 0 Event: time 1513255720.525511, -------------- EV_SYN ------------
later on I used "sdl2-jstest" installed in step 1) Usage: sdl2-jstest [OPTION] -e, --event JOYNUM Display the events that are recieved from the joystick
~ $ sdl2-jstest -e 0 Joystick Name: 'GamepadPlus' Joystick GUID: 0500000049190000020400001b010000 Joystick Number: 0 Number of Axes: 7 Number of Buttons: 159 Number of Hats: 1 Number of Balls: 0 GameController: not a gamepad
Entering joystick test loop, press Ctrl-c to exit SDL_JOYDEVICEADDED which:0 SDL_JOYBUTTONDOWN: joystick: 0 button: 0 state: 1 SDL_JOYBUTTONUP: joystick: 0 button: 0 state: 0 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 1 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 0 Recieved interrupt, exiting
here I get output for sdl, as you can see I pressed "dpup" which gave me joystick: 0 hat: 0 value: 1 -> which should represent "h0.1"
I also used "jtest" , i guess this is for udev, since I get axes when pressed dpad buttons
jstest /dev/input/js0
jstest --event /dev/input/js0 Driver version is 2.1.0. . . . Event: type 1, time 331607620, number 0, value 1 Event: type 1, time 331607780, number 0, value 0 Event: type 2, time 331608350, number 7, value -32767 Event: type 2, time 331608450, number 7, value 0
in line with "Event: type 2" I pressed "dpup" and I got axes as value -32767
Recapitulation for DPAD buttons , pressed in order , {up, right, down , left} in "evtest "and "sdl2-jstest"
evtest /dev/input/event2 Testing ... (interrupt to exit) Event: time 1513256357.824390, type 3 (EV_ABS), code 17 (ABS_HAT0Y), value -1 Event: time 1513256357.824390, -------------- EV_SYN ------------ Event: time 1513256357.970634, type 3 (EV_ABS), code 17 (ABS_HAT0Y), value 0 Event: time 1513256357.970634, -------------- EV_SYN ------------ Event: time 1513256358.844396, type 3 (EV_ABS), code 16 (ABS_HAT0X), value 1 Event: time 1513256358.844396, -------------- EV_SYN ------------ Event: time 1513256358.973150, type 3 (EV_ABS), code 16 (ABS_HAT0X), value 0 Event: time 1513256358.973150, -------------- EV_SYN ------------ Event: time 1513256359.740674, type 3 (EV_ABS), code 17 (ABS_HAT0Y), value 1 Event: time 1513256359.740674, -------------- EV_SYN ------------ Event: time 1513256359.920649, type 3 (EV_ABS), code 17 (ABS_HAT0Y), value 0 Event: time 1513256359.920649, -------------- EV_SYN ------------ Event: time 1513256360.520634, type 3 (EV_ABS), code 16 (ABS_HAT0X), value -1 Event: time 1513256360.520634, -------------- EV_SYN ------------ Event: time 1513256360.669398, type 3 (EV_ABS), code 16 (ABS_HAT0X), value 0 Event: time 1513256360.669398, -------------- EV_SYN ------------
~ $ sdl2-jstest -e 0 Joystick Name: 'GamepadPlus' Joystick GUID: 0500000049190000020400001b010000 Joystick Number: 0 Number of Axes: 7 Number of Buttons: 159 Number of Hats: 1 Number of Balls: 0 GameController: not a gamepad
Entering joystick test loop, press Ctrl-c to exit SDL_JOYDEVICEADDED which:0 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 1 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 0 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 2 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 0 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 4 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 0 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 8 SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 0
my table e-code e-btn-name sdl-btn-name udev-btn sdl-btn
304 BTN_SOUTH a b0 b1 | 305 BTN_EAST b b1 b0 | 307 BTN_NORTH x b3 b4 | 308 BTN_WEST y b4 b3 | 310 BTN_TL leftshoulder b6 b6 312 BTN_TL2 lefttrigger b8 b8 311 BTN_TR rightshoulder b7 b7 313 BTN_TR2 righttrigger b9 b9 314 BTN_SELECT back b10 b10 315 BTN_START start b11 b11 317 BTN_THUMBL leftstick b13 b13 318 BTN_THUMBR rightstick b14 b14 0 ABS_X leftx a0 a0 1 ABS_Y lefty a1 a1 3 ABS_Z rightx a2 a2 5 ABS_RZ righty a3 a3 16 ABS_HAT0X dpleft a6 h0left h0.8 | 17 ABS_HAT0Y dpup a7 h0up h0.1 | 16 ABS_HAT0X dpright a6 h0right h0.2 |
17 ABS_HAT0Y dpdown a7 h0down h0.4 |
I built string below and added it into /usr/share/moonlight/gamecontrollerdb.txt 0500000049190000020400001b010000,GamepadPlus,a:b0,b:b1,x:b4,y:b3,leftshoulder:b6,lefttrigger:b8,rightshoulder:b7,righttrigger:b9,back:b10,start:b11,leftstick:b13,rightstick:b14,leftx:a0,lefty:a1,rightx:a2,righty:a3,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,platform:Linux,
What is the expected result? DPAD buttons are working.
What happens instead of that? looks like all buttons are working except DPAD. Have any clue what can be the an issue.
PS: apologize for my english.