Conversation
…all synchronous. No longer need the signal, or the thread locking.
|
Hi Have you ever encountered a race condition in the current solution? Wouldn't it have been enough then to change QUEUE_CALL to BLOCK_CALL to prevent it (the sdbus async event loop would be blocked until the triggered handler is fully processed and a new request is made - so no race condition in the mean time)? Alternatively custom sdbus event loop which allows to pause event processing. I would prefer simpler solution here. Regarding HID, I already have an earlier PR with a device using it, so I will probably need to extract the HID provider as a generic provider first. QTcpSocket is still owned by QTcpServer and freed alongside it, but you are right that it should be done when the connection is closed (by changing the parent or explicitly calling deleteLater in signalClientConnectionClosedHandler) |
|
Hi @awawa-dev, I have encountered the race while tracking down the memory leak. Heaptrack slowed things down enough to trigger it. I believe that on slow systems the race can therefore also happen. I did not consider using BLOCK_CALL. I saw the other PR for a hid device. I actually started already on a Regarding the socket, although it will free on program exit, on my machine memory use ballooned to 400MiB+ overnight. In my case i have a HyperHDR status icon in my waybar config, which checks status every second. So i needed the fix to not have to restart HyperHDR every day. Once i have tried BLOCK_CALL and ProviderHid is ready, i will either update this PR or close it and create a new one. What do you think about how i implemented multiple HID devices acting as one? I could not find something in the UI to add multiple devices, so i thought this would be ok. At least it works. Cheers! |
|
Hi Mark, the PipeWire/portal part turned out to be more complicated than it initially looked, so I split it out into a separate PR: #1609. After digging deeper into the race discussed here, I replaced the per-request Could you please have a look at #1609, test it on your setup, and add any comments or suggestions there? Once this is settled, #1607 can stay focused on the other changes.
Usually HyperHDR handles one device per instance. It can also control multiple physical lights within a single instance for some devices (e.g. Philips Hue lamps), so whether multiple HID devices should be aggregated really depends on the device/API model. But those usually have dedicated JS wizards to handle the device-specific configuration (multiple devices in a single instance for Philips Hue, LIFX or Home Assistant), HID provider should be independent regardless which approach is chosen. Multiple lamps per single instance offer better performance, synchronization and use lower resources. |
Summary
What kind of change does this PR introduce? (check at least one)
If changing the UI of web configuration, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing setups:
The PR fulfills these requirements:
Fixes: #xxx[,#xxx], where "xxx" is the issue number)To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information: