summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Shaposhnikov <x0166637@ti.com>2013-06-18 09:26:47 -0500
committerRoman Shaposhnikov <x0166637@ti.com>2013-06-18 09:26:47 -0500
commit01216b9bc92523c0aea468ed1b7384941ecd0750 (patch)
treea0296d12e2531c66a974c700927c7f7533879a75
parentac9f346edaa5ed62b5bfdb412a4de7c8849162e7 (diff)
parent75d057d9157f33a99691dc70b9498e2e76bf69ef (diff)
downloadcommon-open-01216b9bc92523c0aea468ed1b7384941ecd0750.tar.gz
Merge omap-mirror/p-jb-mr1-release into omap-mirror/d-jb-mr1-release
-rw-r--r--audio/audio_hw.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 774aecd..af82821 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -32,6 +32,7 @@
#include <pthread.h>
#include <stdint.h>
#include <sys/time.h>
+#include <unistd.h>
#include <stdlib.h>
#include <cutils/log.h>
@@ -2523,6 +2524,16 @@ static int start_input_stream(struct omap_stream_in *in)
if (adev->mode != AUDIO_MODE_IN_CALL) {
adev->devices.in_devices &= ~AUDIO_DEVICE_IN_ALL;
adev->devices.in_devices |= in->device & ~AUDIO_DEVICE_BIT_IN;;
+
+ if(adev->devices.in_devices & AUDIO_DEVICE_IN_USB_HEADSET) {
+ char usb_in_device [20];
+ int n = sprintf(usb_in_device, "/dev/snd/pcmC%uD%uc", CARD_OMAP_USB, PORT_MM);
+ if (!(n > 0 && access(usb_in_device, F_OK) == 0)) {
+ adev->devices.in_devices &= ~(AUDIO_DEVICE_IN_USB_HEADSET & ~AUDIO_DEVICE_BIT_IN);
+ adev->devices.in_devices |= AUDIO_DEVICE_IN_BUILTIN_MIC & ~AUDIO_DEVICE_BIT_IN;
+ }
+ }
+
select_input_device(adev);
adev->vx_rec_on = false;
} else {
@@ -2551,13 +2562,13 @@ static int start_input_stream(struct omap_stream_in *in)
if (in->remix_at_driver)
in->config.channels = in->remix_at_driver->in_chans;
- if(adev->devices.in_devices & AUDIO_DEVICE_IN_USB_HEADSET) {
+ if (adev->devices.in_devices & AUDIO_DEVICE_IN_USB_HEADSET) {
card = CARD_OMAP_USB;
/*device should be 0 for usb headset capture */
device = PORT_MM;
}
- if(adev->devices.in_devices & AUDIO_DEVICE_IN_FM_RADIO_RX) {
+ if (adev->devices.in_devices & AUDIO_DEVICE_IN_FM_RADIO_RX) {
card = CARD_OMAP_DEFAULT;
/*device should be PORT_MM2_UL for FM capture */
device = PORT_MM2_UL;