Open ChristianAnke opened 1 year ago
I'll test how much this affects the execution time of the detect command. Gathering all monitor attributes does already take a lot of time and thus makes the widget pretty slow when it comes to detecting recently connected monitors. Avoiding asynchronous ddcutil calls would slow this down even further.
I can confirm the race-condition stated by OP. I was able to resolve this by making fetch_monitor_data
use the non-async subprocess_wrappper
and making that function itself non-async. With two monitors attached, I do not notice a significant slowdown. (Which even if wouldn't be that bad anyway as this is only performed on widget-bringup I think.)
git diff
Considering the minor slowdowns I'll disable the concurrent ddcutil calls for now. The upcoming major release will feature an option to synchronize the brightness between all screens, which would benefit from faster execution. But until then, there no really benefit with calling ddcutil concurrently.
Fixed in ddcci-plasmoid-backend 0.1.10 for now.
I have two identical monitors and only one of them is detected. The issue seems to be the concurrently executed
ddcutil getvcp
which lead to an error which renders one monitor undetected.Output from
python3 -m ddcci_plasmoid_backend -d detect
:And this can be reproduced with simple shell:
ddcutil getvcp --bus 16 --brief 10 & ddcutil getvcp --bus 17 --brief 10
Were as executing them in sequence makes the error safely disappear:
ddcutil getvcp --bus 16 --brief 10; ddcutil getvcp --bus 17 --brief 10
It might be better to avoid the async execution here.