]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: Workaround for weird PulseAudio behavior on rewind error
authorTakashi Iwai <tiwai@suse.de>
Wed, 3 Jan 2018 14:16:30 +0000 (15:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 5 Jan 2018 15:07:50 +0000 (16:07 +0100)
commit5f324d7063eb5be317aef1773dfcd4104eb3c163
treebc9219bebba4fadf786a05f772424ea902d23d92
parentb8afe4b5ccd3a37d85ab26e6c9a46a679bfa5433
ALSA: pcm: Workaround for weird PulseAudio behavior on rewind error

The commit c754480d297f ("ALSA: pcm: Call ack() whenever appl_ptr is
updated") introduced the possible error code returned from the PCM
rewind ioctl.  Basically the change was for handling the indirect PCM
more correctly, but ironically, it caused rather a side-effect:
PulseAudio gets pissed off when receiving an error from rewind, throws
everything away and stops processing further, resulting in the
silence.

It's clearly a failure in the application side, so the best would be
to fix that bug in PA.  OTOH, PA is mostly the only user of the rewind
feature, so it's not good to slap the sole customer.

This patch tries to mitigate the situation: instead of returning an
error, now the rewind ioctl returns zero when the driver can't rewind.
It indicates that no rewind was performed, so the behavior is
consistent, at least.

Fixes: c754480d297f ("ALSA: pcm: Call ack() whenever appl_ptr is updated")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c