lagrange icon indicating copy to clipboard operation
lagrange copied to clipboard

Excess CPU usage during media playback

Open bitigchi opened this issue 3 years ago • 2 comments

macOS 11.6.1, Lagrange 1.9.1

Steps:

  1. Visit gemini://konpeito.media/, and playback a track

Expected:

  1. CPU usage should be within reasonable limits

Actual:

  1. During playback, Lagrange uses 100% CPU (not more)
  2. When paused, coreaudiod continues using around 25% (should be idle as well)

bitigchi avatar Dec 03 '21 11:12 bitigchi

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.

skyjake avatar Dec 03 '21 11:12 skyjake

dbbeddecb55c7bd5ca5239f0c040886cde7e29d7 should fix the high CPU usage. It will be included in v1.10.

skyjake avatar Jan 07 '22 15:01 skyjake