mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #1254] High CPU usage and stutter for some songs #575
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#575
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alvaropp on GitHub (Feb 22, 2024).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1254
Hi everyone!
Describe the bug
I'm experiencing stutter and 100% CPU usage when playing some particular songs, and every now and then otherwise.
I'm running on a Raspberry Pi Zero W Rev 1.1 and listening on a bluetooth speaker. I've basically tried to set the sound quality as low as possible as the RPi Zero doesn't seem to be able to cope with medium/high quality + bluetooth. I'm using Librespot 0.4.2 and running the following command:
sudo librespot --name rpi --bitrate 96 --format S16 --ap-port 13561 --dither none --mixer softvol --initial-volume 0 --volume-ctrl log --volume-range 60 --cache /varIt plays music perfectly fine 99.99% of the time, but some particular songs present a lot of stutter and CPU usage skyrockets:
Usual CPU load:

Max CPU load and stutter:

To reproduce
There's a couple of songs that I've noticed producing stutter very frequently—I can monitor Spotify from my laptop and see the songs' progress bar jumping around a little:
Log
Host (what you are running
librespoton):22f8aed(Built on 2022-08-18, Build ID: 8HLByBc0, Profile: release)Additional comments
Are there any other settings you can recommend tweaking to reduce CPU usage even more?
@roderickvd commented on GitHub (Mar 31, 2024):
You can try using Also directly, instead of through Rodio which will consume some extra cycles especially when resampling.
Unfortunately we have started waving goodbye to support to the original Zero, which is starting to get underpowered.
Older versions should run OK on it.
@roderickvd commented on GitHub (Sep 16, 2024):
Pi Zero no longer supported.