linuxraw: The linuxraw controller driver connects the mouse instead of the joypad in GNU/Linux virtual machines

Open
#16,898 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, linux

Research direction

Start by reproducing the linuxraw behavior in the described Ubuntu MATE virtual machine with virt-manager, using jstest to compare the tablet and joypad devices. Trace the linuxraw controller driver’s device selection and configuration handling. Done means selecting the joypad remains effective and button mapping no longer uses "spice vdagent tablet".

Written by the indexing model from the issue text.

Description

Description

The linuxraw controller driver connects the mouse instead of the joypad in GNU/Linux virtual machines. The mouse device is known as "spice vdagent tablet" in QEMU.

This issue affects all joypads, not just the Nintendo Switch Pro Controller as described below. Also, note that Ubuntu MATE 24.04 does not support the Nintendo Switch Pro Controller with jstest, only the Sony DualSense is supported. Consequently, I am using Ubuntu 23.04 to avoid potential bottleneck issues. Both controllers can be configured using either sdl2 or udev in both Ubuntu MATE 23.03, and 24.04.

Expected behavior

linuxraw/Nintendo Switch Pro Controller.cfg

input_driver = "linuxraw"
input_device = "Nintendo Switch Pro Controller"
...
Actual behavior

** Issue 2: "spice vdagent tablet" is still used** despite that I previously selected "Nintendo Switch Pro Controller".

linuxraw/Nintendo Switch Pro Controller.cfg

input_driver = "linuxraw"
input_device = "spice vdagent tablet"
input_up_axis = "-5"
Steps to reproduce the bug

In GNU/Linux:

  • sudo apt-get install virt-manager
  • Install a Ubuntu MATE 23.04 virtual machine

In the Ubuntu MATE 23.04 virtual machine

  • Virtual Machine -> Redirect USB device -> [Your controller]
  • Test the mouse (spice vdagent tablet)
jstest /dev/input/js0
Driver version is 2.1.0.
Joystick (spice vdagent tablet) has 2 axes (X, Y)
and 5 buttons (LeftBtn, RightBtn, MiddleBtn, SideBtn, ExtraBtn).
Testing ... (interrupt to exit)
Axes:  0: -1334  1: 10768 Buttons:  0:off  1:off  2:off  3:off  4:off ^C
  • Test the game controller:
$ jstest /dev/input/js1
Driver version is 2.1.0.
Joystick (Nintendo Switch Pro Controller) has 6 axes (X, Y, Rx, Ry, Hat0X, Hat0Y)
and 14 buttons (BtnA, BtnB, BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, BtnStart, BtnMode, BtnThumbL, BtnThumbR).
Testing ... (interrupt to exit)
Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:    46  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:    46  2:  -710  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:    46  2:  -710  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:    46  2:  -710  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7Axes:  0:     0  1:    46  2:  -710  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10:off 11:off 12:off 13:off

In RetroArch:

  1. Open RetroArch.
  2. Change the Controller Directory (standard procedure).
  3. Navigate to Settings -> Drivers -> Controller.
  4. Select "linuxraw", and restart RetroArch

image

  • Issue 1: Apparently "spice vdagent tablet" is primary connected:
    • Navigate to: Settings -> Input -> RetroPad Binds -> Port 1 Controls -> Device Index
    • Select "Nintendo Switch Pro Controller"
      image
  • Go back to "Port 1 Controls"
  • Click on "Set All Control"
  • RetroArch registers that I press the buttons, but do not assign them any values, except for DPAD-up.
Version/Commit
  • RetroArch: 1.19.1 AppImage, 1.19.1 Flatpak
Additional details
  • Operating System: Ubuntu MATE with virt-manager
  • Virtual Machine Software: virt-manager with a Ubuntu MATE 23.0 virtual image.
Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libretro/RetroArch

All issues in libretro/RetroArch

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.