Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
I am facing same issue with rotary encoder knobe with imx6 platform. We are using wayland-egl and weston compositor and we are not getting events in GUI.
We have browser application which receives events. If we change QT QPA PLATFORM to linuxfb everything works fine but when we set wayland-egl it is not working
It looks like events are not mapped correctly as debug log shows:
LINUXFB:2021-10-21T08:50:55.749591+00:00 corecard stderr: qt.qpa.input: Using xkbcommon for key mappingWAYLAND:2021-10-21T12:02:26.850376+00:00 corecard stderr: qt.xkb.compose: using xkb compose input context2021-10-21T12:02:26.850452+00:00 corecard stderr: qt.qpa.wayland: using input method: QComposeInputContext
I also read lot of things about SEAT and other things to set in weston.ini but really don't know what to set.
Your quick response is highly appreciated !!
--
Thanks,
Hitesh
Edited
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
GraphQL error: The resource that you are attempting to access does not exist or you don't have permission to perform this action
No child items are currently open.
Linked items
0
Link issues together to show that they're related.
Learn more.
According to Qt docs, eglfs and linuxfb have all the input handling code compiled-in. Using wayland-egl will instead use libinput, which most likely won't detect your rotary knob.
Easier to verify is to look at the compositor log. Use --log as an argument to weston and paste it here
as well.
The log clearly says: warning: no input devices on entering Weston. without any inputs being detected whatsoever.
Could you do a ls -al /dev/input/* and paste it here as well please?
Do you have udev up an running? Thought I don't how you'd run anything without it :/.
if you happen to have libinput-tools installed you can also try doing libinput list-devices to see if libinput sees/supports your device (which I suspect it doesn't).
And based on all buttons (HOME, BACK and ROTARY PUSH) and ROTATE LEFT/RIGHT it displays the correct events. See generated events for rotate left, then right and then push the rotary:
@whot yes "libinput list-devices" shows nothing but "libinput record" shows available rotary knob.
See for more logs I pasted in above reply. It's not joystick kind of but we have total 5 events. 2 using push buttons and 3 using rotary encoder (clock wise, anti clock wise and push the rotary encoder). We are sending KEY CODES accordingly from linux driver.
libinput relies on udev to tell it what type of device it is. In this case because you're not using udev, there's no ID_INPUT_KEYBOARD or other property set, so libinput simply won't recognise it as input device and won't use it. Once you set the required udev properties, it shoudl work as keyboard.
We can't use udev because it comes with systemd in buildroot and we are not using systemd for our system init. But we already using mdev which is light version of udev only.
Can you let me know what specifically udev does which can't be done by mdev?
Also can't I hardcode some of the property in libinput so that it understand what type of device it is? We don't have any other possible input now or won't have in future for our product so we should be good even if it only supports our rotary encoder only as input device.
ftr, we don't need udev as much as we need libudev, specifically the ability to get a device from a devnode and list its properties. No idea how to do this with mdev though.
You can hardcode it in evdev_device_get_udev_tags(), tag it with EVDEV_UDEV_TAG_KEYBOARD and you may be good to go.
Sorry for asking you silly questions (but I am new to this), I even did not get debug prints of this function. Is there anything needs to be enabled in weston.ini ??
Hi @mvlad I tried this unconditionally "tags |= (EVDEV_UDEV_TAG_INPUT | EVDEV_UDEV_TAG_KEYBOARD);" but it didn't helped.
I doubt that I don't see debug prints in this function at all. So libinput is not bind properly with weston compositor or some configuration to bind libinput (which call this function) is missing.
Can you input what could be missing? Is there any tool I can check if libinput change is applied correctly ?
libinput is a library to handle input devices that offers an alternative to the Qt's own evdev input support. To enable using libinput, when you configure and build Qt, make sure that the development files for libudev and libinput are available. If you require keyboard support, then xkbcommon is also necessary. With eglfs and linuxfb, no further actions are necessary as these plugins use libinput by default. If libinput support is not available or the QT_QPA_EGLFS_NO_LIBINPUT environment variable is set, then Qt's own evdev handlers are used instead.
My QT5 configuration is as below:
Features used by QPA backends: evdev .................................. yes libinput ............................... yes INTEGRITY HID .......................... no mtdev .................................. yes tslib .................................. yes xkbcommon .............................. yes X11 specific: XLib ................................. no XCB Xlib ............................. no EGL on X11 ........................... no xkbcommon-x11 ........................ no
This means my QT is configured correctly. Any feedback.
You should be able to check if libinput works on embedded platforms by exporting an env variable QT_LOGGING_RULES="qt.qpa.input=true" and then run your application. You should be able to see if the rotary knob is indeed being tagged or not and confirm that indeed it is using libinput, though so far it seems unlikely.
@whot should have a better idea on why that patch doesn't work.
Could this mean that even with the changes suggest by @whot those aren't actually executed because you really needed udev for it to be triggered? Kind of sounds like that. Well, glad it works now.
Yes that's correct @mvlad !! I just enabled eudev package in buildroot which has installed udevd and udevadm binaries. And As soon as S10udev deamon registered weston has started detecting keyboard in log. And the rest as I said, everything started working well.
apologies for the delay, I was on leave last week. Glad it's sorted, but for the future:
Is there any tool I can check if libinput change is applied correctly ?
libinput debug-events can be run from the builddir and is the easiest way to debug libinput's behaviour since you can even gdb through it. See the docs