kyleneideck / BackgroundMusic

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.
GNU General Public License v2.0
15.86k stars 671 forks source link

High coreaudio usage while running #694

Open pseudolimonada opened 11 months ago

pseudolimonada commented 11 months ago

While not running

image

While running

image

Seems rather significant usage, 15-20% cpu for a sound management tool with speakers on idle (no apps directly running audio), and base settings for all apps (no mixing done yet through background music).

edit: 8th column is cpu usage

kyleneideck commented 11 months ago

It's a bug that Background Music is leaving coreaudiod active while no apps are playing audio, but I think that CPU usage is roughly what I see anytime audio is playing. Background Music is probably playing audio, but only silence.

IIRC the CPU usage is from the audio processing coreaudiod does on MacBooks to protect the speakers and tune the audio for the laptop speakers. Are you using a laptop?

At the moment, I don't have Background Music running, but something on my system must be running audio (probably Firefox) because coreaudiod is at around 16% CPU. That's only 16% of one core, of course, but still very annoying. It's common enough that I wonder if it might be a bug in CoreAudio that's causing this.

I'd guess that https://github.com/kyleneideck/BackgroundMusic/issues/470 could be the underlying cause for you, but that bug only occurs after you've played audio while Background Music is running. Is that the case for you as well or does it happen immediately?

pseudolimonada commented 11 months ago

I command+Q Background Music, took the first screenshot, then opened Background music and it immediately shot up to this 17-20 range that persists, without anything playing.

I also tried testing just playing audio without Background Music and one source shoots it to 8%, two concurrent to 10%.

This is on an M2 MBP.