vixalien / decibels

Play audio files
https://gitlab.gnome.org/vixalien/decibels
GNU General Public License v3.0
52 stars 17 forks source link

Waveform display uses 100% of CPU #18

Closed tpikonen closed 11 months ago

tpikonen commented 11 months ago

The CPU usage of Decibels (latest from flathub) jumps to 100% whenever the scrolling waveform is shown. When the playback is on, but the Decibels window is not visible, the CPU use is negligible. For comparison, playing HD video with mpv takes about 20% CPU on this system.

I'm using Gnome Shell on Wayland from Debian, but I also see this on a postmarketOS phone with Phosh, so this is probably not a display driver or compositor issue.

vixalien commented 11 months ago

hey. I haven't been able to reproduce the issue (Decibels can never use 100% of the CPU).

however, I've been working to fix the render of the waveform more efficiently, which should fix (or at least) reduce the CPU usage of Decibels.

could you please download and test the latest Nightly Flatpak of Decibels and check if the issue still exists?

tpikonen commented 11 months ago

Thanks for looking into this. I tried 0.1.4 and still had problems, but rebooting fixed them, which would indicate that the bug is somewhere else in the audio or video stack. Curiously, rebooting solved problems both on my laptop (gnome-shell+wayland+pipewire-pulse) and phone (phosh+wayland+pulseaudio). The common thing here is wayland, but this is pure guesswork.

Currently playing an audio file with Decibels full screen takes about 20% of one core on my laptop (after the initial spike) and about 60% on a Oneplus 6. The latter is a bit heavy, but with Decibels off screen this drops to 16%.

Since this is probably not a bug in Decibels, I'm closing this issue.