diff options
author | Sangchul Lee <sc11.lee@samsung.com> | 2015-12-10 21:54:24 +0900 |
---|---|---|
committer | Sangchul Lee <sc11.lee@samsung.com> | 2015-12-10 21:54:54 +0900 |
commit | bd2564314671d32c27c33ad2f0cde501d6dcfb81 (patch) | |
tree | 4b73ae3472194224c066a0b937b3b39038fccf71 | |
parent | 8a5a1ba4d6399e361ec349fadc24e08d1e7ee1fe (diff) | |
download | audio-hal-sc7727-bd2564314671d32c27c33ad2f0cde501d6dcfb81.tar.gz audio-hal-sc7727-bd2564314671d32c27c33ad2f0cde501d6dcfb81.tar.bz2 audio-hal-sc7727-bd2564314671d32c27c33ad2f0cde501d6dcfb81.zip |
Correct VOICE_PCM_DEVICE to "hw:sprdphone,1" and remove an unused device AUDIO_DEVICE_OUT_AUXsubmit/tizen_mobile/20151210.225937accepted/tizen/mobile/20151211.055352
[Version] 0.1.2
[Profile] Mobile
[Issue Type] Bug Fix
Change-Id: Ic5ff3bf7a9ad5d2c355aad762e536349c15d21d4
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
-rw-r--r-- | packaging/audio-hal-sc7727.spec | 2 | ||||
-rw-r--r-- | tizen-audio-device.c | 7 | ||||
-rw-r--r-- | tizen-audio-internal.h | 24 |
3 files changed, 15 insertions, 18 deletions
diff --git a/packaging/audio-hal-sc7727.spec b/packaging/audio-hal-sc7727.spec index 738d067..abc0bd8 100644 --- a/packaging/audio-hal-sc7727.spec +++ b/packaging/audio-hal-sc7727.spec @@ -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 diff --git a/tizen-audio-device.c b/tizen-audio-device.c index 5746ca3..b907acc 100644 --- a/tizen-audio-device.c +++ b/tizen-audio-device.c @@ -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; diff --git a/tizen-audio-internal.h b/tizen-audio-internal.h index f1f684f..092d09b 100644 --- a/tizen-audio-internal.h +++ b/tizen-audio-internal.h @@ -76,27 +76,27 @@ } 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" |