Skip to content

USBCECAdapterDetection: Limit scan to tty subsystem#494

Closed
fritsch wants to merge 1 commit intoPulse-Eight:masterfrom
fritsch:master
Closed

USBCECAdapterDetection: Limit scan to tty subsystem#494
fritsch wants to merge 1 commit intoPulse-Eight:masterfrom
fritsch:master

Conversation

@fritsch
Copy link
Contributor

@fritsch fritsch commented Mar 15, 2020

While debugging high CPU load coming from PeripUSBCEC thread I figured that the library call: DetectAdapters hoggs the CPU for up to 200 ms per Call. Looking into it I spotted that the usb udev enumeration and scanning happens on every device in /sys

Therefore: Limit device comparison for the tty subsystem only. This reduces comparisons by factor 4. 100 tty-devices vs. 400 devices in sum. It's a pitty that we need to start with the leafs and then query over the parent.

Runtime tested on LibreELEC.

@fritsch fritsch changed the title USBCECAdapterDetection: Limit scan to USB subsystem USBCECAdapterDetection: Limit scan to vendorId Mar 16, 2020
@fritsch fritsch closed this Mar 16, 2020
@fritsch fritsch changed the title USBCECAdapterDetection: Limit scan to vendorId USBCECAdapterDetection: Limit scan to tty subsystem Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant