diff options
author | Sandeep Shinde <sashinde@nvidia.com> | 2010-05-08 19:45:10 +0530 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-05-10 10:52:45 -0700 |
commit | 115234ca014caa7d19774a97d81b6198a83ccc56 (patch) | |
tree | a70c3a9685f8126461e972ae4ba533e8352f8473 /sound | |
parent | 7213ef2f3c81e1f1d286e75ec63a1483b228e117 (diff) |
tegra ALSA: Do not queue buffers to the mixer in stopped state
In SNDRV_PCM_TRIGGER_STOP state of the driver, if a buffer gets
queued then it might not be returned back as it never gets rendered.
In this scenario play_thread never exits as it keep on waiting for
receiving all the buffers back from mixer before exiting.
This is to solve bug 684393.
In case of START->STOP->START scenario (happens in case of underruns),
without closing the stream, there will not be any buffer loss as buffers
are queued by application at appl_ptr and they remain there, once next
START is called, they will be picked up for the playback.
Change-Id: I4536e35bc59a6a4d67b24d9a8dc57a738ec695e3
Reviewed-on: http://git-master/r/1323
Reviewed-by: Gary King <gking@nvidia.com>
Reviewed-by: Vijay Mali <vmali@nvidia.com>
Tested-by: Vijay Mali <vmali@nvidia.com>
Reviewed-by: Sandeep Shinde <sashinde@nvidia.com>
Tested-by: Sandeep Shinde <sashinde@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_pcm_rpc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/tegra/tegra_pcm_rpc.c b/sound/soc/tegra/tegra_pcm_rpc.c index 69b74d17b681..09aeefa71592 100644 --- a/sound/soc/tegra/tegra_pcm_rpc.c +++ b/sound/soc/tegra/tegra_pcm_rpc.c @@ -78,7 +78,7 @@ static int play_thread( void *arg) rtbuffersize = frames_to_bytes(runtime, runtime->buffer_size); buffer_to_prime = (rtbuffersize / TEGRA_DEFAULT_BUFFER_SIZE); - for(;;) { + for (;;) { switch (prtd->state) { case SNDRV_PCM_TRIGGER_START: state = NvAudioFxState_Run; @@ -104,7 +104,8 @@ static int play_thread( void *arg) if (kthread_should_stop()) break; - if (prtd->audiofx_frames < runtime->control->appl_ptr) { + if ((prtd->audiofx_frames < runtime->control->appl_ptr) && + (state != SNDRV_PCM_TRIGGER_STOP)) { memset(&abd, 0, sizeof(NvAudioFxBufferDescriptor)); size = TEGRA_DEFAULT_BUFFER_SIZE; |