mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #329] Audio stuttering after long inactivity using ALSA dmix #214
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#214
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 @thebigtouffe on GitHub (Apr 13, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/329
Hello guys,
My audio is stuttering after several hours of inactivity (ie no tracks played). I play music on a custom alsa device that uses dmix module. I tried to increase the buffer size in ALSA conf, but it has no effect whatsoever (and testing does require patience). A workaround is to periodically restart librespot. Though I do not think this is a bug in librespot I wanted to document this issue. I will run librespot in verbose mode to get more information.
I am running Mar 27, 2019 version compiled on a Raspberry Pi 2 using HifiBerry DAC+.
Here is my ALSA config:
The command I use to run librespot :
/usr/bin/librespot --name XXX --bitrate 160 --username YYY --password ZZZ --disable-audio-cache --device ossmix --enable-volume-normalisationSince I use raspotify for daemonizing I run the following script every hour to avoid audio stuttering:
@willstott101 commented on GitHub (Apr 13, 2019):
Are you using the current master (Rodio backend) or a slightly older version (portaudio)?
The version of the Rodio backend in master doesn't release the audio device when it stops playing. Maybe try using the alsa backend directly.
Build with
--features alsa-backendand run with--backend alsabut everything else the same.@willstott101 commented on GitHub (Apr 13, 2019):
I wasn't sure if this would ever cause issues but this sounds exactly like it might be a symptom. I have a PR to help resolve this, but I'm waiting on upstream Rodio to iron out a few issues
@kingosticks commented on GitHub (Apr 13, 2019):
This is raspotify on a pi, which is built with only the alsa backend.
I guess the question I have is, does the stuttering stop if it's left playing for a while or if you skip tracks? Have you tried without the dmix plug? Have you tried disabling the dynamic cpu scaling governor that raspbian uses by default?
@thebigtouffe commented on GitHub (Apr 14, 2019):
I am using Rodio sink. I will try with ALSA backend directly and with latest version. Audio was stuttering this morning, but I found nothing particular in librespot logs.
@thebigtouffe commented on GitHub (Apr 14, 2019):
I only use raspotify for daemonizing, I compile librespot myself. The audio is still stuttering after at least a minute (didn't try longer than that) and changing track doesn't help.
Without dmix I did not have this problem, but librespot often crashed because many apps had access to the default ALSA device (which allows only one source). Besides, I was using an old version that did not feature rodio if I remember correctly.
I don't use Raspbian but osmc, but I think both have
force_turbo=0. I will try withforce_turbo=1.@kingosticks commented on GitHub (Apr 14, 2019):
Ahh, sorry, my misunderstand. Maybe it is related to rodio issue. but since that dmix config is specifically for supporting the case where the device isn't released it doesn't make total sense yet.
Edit: The cpu scaling govenator can also be controlled through the /sys filesystem (https://raspberrypi.stackexchange.com/questions/9034/how-to-change-the-default-governor#9048) and that's how I've always done it. However, if this is specific to dmix then maybe it'll make no difference.
@thebigtouffe commented on GitHub (Apr 15, 2019):
Apparently it is related to rodio. I compiled latest version with
alsa-backendfeature and I did not get any stuttering using ALSA backend option after 8 hours of inactivity. I will keep on running librespot for a couple days to check if the stuttering reappears.