Bug 244079 - QEMU / KVM Q35 USB Tablet (EVTouch) input device not captured by evdev
Summary: QEMU / KVM Q35 USB Tablet (EVTouch) input device not captured by evdev
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-STABLE
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-virtualization mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-12 20:25 UTC by John Hartley
Modified: 2020-02-18 07:06 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Hartley 2020-02-12 20:25:42 UTC
BUG:

The QEMU EvTouch USB Graphics Tablet is not one of devices that is captured and available  via /dev/input/event*

The impact of this is that you cannot get X11 evadev pointer device support to work with FreeBSD 12.1 running on QEMU / KVM / Q35 .

TESTING:

Running FreeBSD 12.1 on:
QEMU / KVM / OVMF / Q35 VM with EvTouch USB Graphics Tablet connected.


Boot shows that devices is connected:


<<DMESG USB REPORT>>

# dmesg | grep USB
uhci0: <Intel 82801I (ICH9) USB controller> port 0xb0a0-0xb0bf irq 16 at device 29.0 on pci0
uhci1: <Intel 82801I (ICH9) USB controller> port 0xb080-0xb09f irq 17 at device 29.1 on pci0
uhci2: <Intel 82801I (ICH9) USB controller> port 0xb060-0xb07f irq 18 at device 29.2 on pci0
ehci0: <Intel 82801I (ICH9) USB 2.0 controller> mem 0xc8b83000-0xc8b83fff irq 19 at device 29.7 on pci0
usbus0: 12Mbps Full Speed USB v1.0
usbus2: usbus1: 12Mbps Full Speed USB v1.0
usbus3: 12Mbps Full Speed USB v1.0
480Mbps High Speed USB v2.0
ugen3.2: <QEMU QEMU USB Keyboard> at usbus3
ukbd0: <QEMU QEMU USB Keyboard, class 0/0, rev 2.00/0.00, addr 2> on usbus3
ugen3.3: <QEMU QEMU USB Mouse> at usbus3
ugen3.4: <QEMU QEMU USB Tablet> at usbus3
ums0: <QEMU QEMU USB Mouse, class 0/0, rev 2.00/0.00, addr 3> on usbus3
uhid0: <QEMU QEMU USB Tablet, class 0/0, rev 2.00/0.00, addr 4> on usbus3
<<DMESG USB REPORT>>


So QEMU USB Tablet is found and connected to device /dev/uhid0

However it does not appear in set of evdev captured devices


<<EVDEV DEVICE INFO>>

# python3.7 -m evdev.evtest
ID  Device               Name                                Phys                                Uniq
------------------------------------------------------------------------------------------------------------------------------------------
0   /dev/input/event0    System keyboard multiplexer         kbdmux0                                 
1   /dev/input/event1    System mouse                        sysmouse                                
2   /dev/input/event2    AT keyboard                         atkbd0                                  
3   /dev/input/event3    IntelliMouse Explorer               psm0                                    
4   /dev/input/event4    QEMU QEMU USB Keyboard, class 0/0, rev 2.00/0.00, addr 2 ukbd0                               68284-0000:00:1d.7-1
5   /dev/input/event5    QEMU QEMU USB Mouse, class 0/0, rev 2.00/0.00, addr 3 ums0                                89126-0000:00:1d.7-4

Select devices [0-5]:

<<END EVDEV DEVICE INFO>>

NOTE: Kernel build with netmap disabled kernel due to this bug:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241774) 


EXPECTED BEHAVIOUR:

QEMU USB Tablet should also be one of devices captured with input data available via /dev/input/event* device

Please let me know if you need additional testing to help with diagnosis.

I am reporting this as effecting many people as flow through to lack of EvTouch USB support much discussed issues when doing web search. This bug reports potential root cause fix.
Comment 1 Vladimir Kondratyev freebsd_committer 2020-02-16 00:54:11 UTC
uhid(4) does not support evdev now

Try misc/utouch-kmod driver from the ports tree
Comment 2 John Hartley 2020-02-18 07:06:55 UTC
Hi Vladimir,

thank you very much for response.

I have done as suggested:

<<DMESG WITH UTOUCH>>

