From 15335ee07c43739433b4cf566428b5f07f8c443d Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Tue, 28 Jun 2011 16:21:22 -0700 Subject: 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 --- audio/audio_hw.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'audio') 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; -- cgit v1.1