summaryrefslogtreecommitdiffstats
path: root/mixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixer.c')
-rw-r--r--mixer.c202
1 files changed, 78 insertions, 124 deletions
diff --git a/mixer.c b/mixer.c
index e77feb5..f22b96d 100644
--- a/mixer.c
+++ b/mixer.c
@@ -250,7 +250,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
for(i=0 ; attr[i] != NULL && attr[i+1] != NULL ; i++) {
if(strcmp(attr[i], "device") == 0) {
i++;
- LOGD("Parsing config for device: %s", attr[i]);
+ ALOGD("Parsing config for device: %s", attr[i]);
}
}
} else if(strcmp(elem, "output") == 0) {
@@ -270,22 +270,22 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
i++;
switch(atoi(attr[i])) {
case 1:
- config_data->io_props.channels = AUDIO_CHANNEL_OUT_MONO;
+ config_data->io_props.channel_mask = AUDIO_CHANNEL_OUT_MONO;
break;
case 2:
- config_data->io_props.channels = AUDIO_CHANNEL_OUT_STEREO;
+ config_data->io_props.channel_mask = AUDIO_CHANNEL_OUT_STEREO;
break;
case 4:
- config_data->io_props.channels = AUDIO_CHANNEL_OUT_SURROUND;
+ config_data->io_props.channel_mask = AUDIO_CHANNEL_OUT_SURROUND;
break;
case 6:
- config_data->io_props.channels = AUDIO_CHANNEL_OUT_5POINT1;
+ config_data->io_props.channel_mask = AUDIO_CHANNEL_OUT_5POINT1;
break;
case 8:
- config_data->io_props.channels = AUDIO_CHANNEL_OUT_7POINT1;
+ config_data->io_props.channel_mask = AUDIO_CHANNEL_OUT_7POINT1;
break;
default:
- LOGE("Unknown channel attr: %s", attr[i]);
+ ALOGE("Unknown channel attr: %s", attr[i]);
break;
}
} else if(strcmp(attr[i], "format") == 0) {
@@ -299,7 +299,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
} else if(strcmp(attr[i], "PCM_8_24") == 0) {
config_data->io_props.format = AUDIO_FORMAT_PCM_8_24_BIT;
} else {
- LOGE("Unknown format attr: %s", attr[i]);
+ ALOGE("Unknown format attr: %s", attr[i]);
}
} else if(strcmp(attr[i], "period_size") == 0) {
i++;
@@ -308,7 +308,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
i++;
config_data->io_props.period_count = atoi(attr[i]);
} else {
- LOGE("Unknown output attr: %s", attr[i]);
+ ALOGE("Unknown output attr: %s", attr[i]);
}
}
} else if(strcmp(elem, "input") == 0) {
@@ -328,13 +328,13 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
i++;
switch(atoi(attr[i])) {
case 1:
- config_data->io_props.channels = AUDIO_CHANNEL_IN_MONO;
+ config_data->io_props.channel_mask = AUDIO_CHANNEL_IN_MONO;
break;
case 2:
- config_data->io_props.channels = AUDIO_CHANNEL_IN_STEREO;
+ config_data->io_props.channel_mask = AUDIO_CHANNEL_IN_STEREO;
break;
default:
- LOGE("Unknown channel attr: %s", attr[i]);
+ ALOGE("Unknown channel attr: %s", attr[i]);
break;
}
} else if(strcmp(attr[i], "format") == 0) {
@@ -348,7 +348,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
} else if(strcmp(attr[i], "PCM_8_24") == 0) {
config_data->io_props.format = AUDIO_FORMAT_PCM_8_24_BIT;
} else {
- LOGE("Unknown format attr: %s", attr[i]);
+ ALOGE("Unknown format attr: %s", attr[i]);
}
} else if(strcmp(attr[i], "period_size") == 0) {
i++;
@@ -357,7 +357,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
i++;
config_data->io_props.period_count = atoi(attr[i]);
} else {
- LOGE("Unknown input attr: %s", attr[i]);
+ ALOGE("Unknown input attr: %s", attr[i]);
}
}
} else if(strcmp(elem, "modem") == 0) {
@@ -371,7 +371,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
i++;
config_data->io_props.device = atoi(attr[i]);
} else {
- LOGE("Unknown modem attr: %s", attr[i]);
+ ALOGE("Unknown modem attr: %s", attr[i]);
}
}
} else if(strcmp(elem, "device") == 0) {
@@ -408,10 +408,8 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
config_data->device_props.type = AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
} else if(strcmp(attr[i], "digital-dock-headset") == 0) {
config_data->device_props.type = AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
- } else if(strcmp(attr[i], "fm") == 0) {
- config_data->device_props.type = AUDIO_DEVICE_OUT_FM;
} else {
- LOGE("Unknown device attr: %s", attr[i]);
+ ALOGE("Unknown device attr: %s", attr[i]);
}
} else if(config_data->direction == TINYALSA_MIXER_DIRECTION_INPUT) {
if(strcmp(attr[i], "default") == 0) {
@@ -433,18 +431,18 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
} else if(strcmp(attr[i], "back-mic") == 0) {
config_data->device_props.type = AUDIO_DEVICE_IN_BACK_MIC;
} else {
- LOGE("Unknown device attr: %s", attr[i]);
+ ALOGE("Unknown device attr: %s", attr[i]);
}
}
} else {
- LOGE("Unknown device attr: %s", attr[i]);
+ ALOGE("Unknown device attr: %s", attr[i]);
}
if(config_data->device_props.type != 0) {
config_data->device = tinyalsa_mixer_device_alloc();
memcpy(&config_data->device->props, &config_data->device_props, sizeof(config_data->device_props));
} else {
- LOGE("Missing attrs for elem: %s", elem);
+ ALOGE("Missing attrs for elem: %s", elem);
}
}
} else if(strcmp(elem, "path") == 0) {
@@ -456,10 +454,10 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
} else if(strcmp(attr[i], "disable") == 0) {
config_data->list_start = &config_data->device->disable;
} else {
- LOGE("Unknown path attr: %s", attr[i]);
+ ALOGE("Unknown path attr: %s", attr[i]);
}
} else {
- LOGE("Unknown path attr: %s", attr[i]);
+ ALOGE("Unknown path attr: %s", attr[i]);
}
}
} else if(strcmp(elem, "ctrl") == 0) {
@@ -470,7 +468,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
mixer_data->type = MIXER_DATA_TYPE_CTRL;
list->data = (void *) mixer_data;
} else {
- LOGE("Missing device/path for elem: %s", elem);
+ ALOGE("Missing device/path for elem: %s", elem);
return;
}
@@ -485,7 +483,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
i++;
mixer_data->value = strdup((char *) attr[i]);
} else {
- LOGE("Unknown ctrl attr: %s", attr[i]);
+ ALOGE("Unknown ctrl attr: %s", attr[i]);
}
}
@@ -510,7 +508,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
mixer_data->type = MIXER_DATA_TYPE_WRITE;
list->data = (void *) mixer_data;
} else {
- LOGE("Missing device/path for elem: %s", elem);
+ ALOGE("Missing device/path for elem: %s", elem);
return;
}
@@ -522,7 +520,7 @@ void tinyalsa_mixer_config_start(void *data, const XML_Char *elem,
i++;
mixer_data->value = strdup((char *) attr[i]);
} else {
- LOGE("Unknown write attr: %s", attr[i]);
+ ALOGE("Unknown write attr: %s", attr[i]);
}
}
@@ -637,13 +635,13 @@ int tinyalsa_mixer_config_parse(struct tinyalsa_mixer *mixer, char *config_file)
f = fopen(config_file, "r");
if(!f) {
- LOGE("Failed to open tinyalsa-audio config file!");
+ ALOGE("Failed to open tinyalsa-audio config file!");
return -1;
}
p = XML_ParserCreate(NULL);
if(!p) {
- LOGE("Failed to create XML parser!");
+ ALOGE("Failed to create XML parser!");
goto error_file;
}
@@ -656,14 +654,14 @@ int tinyalsa_mixer_config_parse(struct tinyalsa_mixer *mixer, char *config_file)
while(!eof) {
len = fread(buf, 1, sizeof(buf), f);
if(ferror(f)) {
- LOGE("Failed to read config file!");
+ ALOGE("Failed to read config file!");
goto error_xml_parser;
}
eof = feof(f);
if(XML_Parse(p, buf, len, eof) == XML_STATUS_ERROR) {
- LOGE("Failed to parse line %d: %s",
+ ALOGE("Failed to parse line %d: %s",
(int) XML_GetCurrentLineNumber(p),
(char *) XML_ErrorString(XML_GetErrorCode(p)));
goto error_xml_parser;
@@ -703,7 +701,7 @@ int tinyalsa_mixer_set_route_ctrl(struct tinyalsa_mixer *mixer,
ctl = mixer_get_ctl_by_name(mixer->mixer, mixer_data->name);
type = mixer_ctl_get_type(ctl);
- LOGD("Setting %s to %s", mixer_data->name, mixer_data->value);
+ ALOGD("Setting %s to %s", mixer_data->name, mixer_data->value);
switch(type) {
case MIXER_CTL_TYPE_BOOL:
@@ -743,7 +741,7 @@ int tinyalsa_mixer_set_route_write(struct tinyalsa_mixer *mixer,
if(mixer_data->type != MIXER_DATA_TYPE_WRITE)
return -1;
- LOGD("Writing %s to %s", mixer_data->value, mixer_data->name);
+ ALOGD("Writing %s to %s", mixer_data->value, mixer_data->name);
asprintf(&buffer, "%s\n", mixer_data->value);
if(buffer == NULL)
@@ -778,18 +776,18 @@ int tinyalsa_mixer_set_route_list(struct tinyalsa_mixer *mixer, struct list_head
if(mixer_data->type == MIXER_DATA_TYPE_CTRL) {
if(mixer_data->attr != NULL &&
strcmp(mixer_data->attr, "voice-volume") == 0) {
- LOGD("Skipping voice volume control");
+ ALOGD("Skipping voice volume control");
} else {
rc = tinyalsa_mixer_set_route_ctrl(mixer, mixer_data);
if(rc < 0) {
- LOGE("Unable to set control!");
+ ALOGE("Unable to set control!");
goto list_continue;
}
}
} else if(mixer_data->type == MIXER_DATA_TYPE_WRITE) {
rc = tinyalsa_mixer_set_route_write(mixer, mixer_data);
if(rc < 0) {
- LOGE("Unable to write!");
+ ALOGE("Unable to write!");
goto list_continue;
}
}
@@ -816,14 +814,14 @@ int tinyalsa_mixer_set_route(struct tinyalsa_mixer *mixer,
mixer->mixer = mixer_open(mixer_io->props.card);
if(mixer->mixer == NULL) {
- LOGE("Unable to open mixer for card: %d", mixer_io->props.card);
+ ALOGE("Unable to open mixer for card: %d", mixer_io->props.card);
return -1;
}
mixer_device = tinyalsa_mixer_get_device(mixer_io, device);
if(mixer_device == NULL) {
- LOGE("Unable to find a matching device: 0x%x", device);
+ ALOGE("Unable to find a matching device: 0x%x", device);
goto error_mixer;
}
@@ -834,14 +832,14 @@ int tinyalsa_mixer_set_route(struct tinyalsa_mixer *mixer,
if(mixer_io->device_current != NULL) {
rc = tinyalsa_mixer_set_route_list(mixer, mixer_io->device_current->disable);
if(rc < 0) {
- LOGE("Unable to disable current device controls");
+ ALOGE("Unable to disable current device controls");
goto error_mixer;
}
}
rc = tinyalsa_mixer_set_route_list(mixer, mixer_device->enable);
if(rc < 0) {
- LOGE("Unable to enable device controls");
+ ALOGE("Unable to enable device controls");
goto error_mixer;
}
@@ -886,24 +884,24 @@ int tinyalsa_mixer_set_device_volume_with_attr(struct tinyalsa_mixer *mixer,
mixer_io = &mixer->modem;
break;
default:
- LOGE("Invalid diretion: 0x%x", direction);
+ ALOGE("Invalid diretion: 0x%x", direction);
return -1;
}
if(!mixer_io->state) {
- LOGE("Unable to set device for the asked direction: state is %d", mixer_io->state);
+ ALOGE("Unable to set device for the asked direction: state is %d", mixer_io->state);
return -1;
}
mixer->mixer = mixer_open(mixer_io->props.card);
if(mixer->mixer == NULL) {
- LOGE("Unable to open mixer for card: %d", mixer_io->props.card);
+ ALOGE("Unable to open mixer for card: %d", mixer_io->props.card);
return -1;
}
mixer_device = tinyalsa_mixer_get_device(mixer_io, device);
if(mixer_device == NULL) {
- LOGE("Unable to find a matching device: 0x%x", device);
+ ALOGE("Unable to find a matching device: 0x%x", device);
goto error_mixer;
}
@@ -911,18 +909,18 @@ int tinyalsa_mixer_set_device_volume_with_attr(struct tinyalsa_mixer *mixer,
mixer_data = tinyalsa_mixer_get_data_with_attr(list, attr);
if(mixer_data == NULL) {
- LOGE("Unable to find a matching ctrl with attr: %s", attr);
+ ALOGE("Unable to find a matching ctrl with attr: %s", attr);
goto error_mixer;
}
if(mixer_data->value == NULL) {
- LOGE("Missing mixer data value!");
+ ALOGE("Missing mixer data value!");
goto error_mixer;
}
values_count = sscanf(mixer_data->value, "%d-%d", &value_min, &value_max);
if(values_count != 2) {
- LOGE("Failed to get mixer data value!");
+ ALOGE("Failed to get mixer data value!");
goto error_mixer;
}
@@ -934,7 +932,7 @@ int tinyalsa_mixer_set_device_volume_with_attr(struct tinyalsa_mixer *mixer,
rc = tinyalsa_mixer_set_route_ctrl(mixer, mixer_data);
if(rc < 0) {
- LOGE("Unable to set ctrl!");
+ ALOGE("Unable to set ctrl!");
goto error_data;
}
@@ -983,24 +981,24 @@ int tinyalsa_mixer_set_device_state_with_attr(struct tinyalsa_mixer *mixer,
mixer_io = &mixer->modem;
break;
default:
- LOGE("Invalid diretion: 0x%x", direction);
+ ALOGE("Invalid diretion: 0x%x", direction);
return -1;
}
if(!mixer_io->state) {
- LOGE("Unable to set device for the asked direction: state is %d", mixer_io->state);
+ ALOGE("Unable to set device for the asked direction: state is %d", mixer_io->state);
return -1;
}
mixer->mixer = mixer_open(mixer_io->props.card);
if(mixer->mixer == NULL) {
- LOGE("Unable to open mixer for card: %d", mixer_io->props.card);
+ ALOGE("Unable to open mixer for card: %d", mixer_io->props.card);
return -1;
}
mixer_device = tinyalsa_mixer_get_device(mixer_io, device);
if(mixer_device == NULL) {
- LOGE("Unable to find a matching device: 0x%x", device);
+ ALOGE("Unable to find a matching device: 0x%x", device);
goto error_mixer;
}
@@ -1011,13 +1009,13 @@ int tinyalsa_mixer_set_device_state_with_attr(struct tinyalsa_mixer *mixer,
mixer_data = tinyalsa_mixer_get_data_with_attr(list, attr);
if(mixer_data == NULL) {
- LOGE("Unable to find a matching ctrl with attr: %s", attr);
+ ALOGE("Unable to find a matching ctrl with attr: %s", attr);
goto error_mixer;
}
rc = tinyalsa_mixer_set_route_ctrl(mixer, mixer_data);
if(rc < 0) {
- LOGE("Unable to set ctrl!");
+ ALOGE("Unable to set ctrl!");
goto error_mixer;
}
@@ -1061,18 +1059,18 @@ int tinyalsa_mixer_set_state(struct tinyalsa_mixer *mixer,
default_device = AUDIO_DEVICE_OUT_DEFAULT;
break;
default:
- LOGE("Invalid diretion: 0x%x", direction);
+ ALOGE("Invalid diretion: 0x%x", direction);
return -1;
}
if(mixer_io->state == state) {
- LOGD("Current state is already: %d", state);
+ ALOGD("Current state is already: %d", state);
return 0;
}
mixer->mixer = mixer_open(mixer_io->props.card);
if(mixer->mixer == NULL) {
- LOGE("Unable to open mixer for card: %d", mixer_io->props.card);
+ ALOGE("Unable to open mixer for card: %d", mixer_io->props.card);
return -1;
}
@@ -1080,27 +1078,27 @@ int tinyalsa_mixer_set_state(struct tinyalsa_mixer *mixer,
mixer_io->device_current->disable != NULL) {
rc = tinyalsa_mixer_set_route_list(mixer, mixer_io->device_current->disable);
if(rc < 0) {
- LOGE("Unable to disable current device controls");
+ ALOGE("Unable to disable current device controls");
goto error_mixer;
}
}
mixer_device = tinyalsa_mixer_get_device(mixer_io, default_device);
if(mixer_device == NULL) {
- LOGD("Unable to find default device");
+ ALOGD("Unable to find default device");
// This is not really an issue
}
if(state && mixer_device != NULL && mixer_device->enable != NULL) {
rc = tinyalsa_mixer_set_route_list(mixer, mixer_device->enable);
if(rc < 0) {
- LOGE("Unable to enable default device controls");
+ ALOGE("Unable to enable default device controls");
goto error_mixer;
}
} else if(!state && mixer_device != NULL) {
rc = tinyalsa_mixer_set_route_list(mixer, mixer_device->disable);
if(rc < 0) {
- LOGE("Unable to disable default device controls");
+ ALOGE("Unable to disable default device controls");
goto error_mixer;
}
}
@@ -1126,21 +1124,21 @@ error_mixer:
int tinyalsa_mixer_set_output_state(struct tinyalsa_mixer *mixer, int state)
{
- LOGD("%s(%d)", __func__, state);
+ ALOGD("%s(%d)", __func__, state);
return tinyalsa_mixer_set_state(mixer, TINYALSA_MIXER_DIRECTION_OUTPUT, state);
}
int tinyalsa_mixer_set_input_state(struct tinyalsa_mixer *mixer, int state)
{
- LOGD("%s(%d)", __func__, state);
+ ALOGD("%s(%d)", __func__, state);
return tinyalsa_mixer_set_state(mixer, TINYALSA_MIXER_DIRECTION_INPUT, state);
}
int tinyalsa_mixer_set_modem_state(struct tinyalsa_mixer *mixer, int state)
{
- LOGD("%s(%d)", __func__, state);
+ ALOGD("%s(%d)", __func__, state);
return tinyalsa_mixer_set_state(mixer, TINYALSA_MIXER_DIRECTION_MODEM, state);
}
@@ -1149,13 +1147,13 @@ int tinyalsa_mixer_set_device(struct tinyalsa_mixer *mixer, audio_devices_t devi
{
int rc;
- LOGD("%s(%x)", __func__, device);
+ ALOGD("%s(%x)", __func__, device);
if(mixer == NULL)
return -1;
if(!audio_is_output_device(device) && !audio_is_input_device(device)) {
- LOGE("Invalid device: 0x%x", device);
+ ALOGE("Invalid device: 0x%x", device);
return -1;
}
@@ -1163,7 +1161,7 @@ int tinyalsa_mixer_set_device(struct tinyalsa_mixer *mixer, audio_devices_t devi
if(audio_is_output_device(device) && mixer->output.state) {
rc = tinyalsa_mixer_set_route(mixer, &mixer->output, device);
if(rc < 0) {
- LOGE("Unable to set route for device: %x", device);
+ ALOGE("Unable to set route for output device: 0x%x", device);
return -1;
}
}
@@ -1171,7 +1169,7 @@ int tinyalsa_mixer_set_device(struct tinyalsa_mixer *mixer, audio_devices_t devi
if(audio_is_input_device(device) && mixer->input.state) {
rc = tinyalsa_mixer_set_route(mixer, &mixer->input, device);
if(rc < 0) {
- LOGE("Unable to set route for device: %x", device);
+ ALOGE("Unable to set route for input device: 0x%x", device);
return -1;
}
}
@@ -1179,7 +1177,7 @@ int tinyalsa_mixer_set_device(struct tinyalsa_mixer *mixer, audio_devices_t devi
if(audio_is_output_device(device) && mixer->modem.state) {
rc = tinyalsa_mixer_set_route(mixer, &mixer->modem, device);
if(rc < 0) {
- LOGE("Unable to set route for device: %x", device);
+ ALOGE("Unable to set route for modem device: 0x%x", device);
return -1;
}
}
@@ -1190,7 +1188,7 @@ int tinyalsa_mixer_set_device(struct tinyalsa_mixer *mixer, audio_devices_t devi
int tinyalsa_mixer_set_output_volume(struct tinyalsa_mixer *mixer,
audio_devices_t device, float volume)
{
- LOGD("%s(%p, %x, %f)", __func__, mixer, device, volume);
+ ALOGD("%s(%p, %x, %f)", __func__, mixer, device, volume);
return tinyalsa_mixer_set_device_volume_with_attr(mixer,
TINYALSA_MIXER_DIRECTION_OUTPUT, device,
@@ -1199,7 +1197,7 @@ int tinyalsa_mixer_set_output_volume(struct tinyalsa_mixer *mixer,
int tinyalsa_mixer_set_master_volume(struct tinyalsa_mixer *mixer, float volume)
{
- LOGD("%s(%p, %f)", __func__, mixer, volume);
+ ALOGD("%s(%p, %f)", __func__, mixer, volume);
return tinyalsa_mixer_set_device_volume_with_attr(mixer,
TINYALSA_MIXER_DIRECTION_OUTPUT, AUDIO_DEVICE_OUT_DEFAULT,
@@ -1209,7 +1207,7 @@ int tinyalsa_mixer_set_master_volume(struct tinyalsa_mixer *mixer, float volume)
int tinyalsa_mixer_set_mic_mute(struct tinyalsa_mixer *mixer,
audio_devices_t device, int mute)
{
- LOGD("%s(%p, %x, %d)", __func__, mixer, device, mute);
+ ALOGD("%s(%p, %x, %d)", __func__, mixer, device, mute);
// Mic mute can be set for both input and modem directions
if(audio_is_input_device(device)) {
@@ -1228,7 +1226,7 @@ int tinyalsa_mixer_set_mic_mute(struct tinyalsa_mixer *mixer,
int tinyalsa_mixer_set_input_gain(struct tinyalsa_mixer *mixer,
audio_devices_t device, float gain)
{
- LOGD("%s(%p, %x, %f)", __func__, mixer, device, gain);
+ ALOGD("%s(%p, %x, %f)", __func__, mixer, device, gain);
return tinyalsa_mixer_set_device_volume_with_attr(mixer,
TINYALSA_MIXER_DIRECTION_INPUT, device,
@@ -1238,81 +1236,37 @@ int tinyalsa_mixer_set_input_gain(struct tinyalsa_mixer *mixer,
int tinyalsa_mixer_set_voice_volume(struct tinyalsa_mixer *mixer,
audio_devices_t device, float volume)
{
- LOGD("%s(%p, %x, %f)", __func__, mixer, device, volume);
+ ALOGD("%s(%p, %x, %f)", __func__, mixer, device, volume);
return tinyalsa_mixer_set_device_volume_with_attr(mixer,
TINYALSA_MIXER_DIRECTION_MODEM, device,
"voice-volume", volume);
}
-audio_devices_t tinyalsa_mixer_get_supported_devices(struct tinyalsa_mixer *mixer)
-{
- struct tinyalsa_mixer_device *mixer_device;
- audio_devices_t devices = 0x00;
- struct list_head *list;
-
- LOGD("%s(%p)", __func__, mixer);
-
- if(mixer == NULL)
- return -1;
-
- list = mixer->output.devices;
- while(list != NULL) {
- if(list->data != NULL) {
- mixer_device = (struct tinyalsa_mixer_device *) list->data;
- devices |= mixer_device->props.type;
- }
-
- list = list->next;
- }
-
- list = mixer->input.devices;
- while(list != NULL) {
- if(list->data != NULL) {
- mixer_device = (struct tinyalsa_mixer_device *) list->data;
- devices |= mixer_device->props.type;
- }
-
- list = list->next;
- }
-
- list = mixer->modem.devices;
- while(list != NULL) {
- if(list->data != NULL) {
- mixer_device = (struct tinyalsa_mixer_device *) list->data;
- devices |= mixer_device->props.type;
- }
-
- list = list->next;
- }
-
- return devices;
-}
-
struct tinyalsa_mixer_io_props *tinyalsa_mixer_get_output_props(struct tinyalsa_mixer *mixer)
{
- LOGD("%s(%p)", __func__, mixer);
+ ALOGD("%s(%p)", __func__, mixer);
return &(mixer->output.props);
}
struct tinyalsa_mixer_io_props *tinyalsa_mixer_get_input_props(struct tinyalsa_mixer *mixer)
{
- LOGD("%s(%p)", __func__, mixer);
+ ALOGD("%s(%p)", __func__, mixer);
return &(mixer->input.props);
}
struct tinyalsa_mixer_io_props *tinyalsa_mixer_get_modem_props(struct tinyalsa_mixer *mixer)
{
- LOGD("%s(%p)", __func__, mixer);
+ ALOGD("%s(%p)", __func__, mixer);
return &(mixer->modem.props);
}
void tinyalsa_mixer_close(struct tinyalsa_mixer *mixer)
{
- LOGD("%s(%p)", __func__, mixer);
+ ALOGD("%s(%p)", __func__, mixer);
if(mixer == NULL)
return;
@@ -1333,7 +1287,7 @@ int tinyalsa_mixer_open(struct tinyalsa_mixer **mixer_p, char *config_file)
struct tinyalsa_mixer *mixer = NULL;
int rc;
- LOGD("%s(%p, %s)", __func__, mixer_p, config_file);
+ ALOGD("%s(%p, %s)", __func__, mixer_p, config_file);
if(mixer_p == NULL || config_file == NULL)
return -1;
@@ -1342,7 +1296,7 @@ int tinyalsa_mixer_open(struct tinyalsa_mixer **mixer_p, char *config_file)
rc = tinyalsa_mixer_config_parse(mixer, config_file);
if(rc < 0) {
- LOGE("Unable to parse mixer config!");
+ ALOGE("Unable to parse mixer config!");
goto error_mixer;
}