Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alsa underrun fix and pause #128

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Alsa underrun fix and pause #128

merged 2 commits into from
Apr 30, 2024

Commits on Apr 29, 2024

  1. alsa: Use snd_pcm_pause(), recover from buffer underruns

    Currently the plugout_alsa "pauses" playback simply by ceasing to
    call `snd_pcm_writei()`; this causes a buffer underrun error on
    resuming playback, and omission of one buffer's worth of samples
    from playback (currently 2048 samples).
    
    To mitigate this, check for an underrun retval (`-EPIPE`) after calling
    `snd_pcm_writei()` and if applicable, recover by calling
    `snd_pcm_prepare()` and	repeating the `snd_pcm_writei()` call to avoid
    dropping samples.
    
    Also implement an `alsa_pause()` function to pause and resume playback
    without a buffer underrun using `snd_pcm_pause()`. The call will be
    ineffective if unsupported by underlying hardware, in which case the
    buffer underrun handling above will come into play.
    mrehkopf committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    069bf2a View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. plugout_alsa: only use pause support when hardware supports it

    Don't try to pause the ALSA sound device if the device does not
    support the pause operation.
    
    Also report errors on pause/resume.
    mmitch committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    e41223a View commit details
    Browse the repository at this point in the history