timschneeb / GalaxyBudsClient

Unofficial Galaxy Buds Manager for Windows, macOS, Linux, and Android
GNU General Public License v3.0
3.61k stars 191 forks source link

[BUG] Abnormal CPU usage #515

Closed RootOperator closed 3 months ago

RootOperator commented 4 months ago

Describe the bug
Idle in background uses about 8% cpu which doesn't sound right (not sure what the old version had) but when disconnecting and reconnecting my buds 2 pro while the application is running the CPU usages goes up to 16% and stays there until you completely close and re open it again

To Reproduce
Run application in background. disconnect earbuds and reconnect.

Expected behavior
No permanent doubling of the CPU usage.

Screenshots
image

Desktop (please complete the following information):

Additional context

Log files
application.log

mahmutsezai commented 4 months ago

Same behaviour on arch 6.9.5. Cpu usage goes to %100 as soon as application is open. Screenshot from 2024-06-20 23-58-06

timschneeb commented 4 months ago

I fixed this recently, but I haven't released a new stable release for it yet. You can download a build with the fix here for now: https://github.com/timschneeb/GalaxyBudsClient/actions/runs/9539521694

d-avery commented 4 months ago

Also have this issue on Arch. Good to know there's a fix!

timschneeb commented 4 months ago

The fix has been released in v5.0.1: https://github.com/timschneeb/GalaxyBudsClient/releases/tag/5.0.1

dougmeek commented 4 months ago

I've been running 5.0.1 on Linux for a couple days and the 100% CPU bug does not seem to be fixed. Keeps one of my cores pegged constantly. If you would like debug data, please let me know what you'd like to see.

dougmeek commented 4 months ago

Screenshot attached:

Screenshot_20240701_153854

timschneeb commented 3 months ago

I found a deadlock in one of the UI libraries I'm using. Downgrading it (commit ab5f349) appears to have ~fixed the 100% CPU usage bug on my system. I'll have to test it for a while to make sure it's actually fixed, though.~

~Binaries with the fix can be downloaded here for now: https://github.com/timschneeb/GalaxyBudsClient/actions/runs/9900010544~

Edit: Looks like the actual issue is caused by a library used to create global keyboard hooks on X11. It only spikes the CPU usage after running for 1 or 2 hours, making debugging this annoying.

timschneeb commented 3 months ago

Fixed by https://github.com/TolikPylypchuk/SharpHook/issues/112 and b3c741b

Binaries with the fix can be downloaded here for now: https://github.com/timschneeb/GalaxyBudsClient/actions/runs/9922666656

dougmeek commented 3 months ago

Thanks for looking into this @timschneeb. I'll give it a test drive later today. Since I'm running Nvidia, I haven't tested this with Wayland yet, but hopefully this fixes it for X11.