diff options
author | Simon Wilson <simonwilson@google.com> | 2011-07-12 11:24:24 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-07-12 11:25:48 -0700 |
commit | 233c249b7be2e836f17155523e2779dbbff6529c (patch) | |
tree | 253f6420be5d09b9520ea6ec3840a979e6567613 /audio/audio_hw.c | |
parent | 724cd4987984f7646af7780536f5af88eeca2f2f (diff) | |
download | device_samsung_tuna-233c249b7be2e836f17155523e2779dbbff6529c.zip device_samsung_tuna-233c249b7be2e836f17155523e2779dbbff6529c.tar.gz device_samsung_tuna-233c249b7be2e836f17155523e2779dbbff6529c.tar.bz2 |
audio: put pcm into standby before changing output device
This avoids the high-pitched whine when changing the route from
speaker to headset by ensuring that no bytes are being transferred
through the ABE while the route is altered. It also means the
workaround to avoid the kernel panic when exiting standby in
out_write() can be removed.
Change-Id: I67d391d003bd90892622a212b45a394e2d15ff70
Diffstat (limited to 'audio/audio_hw.c')
-rw-r--r-- | audio/audio_hw.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 90c7d3f..b431548 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -581,6 +581,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) if (ret >= 0) { if (adev->out_device != atoi(value)) { adev->out_device = atoi(value); + out_standby(stream); select_output_device(adev); } } @@ -629,8 +630,6 @@ static ssize_t out_write(struct audio_stream_out *stream, const void* buffer, pthread_mutex_lock(&out->lock); if (out->standby) { - /* reset the downlink mixer settings otherwise the ABE panics */ - select_output_device(adev); ret = start_output_stream(out); if (ret == 0) out->standby = 0; |