Refactor code making it easier to add new device types#249
Refactor code making it easier to add new device types#249pastaq merged 4 commits intoShadowBlip:mainfrom
Conversation
Pending is an infinite loop, this means that if run() terminates the program will be stuck in an endless (unresponsive) loop: remove the usage of pending and replace it with a join on run so that if the program exits due to an error systemd can restart it; this also avoids using an unnecessary task. Also avoid losing reference to the spawned Ctrl+C task.
7b09cad to
e7ccb08
Compare
…:devnode being populated For a future implementation of leds it is important checks of devnode being populated are pushed where devnode is acually used: do that while also splitting up a gigantic method that both leaked a reference to a spaned task and was very hard to work with.
…ctually requires it In order to implement LED(s) handling and potentially other device types that don't have a node in /dev early checks for devnode() being valid must be dropped.
e7ccb08 to
4bb68a9
Compare
81ba6f6 to
91d58d9
Compare
pastaq
left a comment
There was a problem hiding this comment.
Some minor nits and a couple questions. Overall I like the changes, good work. Especially the simplified functions, that has been on my TODO list for a while.
08a0005 to
2927a34
Compare
d035686 to
e5a9f36
Compare
e5a9f36 to
34d32d9
Compare
There was a problem hiding this comment.
When ManageAllDevices is set to true, Manager fails to create a CompositeDevice for an external controller. We get a false positive for a virtual controller when it should detect as a bluetooth device.
Tested on Xbox Elite Series 2 Controller.
[2025-01-09T00:46:30Z DEBUG inputplumber::input::manager] Xbox Wireless Controller (event21) is virtual, skipping consideration for /devices/virtual/misc/uhid/0005:045E:0B22.002C/input/input125/event21
34d32d9 to
8737c71
Compare
|
Testing this change with the Sony DualSense controller, I get two One device captures the hidraw interface: And the other captures the evdev nodes: |
I answer to this mainly for personal record: After doing this to manage all devices: I only got two composite devices: one for ds5 and one for the ally EDIT: bluetooth is the same even with bluetooth. No separated composites are created. |
|
@NeroReflex It seems like I can no longer replicate the duplicate CompositeDevice issue I was seeing before, so ignore my comment 😅 |
… the manager component This makes it easier in the future to add new device types suc as led devices.
8737c71 to
9134c88
Compare
|
🎉 This PR is included in version 0.41.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Since LEDs devices do not have a devnode the hard requirement for source devices of having one is to be removed and the presence check must be postponed to type of devices that actually have one and requires it to work properly.
Refactor manager.rs to remove device specialization where no particular benefits are provided by that specialization.
This PR reduces the overall number of running threads, without changing how the application behaves.