summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-09-16 16:54:45 -0700
committerSimon Wilson <simonwilson@google.com>2011-09-18 13:18:46 -0700
commit1829c469d8ce1907500aeb654dfd2285260bdb96 (patch)
tree383b1bca1fde038f96e8674bcf07ffb2651ff4bb /audio
parent855a3e41227e3df712d942d172895d51efe0e7bb (diff)
downloaddevice_samsung_tuna-1829c469d8ce1907500aeb654dfd2285260bdb96.zip
device_samsung_tuna-1829c469d8ce1907500aeb654dfd2285260bdb96.tar.gz
device_samsung_tuna-1829c469d8ce1907500aeb654dfd2285260bdb96.tar.bz2
audio: add support for HDMI ouput
Add basic support of HDMI output during playback. Note that if multiple output devices are set, if HDMI is one of them, only HDMI will be used. Change-Id: I0a3ccdd6824a73553649e63b2d6ccde6aa99310e Signed-off-by: Chris Kelly <c-kelly@ti.com> Signed-off-by: Eric Laurent <elaurent@google.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index fe0a187..93da0bf 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -94,6 +94,12 @@
#define MIXER_BT_RIGHT "BT Right"
#define MIXER_450HZ_HIGH_PASS "450Hz High-pass"
+
+/* ALSA cards for OMAP4 */
+#define CARD_OMAP4_ABE 0
+#define CARD_OMAP4_HDMI 1
+#define CARD_TUNA_DEFAULT CARD_OMAP4_ABE
+
/* ALSA ports for OMAP4 */
#define PORT_MM 0
#define PORT_MM2_UL 1
@@ -587,6 +593,7 @@ static void set_incall_device(struct tuna_audio_device *adev)
device_type = SOUND_AUDIO_PATH_HANDSET;
break;
case AUDIO_DEVICE_OUT_SPEAKER:
+ case AUDIO_DEVICE_OUT_AUX_DIGITAL:
device_type = SOUND_AUDIO_PATH_SPEAKER;
break;
case AUDIO_DEVICE_OUT_WIRED_HEADSET:
@@ -738,6 +745,10 @@ static void select_output_device(struct tuna_audio_device *adev)
break;
case TTY_MODE_OFF:
default:
+ /* force speaker on when in call and HDMI is selected as voice DL audio
+ * cannot be routed to HDMI by ABE */
+ if (adev->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)
+ speaker_on = 1;
break;
}
}
@@ -874,6 +885,7 @@ static void select_input_device(struct tuna_audio_device *adev)
static int start_output_stream(struct tuna_stream_out *out)
{
struct tuna_audio_device *adev = out->dev;
+ unsigned int card = CARD_TUNA_DEFAULT;
adev->active_output = out;
@@ -881,8 +893,10 @@ static int start_output_stream(struct tuna_stream_out *out)
/* FIXME: only works if only one output can be active at a time */
select_output_device(adev);
}
-
- out->pcm = pcm_open(0, PORT_MM, PCM_OUT, &out->config);
+ /* in the case of multiple devices, this will cause use of HDMI only */
+ if(adev->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)
+ card = CARD_OMAP4_HDMI;
+ out->pcm = pcm_open(card, PORT_MM, PCM_OUT, &out->config);
if (!pcm_is_ready(out->pcm)) {
LOGE("cannot open pcm_out driver: %s", pcm_get_error(out->pcm));
pcm_close(out->pcm);
@@ -1137,6 +1151,10 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs)
adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION) {
force_input_standby = true;
}
+ /* force standby if moving to/from HDMI */
+ if ((out->device & AUDIO_DEVICE_OUT_AUX_DIGITAL) ^
+ (adev->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL))
+ do_output_standby(out);
}
adev->devices &= ~AUDIO_DEVICE_OUT_ALL;
adev->devices |= out->device;