# dmesg | grep USB
uhci0: <Intel 82801I (ICH9) USB controller> port 0xb0a0-0xb0bf irq 16 at device 29.0 on pci0
uhci1: <Intel 82801I (ICH9) USB controller> port 0xb080-0xb09f irq 17 at device 29.1 on pci0
uhci2: <Intel 82801I (ICH9) USB controller> port 0xb060-0xb07f irq 18 at device 29.2 on pci0
ehci0: <Intel 82801I (ICH9) USB 2.0 controller> mem 0xc8b83000-0xc8b83fff irq 19 at device 29.7 on pci0
usbus0: 12Mbps Full Speed USB v1.0
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 480Mbps High Speed USB v2.0
usbus1: 12Mbps Full Speed USB v1.0
ugen3.2: <QEMU QEMU USB Keyboard> at usbus3
ukbd0: <QEMU QEMU USB Keyboard, class 0/0, rev 2.00/0.00, addr 2> on usbus3
ugen3.3: <QEMU QEMU USB Mouse> at usbus3
ugen3.4: <QEMU QEMU USB Tablet> at usbus3
utouch0: <QEMU QEMU USB Tablet, class 0/0, rev 2.00/0.00, addr 4> on usbus3
ums0: <QEMU QEMU USB Mouse, class 0/0, rev 2.00/0.00, addr 3> on usbus3

<<END DMESG WITH UTOUCH>>

<<EVTEST>>

# python3.7 -m evdev.evtest
ID  Device               Name                                Phys                                Uniq
------------------------------------------------------------------------------------------------------------------------------------------
0   /dev/input/event0    System keyboard multiplexer         kbdmux0                                 
1   /dev/input/event1    System mouse                        sysmouse                                
2   /dev/input/event2    AT keyboard                         atkbd0                                  
3   /dev/input/event3    IntelliMouse Explorer               psm0                                    
4   /dev/input/event4    QEMU QEMU USB Keyboard, class 0/0, rev 2.00/0.00, addr 2 ukbd0                               68284-0000:00:1d.7-1
5   /dev/input/event5    QEMU QEMU USB Tablet, class 0/0, rev 2.00/0.00, addr 4 utouch0                             28754-0000:00:1d.7-5
6   /dev/input/event6    QEMU QEMU USB Mouse, class 0/0, rev 2.00/0.00, addr 3 ums0                                89126-0000:00:1d.7-4

