summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2011-06-28 16:21:22 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2011-06-28 16:55:27 -0700
commit15335ee07c43739433b4cf566428b5f07f8c443d (patch)
tree7630573f8a9c0ef0be582143aaf39896e8abcdea /audio
parent72826c296a06957d495965a259bcde4863c58821 (diff)
downloaddevice_samsung_tuna-15335ee07c43739433b4cf566428b5f07f8c443d.zip
device_samsung_tuna-15335ee07c43739433b4cf566428b5f07f8c443d.tar.gz
device_samsung_tuna-15335ee07c43739433b4cf566428b5f07f8c443d.tar.bz2
Fix audio output to play audio other than 44k stereo
When opening an output stream, the driver needs to return its format, sample rate and channel mask. Failure to do so will cause AudioFlinger to create the ouput as DIRECT, regardless of the output flags. The consequence of the output thread being in DIRECT mode is that no mixing is done (one sound at a time), and only audio that plays at the HAL's expected audio characteristics (44k 16bit stereo) can be played. The fix consists in returning the format, chanel mask and sample rate values when opening the output stream. Change-Id: Ib26e3337fe199efdba7a70b40df93518aceec04a
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index bc4ff1a..c9d5018 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -746,6 +746,10 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
out->dev = ladev;
+ *format = out_get_format(&out->stream.common);
+ *channels = out_get_channels(&out->stream.common);
+ *sample_rate = out_get_sample_rate(&out->stream.common);
+
*stream_out = &out->stream;
return 0;