diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-11-13 15:41:36 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-11-13 12:04:37 +0100 |
commit | 0e3a1d9e0b692307aa8ae483b3df3c9a53d4256e (patch) | |
tree | f144a7fde101b2a3aff1bf1e460cbc728d1c72ba /axfer/xfer-libasound-irq-rw.c | |
parent | b5d2fadfb18b5e2b2f03037256998b2fbcb9b226 (diff) | |
download | alsa-utils-0e3a1d9e0b692307aa8ae483b3df3c9a53d4256e.tar.gz |
axfer: add an option to suppress event waiting
In aplay, '--test-nowait' is used to suppress calls of snd_pcm_wait()
when I/O operations return -EAGAIN or process truncated number of data
frames. This seems to be for debugging purpose. In this program, this
option is equivalent to suppress event waiting.
This commit adds support for this option.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'axfer/xfer-libasound-irq-rw.c')
-rw-r--r-- | axfer/xfer-libasound-irq-rw.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/axfer/xfer-libasound-irq-rw.c b/axfer/xfer-libasound-irq-rw.c index f05ac4b..625c095 100644 --- a/axfer/xfer-libasound-irq-rw.c +++ b/axfer/xfer-libasound-irq-rw.c @@ -133,10 +133,12 @@ static int r_process_frames_nonblocking(struct libasound_state *state, goto error; } - // Wait for hardware IRQ when no available space. - err = snd_pcm_wait(state->handle, -1); - if (err < 0) - goto error; + if (state->use_waiter) { + // Wait for hardware IRQ when no available space. + err = snd_pcm_wait(state->handle, -1); + if (err < 0) + goto error; + } // Check available space on the buffer. avail = snd_pcm_avail(state->handle); @@ -286,10 +288,12 @@ static int w_process_frames_nonblocking(struct libasound_state *state, unsigned int avail_count; int err; - // Wait for hardware IRQ when no left space. - err = snd_pcm_wait(state->handle, -1); - if (err < 0) - goto error; + if (state->use_waiter) { + // Wait for hardware IRQ when no left space. + err = snd_pcm_wait(state->handle, -1); + if (err < 0) + goto error; + } // Check available space on the buffer. avail = snd_pcm_avail(state->handle); |