Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
30 user(s) are online (19 user(s) are browsing Forums)

Members: 0
Guests: 30

more...

Headlines

 
  Register To Post  

(1) 2 3 »
Touchscreen HID driver & QEMU's USB Tablet device
Just popping in
Just popping in


See User information
As you can imagine from the title, here we will try to solve the problems related to the QEMU's USB Tablet device.


Edited by AlfredOne on 2024/2/23 15:52:36
Edited by AlfredOne on 2024/2/23 15:53:15
Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Quite a regular
Quite a regular


See User information
I don't know what the usb-tablet device emulates. It seems like a HID device that reports absolute coordinates. It usually works with other guest OS drivers but don't know what the AmigaOS driver supports. An alternative is -device usb-wacom-tablet which more closely emulates an actual wacom tablet so maybe that could work better if the default usb-tablet is not recognised by AmigaOS's HID driver but I did not try these.

Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Just popping in
Just popping in


See User information
@balaton
@hans
I checked the hid report buffer of the QEMU USB Tablet device.
It is described as a Mouse, with 3 buttons, a wheel and absolute X,Y coordinates.
For this reason it is not managed by the hidtouch.usbfd, it is not seen as a touchscreen.

In any case the QEMU Tablet device seems to me to be a simulation of a mouse by QEMU. I could easily add support for this type of device, but it makes more sense for the AmigaOS4 hid.usbfd driver to handle it directly. Maybe it doesn't handle it because it only recognizes mice with relative coordinates or touchscreen/digitizer with absolute coordinates.

@hans, have you tried to see if the touchscreen of the tablet is seen as a USB device with the 'lsusb' command?

Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Home away from home
Home away from home


See User information
@AlfredOne

Quote:
@hans, can you tell me if the 3 buttons are physically on the tablet or are they emulated by qemu?

There is no actual tablet. I'm using a laptop with a trackpad.

The advantage of using the emulated "usb-tablet" with a mouse/trackpad, is that the guest OS gets the actual mouse pointer location. The Virtio GPU device uses the host OS' actual mouse pointer/cursor, which can cause weird interaction problems because both the host and guest OS are trying to control the mouse pointer's position. In "usb-tablet" mode, the guest OS gets the actual mouse position directly, and the fight between the guest and host OS can stop.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Home away from home
Home away from home


See User information
@balaton

Quote:
I don't know what the usb-tablet device emulates. It seems like a HID device that reports absolute coordinates. It usually works with other guest OS drivers but don't know what the AmigaOS driver supports.

It looks like the AmigaOS HID driver doesn't support it (I tried it out, and it didn't work). Not surprising, as we've never had such a device.

Quote:
An alternative is -device usb-wacom-tablet which more closely emulates an actual wacom tablet so maybe that could work better if the default usb-tablet is not recognised by AmigaOS's HID driver but I did not try these.


That's worth a try. No time for it right now, though.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
Go to top
Re: Touchscreen HID driver & QEMU
Just popping in
Just popping in


See User information
@hans

Hi Hans,
try if the attached driver is right for you.

Quick explanation:
this driver should recognize and handle the QEMU Tablet Device and similar.
It does not require touch.device or touchbench, it is a standalone driver that sends NEWPOINTERPOS/TABLET events to the input.device, so it works with absolute coordinates.

I tried it with QEMU and the option
-device usb-tablet
and it seems to work.

Note: being a fast adaptation, the driver could also take control of other similar devices and bypass the official AmigaOS4 hid.usbfd driver. If this causes you problems let me know and I will make the driver more selective.

Best regards!

Attach file:


Link only for registered users


Edited by AlfredOne on 2024/2/27 12:03:36
Edited by AlfredOne on 2024/2/27 12:04:05
Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Just popping in
Just popping in


See User information
@all
Do you think it would be useful if I released a QEMU specific usb driver (e.g. qemutatablet.usbfd or qemu.usbfd), instead of a generic hid driver that handles qemu but could handle other hid devices?

Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Just popping in
Just popping in


