lagrange
lagrange copied to clipboard
Excess CPU usage during media playback
macOS 11.6.1, Lagrange 1.9.1
Steps:
- Visit gemini://konpeito.media/, and playback a track
Expected:
- CPU usage should be within reasonable limits
Actual:
- During playback, Lagrange uses 100% CPU (not more)
- When paused,
coreaudiod
continues using around 25% (should be idle as well)
The high CPU usage is related to software decoding, however there may be a bug here where the decoder is not sleeping appropriately while it's waiting for room for more decoded samples. I'll have to investigate.
The issue with pausing is probably because the audio device is kept open during the pause. I should just close the device and reopen it when the audio is resumed.
dbbeddecb55c7bd5ca5239f0c040886cde7e29d7 should fix the high CPU usage. It will be included in v1.10.