Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbd1905c authored by Trinath Thammishetty's avatar Trinath Thammishetty
Browse files

hal: Enable effects for hardware loopback

Add support for hardware loopback usecase in audiohal.

Change-Id: I97c14acca5961b9d9ac23fe04c8d9782c44fa646
parent a08b7aa5
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -262,6 +262,8 @@ int32_t release_loopback_session(loopback_patch_t *active_loopback_patch)
    struct stream_inout *inout =  &active_loopback_patch->patch_stream;
    struct audio_port_config *source_patch_config = &active_loopback_patch->
                                                    loopback_source;
    int32_t pcm_dev_asm_rx_id = platform_get_pcm_device_id(USECASE_AUDIO_TRANSCODE_LOOPBACK,
                                                           PCM_PLAYBACK);

    /* 1. Close the PCM devices */
    if (active_loopback_patch->source_stream) {
@@ -286,6 +288,9 @@ int32_t release_loopback_session(loopback_patch_t *active_loopback_patch)
        return -EINVAL;
    }

    if (adev->offload_effects_stop_output != NULL)
            adev->offload_effects_stop_output(active_loopback_patch->patch_handle_id, pcm_dev_asm_rx_id);

    active_loopback_patch->patch_state = PATCH_INACTIVE;

    /* 2. Get and set stream specific mixer controls */
@@ -542,6 +547,11 @@ int create_loopback_session(loopback_patch_t *active_loopback_patch)
    /* Move patch state to running, now that session is set up */
    active_loopback_patch->patch_state = PATCH_RUNNING;
    ALOGD("%s: Create loopback session end: status(%d)", __func__, ret);

    if (adev->offload_effects_start_output != NULL)
        adev->offload_effects_start_output(active_loopback_patch->patch_handle_id,
                                           pcm_dev_asm_rx_id, adev->mixer);

    return ret;

exit: