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

Commit 8a2a2267 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: VoIP call auto recovery if SSR happens during call"

parents 26f78bc7 bc9c9ca6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1778,6 +1778,10 @@ exit:
    if (ret != 0) {
        if (out->pcm)
            ALOGE("%s: error %d - %s", __func__, ret, pcm_get_error(out->pcm));
        if (out->usecase == USECASE_COMPRESS_VOIP_CALL) {
            voice_extn_compress_voip_close_output_stream(&out->stream.common);
            out->standby = true;
        }
        out_standby(&out->stream.common);
        usleep(bytes * 1000000 / audio_stream_frame_size(&out->stream.common) /
                        out_get_sample_rate(&out->stream.common));
@@ -2184,6 +2188,10 @@ exit:
    pthread_mutex_unlock(&in->lock);

    if (ret != 0) {
        if (in->usecase == USECASE_COMPRESS_VOIP_CALL) {
            voice_extn_compress_voip_close_input_stream(&in->stream.common);
            in->standby = true;
        }
        in_standby(&in->stream.common);
        ALOGV("%s: read failed - sleeping for buffer duration", __func__);
        usleep(bytes * 1000000 / audio_stream_frame_size(&in->stream.common) /
+15 −7
Original line number Diff line number Diff line
@@ -561,6 +561,9 @@ int voice_extn_compress_voip_start_output_stream(struct stream_out *out)

    ALOGD("%s: enter", __func__);

    if (!voip_data.out_stream_count)
        ret = voice_extn_compress_voip_open_output_stream(out);

    ret = voip_start_call(adev, &out->config);
    out->pcm = voip_data.pcm_rx;
    uc_info = get_usecase_from_list(adev, USECASE_COMPRESS_VOIP_CALL);
@@ -579,6 +582,9 @@ int voice_extn_compress_voip_start_input_stream(struct stream_in *in)

    ALOGD("%s: enter", __func__);

    if (!voip_data.in_stream_count)
        ret = voice_extn_compress_voip_open_input_stream(in);

    ret = voip_start_call(adev, &in->config);
    in->pcm = voip_data.pcm_tx;

@@ -593,10 +599,11 @@ int voice_extn_compress_voip_close_output_stream(struct audio_stream *stream)
    int ret = 0;

    ALOGD("%s: enter", __func__);

    if (voip_data.out_stream_count > 0) {
        voip_data.out_stream_count--;
        ret = voip_stop_call(adev);
        voip_data.out_stream = NULL;
    }

    ALOGV("%s: exit: status(%d)", __func__, ret);
    return ret;
@@ -633,12 +640,13 @@ int voice_extn_compress_voip_close_input_stream(struct audio_stream *stream)

    ALOGD("%s: enter", __func__);

    if(voip_data.in_stream_count > 0) {
       voip_data.in_stream_count--;
       status = voip_stop_call(adev);
    }

    ALOGV("%s: exit: status(%d)", __func__, status);
    return status;

}

int voice_extn_compress_voip_open_input_stream(struct stream_in *in)