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

Commit ac2bae89 authored by Weiyin Jiang's avatar Weiyin Jiang Committed by Gerrit - the friendly Code Review server
Browse files

hal: ensure synchronization in sending last cached cal level

Ensure synchronization in sending last cached cal level.

CRs-Fixed: 2743506
Change-Id: I58a83e8ce694a439b5b8dc3ac8691a530974b986
parent e3e3492e
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -5867,19 +5867,21 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
            ret = voice_extn_compress_voip_start_output_stream(out);
        else
            ret = start_output_stream(out);
        pthread_mutex_unlock(&adev->lock);
        /* ToDo: If use case is compress offload should return 0 */
        if (ret != 0) {
            out->standby = true;
            pthread_mutex_unlock(&adev->lock);
            goto exit;
        }
        out->started = 1;
        out->last_fifo_valid = false; // we're coming out of standby, last_fifo isn't valid.
        if (last_known_cal_step != -1) {

        if ((last_known_cal_step != -1) && (adev->platform != NULL)) {
            ALOGD("%s: retry previous failed cal level set", __func__);
            audio_hw_send_gain_dep_calibration(last_known_cal_step);
            platform_send_gain_dep_cal(adev->platform, last_known_cal_step);
            last_known_cal_step = -1;
        }
        pthread_mutex_unlock(&adev->lock);

        if ((out->is_iec61937_info_available == true) &&
            (audio_extn_passthru_is_passthrough_stream(out))&&