• Max Kellermann's avatar
    output/alsa: don't generate silence if ALSA-PCM buffer has enough data · ccafe3f3
    Max Kellermann authored
    If our `ring_buffer` is smaller than the ALSA-PCM buffer (if the
    latter has more than the 4 periods we allocate), it can happen that
    the start threshold is crossed and ALSA switches to
    `SND_PCM_STATE_RUNNING`, but the `ring_buffer` is empty.  In this
    case, MPDD will generate silence, even though the ALSA-PCM buffer has
    enough data.  This causes stuttering (#420).
    
    This commit amends an older workaround for a similar problem (commit
    e08598e7) by adding a snd_pcm_avail()
    check, and only generate silence if there is less than one period of
    data in the ALSA-PCM buffer.
    
    Fixes #420
    ccafe3f3
Name
Last commit
Last update
android Loading commit data...
build Loading commit data...
doc Loading commit data...
python/build Loading commit data...
scripts Loading commit data...
src Loading commit data...
systemd Loading commit data...
test Loading commit data...
win32 Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
NEWS Loading commit data...
README.md Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...
mpd.svg Loading commit data...
valgrind.suppressions Loading commit data...