Merge "hal: add support for FFV get params"
This commit is contained in:
commit
6303662927
|
@ -268,6 +268,10 @@ vendor.audio.offload.pstimeout.secs=3
|
||||||
PRODUCT_PROPERTY_OVERRIDES += \
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
ro.af.client_heap_size_kbyte=7168
|
ro.af.client_heap_size_kbyte=7168
|
||||||
|
|
||||||
|
#keep alive is needed by default for ffv
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
vendor.audio.keep_alive.disabled=false
|
||||||
|
|
||||||
# for HIDL related packages
|
# for HIDL related packages
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
android.hardware.audio@2.0-service \
|
android.hardware.audio@2.0-service \
|
||||||
|
|
|
@ -342,15 +342,19 @@
|
||||||
<ctl name="CDC_IF TX5 MUX" value="DEC5" />
|
<ctl name="CDC_IF TX5 MUX" value="DEC5" />
|
||||||
<ctl name="ADC MUX5" value="DMIC" />
|
<ctl name="ADC MUX5" value="DMIC" />
|
||||||
<ctl name="DMIC MUX5" value="DMIC1" />
|
<ctl name="DMIC MUX5" value="DMIC1" />
|
||||||
|
<ctl name="DEC5 Volume" value="96" />
|
||||||
<ctl name="CDC_IF TX6 MUX" value="DEC6" />
|
<ctl name="CDC_IF TX6 MUX" value="DEC6" />
|
||||||
<ctl name="ADC MUX6" value="DMIC" />
|
<ctl name="ADC MUX6" value="DMIC" />
|
||||||
<ctl name="DMIC MUX6" value="DMIC5" />
|
<ctl name="DMIC MUX6" value="DMIC5" />
|
||||||
|
<ctl name="DEC6 Volume" value="96" />
|
||||||
<ctl name="CDC_IF TX7 MUX" value="DEC7" />
|
<ctl name="CDC_IF TX7 MUX" value="DEC7" />
|
||||||
<ctl name="ADC MUX7" value="DMIC" />
|
<ctl name="ADC MUX7" value="DMIC" />
|
||||||
<ctl name="DMIC MUX7" value="DMIC2" />
|
<ctl name="DMIC MUX7" value="DMIC2" />
|
||||||
|
<ctl name="DEC7 Volume" value="96" />
|
||||||
<ctl name="CDC_IF TX8 MUX" value="DEC8" />
|
<ctl name="CDC_IF TX8 MUX" value="DEC8" />
|
||||||
<ctl name="ADC MUX8" value="DMIC" />
|
<ctl name="ADC MUX8" value="DMIC" />
|
||||||
<ctl name="DMIC MUX8" value="DMIC0" />
|
<ctl name="DMIC MUX8" value="DMIC0" />
|
||||||
|
<ctl name="DEC8 Volume" value="96" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<path name="audio-capture">
|
<path name="audio-capture">
|
||||||
|
|
|
@ -176,6 +176,8 @@ do {\
|
||||||
|
|
||||||
#define SVA_PARAM_DIRECTION_OF_ARRIVAL "st_direction_of_arrival"
|
#define SVA_PARAM_DIRECTION_OF_ARRIVAL "st_direction_of_arrival"
|
||||||
#define SVA_PARAM_CHANNEL_INDEX "st_channel_index"
|
#define SVA_PARAM_CHANNEL_INDEX "st_channel_index"
|
||||||
|
#define MAX_STR_LENGTH_FFV_PARAMS 30
|
||||||
|
#define MAX_FFV_SESSION_ID 100
|
||||||
/*
|
/*
|
||||||
* Current proprietary API version used by AHAL. Queried by STHAL
|
* Current proprietary API version used by AHAL. Queried by STHAL
|
||||||
* for compatibility check with AHAL
|
* for compatibility check with AHAL
|
||||||
|
@ -620,12 +622,46 @@ void audio_extn_sound_trigger_set_parameters(struct audio_device *adev __unused,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int extract_sm_handle(const char *keys, char *paramstr) {
|
||||||
|
char *tmpstr, *token;
|
||||||
|
char *inputstr = NULL;
|
||||||
|
int value = -EINVAL;
|
||||||
|
|
||||||
|
if (keys == NULL || paramstr == NULL)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
|
inputstr = strdup(keys);
|
||||||
|
token =strtok_r(inputstr,":", &tmpstr);
|
||||||
|
|
||||||
|
if (token == NULL)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
|
ALOGD("%s input string <%s> param string <%s>", __func__, keys,token);
|
||||||
|
strlcpy(paramstr, token, MAX_STR_LENGTH_FFV_PARAMS);
|
||||||
|
token =strtok_r(NULL,":=",&tmpstr);
|
||||||
|
|
||||||
|
if (token == NULL)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
|
value = atoi(token);
|
||||||
|
if (value > 0 && value < MAX_FFV_SESSION_ID)
|
||||||
|
ALOGD(" %s SVA sm handle<=%d>",__func__, value);
|
||||||
|
|
||||||
|
exit:
|
||||||
|
if (inputstr != NULL)
|
||||||
|
free(inputstr);
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
void audio_extn_sound_trigger_get_parameters(const struct audio_device *adev __unused,
|
void audio_extn_sound_trigger_get_parameters(const struct audio_device *adev __unused,
|
||||||
struct str_parms *query, struct str_parms *reply)
|
struct str_parms *query,
|
||||||
|
struct str_parms *reply)
|
||||||
{
|
{
|
||||||
audio_event_info_t event;
|
audio_event_info_t event;
|
||||||
int ret, val;
|
int ret;
|
||||||
char value[32];
|
char value[32], paramstr[MAX_STR_LENGTH_FFV_PARAMS];
|
||||||
|
|
||||||
|
ALOGD("%s input string<%s>", __func__, str_parms_to_str(query));
|
||||||
|
|
||||||
ret = str_parms_get_str(query, "SVA_EXEC_MODE_STATUS", value,
|
ret = str_parms_get_str(query, "SVA_EXEC_MODE_STATUS", value,
|
||||||
sizeof(value));
|
sizeof(value));
|
||||||
|
@ -634,17 +670,17 @@ void audio_extn_sound_trigger_get_parameters(const struct audio_device *adev __u
|
||||||
str_parms_add_int(reply, "SVA_EXEC_MODE_STATUS", event.u.value);
|
str_parms_add_int(reply, "SVA_EXEC_MODE_STATUS", event.u.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = str_parms_get_int(query, SVA_PARAM_DIRECTION_OF_ARRIVAL, &val);
|
ret = extract_sm_handle(str_parms_to_str(query), paramstr);
|
||||||
if (ret >= 0) {
|
|
||||||
event.u.st_get_param_data.sm_handle = val;
|
if ((ret >= 0) && !strncmp(paramstr, SVA_PARAM_DIRECTION_OF_ARRIVAL,
|
||||||
|
MAX_STR_LENGTH_FFV_PARAMS)) {
|
||||||
|
event.u.st_get_param_data.sm_handle = ret;
|
||||||
event.u.st_get_param_data.param = SVA_PARAM_DIRECTION_OF_ARRIVAL;
|
event.u.st_get_param_data.param = SVA_PARAM_DIRECTION_OF_ARRIVAL;
|
||||||
event.u.st_get_param_data.reply = reply;
|
event.u.st_get_param_data.reply = reply;
|
||||||
st_dev->st_callback(AUDIO_EVENT_GET_PARAM, &event);
|
st_dev->st_callback(AUDIO_EVENT_GET_PARAM, &event);
|
||||||
}
|
} else if ((ret >=0) && !strncmp(paramstr, SVA_PARAM_CHANNEL_INDEX,
|
||||||
|
MAX_STR_LENGTH_FFV_PARAMS)) {
|
||||||
ret = str_parms_get_int(query, SVA_PARAM_CHANNEL_INDEX, &val);
|
event.u.st_get_param_data.sm_handle = ret;
|
||||||
if (ret >= 0) {
|
|
||||||
event.u.st_get_param_data.sm_handle = val;
|
|
||||||
event.u.st_get_param_data.param = SVA_PARAM_CHANNEL_INDEX;
|
event.u.st_get_param_data.param = SVA_PARAM_CHANNEL_INDEX;
|
||||||
event.u.st_get_param_data.reply = reply;
|
event.u.st_get_param_data.reply = reply;
|
||||||
st_dev->st_callback(AUDIO_EVENT_GET_PARAM, &event);
|
st_dev->st_callback(AUDIO_EVENT_GET_PARAM, &event);
|
||||||
|
|
|
@ -6921,6 +6921,8 @@ error:
|
||||||
static char* adev_get_parameters(const struct audio_hw_device *dev,
|
static char* adev_get_parameters(const struct audio_hw_device *dev,
|
||||||
const char *keys)
|
const char *keys)
|
||||||
{
|
{
|
||||||
|
ALOGD("%s:%s", __func__, keys);
|
||||||
|
|
||||||
struct audio_device *adev = (struct audio_device *)dev;
|
struct audio_device *adev = (struct audio_device *)dev;
|
||||||
struct str_parms *reply = str_parms_create();
|
struct str_parms *reply = str_parms_create();
|
||||||
struct str_parms *query = str_parms_create_str(keys);
|
struct str_parms *query = str_parms_create_str(keys);
|
||||||
|
@ -6975,7 +6977,7 @@ exit:
|
||||||
str_parms_destroy(query);
|
str_parms_destroy(query);
|
||||||
str_parms_destroy(reply);
|
str_parms_destroy(reply);
|
||||||
|
|
||||||
ALOGV("%s: exit: returns - %s", __func__, str);
|
ALOGD("%s: exit: returns - %s", __func__, str);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue