Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] High CPU usage #20

Closed
AnnAngela opened this issue Dec 21, 2021 · 24 comments
Closed

[Bug Report] High CPU usage #20

AnnAngela opened this issue Dec 21, 2021 · 24 comments
Labels
🐛 bug Something isn't working

Comments

@AnnAngela
Copy link

AnnAngela commented Dec 21, 2021

🐛 Describe the bug

The program continuously takes up a lot of CPU usage, even when the Air pods are not connected.

📜 Screenshot

T_XBML)@KU2IT`42J}XF3O3

⚙️ Environments:

  • OS: Windows 10 Pro Version 21H1 19043.1266
  • Version: v0.3.1
  • CPU: Intel Core i7-7700
AirPodsDesktop.log

All the logs contain same line:

[2021-12-21 08:53:50.558] [Main] [warning] [LowAudioLatency.cpp:53] LowAudioLatency::Controller error: 1
StackTrace.log
Not Found.
@SpriteOvO SpriteOvO added the 📝 under investigation This issue is under investigation label Dec 21, 2021
@SpriteOvO
Copy link
Owner

1

I can't reproduce this problem.

Could you describe the situation in more details? Does the high CPU usage occur at launch or after a while? What features do you have enabled? Did that warning log only appear once or keep repeating?

@AnnAngela
Copy link
Author

AnnAngela commented Dec 21, 2021

Does the high CPU usage occur at launch or after a while?

All the time.

What features do you have enabled?

Only the "low latency".

Did that warning log only appear once or keep repeating?

Repeatedly, and the log can easily grow to dozens of MB in size.

@SpriteOvO
Copy link
Owner

SpriteOvO commented Dec 25, 2021

@AnnAngela If you disable low audio latency will the high CPU usage stop? If so, the cause of it looks like QMediaPlayer is not playing MP3 correctly. This may be a rare issue and I'll look into it.

@AnnAngela
Copy link
Author

AnnAngela commented Dec 27, 2021

@SpriteOvO Yes, with low audio latency disabled, the cpu usage dropped down to nearly zero
image
And after re-enabling the function, the cpu usage became 10% again

@SpriteOvO
Copy link
Owner

SpriteOvO commented Dec 28, 2021

@AnnAngela I tried this SO answer in commit ddf601f , regenerated the Silence.mp3 with ID3 v2.3, could you try the artifact of that commit to check if it fixed the bug? Thanks!

@AnnAngela
Copy link
Author

AnnAngela commented Dec 29, 2021 via email

@AnnAngela
Copy link
Author

@SpriteOvO I tried the artifact you linked and here's the result:
image
It's still a bit higher but way more acceptable.

@SpriteOvO
Copy link
Owner

@AnnAngela No more repeat warnings in the log?

low audio latency works by looping a silent MP3 to keep the AirPods active. I'm not sure if the 2.59 (percentage?) for playing MP3 is normal, although mine is around 0.1 (i9-10900KF).

@AnnAngela
Copy link
Author

@AnnAngela No more repeat warnings in the log?

low audio latency works by looping a silent MP3 to keep the AirPods active. I'm not sure if the 2.59 (percentage?) for playing MP3 is normal, although mine is around 0.1 (i9-10900KF).

Hmmmm, after a reboot, the warning message reappeared again.

[2022-01-03 09:01:29.838] [Main] [warning] [LowAudioLatency.cpp:53] LowAudioLatency::Controller error: 1

IDK why =。=

@SpriteOvO
Copy link
Owner

SpriteOvO commented Jan 3, 2022

@AnnAngela AirPodsDesktop logs the git hash when it starts, or you can check the git hash in Settings About, can you confirm it is ddf601f commit?

@AnnAngela
Copy link
Author

@SpriteOvO Affirmative.
image

@SpriteOvO
Copy link
Owner

SpriteOvO commented Jan 4, 2022

@AnnAngela I can't reproduce this error on my PC and I searched as much as I could, but didn't find any more useful information. Could you try this commit (d4b4ce9) artifact? It will always open a console and if there are any Qt internal errors written to stdout / stderr, you will see them. Thanks!

@AnnAngela
Copy link
Author

@SpriteOvO It keeps showing:

DirectShowPlayerService::doRender: Unknown error 0x8004022a.

image

@AnnAngela
Copy link
Author

AnnAngela commented Jan 4, 2022

Interesting, when I ran the program after connecting airpods pro, the problems gone and no error reported.
image

But when I ran the program firstly and connected airpods pro after, the problems came out.

@SpriteOvO
Copy link
Owner

@AnnAngela Thanks for the info, I have reproduced it on my PC. Try this commit (fca503c) artifact, it works for me.

@AnnAngela
Copy link
Author

AnnAngela commented Jan 5, 2022

@SpriteOvO This commit artifact works just fine, LGTM! THX A LOT!

@SpriteOvO
Copy link
Owner

@AnnAngela Thank you very much too! Without you this bug could not be fixed.

@SpriteOvO SpriteOvO added 🐛 bug Something isn't working and removed 📝 under investigation This issue is under investigation labels Jan 5, 2022
@AnnAngela
Copy link
Author

This comment is right, my workspace pc has no other audio output except the airpods, and I think that is the problem.

@AnnAngela
Copy link
Author

@SpriteOvO There is another problem, when I came back to my pc in the afternoon , the program started using high CPU usage again. The log is similar:

[2022-01-05 14:37:31.880] [Main] [warning] [LowAudioLatency.cpp:98] LowAudioLatency::Controller error: 1

Maybe the program should detect if there is another audio output device or not when the airpods disconnecting, and if not the QMediaPlayer should be stop.

@SpriteOvO
Copy link
Owner

SpriteOvO commented Jan 5, 2022

@AnnAngela A little strange, I can't reproduce it. For me, it just needs to have at least one available audio output device at the time of initialization, so that warning will no longer appear, even if no device is available again afterwards.

EDIT: Oh I see it, after waiting for a while after disabling all devices, that warning reappeared.

@SpriteOvO
Copy link
Owner

Stop and reinitialize QMediaPlayer later if an error occurs, it should fix the bug. BTW, Qt always has some glitches that challenge its users, I'm used to it, lol.

@SpriteOvO
Copy link
Owner

Close as this bug should be fixed in 73493fb commit. If there are still problems, feel free to reopen it.

@AnnAngela
Copy link
Author

AnnAngela commented Jan 14, 2022

I tried the latest artifate and it looks good to me. Even after a long time without any audio output device, the program didn't throw any error at all.
QQ截图20220114145311

@widget-
Copy link

widget- commented Jan 7, 2023

low audio latency works by looping a silent MP3 to keep the AirPods active. I'm not sure if the 2.59 (percentage?) for playing MP3 is normal, although mine is around 0.1 (i9-10900KF).

@SpriteOvO Any chance you could add this to the readme (or just mention it's for resuming audio playback faster)? My first impression was that this somehow added codec support for something like AptX Low Latency but then I realized that's probably not what it was doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants