VIM3 Ubuntu MATE (kernel 4.9) with joystick (DS4)

Hello,
I have khadas vim3 with Ubuntu MATE and it’s OS image was built with Fenix with following detail
== ENV CONFIG =======================
VERSION=1.0.3
KHADAS_BOARD=VIM3
LINUX=4.9
UBOOT=2015.01
DISTRIBUTION=Ubuntu
DISTRIB_RELEASE=focal
DISTRIB_TYPE=mate
DISTRIB_ARCH=arm64
INSTALL_TYPE=EMMC
COMPRESS_IMAGE=yes
INSTALL_TYPE_RAW=no

I tried to connect my Dualshock 4 joystick to Vim3 with bluetooth and somehow it says it’s connected (on bluetooth setting) but the joystick isn’t properly recognised.

Also, when I try it with USB cable, it is also recongnised as the device but doesn’t get any input from it. when I check lsusb I can see the joystick is connected to the device

Bus 001 Device 010: ID 054c:09cc Sony Corp. DualShock 4 [CUH-ZCT2x]

however, when I check kern.log (tail -f /var/log/kern.log) I can see the USB connects but nothing happens until it disconnects. I have unplugged and plugged it one more time and it is the same.

Nov 19 11:25:34 localhost kernel: [  205.244343@2] usb 1-1.1.1: new full-speed USB device number 10 using xhci-hcd
Nov 19 11:27:03 localhost kernel: [  294.336490@2] usb 1-1.1.1: USB disconnect, device number 10
Nov 19 11:27:06 localhost kernel: [  297.144301@2] usb 1-1.1.1: new full-speed USB device number 11 using xhci-hcd
Nov 19 11:27:08 localhost kernel: [  298.688500@2] usb 1-1.1.1: USB disconnect, device number 11


When I test the same joystick with other machine, it says

Nov 19 13:36:34 sy-desktop kernel: [16120.379891] usb 1-6: new full-speed USB device number 18 using xhci_hcd
Nov 19 13:36:34 sy-desktop kernel: [16120.529365] usb 1-6: New USB device found, idVendor=054c, idProduct=09cc, bcdDevice= 1.00
Nov 19 13:36:34 sy-desktop kernel: [16120.529370] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Nov 19 13:36:34 sy-desktop kernel: [16120.529374] usb 1-6: Product: Wireless Controller
Nov 19 13:36:34 sy-desktop kernel: [16120.529377] usb 1-6: Manufacturer: Sony Interactive Entertainment
Nov 19 13:36:34 sy-desktop kernel: [16120.540766] input: Sony Interactive Entertainment Wireless Controller Touchpad as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.3/0003:054C:09CC.0014/input/input70
Nov 19 13:36:34 sy-desktop kernel: [16120.541114] input: Sony Interactive Entertainment Wireless Controller Motion Sensors as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.3/0003:054C:09CC.0014/input/input71
Nov 19 13:36:34 sy-desktop kernel: [16120.600036] input: Sony Interactive Entertainment Wireless Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.3/0003:054C:09CC.0014/input/input69
Nov 19 13:36:34 sy-desktop kernel: [16120.600441] sony 0003:054C:09CC.0014: input,hidraw4: USB HID v81.11 Gamepad [Sony Interactive Entertainment Wireless Controller] on usb-0000:00:14.0-6/input3

Things I have tried are using ds4drv to get joystick input (https://github.com/chrippa/ds4drv) and it is keep hanging at Scanning Device stage. The same controller works perfectly on my other Ubuntu 20.04 (desktop) machine (for both USB connection and Bluetooth) so I don’t think it is the controller’s problem.

I have checked with jstest as well and it also doesn’t work. I am not sure if my VIM3 USB port and bluetooth setting is the problem or the OS image with Ubuntu MATE 20.04 with 4.9 kernel is not compatible with DS4 joysticks…

I have done some searching and I couldn’t find any solution.
Thank you in advance and any help regarding this issue would be appreciated!

I tried connecting Microsoft Wireless keyboard & mousepad to VIM3 and it connects with no issue. When I look at var/log/kernel.log I can see the dongle is recognised as input : Microsoft Nano Transceiver. I guess VIM3’s USB port or Bluetooth has no issue, it’s just the connection issue with joystick DS4.

Khadas vim3 image with kernel 4.9 already had CONFIG_INPUT_JOYSTICK as y (https://github.com/khadas/linux/blob/khadas-vims-v1.0.7-release/arch/arm64/configs/kvims_defconfig) and the problem was solved by installing/upgrading bluez and evdev and running ds4drv as raw bluetooth mode.

1 Like