Closed Artefact2 closed 3 years ago
Is this still a problem? If it is, I suggest something like the following instead: (because snd_pcm_pause() may not be supported on all hardware.)
diff --git a/src/sound_alsa.c b/src/sound_alsa.c
index 4defb06..3ab0dd3 100644
--- a/src/sound_alsa.c
+++ b/src/sound_alsa.c
@@ -103,10 +103,13 @@ static void flush(void)
static void onpause(void)
{
+ snd_pcm_drop(pcm_handle);
}
static void onresume(void)
{
+ snd_pcm_prepare(pcm_handle);
+ snd_pcm_start(pcm_handle);
}
static const char *const help[] = {
Not tested.
This might be a bug in alsa-jack, but when pausing in xmp-cli it just plays back the same buffer again and again (demo). Using
snd_pcm_pause()
fixes the issue.