[enhancement] Please move input detection to libudev
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
Low
|
Chris Halse Rogers | ||
mir (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Mir currently uses an inotify watch on /dev/input/ to detect hotplugged input events. That already led to race conditions like bug 1233944 and is generally not very robust. The canonical way to enumerate (for coldplugging at start) and get change notifications for (hotplugging events) hardware is to use uevents, which have a rather convenient client-side library "libudev". These are race free (i. e. you only get told after all udev rules got applied), very efficient (you only get wakeups if something actually changed), and easier to use as you get a lot of the actual information of the piece of hardware "for free" (i. e. already in the udev_device object).
http://
http://
The porting should not actually be too bad. Just like inotify, with pure libudev the monitor gives you an fd you select() on in the main loop, and if there's an event you just grab it with receive_device(). The libgudev library provides a very elegant integration into GLib main loops where you just connect the "uevent" signal to your handler, but I suppose Mir does not want to use this. Plus, the code should presumably get easier as you shouldn't need to actually open and query the input device any more; the udev properties and sysfs attributes should already tell you all you need to know.
also related to https:/
Related branches
- PS Jenkins bot (community): Approve (continuous-integration)
- Daniel van Vugt: Approve (manual test)
- Andreas Pokorny (community): Approve
- Kevin DuBois (community): Approve
- Alan Griffiths: Approve
- Alexandros Frantzis: Pending requested
- Robert Carr: Pending requested
-
Diff: 1913 lines (+1278/-151)32 files modified3rd_party/android-input/android/CMakeLists.txt (+2/-0)
3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp (+46/-92)
3rd_party/android-input/android/frameworks/base/services/input/EventHub.h (+6/-5)
benchmarks/android-input/CMakeLists.txt (+3/-1)
cmake/MirCommon.cmake (+6/-3)
cmake/src/mir/mir_discover_gtest_tests.cpp (+15/-2)
debian/control (+1/-1)
deploy-and-test.sh (+21/-0)
include/test/mir_test_framework/udev_environment.h (+1/-0)
tests/CMakeLists.txt (+3/-10)
tests/acceptance-tests/test_server_disconnect.cpp (+2/-0)
tests/acceptance-tests/test_surfaces_with_output_id.cpp (+5/-0)
tests/mir_test_framework/CMakeLists.txt (+9/-11)
tests/mir_test_framework/udev_environment.cpp (+22/-2)
tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.ioctl (+21/-0)
tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.umockdev (+222/-0)
tests/mir_test_framework/udev_recordings/laptop-keyboard.ioctl (+12/-0)
tests/mir_test_framework/udev_recordings/laptop-keyboard.umockdev (+74/-0)
tests/mir_test_framework/udev_recordings/synaptics-touchpad.ioctl (+29/-0)
tests/mir_test_framework/udev_recordings/synaptics-touchpad.umockdev (+65/-0)
tests/mir_test_framework/udev_recordings/usb-keyboard.ioctl (+13/-0)
tests/mir_test_framework/udev_recordings/usb-keyboard.umockdev (+244/-0)
tests/mir_test_framework/udev_recordings/usb-mouse.ioctl (+14/-0)
tests/mir_test_framework/udev_recordings/usb-mouse.umockdev (+240/-0)
tests/mir_test_framework/using_stub_client_platform.cpp (+11/-2)
tests/unit-tests/CMakeLists.txt (+5/-14)
tests/unit-tests/android_input/CMakeLists.txt (+1/-0)
tests/unit-tests/android_input/test_eventhub.cpp (+125/-0)
tests/unit-tests/client/test_mir_connection.cpp (+6/-0)
tests/unit-tests/input/android/test_android_input_window_handle.cpp (+17/-8)
tools/valgrind_suppressions_armhf (+30/-0)
tools/valgrind_suppressions_generic (+7/-0)
Changed in mir: | |
status: | New → Triaged |
importance: | Undecided → Medium |
description: | updated |
Changed in mir: | |
importance: | Medium → Low |
tags: | added: ubuntu-qa |
tags: |
added: qa-touch removed: ubuntu-qa |
summary: |
- Please move input detection to libudev + [feature] Please move input detection to libudev |
tags: | added: feature |
summary: |
- [feature] Please move input detection to libudev + [enhancement] Please move input detection to libudev |
tags: |
added: enhancement removed: feature |
tags: | added: input |
description: | updated |
Changed in mir: | |
status: | Triaged → In Progress |
assignee: | nobody → Chris Halse Rogers (raof) |
milestone: | none → 0.1.6 |
Changed in mir: | |
milestone: | 0.1.6 → 0.1.7 |
Changed in mir: | |
milestone: | 0.1.7 → 0.1.8 |
Changed in mir: | |
status: | Fix Committed → Fix Released |
Changed in mir (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |
Fix committed into lp:mir/devel at revision None, scheduled for release in mir, milestone Unknown