{ 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 },
};
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))) {
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) {
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;
} 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 |
#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"