Loading post_proc/bass_boost.c +17 −14 Original line number Diff line number Diff line Loading @@ -158,25 +158,28 @@ int bassboost_set_device(effect_context_t *context, uint32_t device) (device == AUDIO_DEVICE_OUT_AUX_DIGITAL) || (device == AUDIO_DEVICE_OUT_USB_ACCESSORY) || (device == AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET)) { if (offload_bassboost_get_enable_flag(&(bass_ctxt->offload_bass))) { if (!bass_ctxt->temp_disabled) { if (effect_is_active(&bass_ctxt->common)) { offload_bassboost_set_enable_flag(&(bass_ctxt->offload_bass), false); bass_ctxt->temp_disabled = true; if (bass_ctxt->ctl) offload_bassboost_send_params(bass_ctxt->ctl, bass_ctxt->offload_bass, OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG); ALOGI("%s: ctxt %p, disabled based on device", __func__, bass_ctxt); } bass_ctxt->temp_disabled = true; } ALOGI("%s: ctxt %p, disabled based on device", __func__, bass_ctxt); } else { if (!offload_bassboost_get_enable_flag(&(bass_ctxt->offload_bass)) && bass_ctxt->temp_disabled) { if (bass_ctxt->temp_disabled) { if (effect_is_active(&bass_ctxt->common)) { offload_bassboost_set_enable_flag(&(bass_ctxt->offload_bass), true); bass_ctxt->temp_disabled = false; if (bass_ctxt->ctl) offload_bassboost_send_params(bass_ctxt->ctl, bass_ctxt->offload_bass, OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG); } bass_ctxt->temp_disabled = false; } } offload_bassboost_set_device(&(bass_ctxt->offload_bass), device); return 0; Loading post_proc/bundle.c +11 −5 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ int offload_effects_bundle_hal_start_output(audio_io_handle_t output, int pcm_id int ret = 0; struct listnode *node; char mixer_string[128]; output_context_t * out_ctxt = NULL; ALOGV("%s output %d pcm_id %d", __func__, output, pcm_id); Loading @@ -199,7 +200,7 @@ int offload_effects_bundle_hal_start_output(audio_io_handle_t output, int pcm_id goto exit; } output_context_t *out_ctxt = (output_context_t *) out_ctxt = (output_context_t *) malloc(sizeof(output_context_t)); if (!out_ctxt) { ALOGE("%s fail to allocate for output context", __func__); Loading @@ -217,6 +218,7 @@ int offload_effects_bundle_hal_start_output(audio_io_handle_t output, int pcm_id ALOGE("Failed to open mixer"); out_ctxt->ctl = NULL; ret = -EINVAL; free(out_ctxt); goto exit; } else { out_ctxt->ctl = mixer_get_ctl_by_name(out_ctxt->mixer, mixer_string); Loading @@ -225,6 +227,7 @@ int offload_effects_bundle_hal_start_output(audio_io_handle_t output, int pcm_id mixer_close(out_ctxt->mixer); out_ctxt->mixer = NULL; ret = -EINVAL; free(out_ctxt); goto exit; } } Loading Loading @@ -535,12 +538,12 @@ int effect_process(effect_handle_t self, pthread_mutex_lock(&lock); if (!effect_exists(context)) { status = -EINVAL; status = -ENOSYS; goto exit; } if (context->state != EFFECT_STATE_ACTIVE) { status = -EINVAL; status = -ENODATA; goto exit; } Loading @@ -560,13 +563,13 @@ int effect_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, pthread_mutex_lock(&lock); if (!effect_exists(context)) { status = -EINVAL; status = -ENOSYS; goto exit; } ALOGV("%s: ctxt %p, cmd %d", __func__, context, cmdCode); if (context == NULL || context->state == EFFECT_STATE_UNINITIALIZED) { status = -EINVAL; status = -ENOSYS; goto exit; } Loading Loading @@ -752,6 +755,9 @@ int effect_get_descriptor(effect_handle_t self, return 0; } bool effect_is_active(effect_context_t * ctxt) { return ctxt->state == EFFECT_STATE_ACTIVE; } /* effect_handle_t interface implementation for offload effects */ const struct effect_interface_s effect_interface = { Loading post_proc/bundle.h +2 −0 Original line number Diff line number Diff line Loading @@ -87,4 +87,6 @@ struct effect_context_s { int set_config(effect_context_t *context, effect_config_t *config); bool effect_is_active(effect_context_t *context); #endif /* OFFLOAD_EFFECT_BUNDLE_H */ post_proc/reverb.c +1 −1 Original line number Diff line number Diff line Loading @@ -229,7 +229,7 @@ int16_t reverb_get_density(reverb_context_t *context) void reverb_set_density(reverb_context_t *context, int16_t density) { ALOGV("%s: ctxt %p, density: %d", __func__, density, density); ALOGV("%s: ctxt %p, density: %d", __func__, context, density); context->reverb_settings.density = density; offload_reverb_set_density(&(context->offload_reverb), density); if (context->ctl) Loading post_proc/virtualizer.c +17 −13 Original line number Diff line number Diff line Loading @@ -157,25 +157,28 @@ int virtualizer_set_device(effect_context_t *context, uint32_t device) (device == AUDIO_DEVICE_OUT_AUX_DIGITAL) || (device == AUDIO_DEVICE_OUT_USB_ACCESSORY) || (device == AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET)) { if (offload_virtualizer_get_enable_flag(&(virt_ctxt->offload_virt))) { if (!virt_ctxt->temp_disabled) { if (effect_is_active(&virt_ctxt->common)) { offload_virtualizer_set_enable_flag(&(virt_ctxt->offload_virt), false); virt_ctxt->temp_disabled = true; if (virt_ctxt->ctl) offload_virtualizer_send_params(virt_ctxt->ctl, virt_ctxt->offload_virt, OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG); } virt_ctxt->temp_disabled = true; ALOGI("%s: ctxt %p, disabled based on device", __func__, virt_ctxt); } } else { if (!offload_virtualizer_get_enable_flag(&(virt_ctxt->offload_virt)) && virt_ctxt->temp_disabled) { if (virt_ctxt->temp_disabled) { if (effect_is_active(&virt_ctxt->common)) { offload_virtualizer_set_enable_flag(&(virt_ctxt->offload_virt), true); virt_ctxt->temp_disabled = false; if (virt_ctxt->ctl) offload_virtualizer_send_params(virt_ctxt->ctl, virt_ctxt->offload_virt, OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG); } virt_ctxt->temp_disabled = false; } } offload_virtualizer_set_device(&(virt_ctxt->offload_virt), device); return 0; Loading Loading @@ -212,6 +215,7 @@ int virtualizer_init(effect_context_t *context) set_config(context, &context->config); virt_ctxt->temp_disabled = false; memset(&(virt_ctxt->offload_virt), 0, sizeof(struct virtualizer_params)); return 0; Loading Loading
post_proc/bass_boost.c +17 −14 Original line number Diff line number Diff line Loading @@ -158,25 +158,28 @@ int bassboost_set_device(effect_context_t *context, uint32_t device) (device == AUDIO_DEVICE_OUT_AUX_DIGITAL) || (device == AUDIO_DEVICE_OUT_USB_ACCESSORY) || (device == AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET)) { if (offload_bassboost_get_enable_flag(&(bass_ctxt->offload_bass))) { if (!bass_ctxt->temp_disabled) { if (effect_is_active(&bass_ctxt->common)) { offload_bassboost_set_enable_flag(&(bass_ctxt->offload_bass), false); bass_ctxt->temp_disabled = true; if (bass_ctxt->ctl) offload_bassboost_send_params(bass_ctxt->ctl, bass_ctxt->offload_bass, OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG); ALOGI("%s: ctxt %p, disabled based on device", __func__, bass_ctxt); } bass_ctxt->temp_disabled = true; } ALOGI("%s: ctxt %p, disabled based on device", __func__, bass_ctxt); } else { if (!offload_bassboost_get_enable_flag(&(bass_ctxt->offload_bass)) && bass_ctxt->temp_disabled) { if (bass_ctxt->temp_disabled) { if (effect_is_active(&bass_ctxt->common)) { offload_bassboost_set_enable_flag(&(bass_ctxt->offload_bass), true); bass_ctxt->temp_disabled = false; if (bass_ctxt->ctl) offload_bassboost_send_params(bass_ctxt->ctl, bass_ctxt->offload_bass, OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG); } bass_ctxt->temp_disabled = false; } } offload_bassboost_set_device(&(bass_ctxt->offload_bass), device); return 0; Loading
post_proc/bundle.c +11 −5 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ int offload_effects_bundle_hal_start_output(audio_io_handle_t output, int pcm_id int ret = 0; struct listnode *node; char mixer_string[128]; output_context_t * out_ctxt = NULL; ALOGV("%s output %d pcm_id %d", __func__, output, pcm_id); Loading @@ -199,7 +200,7 @@ int offload_effects_bundle_hal_start_output(audio_io_handle_t output, int pcm_id goto exit; } output_context_t *out_ctxt = (output_context_t *) out_ctxt = (output_context_t *) malloc(sizeof(output_context_t)); if (!out_ctxt) { ALOGE("%s fail to allocate for output context", __func__); Loading @@ -217,6 +218,7 @@ int offload_effects_bundle_hal_start_output(audio_io_handle_t output, int pcm_id ALOGE("Failed to open mixer"); out_ctxt->ctl = NULL; ret = -EINVAL; free(out_ctxt); goto exit; } else { out_ctxt->ctl = mixer_get_ctl_by_name(out_ctxt->mixer, mixer_string); Loading @@ -225,6 +227,7 @@ int offload_effects_bundle_hal_start_output(audio_io_handle_t output, int pcm_id mixer_close(out_ctxt->mixer); out_ctxt->mixer = NULL; ret = -EINVAL; free(out_ctxt); goto exit; } } Loading Loading @@ -535,12 +538,12 @@ int effect_process(effect_handle_t self, pthread_mutex_lock(&lock); if (!effect_exists(context)) { status = -EINVAL; status = -ENOSYS; goto exit; } if (context->state != EFFECT_STATE_ACTIVE) { status = -EINVAL; status = -ENODATA; goto exit; } Loading @@ -560,13 +563,13 @@ int effect_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, pthread_mutex_lock(&lock); if (!effect_exists(context)) { status = -EINVAL; status = -ENOSYS; goto exit; } ALOGV("%s: ctxt %p, cmd %d", __func__, context, cmdCode); if (context == NULL || context->state == EFFECT_STATE_UNINITIALIZED) { status = -EINVAL; status = -ENOSYS; goto exit; } Loading Loading @@ -752,6 +755,9 @@ int effect_get_descriptor(effect_handle_t self, return 0; } bool effect_is_active(effect_context_t * ctxt) { return ctxt->state == EFFECT_STATE_ACTIVE; } /* effect_handle_t interface implementation for offload effects */ const struct effect_interface_s effect_interface = { Loading
post_proc/bundle.h +2 −0 Original line number Diff line number Diff line Loading @@ -87,4 +87,6 @@ struct effect_context_s { int set_config(effect_context_t *context, effect_config_t *config); bool effect_is_active(effect_context_t *context); #endif /* OFFLOAD_EFFECT_BUNDLE_H */
post_proc/reverb.c +1 −1 Original line number Diff line number Diff line Loading @@ -229,7 +229,7 @@ int16_t reverb_get_density(reverb_context_t *context) void reverb_set_density(reverb_context_t *context, int16_t density) { ALOGV("%s: ctxt %p, density: %d", __func__, density, density); ALOGV("%s: ctxt %p, density: %d", __func__, context, density); context->reverb_settings.density = density; offload_reverb_set_density(&(context->offload_reverb), density); if (context->ctl) Loading
post_proc/virtualizer.c +17 −13 Original line number Diff line number Diff line Loading @@ -157,25 +157,28 @@ int virtualizer_set_device(effect_context_t *context, uint32_t device) (device == AUDIO_DEVICE_OUT_AUX_DIGITAL) || (device == AUDIO_DEVICE_OUT_USB_ACCESSORY) || (device == AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET)) { if (offload_virtualizer_get_enable_flag(&(virt_ctxt->offload_virt))) { if (!virt_ctxt->temp_disabled) { if (effect_is_active(&virt_ctxt->common)) { offload_virtualizer_set_enable_flag(&(virt_ctxt->offload_virt), false); virt_ctxt->temp_disabled = true; if (virt_ctxt->ctl) offload_virtualizer_send_params(virt_ctxt->ctl, virt_ctxt->offload_virt, OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG); } virt_ctxt->temp_disabled = true; ALOGI("%s: ctxt %p, disabled based on device", __func__, virt_ctxt); } } else { if (!offload_virtualizer_get_enable_flag(&(virt_ctxt->offload_virt)) && virt_ctxt->temp_disabled) { if (virt_ctxt->temp_disabled) { if (effect_is_active(&virt_ctxt->common)) { offload_virtualizer_set_enable_flag(&(virt_ctxt->offload_virt), true); virt_ctxt->temp_disabled = false; if (virt_ctxt->ctl) offload_virtualizer_send_params(virt_ctxt->ctl, virt_ctxt->offload_virt, OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG); } virt_ctxt->temp_disabled = false; } } offload_virtualizer_set_device(&(virt_ctxt->offload_virt), device); return 0; Loading Loading @@ -212,6 +215,7 @@ int virtualizer_init(effect_context_t *context) set_config(context, &context->config); virt_ctxt->temp_disabled = false; memset(&(virt_ctxt->offload_virt), 0, sizeof(struct virtualizer_params)); return 0; Loading