See User information
@AlfredOne
It's a good idea.
Is it possible to adapt the driver to the graphics tablet?

Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Just popping in
Just popping in


See User information
@vagappc
Yes. Can you tell me the graphics tablet model?
Write me privately or in the new topic:
Support for other touch devices.

Go to top
Re: Touchscreen HID driver & QEMU
Quite a regular
Quite a regular


See User information
@AlfredOne

Quote:
AlfredOne wrote:@all
Do you think it would be useful if I released a QEMU specific usb driver (e.g. qemutatablet.usbfd or qemu.usbfd), instead of a generic hid driver that handles qemu but could handle other hid devices?


I am not sure what such a support under AmigaOs4.1 Qemu could mean. In terms of the "qemu.usbfd" device, would this mean that we could use such a usb driver to facilitate the integration of devices under AmigaOs4.1 ?

Quote:
Human Interface Device (HID) refers to the HID protocol, a standard way of communicating with connected devices. Examples of HID devices are keyboards, mice, headsets and game controllers


Or is it still about being able to use touch input with a LapTop or TouchPad?

MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE
Go to top
Re: Touchscreen HID driver & QEMU
Just popping in
Just popping in


See User information
@Maijestro

The difference is how QEMU emulates a pointing device.
Normally QEMU shows a touchpad or a mouse as a standard HID mouse, so AmigaOS4.1 sees a HID mouse and receives from QEMU events with relative movements in x and y. In this case the official hid.usbfd driver of amigaos handles this in the right way.
You can verify that events received are relative x,y by looking at the mouse cursor positions in the emulated AmigaOS4.1 and the "real" mouse cursor of the host system: they do not match. In general it is not a problem, except in particular cases (see Hans's post).

Alternatively, QEMU can emulate the pointing device as a HID tablet instead of a HID mouse. In this case, QEMU does not expose a mouse, but exposes a tablet as an input device and sends absolute coordinates to AmigaOS4 such that the AmigaOS4 mouse cursor coincides with the host operating system's mouse cursor. Hans reported that this mode would be useful when using the Virtio GPU device.
The problem is that the amigaos hid.usbfd driver cannot currently manage the tablet device.

So I wrote a driver that handles a tablet device.
Using the HID protocol, this driver can actually manage all tablet like devices, but I was wondering if it wasn't worth making the driver more selective, so that it works only when it detects the QEMU emulated tablet.

Go to top
Re: Touchscreen HID driver & QEMU
Quite a regular
Quite a regular


See User information
@AlfredOne
I think it's better to add support generally in the HID driver rather than making it a QEMU specific driver. The QEMU emulated usb-tablet is just a generic tablet so the same driver could be useful for similar hardware so no need to restrict it to QEMU. It also avoids duplicating code if it's kept in the HID driver.

As you've already noted this probably won't make a difference when using sm501 which only supports guest side hardware cursor. It's only an issue with other devices that support host side HW cursor such as virtio-gpu or ati-vga (but the latter does not work yet and most people can't get a driver for the former so it's not an issue for them yet).

Go to top
Re: Touchscreen HID driver & QEMU
Quite a regular
Quite a regular


See User information
@AlfredOne

Quote:

Alternatively, QEMU can emulate the pointing device as a HID tablet instead of a HID mouse. In this case, QEMU does not expose a mouse, but exposes a tablet as an input device and sends absolute coordinates to AmigaOS4 such that the AmigaOS4 mouse cursor coincides with the host operating system's mouse cursor. Hans reported that this mode would be useful when using the Virtio GPU device.
The problem is that the amigaos hid.usbfd driver cannot currently manage the tablet device..


Thanks for the short explanation, I didn't fully understand it before.

I see it similarly to @Balaton the driver should be developed primarily for real hardware, of course it would be nice if you could extend this driver to support Qemu/AmigaOs4.1. As already mentioned, we cannot reproduce the problems that Hans has with the Virtio GPU and the use of the mouse cursor because these drivers are not available to us.

But I already had a similar problem and it was related to the Cocoa display manager, which resulted in the mouse speed in the guest system (AmigaOs4.1) being slower than in the host system. I reported this bug and it was later patched. In order to be able to avoid such problems in the future, the HID tablet would certainly make sense as an alternative to the HID mouse thanks to its driver support for AmigaOs4.1.

This is just my personal opinion.

MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE
Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Home away from home
Home away from home


See User information
@AlfredOne

Sorry, I haven't had a chance to test your driver.

I also think that support for the virtual QEMU tablet device should be in a generic HID driver.

@Maijestro

Quote:
I see it similarly to @Balaton the driver should be developed primarily for real hardware, of course it would be nice if you could extend this driver to support Qemu/AmigaOs4.1. As already mentioned, we cannot reproduce the problems that Hans has with the Virtio GPU and the use of the mouse cursor because these drivers are not available to us.

You don't need the VirtioGPU driver to test the QEMU tablet device.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Quite a regular
Quite a regular


See User information
@Hans
Quote:
You don't need the VirtioGPU driver to test the QEMU tablet device.

But you probably won't see any difference with sm501 that's using guest side hw cursor so could only tell if it works at all but not if it's any better than usb-mouse which was the question to be tested.

Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Home away from home
Home away from home


See User information
@balaton

Quote:
But you probably won't see any difference with sm501 that's using guest side hw cursor so could only tell if it works at all but not if it's any better than usb-mouse which was the question to be tested.

Nope. The QEMU USB tablet device is unusable with the default HID driver. If you can't see any difference between it and a standard USB mouse, then the driver (and QEMU) are doing a very good job.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
Go to top
Re: Touchscreen HID driver & QEMU's USB Tablet device
Quite a regular
Quite a regular


See User information
@Hans
Yes that's what I meant by you can only test if it works or not but if it works with the updated driver then you'll probably just get the same result as with a mouse when using sm501. The real advangage of a tablet is only noticable on host side hardware cursor otherwise the events will go through the guest and the guest will update the cursor so I don't think it would be noticable without host side hardware cursor.

Go to top
Re: Touchscreen HID driver & QEMU
Quite a regular
Quite a regular


See User information
@AlfredOne

I tested your USB driver briefly under AmigaOs4.1 it seems to work well, but when I click on the title bar of the workbench or move the mouse cursor to the edge of the image I see 2 mouse cursors, host and guest. Pay attention to the left side of the picture:

Qemu/AmigaOs4.1 HID tablet:

Resized Image

Resized Image


The driver or the new HID device is recognized by AmigaOs4.1. I could only record it with my cell phone.....

Edit:The problem is that the AmigaOs4.1 menu can no longer be called up from the title bar.


Edited by Maijestro on 2024/3/1 16:40:21
Edited by Maijestro on 2024/3/1 16:40:36
MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE
Go to top
Re: Touchscreen HID driver & QEMU
Just popping in
Just popping in


See User information
@Maijestro

The 2 mouse cursors, host and guest, visible at the same time, I think are inevitable.
In "tablet" mode, as soon as the cursor leaves the emulated AmigaOS screen, the host cursor appears, but the Amiga cursor no longer receives events and remains stationary in the last position.

Go to top
Re: Touchscreen HID driver & QEMU
Quite a regular
Quite a regular


See User information
@AlfredOne

Quote:

The 2 mouse cursors, host and guest, visible at the same time, I think are inevitable.
In "tablet" mode, as soon as the cursor leaves the emulated AmigaOS screen, the host cursor appears, but the Amiga cursor no longer receives events and remains stationary in the last position.


Ok, as already mentioned, the problem is that AmigaOs4.1 menus can no longer be called up via the title bar because the host then takes over.

Otherwise, the host and guest mouse pointers are exactly the same speed when used.

MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE
Go to top

  Register To Post
(1) 2 3 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project