Udoo Neo Full not detecting any joysticks with SDL2 / UDOObuntu 2.1.2

Discussion in 'UDOO NEO' started by oxoocoffee, Feb 24, 2017.

Tags:
  1. oxoocoffee

    oxoocoffee Member

    Joined:
    Sep 13, 2016
    Messages:
    57
    Likes Received:
    6
    Ok so I switched to dummy driver and this time I got this. Still wondering why frame buffer was not detected (separate issue)

    udooer@udooneo:~/github/jstest-sdl$ SDL_VIDEODRIVER=dummy ./jstest-sdl --list
    No joysticks were found
    udooer@udooneo:~/github/jstest-sdl$ ls -l /dev/input/
    by-id/ event0 event2 event4 js1 js3
    by-path/ event1 event3 js0 js2 mice
     
  2. oxoocoffee

    oxoocoffee Member

    Joined:
    Sep 13, 2016
    Messages:
    57
    Likes Received:
    6
    I was just informed on IRC SDL channel that SDL2 does not use jsX. It was used in SDL1. Now SDL2 is using udev/evdev.
    Is there a module that needs to be build or some rule added?
     
  3. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    You need to add some udev rules for your joystick:

    First find the ID_VENDOR and ID_MODEL of the joystick (change jsX) eg:

    Code:
    udevadm info -q all -n /dev/input/js0
    
    create a udev rule file in /etc/udev/rules.d/73-presistent-joystick.rules

    Add an entry for the your ID_VENDOR and ID_MODEL eg:

    Code:
    KERNEL=="js?", ENV{ID_VENDOR}=="YOUR ID VENDOR", ENV{ID_MODEL}=="YOUR ID MODEL" , NAME="input/js0"
    
     
  4. oxoocoffee

    oxoocoffee Member

    Joined:
    Sep 13, 2016
    Messages:
    57
    Likes Received:
    6
    Below is info for each jsX. I also added /etc/udev/rules.d/73-presistent-joystick.rules

    KERNEL=="js?", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c219" , NAME="input/js0"

    After rebooting and plugging my usb joystick It still it is listed as js3. Doing cat js3 and pressing buttons on joystick I get some echo on screen.

    udooer@udooneo:/dev/input$ udevadm info -q all -n /dev/input/js0
    P: /devices/virtual/input/input1/js0
    N: input/js0
    E: DEVNAME=/dev/input/js0
    E: DEVPATH=/devices/virtual/input/input1/js0
    E: ID_INPUT=1
    E: ID_INPUT_ACCELEROMETER=1
    E: MAJOR=13
    E: MINOR=0
    E: SUBSYSTEM=input
    E: USEC_INITIALIZED=779519

    udooer@udooneo:/dev/input$ udevadm info -q all -n /dev/input/js1
    P: /devices/virtual/input/input2/js1
    N: input/js1
    E: DEVNAME=/dev/input/js1
    E: DEVPATH=/devices/virtual/input/input2/js1
    E: ID_INPUT=1
    E: ID_INPUT_ACCELEROMETER=1
    E: MAJOR=13
    E: MINOR=1
    E: SUBSYSTEM=input
    E: USEC_INITIALIZED=780925

    udooer@udooneo:/dev/input$ udevadm info -q all -n /dev/input/js2
    P: /devices/virtual/input/input3/js2
    N: input/js2
    E: DEVNAME=/dev/input/js2
    E: DEVPATH=/devices/virtual/input/input3/js2
    E: ID_INPUT=1
    E: ID_INPUT_ACCELEROMETER=1
    E: MAJOR=13
    E: MINOR=2
    E: SUBSYSTEM=input
    E: USEC_INITIALIZED=782143

    udooer@udooneo:/dev/input$ udevadm info -q all -n /dev/input/js3
    P: /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1:1.0/0003:046D:C219.0001/input/input4/js3
    N: input/js3
    S: input/by-id/usb-Logitech_Logitech_Cordless_RumblePad_2-joystick
    S: input/by-path/platform-ci_hdrc.1-usb-0:1:1.0-joystick
    E: DEVLINKS=/dev/input/by-id/usb-Logitech_Logitech_Cordless_RumblePad_2-joystick /dev/input/by-path/platform-ci_hdrc.1-usb-0:1:1.0-joystick
    E: DEVNAME=/dev/input/js3
    E: DEVPATH=/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1:1.0/0003:046D:C219.0001/input/input4/js3
    E: ID_BUS=usb
    E: ID_FOR_SEAT=input-platform-ci_hdrc_1-usb-0_1_1_0
    E: ID_INPUT=1
    E: ID_INPUT_JOYSTICK=1
    E: ID_MODEL=Logitech_Cordless_RumblePad_2
    E: ID_MODEL_ENC=Logitech\x20Cordless\x20RumblePad\x202
    E: ID_MODEL_ID=c219
    E: ID_PATH=platform-ci_hdrc.1-usb-0:1:1.0
    E: ID_PATH_TAG=platform-ci_hdrc_1-usb-0_1_1_0
    E: ID_REVISION=0200
    E: ID_SERIAL=Logitech_Logitech_Cordless_RumblePad_2
    E: ID_TYPE=hid
    E: ID_USB_DRIVER=usbhid
    E: ID_USB_INTERFACES=:030000:
    E: ID_USB_INTERFACE_NUM=00
    E: ID_VENDOR=Logitech
    E: ID_VENDOR_ENC=Logitech
    E: ID_VENDOR_ID=046d
    E: MAJOR=13
    E: MINOR=3
    E: SUBSYSTEM=input
    E: TAGS=:seat:uaccess:
    E: USEC_INITIALIZED=783143
     
  5. oxoocoffee

    oxoocoffee Member

    Joined:
    Sep 13, 2016
    Messages:
    57
    Likes Received:
    6
    After removing joystick and rebooting udoo board I see that after adding rule I do not see any jsX in /dev/input/

    udooer@udooneo:~$ ls -l /dev/input/
    total 0
    drwxr-xr-x 2 root root 60 Jul 17 11:20 by-path
    crw-r----- 1 root root 13, 64 Jul 17 11:20 event0
    crw------- 1 root root 13, 65 Jul 17 11:20 event1
    crw------- 1 root root 13, 66 Jul 17 11:20 event2
    crw------- 1 root root 13, 67 Jul 17 11:20 event3
    crw-r----- 1 root root 13, 63 Jul 17 11:20 mice

    After plugging in joystick I do get all four js with still js3 as my joystick and event4 added

    udooer@udooneo:~$ ls -l /dev/input/
    total 0
    drwxr-xr-x 2 root root 80 Jul 17 11:41 by-id
    drwxr-xr-x 2 root root 100 Jul 17 11:41 by-path
    crw-r----- 1 root root 13, 64 Jul 17 11:20 event0
    crw------- 1 root root 13, 65 Jul 17 11:20 event1
    crw------- 1 root root 13, 66 Jul 17 11:20 event2
    crw------- 1 root root 13, 67 Jul 17 11:20 event3
    crw-r----- 1 root root 13, 68 Jul 17 11:41 event4
    crw-r--r-- 1 root root 13, 0 Jul 17 11:41 js0
    crw-r--r-- 1 root root 13, 1 Jul 17 11:41 js1
    crw-r--r-- 1 root root 13, 2 Jul 17 11:41 js2
    crw-r--r-- 1 root root 13, 3 Jul 17 11:41 js3
    crw-r----- 1 root root 13, 63 Jul 17 11:20 mice

    Also here is my dmesg

    [ 16.262651] init: udoofota-server respawning too fast, stopped
    [ 16.574394] libphy: 2188000.ethernet:00 - Link is Up - 100/Full
    [ 16.574427] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    [ 39.832738] systemd-udevd[218]: timeout 'accelerometer /devices/virtual/input/input2'
    [ 39.902943] systemd-udevd[216]: timeout 'accelerometer /devices/virtual/input/input3'
    [ 69.313005] cfg80211: Verifying active interfaces after reg change
    [ 74.847782] init: ttyGS0 main process ended, respawning
    [ 1280.302915] usb 1-1: new low-speed USB device number 2 using ci_hdrc
    [ 1280.628177] usbcore: registered new interface driver usbhid
    [ 1280.628200] usbhid: USB HID core driver
    [ 1280.680062] input: Logitech Logitech Cordless RumblePad 2 as /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1:1.0/0003:046D:C219.0001/input/input4
    [ 1280.680484] logitech 0003:046D:C219.0001: input: USB HID v1.10 Gamepad [Logitech Logitech Cordless RumblePad 2] on usb-ci_hdrc.1-1/input0
    [ 1280.680501] hid_logitech: Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.se>
     
  6. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    You need a line like this:

    Code:
    KERNEL=="js?", ENV{ID_VENDOR}=="Logitech", ENV{ID_MODEL}=="Logitech_Cordless_RumblePad_2" , NAME="input/js3"
    
     
  7. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    Typo should be:

    Code:
    KERNEL=="js?", ENV{ID_VENDOR}=="Logitech", ENV{ID_MODEL}=="Logitech_Cordless_RumblePad_2" , NAME="input/js0"
    
    [/QUOTE]
     
  8. oxoocoffee

    oxoocoffee Member

    Joined:
    Sep 13, 2016
    Messages:
    57
    Likes Received:
    6
    jas-mx

    I did updated my rule to
    KERNEL=="js?", ENV{ID_VENDOR}=="Logitech", ENV{ID_MODEL}=="Logitech_Cordless_RumblePad_2" , NAME="input/js0"

    after board and plugging in joystick I get data updates on js3 not on js0

    Looks like accelerometer is going before it

    Here is latest dmesg

    [ 17.424239] libphy: 2188000.ethernet:00 - Link is Up - 100/Full
    [ 17.424269] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    [ 39.582748] systemd-udevd[213]: timeout 'accelerometer /devices/virtual/input/input1'
    [ 69.059954] cfg80211: Verifying active interfaces after reg change
    [ 74.404616] init: ttyGS0 main process ended, respawning
    [ 1742.872465] usb 1-1: new low-speed USB device number 2 using ci_hdrc
    [ 1743.196454] usbcore: registered new interface driver usbhid
    [ 1743.196479] usbhid: USB HID core driver
    [ 1743.253417] input: Logitech Logitech Cordless RumblePad 2 as /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1:1.0/0003:046D:C219.0001/input/input4
    [ 1743.253917] logitech 0003:046D:C219.0001: input: USB HID v1.10 Gamepad [Logitech Logitech Cordless RumblePad 2] on usb-ci_hdrc.1-1/input0
    [ 1743.253942] hid_logitech: Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.se>
     
  9. oxoocoffee

    oxoocoffee Member

    Joined:
    Sep 13, 2016
    Messages:
    57
    Likes Received:
    6
    I think these are the guys js0-js2

    udooer@udooneo:/sensors$ ls -l
    total 0
    lrwxrwxrwx 1 root root 39 Jul 18 12:14 accelerometer -> /sys/class/misc/FreescaleAccelerometer/
    lrwxrwxrwx 1 root root 35 Jul 18 12:14 gyroscope -> /sys/class/misc/FreescaleGyroscope/
    lrwxrwxrwx 1 root root 38 Jul 18 12:14 magnetometer -> /sys/class/misc/FreescaleMagnetometer/

    Also from dmesg

    [ 7.648747] input: FreescaleGyroscope as /devices/virtual/input/input1
    [ 7.651150] fxas2100x device driver probe successfully
    [ 7.658565] input: FreescaleAccelerometer as /devices/virtual/input/input2
    [ 7.660400] input: FreescaleMagnetometer as /devices/virtual/input/input3

    Could they be remaped to other js or disabled since I am not using them at the moment?
     
    Last edited: Jul 18, 2017
  10. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    The udev rule should have replaced js0 with your joystick so you will need to debug why its not working. If you want to disable the acclerometer/gyroscope then you need to disable then from the dts file or create udev rules to stop them being mapped.
     
  11. oxoocoffee

    oxoocoffee Member

    Joined:
    Sep 13, 2016
    Messages:
    57
    Likes Received:
    6
    I will look into disabling it in udev. Could you also expand on "debugging" Where would you start and what to look for as a start point?
    Anything you can think of. I will try to find what the issue might be. I never done this so it is great time to learn.
    Thank you
     

Share This Page