Bug 14206 - Kodi: even when not enabled, forcefully selects libevdev and libinput [was: QT5 touch screen rotation does not work since 2021.05]
Summary: Kodi: even when not enabled, forcefully selects libevdev and libinput [was: Q...
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2021.05
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: Yann E. MORIN
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-06 13:29 UTC by Thomas Ruschival
Modified: 2021-09-17 21:30 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Ruschival 2021-09-06 13:29:48 UTC
The `rotate` parameter for the touchscreen orientation does not work using environment variable QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS in QT5. e.g.
QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/touch:rotate=90 has no effect.
No value for rotation (90,180,270) has any effect.

It used to work up until 2021.02 and stopped working since Buildroot 2021.05.

Looking for the cause I found that since 2021.05 libxkbcommon (BR2_PACKAGE_LIBXKBCOMMON) and libinput (BR2_PACKAGE_LIBINPUT) are selected. In turn libevdev (BR2_PACKAGE_LIBEVDEV) is selected.
Libinput and libxkbcommon are selected by BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_GBM.

As a quick check I removed the line 'source "package/kodi/Config.in"' form
package/Config.in and rebuilt all in this case the touch-input rotation works.

Kodi was never selected on the system.  Would it make sense to only select
libinput and libxkbcommon if BR2_PACKAGE_KODI is actually selected?

I guess this affects all applications using QT5 with a rotated touch screen - can anyone confirm this issue?
Comment 1 Thomas Ruschival 2021-09-08 12:30:44 UTC
I succeeded narrowing down the issue by commenting out "package/kodi/Config.in"' in package/Config.in and manually adding libraries.

Adding only libevdev does not affect the behavior of QT. Adding libinput as well the touch screen rotation does no longer work.

Apparently /usr/lib/qt/plugins/platforms/libqeglfs.so is dynamically linked against libinput if it is available during build time of Qt5.
Comment 2 Thomas Ruschival 2021-09-10 11:55:41 UTC
It is not a bug but a behavior of Qt5 v5.15.
(https://doc.qt.io/qt-5/inputs-linux-device.html) 

The issue can be solved/worked around in two different ways:

Either: 
Disable the use of libinput (QT_QPA_EGLFS_NO_LIBINPUT=1) and continue using the environment variable QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/touch:rotate=90

OR: 
use the generic platform plugin configuration variable QT_QPA_GENERIC_PLUGINS=evdevtouch:/dev/input/touch:rotate=90
Comment 3 Yann E. MORIN 2021-09-11 07:59:08 UTC
Thomas, All,

(In reply to Thomas Ruschival from comment #0)
> Looking for the cause I found that since 2021.05 libxkbcommon (BR2_PACKAGE_LIBXKBCOMMON)
> and libinput (BR2_PACKAGE_LIBINPUT) are selected. In turn libevdev (BR2_PACKAGE_LIBEVDEV)
> is selected.
> Libinput and libxkbcommon are selected by BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_GBM.

Indeed, this code is incorrect; good catch! :-)

I'll send a patch soonish to fix that.

Regards,
Yann E. MORIN.
Comment 4 Yann E. MORIN 2021-09-17 21:30:49 UTC
Thomas, All,

Thanks for the report. We believe the issue has now been fixed with commit
b80c488d04 (package/kodi: fix selection of dependencies).

Regards,
Yann E. MORIN.