• 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
..
plugins Loading commit data...
Client.hxx Loading commit data...
Control.cxx Loading commit data...
Control.hxx Loading commit data...
Defaults.cxx Loading commit data...
Defaults.hxx Loading commit data...
Domain.cxx Loading commit data...
Domain.hxx Loading commit data...
Filtered.cxx Loading commit data...
Filtered.hxx Loading commit data...
Finish.cxx Loading commit data...
Init.cxx Loading commit data...
Interface.cxx Loading commit data...
Interface.hxx Loading commit data...
MultipleOutputs.cxx Loading commit data...
MultipleOutputs.hxx Loading commit data...
OutputAPI.hxx Loading commit data...
OutputCommand.cxx Loading commit data...
OutputCommand.hxx Loading commit data...
OutputPlugin.cxx Loading commit data...
OutputPlugin.hxx Loading commit data...
Print.cxx Loading commit data...
Print.hxx Loading commit data...
Registry.cxx Loading commit data...
Registry.hxx Loading commit data...
SharedPipeConsumer.cxx Loading commit data...
SharedPipeConsumer.hxx Loading commit data...
Source.cxx Loading commit data...
Source.hxx Loading commit data...
State.cxx Loading commit data...
State.hxx Loading commit data...
Thread.cxx Loading commit data...
Timer.cxx Loading commit data...
Timer.hxx Loading commit data...
meson.build Loading commit data...