summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Shaposhnikov2013-06-18 09:26:47 -0500
committerRoman Shaposhnikov2013-06-18 09:26:47 -0500
commit01216b9bc92523c0aea468ed1b7384941ecd0750 (patch)
treea0296d12e2531c66a974c700927c7f7533879a75
parentac9f346edaa5ed62b5bfdb412a4de7c8849162e7 (diff)
parent75d057d9157f33a99691dc70b9498e2e76bf69ef (diff)
downloaddevice-ti-common-open-01216b9bc92523c0aea468ed1b7384941ecd0750.tar.gz
device-ti-common-open-01216b9bc92523c0aea468ed1b7384941ecd0750.tar.xz
device-ti-common-open-01216b9bc92523c0aea468ed1b7384941ecd0750.zip
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 @@
32#include <pthread.h> 32#include <pthread.h>
33#include <stdint.h> 33#include <stdint.h>
34#include <sys/time.h> 34#include <sys/time.h>
35#include <unistd.h>
35#include <stdlib.h> 36#include <stdlib.h>
36 37
37#include <cutils/log.h> 38#include <cutils/log.h>
@@ -2523,6 +2524,16 @@ static int start_input_stream(struct omap_stream_in *in)
2523 if (adev->mode != AUDIO_MODE_IN_CALL) { 2524 if (adev->mode != AUDIO_MODE_IN_CALL) {
2524 adev->devices.in_devices &= ~AUDIO_DEVICE_IN_ALL; 2525 adev->devices.in_devices &= ~AUDIO_DEVICE_IN_ALL;
2525 adev->devices.in_devices |= in->device & ~AUDIO_DEVICE_BIT_IN;; 2526 adev->devices.in_devices |= in->device & ~AUDIO_DEVICE_BIT_IN;;
2527
2528 if(adev->devices.in_devices & AUDIO_DEVICE_IN_USB_HEADSET) {
2529 char usb_in_device [20];
2530 int n = sprintf(usb_in_device, "/dev/snd/pcmC%uD%uc", CARD_OMAP_USB, PORT_MM);
2531 if (!(n > 0 && access(usb_in_device, F_OK) == 0)) {
2532 adev->devices.in_devices &= ~(AUDIO_DEVICE_IN_USB_HEADSET & ~AUDIO_DEVICE_BIT_IN);
2533 adev->devices.in_devices |= AUDIO_DEVICE_IN_BUILTIN_MIC & ~AUDIO_DEVICE_BIT_IN;
2534 }
2535 }
2536
2526 select_input_device(adev); 2537 select_input_device(adev);
2527 adev->vx_rec_on = false; 2538 adev->vx_rec_on = false;
2528 } else { 2539 } else {
@@ -2551,13 +2562,13 @@ static int start_input_stream(struct omap_stream_in *in)
2551 if (in->remix_at_driver) 2562 if (in->remix_at_driver)
2552 in->config.channels = in->remix_at_driver->in_chans; 2563 in->config.channels = in->remix_at_driver->in_chans;
2553 2564
2554 if(adev->devices.in_devices & AUDIO_DEVICE_IN_USB_HEADSET) { 2565 if (adev->devices.in_devices & AUDIO_DEVICE_IN_USB_HEADSET) {
2555 card = CARD_OMAP_USB; 2566 card = CARD_OMAP_USB;
2556 /*device should be 0 for usb headset capture */ 2567 /*device should be 0 for usb headset capture */
2557 device = PORT_MM; 2568 device = PORT_MM;
2558 } 2569 }
2559 2570
2560 if(adev->devices.in_devices & AUDIO_DEVICE_IN_FM_RADIO_RX) { 2571 if (adev->devices.in_devices & AUDIO_DEVICE_IN_FM_RADIO_RX) {
2561 card = CARD_OMAP_DEFAULT; 2572 card = CARD_OMAP_DEFAULT;
2562 /*device should be PORT_MM2_UL for FM capture */ 2573 /*device should be PORT_MM2_UL for FM capture */
2563 device = PORT_MM2_UL; 2574 device = PORT_MM2_UL;