ALSA: pcm_lib - optimize wake_up() calls for PCM I/O
As noted by pl bossart <bossart.nospam@gmail.com>, the PCM I/O routines
(snd_pcm_lib_write1, snd_pcm_lib_read1) should block wake_up() calls
until all samples are not processed.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index fe1b131..e26fb3c 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -311,6 +311,7 @@
struct snd_pcm_mmap_control *control;
/* -- locking / scheduling -- */
+ unsigned int nowake: 1; /* no wakeup (data-copy in progress) */
wait_queue_head_t sleep;
struct fasync_struct *fasync;
@@ -839,6 +840,8 @@
int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream);
int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
unsigned int cmd, void *arg);
+int snd_pcm_update_state(struct snd_pcm_substream *substream,
+ struct snd_pcm_runtime *runtime);
int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream);
int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream);