summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorManjula Gupta <magupta@nvidia.com>2010-04-30 14:37:33 +0530
committerGary King <gking@nvidia.com>2010-05-03 20:20:08 -0700
commitaa90b701692003f03ed4bd3a0d89a8091bed26e9 (patch)
treea844188181210fdedaf04c3f423e1153b715a9f5 /sound
parent5fe13d3c3b8c73cb5c3f8966bf1dc6e86bf652ac (diff)
tegra ALSA : Handle Underrun Case
In case of underrun application triggers stop and starts the playback again, don't exit the thread in case of stop. underrun can happen when an application does not feed new samples in time to alsa-lib (due to CPU usage). With this change breaks may be observed in case of underrun which cannot be avoided, but the application will finish the playback and exits gracefully. For bug:663146 [LDK/Chromium/ALSA/Stability] "underrun!!!" (pcm_write:1442: write error: Input/output error) issues in ALSA while playback. Change-Id: Ib9b30461b4e381a66c3fd48467406e448aa41a17 Reviewed-on: http://git-master/r/1257 Reviewed-by: Vijay Mali <vmali@nvidia.com> Tested-by: Vijay Mali <vmali@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_pcm_rpc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/tegra/tegra_pcm_rpc.c b/sound/soc/tegra/tegra_pcm_rpc.c
index f6acc88db4f1..0b799730f795 100644
--- a/sound/soc/tegra/tegra_pcm_rpc.c
+++ b/sound/soc/tegra/tegra_pcm_rpc.c
@@ -97,11 +97,13 @@ static int play_thread( void *arg)
sizeof(NvAudioFxState),
&state);
prtd->state = NVALSA_INVALID_STATE;
- goto EXIT;
default:
;
}
+ if (kthread_should_stop())
+ break;
+
if (prtd->audiofx_frames < runtime->control->appl_ptr) {
memset(&abd, 0, sizeof(NvAudioFxBufferDescriptor));
@@ -136,6 +138,7 @@ static int play_thread( void *arg)
wait_for_completion(&prtd->appl_ptr_comp);
prtd->play_thread_waiting = false;
init_completion(&prtd->appl_ptr_comp);
+ continue;
}
if ((buffer_to_prime == buffer_in_queue) ||
@@ -180,8 +183,6 @@ EXIT:
buffer_in_queue--;
}
- while (!kthread_should_stop()) {
- }
return 0;
}