Select devices [0-6]: 5
Listening for events (press ctrl-c to exit) ...
time 1582007519.619301 --------- SYN_DROPPED --------
time 1582007519.619301 --------- SYN_REPORT --------
time 1582007519.638179 type 3 (EV_ABS), code 0    (ABS_X), value 22015
time 1582007519.638179 type 3 (EV_ABS), code 1    (ABS_Y), value 26495
time 1582007519.638179 --------- SYN_REPORT --------
time 1582007519.642895 type 3 (EV_ABS), code 0    (ABS_X), value 21663
time 1582007519.642895 type 3 (EV_ABS), code 1    (ABS_Y), value 27348
time 1582007519.642895 --------- SYN_REPORT --------
time 1582007519.65342 type 3 (EV_ABS), code 0    (ABS_X), value 21215
time 1582007519.65342 type 3 (EV_ABS), code 1    (ABS_Y), value 28585
time 1582007519.65342 --------- SYN_REPORT --------
time 1582007519.66421 type 3 (EV_ABS), code 0    (ABS_X), value 20863
time 1582007519.66421 type 3 (EV_ABS), code 1    (ABS_Y), value 29823
time 1582007519.66421 --------- SYN_REPORT --------
time 1582007519.677026 type 3 (EV_ABS), code 0    (ABS_X), value 20607
time 1582007519.677026 type 3 (EV_ABS), code 1    (ABS_Y), value 31060
time 1582007519.677026 --------- SYN_REPORT --------
time 1582007519.686741 type 3 (EV_ABS), code 0    (ABS_X), value 20415
time 1582007519.686741 type 3 (EV_ABS), code 1    (ABS_Y), value 32297
time 1582007519.686741 --------- SYN_REPORT --------
time 1582007536.383169 type 3 (EV_ABS), code 0    (ABS_X), value 12031
time 1582007536.383169 type 3 (EV_ABS), code 1    (ABS_Y), value 17108
time 1582007536.383169 --------- SYN_REPORT --------
time 1582007536.449228 type 3 (EV_ABS), code 0    (ABS_X), value 12063
time 1582007536.449228 --------- SYN_REPORT --------
time 1582007536.744538 type 3 (EV_ABS), code 1    (ABS_Y), value 17066
time 1582007536.744538 --------- SYN_REPORT --------
time 1582007536.754257 type 3 (EV_ABS), code 0    (ABS_X), value 12095
time 1582007536.754257 type 3 (EV_ABS), code 1    (ABS_Y), value 17023
time 1582007536.754257 --------- SYN_REPORT --------
time 1582007536.765432 type 3 (EV_ABS), code 0    (ABS_X), value 12127
time 1582007536.765432 type 3 (EV_ABS), code 1    (ABS_Y), value 16980
time 1582007536.765432 --------- SYN_REPORT --------
time 1582007536.779227 type 3 (EV_ABS), code 0    (ABS_X), value 12159
time 1582007536.779227 type 3 (EV_ABS), code 1    (ABS_Y), value 16938
time 1582007536.779227 --------- SYN_REPORT --------
time 1582007536.786433 type 3 (EV_ABS), code 0    (ABS_X), value 12223
time 1582007536.786433 type 3 (EV_ABS), code 1    (ABS_Y), value 16895
time 1582007536.786433 --------- SYN_REPORT --------
time 1582007536.805982 type 3 (EV_ABS), code 0    (ABS_X), value 12255
time 1582007536.805982 type 3 (EV_ABS), code 1    (ABS_Y), value 16852
time 1582007536.805982 --------- SYN_REPORT --------
time 1582007536.809289 type 3 (EV_ABS), code 0    (ABS_X), value 12319
time 1582007536.809289 type 3 (EV_ABS), code 1    (ABS_Y), value 16810
time 1582007536.809289 --------- SYN_REPORT --------
time 1582007536.822264 type 3 (EV_ABS), code 0    (ABS_X), value 12351
time 1582007536.822264 type 3 (EV_ABS), code 1    (ABS_Y), value 16767
time 1582007536.822264 --------- SYN_REPORT --------
time 1582007536.831691 type 3 (EV_ABS), code 0    (ABS_X), value 12383
time 1582007536.831691 type 3 (EV_ABS), code 1    (ABS_Y), value 16724
time 1582007536.831691 --------- SYN_REPORT --------
time 1582007536.854654 type 3 (EV_ABS), code 0    (ABS_X), value 12415
time 1582007536.854654 type 3 (EV_ABS), code 1    (ABS_Y), value 16682
time 1582007536.854654 --------- SYN_REPORT --------
time 1582007537.103654 type 1 (EV_KEY), code 272  (['BTN_LEFT', 'BTN_MOUSE']), value 1
time 1582007537.103654 --------- SYN_REPORT --------
time 1582007537.236717 type 3 (EV_ABS), code 0    (ABS_X), value 12479
time 1582007537.236717 --------- SYN_REPORT --------
time 1582007537.2603  type 3 (EV_ABS), code 0    (ABS_X), value 12511
time 1582007537.2603  --------- SYN_REPORT --------
time 1582007537.279146 type 1 (EV_KEY), code 272  (['BTN_LEFT', 'BTN_MOUSE']), value 0
time 1582007537.279146 --------- SYN_REPORT --------
time 1582007537.280155 type 3 (EV_ABS), code 0    (ABS_X), value 12543
time 1582007537.280155 type 3 (EV_ABS), code 1    (ABS_Y), value 16724
time 1582007537.280155 --------- SYN_REPORT --------
time 1582007537.282278 type 3 (EV_ABS), code 0    (ABS_X), value 12607
time 1582007537.282278 --------- SYN_REPORT --------
time 1582007537.292983 type 3 (EV_ABS), code 0    (ABS_X), value 12671
time 1582007537.292983 type 3 (EV_ABS), code 1    (ABS_Y), value 16767
time 1582007537.292983 --------- SYN_REPORT --------
time 1582007537.313748 type 3 (EV_ABS), code 0    (ABS_X), value 12735
time 1582007537.313748 --------- SYN_REPORT --------
time 1582007537.315358 type 3 (EV_ABS), code 0    (ABS_X), value 12895
...
...
...

time 1582007545.415462 --------- SYN_REPORT --------

<<END EVTEST>>

So I am now getting Absolute X/Y (which is what I want) but when I do startx the mouse is not working correctly.

NOTE: I have following enabled via /etc/rc.conf:

dbus_enable="YES"

All other mouse/pointer related items are commented out (ie disabled):

#moused_enable="YES"
#hald_enable="YES"

The xinput indicates that the evdev driver has not loaded and Xorg is defaulting to mouse_drv:

<<XINPUT>>
# cat xinput-01.txt 
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ sysmouse                                	id=7	[slave  pointer  (2)]
⎜   ↳ Mouse                                   	id=8	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ kbdmux                                  	id=6	[slave  keyboard (3)]
<<END XINPUT>>

So issue is now how to get evdev input device connected to xorg...

can you provide any tip / link on this ?

Thank you.

Cheers,


John Hartley.