Correct VOICE_PCM_DEVICE to "hw:sprdphone,1" and remove an unused device AUDIO_DEVICE... 74/53974/1 accepted/tizen/mobile/20151211.055352 submit/tizen_mobile/20151210.225937
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 10 Dec 2015 12:54:24 +0000 (21:54 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 10 Dec 2015 12:54:54 +0000 (21:54 +0900)
[Version] 0.1.2
[Profile] Mobile
[Issue Type] Bug Fix

Change-Id: Ic5ff3bf7a9ad5d2c355aad762e536349c15d21d4
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/audio-hal-sc7727.spec
tizen-audio-device.c
tizen-audio-internal.h

index 738d067..abc0bd8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       audio-hal-sc7727
 Summary:    TIZEN Audio HAL for SC7727
-Version:    0.1.1
+Version:    0.1.2
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 5746ca3..b907acc 100644 (file)
@@ -35,7 +35,6 @@ static device_type_t outDeviceTypes[] = {
     { AUDIO_DEVICE_OUT_RECEIVER, "Earpiece" },
     { AUDIO_DEVICE_OUT_JACK, "Headphones" },
     { AUDIO_DEVICE_OUT_BT_SCO, "Bluetooth" },
-    { AUDIO_DEVICE_OUT_AUX, "Line" },
     { AUDIO_DEVICE_OUT_HDMI, "HDMI" },
     { 0, 0 },
 };
@@ -60,8 +59,6 @@ static uint32_t convert_device_string_to_enum(const char* device_str, uint32_t d
         device = AUDIO_DEVICE_OUT_JACK;
     } else if ((!strncmp(device_str,"bt", MAX_NAME_LEN)) && (direction == AUDIO_DIRECTION_OUT)) {
         device = AUDIO_DEVICE_OUT_BT_SCO;
-    } else if (!strncmp(device_str,"aux", MAX_NAME_LEN)) {
-        device = AUDIO_DEVICE_OUT_AUX;
     } else if (!strncmp(device_str,"hdmi", MAX_NAME_LEN)) {
         device = AUDIO_DEVICE_OUT_HDMI;
     } else if ((!strncmp(device_str,"builtin-mic", MAX_NAME_LEN))) {
@@ -97,7 +94,7 @@ static audio_return_t set_devices(audio_hal_t *ah, const char *verb, device_info
     if ((devices[0].direction == AUDIO_DIRECTION_OUT) && ah->device.active_in) {
         /* check the active in devices */
         for (j = 0; j < inDeviceTypes[j].type; j++) {
-            if (((ah->device.active_in & (~0x80000000)) & inDeviceTypes[j].type))
+            if (((ah->device.active_in & (~AUDIO_DEVICE_IN)) & inDeviceTypes[j].type))
                 active_devices[dev_idx++] = inDeviceTypes[j].name;
         }
     } else if ((devices[0].direction == AUDIO_DIRECTION_IN) && ah->device.active_out) {
@@ -110,7 +107,7 @@ static audio_return_t set_devices(audio_hal_t *ah, const char *verb, device_info
 
     for (i = 0; i < num_of_devices; i++) {
         new_device = convert_device_string_to_enum(devices[i].type, devices[i].direction);
-        if (new_device & 0x80000000) {
+        if (new_device & AUDIO_DEVICE_IN) {
             for (j = 0; j < inDeviceTypes[j].type; j++) {
                 if (new_device == inDeviceTypes[j].type) {
                     active_devices[dev_idx++] = inDeviceTypes[j].name;
index f1f684f..092d09b 100644 (file)
 } while (0)
 
 /* Devices : Normal  */
+#define AUDIO_DEVICE_OUT               0x00000000
+#define AUDIO_DEVICE_IN                0x80000000
 enum audio_device_type {
     AUDIO_DEVICE_NONE                 = 0,
 
     /* output devices */
-    AUDIO_DEVICE_OUT_SPEAKER          = 0x00000001,
-    AUDIO_DEVICE_OUT_RECEIVER         = 0x00000002,
-    AUDIO_DEVICE_OUT_JACK             = 0x00000004,
-    AUDIO_DEVICE_OUT_BT_SCO           = 0x00000008,
-    AUDIO_DEVICE_OUT_AUX              = 0x00000010,
-    AUDIO_DEVICE_OUT_HDMI             = 0x00000020,
+    AUDIO_DEVICE_OUT_SPEAKER          = AUDIO_DEVICE_OUT | 0x00000001,
+    AUDIO_DEVICE_OUT_RECEIVER         = AUDIO_DEVICE_OUT | 0x00000002,
+    AUDIO_DEVICE_OUT_JACK             = AUDIO_DEVICE_OUT | 0x00000004,
+    AUDIO_DEVICE_OUT_BT_SCO           = AUDIO_DEVICE_OUT | 0x00000008,
+    AUDIO_DEVICE_OUT_HDMI             = AUDIO_DEVICE_OUT | 0x00000010,
     AUDIO_DEVICE_OUT_ALL              = (AUDIO_DEVICE_OUT_SPEAKER |
                                          AUDIO_DEVICE_OUT_RECEIVER |
                                          AUDIO_DEVICE_OUT_JACK |
                                          AUDIO_DEVICE_OUT_BT_SCO |
-                                         AUDIO_DEVICE_OUT_AUX |
                                          AUDIO_DEVICE_OUT_HDMI),
     /* input devices */
-    AUDIO_DEVICE_IN_MAIN_MIC          = 0x80000001,
-    AUDIO_DEVICE_IN_SUB_MIC           = 0x80000002,
-    AUDIO_DEVICE_IN_JACK              = 0x80000004,
-    AUDIO_DEVICE_IN_BT_SCO            = 0x80000008,
+    AUDIO_DEVICE_IN_MAIN_MIC          = AUDIO_DEVICE_IN | 0x00000001,
+    AUDIO_DEVICE_IN_SUB_MIC           = AUDIO_DEVICE_IN | 0x00000002,
+    AUDIO_DEVICE_IN_JACK              = AUDIO_DEVICE_IN | 0x00000004,
+    AUDIO_DEVICE_IN_BT_SCO            = AUDIO_DEVICE_IN | 0x00000008,
     AUDIO_DEVICE_IN_ALL               = (AUDIO_DEVICE_IN_MAIN_MIC |
                                          AUDIO_DEVICE_IN_SUB_MIC |
                                          AUDIO_DEVICE_IN_JACK |
@@ -127,7 +127,7 @@ typedef struct device_type {
 #define strneq strcmp
 
 #define ALSA_DEFAULT_CARD       "sprdphone"
-#define VOICE_PCM_DEVICE        "hw:0,1"
+#define VOICE_PCM_DEVICE        "hw:sprdphone,1"
 #define PLAYBACK_PCM_DEVICE     "hw:sprdphone,0"
 #define CAPTURE_PCM_DEVICE      "hw:sprdphone,0"