summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/audio-hal-sc7727.spec2
-rw-r--r--tizen-audio-device.c7
-rw-r--r--tizen-audio-internal.h24
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"