Loading hal/audio_extn/spkr_protection.c +12 −1 Original line number Diff line number Diff line Loading @@ -339,6 +339,9 @@ static int spkr_calibrate(int t0) } } uc_info_rx = (struct audio_usecase *)calloc(1, sizeof(struct audio_usecase)); if (!uc_info_rx) { return -ENOMEM; } uc_info_rx->id = USECASE_AUDIO_SPKR_CALIB_RX; uc_info_rx->type = PCM_PLAYBACK; uc_info_rx->in_snd_device = SND_DEVICE_NONE; Loading Loading @@ -368,6 +371,10 @@ static int spkr_calibrate(int t0) } uc_info_tx = (struct audio_usecase *) calloc(1, sizeof(struct audio_usecase)); if (!uc_info_tx) { status.status = -ENOMEM; goto exit; } uc_info_tx->id = USECASE_AUDIO_SPKR_CALIB_TX; uc_info_tx->type = PCM_CAPTURE; uc_info_tx->in_snd_device = SND_DEVICE_IN_CAPTURE_VI_FEEDBACK; Loading Loading @@ -812,6 +819,9 @@ int audio_extn_spkr_prot_start_processing(snd_device_t snd_device) snd_device = audio_extn_get_spkr_prot_snd_device(snd_device); spkr_prot_set_spkrstatus(true); uc_info_tx = (struct audio_usecase *)calloc(1, sizeof(struct audio_usecase)); if (!uc_info_tx) { return -ENOMEM; } ALOGV("%s: snd_device(%d: %s)", __func__, snd_device, platform_get_snd_device_name(snd_device)); audio_route_apply_and_update_path(adev->audio_route, Loading Loading @@ -892,6 +902,7 @@ void audio_extn_spkr_prot_stop_processing(snd_device_t snd_device) } handle.spkr_processing_state = SPKR_PROCESSING_IN_IDLE; pthread_mutex_unlock(&handle.mutex_spkr_prot); if (adev) audio_route_reset_and_update_path(adev->audio_route, platform_get_snd_device_name(snd_device)); ALOGV("%s: Exit", __func__); Loading hal/audio_hw.c +10 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ int disable_audio_route(struct audio_device *adev, snd_device_t snd_device; char mixer_path[MIXER_PATH_MAX_LENGTH]; if (usecase == NULL) if (usecase == NULL || usecase->id == USECASE_INVALID) return -EINVAL; ALOGV("%s: enter: usecase(%d)", __func__, usecase->id); Loading Loading @@ -1645,6 +1645,8 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) ALOGD("%s: enter: usecase(%d: %s) kvpairs: %s", __func__, out->usecase, use_case_table[out->usecase], kvpairs); parms = str_parms_create_str(kvpairs); if (!parms) goto error; err = str_parms_get_str(parms, AUDIO_PARAMETER_STREAM_ROUTING, value, sizeof(value)); if (err >= 0) { val = atoi(value); Loading Loading @@ -1721,6 +1723,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) } str_parms_destroy(parms); error: ALOGV("%s: exit: code(%d)", __func__, ret); return ret; } Loading Loading @@ -2212,6 +2215,8 @@ static int in_set_parameters(struct audio_stream *stream, const char *kvpairs) ALOGD("%s: enter: kvpairs=%s", __func__, kvpairs); parms = str_parms_create_str(kvpairs); if (!parms) goto error; pthread_mutex_lock(&in->lock); pthread_mutex_lock(&adev->lock); Loading Loading @@ -2251,6 +2256,7 @@ done: pthread_mutex_unlock(&in->lock); str_parms_destroy(parms); error: ALOGV("%s: exit: status(%d)", __func__, ret); return ret; } Loading Loading @@ -2738,6 +2744,8 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) ALOGD("%s: enter: %s", __func__, kvpairs); parms = str_parms_create_str(kvpairs); if (!parms) goto error; ret = str_parms_get_str(parms, "SND_CARD_STATUS", value, sizeof(value)); if (ret >= 0) { char *snd_card_status = value+2; Loading Loading @@ -2840,6 +2848,7 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) done: str_parms_destroy(parms); pthread_mutex_unlock(&adev->lock); error: ALOGV("%s: exit with code(%d)", __func__, status); return status; } Loading Loading
hal/audio_extn/spkr_protection.c +12 −1 Original line number Diff line number Diff line Loading @@ -339,6 +339,9 @@ static int spkr_calibrate(int t0) } } uc_info_rx = (struct audio_usecase *)calloc(1, sizeof(struct audio_usecase)); if (!uc_info_rx) { return -ENOMEM; } uc_info_rx->id = USECASE_AUDIO_SPKR_CALIB_RX; uc_info_rx->type = PCM_PLAYBACK; uc_info_rx->in_snd_device = SND_DEVICE_NONE; Loading Loading @@ -368,6 +371,10 @@ static int spkr_calibrate(int t0) } uc_info_tx = (struct audio_usecase *) calloc(1, sizeof(struct audio_usecase)); if (!uc_info_tx) { status.status = -ENOMEM; goto exit; } uc_info_tx->id = USECASE_AUDIO_SPKR_CALIB_TX; uc_info_tx->type = PCM_CAPTURE; uc_info_tx->in_snd_device = SND_DEVICE_IN_CAPTURE_VI_FEEDBACK; Loading Loading @@ -812,6 +819,9 @@ int audio_extn_spkr_prot_start_processing(snd_device_t snd_device) snd_device = audio_extn_get_spkr_prot_snd_device(snd_device); spkr_prot_set_spkrstatus(true); uc_info_tx = (struct audio_usecase *)calloc(1, sizeof(struct audio_usecase)); if (!uc_info_tx) { return -ENOMEM; } ALOGV("%s: snd_device(%d: %s)", __func__, snd_device, platform_get_snd_device_name(snd_device)); audio_route_apply_and_update_path(adev->audio_route, Loading Loading @@ -892,6 +902,7 @@ void audio_extn_spkr_prot_stop_processing(snd_device_t snd_device) } handle.spkr_processing_state = SPKR_PROCESSING_IN_IDLE; pthread_mutex_unlock(&handle.mutex_spkr_prot); if (adev) audio_route_reset_and_update_path(adev->audio_route, platform_get_snd_device_name(snd_device)); ALOGV("%s: Exit", __func__); Loading
hal/audio_hw.c +10 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ int disable_audio_route(struct audio_device *adev, snd_device_t snd_device; char mixer_path[MIXER_PATH_MAX_LENGTH]; if (usecase == NULL) if (usecase == NULL || usecase->id == USECASE_INVALID) return -EINVAL; ALOGV("%s: enter: usecase(%d)", __func__, usecase->id); Loading Loading @@ -1645,6 +1645,8 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) ALOGD("%s: enter: usecase(%d: %s) kvpairs: %s", __func__, out->usecase, use_case_table[out->usecase], kvpairs); parms = str_parms_create_str(kvpairs); if (!parms) goto error; err = str_parms_get_str(parms, AUDIO_PARAMETER_STREAM_ROUTING, value, sizeof(value)); if (err >= 0) { val = atoi(value); Loading Loading @@ -1721,6 +1723,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) } str_parms_destroy(parms); error: ALOGV("%s: exit: code(%d)", __func__, ret); return ret; } Loading Loading @@ -2212,6 +2215,8 @@ static int in_set_parameters(struct audio_stream *stream, const char *kvpairs) ALOGD("%s: enter: kvpairs=%s", __func__, kvpairs); parms = str_parms_create_str(kvpairs); if (!parms) goto error; pthread_mutex_lock(&in->lock); pthread_mutex_lock(&adev->lock); Loading Loading @@ -2251,6 +2256,7 @@ done: pthread_mutex_unlock(&in->lock); str_parms_destroy(parms); error: ALOGV("%s: exit: status(%d)", __func__, ret); return ret; } Loading Loading @@ -2738,6 +2744,8 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) ALOGD("%s: enter: %s", __func__, kvpairs); parms = str_parms_create_str(kvpairs); if (!parms) goto error; ret = str_parms_get_str(parms, "SND_CARD_STATUS", value, sizeof(value)); if (ret >= 0) { char *snd_card_status = value+2; Loading Loading @@ -2840,6 +2848,7 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) done: str_parms_destroy(parms); pthread_mutex_unlock(&adev->lock); error: ALOGV("%s: exit with code(%d)", __func__, status); return status; } Loading