Loading hal/audio_extn/ip_hdlr_intf.c +10 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,16 @@ struct rtic_event { uint8_t payload[0]; }; bool audio_extn_ip_hdlr_intf_supported(audio_format_t format) { if ((format & AUDIO_FORMAT_MAIN_MASK == AUDIO_FORMAT_AC3) || (format & AUDIO_FORMAT_MAIN_MASK == AUDIO_FORMAT_E_AC3) || (format & AUDIO_FORMAT_MAIN_MASK == AUDIO_FORMAT_DOLBY_TRUEHD)) return true; else return false; } int audio_extn_ip_hdlr_intf_event(void *stream_handle, void *payload, void *ip_hdlr_handle) { ALOGVV("%s:[%d] handle = %p",__func__, ip_hdlr->ref_cnt, ip_hdlr_handle); Loading hal/audio_extn/ip_hdlr_intf.h +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ int audio_extn_ip_hdlr_intf_open(void *handle, bool is_dsp_decode, void *aud_ses int audio_extn_ip_hdlr_intf_close(void *handle, bool is_dsp_decode, void *aud_sess_handle); int audio_extn_ip_hdlr_intf_init(void **handle, char *lib_path, void **lib_handle); int audio_extn_ip_hdlr_intf_deinit(void *handle); bool audio_extn_ip_hdlr_intf_supported(audio_format_t format); #else Loading @@ -43,6 +44,7 @@ int audio_extn_ip_hdlr_intf_deinit(void *handle); #define audio_extn_ip_hdlr_intf_close(handle, is_dsp_decode, aud_sess_handle) (0) #define audio_extn_ip_hdlr_intf_init(handle, lib_path, lib_handle) (0) #define audio_extn_ip_hdlr_intf_deinit(handle) (0) #define audio_extn_ip_hdlr_intf_supported(format) (0) #endif Loading hal/audio_hw.c +26 −1 Original line number Diff line number Diff line Loading @@ -2215,6 +2215,12 @@ static int stop_output_stream(struct stream_out *out) if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) audio_extn_keep_alive_start(); if (audio_extn_ip_hdlr_intf_supported(out->format) && out->ip_hdlr_handle) { ret = audio_extn_ip_hdlr_intf_close(out->ip_hdlr_handle, true, out); if (ret < 0) ALOGE("%s: audio_extn_ip_hdlr_intf_close failed %d",__func__, ret); } ALOGV("%s: exit: status(%d)", __func__, ret); return ret; } Loading Loading @@ -2424,6 +2430,12 @@ int start_output_stream(struct stream_out *out) audio_extn_perf_lock_release(&adev->perf_lock_handle); ALOGD("%s: exit", __func__); if (audio_extn_ip_hdlr_intf_supported(out->format) && out->ip_hdlr_handle) { ret = audio_extn_ip_hdlr_intf_open(out->ip_hdlr_handle, true, out); if (ret < 0) ALOGE("%s: audio_extn_ip_hdlr_intf_open failed %d",__func__, ret); } return ret; error_open: audio_extn_perf_lock_release(&adev->perf_lock_handle); Loading Loading @@ -4402,7 +4414,8 @@ int adev_open_output_stream(struct audio_hw_device *dev, popcount(out->channel_mask), out->playback_started); /* setup a channel for client <--> adsp communication for stream events */ if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) || (out->flags & AUDIO_OUTPUT_FLAG_DIRECT_PCM)) { (out->flags & AUDIO_OUTPUT_FLAG_DIRECT_PCM) || (audio_extn_ip_hdlr_intf_supported(config->format))) { hdlr_stream_cfg.pcm_device_id = platform_get_pcm_device_id( out->usecase, PCM_PLAYBACK); hdlr_stream_cfg.flags = out->flags; Loading @@ -4414,6 +4427,13 @@ int adev_open_output_stream(struct audio_hw_device *dev, out->adsp_hdlr_stream_handle = NULL; } } if (audio_extn_ip_hdlr_intf_supported(config->format)) { ret = audio_extn_ip_hdlr_intf_init(&out->ip_hdlr_handle, NULL, NULL); if (ret < 0) { ALOGE("%s: audio_extn_ip_hdlr_intf_init failed %d",__func__, ret); out->ip_hdlr_handle = NULL; } } ALOGV("%s: exit", __func__); return 0; Loading Loading @@ -4443,6 +4463,11 @@ void adev_close_output_stream(struct audio_hw_device *dev __unused, out->adsp_hdlr_stream_handle = NULL; } if (audio_extn_ip_hdlr_intf_supported(out->format) && out->ip_hdlr_handle) { audio_extn_ip_hdlr_intf_deinit(out->ip_hdlr_handle); out->ip_hdlr_handle = NULL; } if (out->usecase == USECASE_COMPRESS_VOIP_CALL) { pthread_mutex_lock(&adev->lock); ret = voice_extn_compress_voip_close_output_stream(&stream->common); Loading hal/audio_hw.h +1 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,7 @@ struct stream_out { bool offload_thread_blocked; void *adsp_hdlr_stream_handle; void *ip_hdlr_handle; stream_callback_t client_callback; void *client_cookie; Loading Loading
hal/audio_extn/ip_hdlr_intf.c +10 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,16 @@ struct rtic_event { uint8_t payload[0]; }; bool audio_extn_ip_hdlr_intf_supported(audio_format_t format) { if ((format & AUDIO_FORMAT_MAIN_MASK == AUDIO_FORMAT_AC3) || (format & AUDIO_FORMAT_MAIN_MASK == AUDIO_FORMAT_E_AC3) || (format & AUDIO_FORMAT_MAIN_MASK == AUDIO_FORMAT_DOLBY_TRUEHD)) return true; else return false; } int audio_extn_ip_hdlr_intf_event(void *stream_handle, void *payload, void *ip_hdlr_handle) { ALOGVV("%s:[%d] handle = %p",__func__, ip_hdlr->ref_cnt, ip_hdlr_handle); Loading
hal/audio_extn/ip_hdlr_intf.h +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ int audio_extn_ip_hdlr_intf_open(void *handle, bool is_dsp_decode, void *aud_ses int audio_extn_ip_hdlr_intf_close(void *handle, bool is_dsp_decode, void *aud_sess_handle); int audio_extn_ip_hdlr_intf_init(void **handle, char *lib_path, void **lib_handle); int audio_extn_ip_hdlr_intf_deinit(void *handle); bool audio_extn_ip_hdlr_intf_supported(audio_format_t format); #else Loading @@ -43,6 +44,7 @@ int audio_extn_ip_hdlr_intf_deinit(void *handle); #define audio_extn_ip_hdlr_intf_close(handle, is_dsp_decode, aud_sess_handle) (0) #define audio_extn_ip_hdlr_intf_init(handle, lib_path, lib_handle) (0) #define audio_extn_ip_hdlr_intf_deinit(handle) (0) #define audio_extn_ip_hdlr_intf_supported(format) (0) #endif Loading
hal/audio_hw.c +26 −1 Original line number Diff line number Diff line Loading @@ -2215,6 +2215,12 @@ static int stop_output_stream(struct stream_out *out) if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) audio_extn_keep_alive_start(); if (audio_extn_ip_hdlr_intf_supported(out->format) && out->ip_hdlr_handle) { ret = audio_extn_ip_hdlr_intf_close(out->ip_hdlr_handle, true, out); if (ret < 0) ALOGE("%s: audio_extn_ip_hdlr_intf_close failed %d",__func__, ret); } ALOGV("%s: exit: status(%d)", __func__, ret); return ret; } Loading Loading @@ -2424,6 +2430,12 @@ int start_output_stream(struct stream_out *out) audio_extn_perf_lock_release(&adev->perf_lock_handle); ALOGD("%s: exit", __func__); if (audio_extn_ip_hdlr_intf_supported(out->format) && out->ip_hdlr_handle) { ret = audio_extn_ip_hdlr_intf_open(out->ip_hdlr_handle, true, out); if (ret < 0) ALOGE("%s: audio_extn_ip_hdlr_intf_open failed %d",__func__, ret); } return ret; error_open: audio_extn_perf_lock_release(&adev->perf_lock_handle); Loading Loading @@ -4402,7 +4414,8 @@ int adev_open_output_stream(struct audio_hw_device *dev, popcount(out->channel_mask), out->playback_started); /* setup a channel for client <--> adsp communication for stream events */ if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) || (out->flags & AUDIO_OUTPUT_FLAG_DIRECT_PCM)) { (out->flags & AUDIO_OUTPUT_FLAG_DIRECT_PCM) || (audio_extn_ip_hdlr_intf_supported(config->format))) { hdlr_stream_cfg.pcm_device_id = platform_get_pcm_device_id( out->usecase, PCM_PLAYBACK); hdlr_stream_cfg.flags = out->flags; Loading @@ -4414,6 +4427,13 @@ int adev_open_output_stream(struct audio_hw_device *dev, out->adsp_hdlr_stream_handle = NULL; } } if (audio_extn_ip_hdlr_intf_supported(config->format)) { ret = audio_extn_ip_hdlr_intf_init(&out->ip_hdlr_handle, NULL, NULL); if (ret < 0) { ALOGE("%s: audio_extn_ip_hdlr_intf_init failed %d",__func__, ret); out->ip_hdlr_handle = NULL; } } ALOGV("%s: exit", __func__); return 0; Loading Loading @@ -4443,6 +4463,11 @@ void adev_close_output_stream(struct audio_hw_device *dev __unused, out->adsp_hdlr_stream_handle = NULL; } if (audio_extn_ip_hdlr_intf_supported(out->format) && out->ip_hdlr_handle) { audio_extn_ip_hdlr_intf_deinit(out->ip_hdlr_handle); out->ip_hdlr_handle = NULL; } if (out->usecase == USECASE_COMPRESS_VOIP_CALL) { pthread_mutex_lock(&adev->lock); ret = voice_extn_compress_voip_close_output_stream(&stream->common); Loading
hal/audio_hw.h +1 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,7 @@ struct stream_out { bool offload_thread_blocked; void *adsp_hdlr_stream_handle; void *ip_hdlr_handle; stream_callback_t client_callback; void *client_cookie; Loading