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

Commit 0d2d286a authored by wangdongdong's avatar wangdongdong Committed by Scott Mertz
Browse files

Force voice path when recording audio during call

Some devices have an issue with distorted/garbled audio tx if recording
audio on a different source while in a call.  This is reproduced easily
in call recording applications that open an input stream after a voice
call has been established.

BACON-289 OPO-536
Change-Id: Id10f26f674ee8b812ee53a62a9f025803a9ca002
parent c7baa3b1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3392,7 +3392,8 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
    in->config.rate = config->sample_rate;
    in->format = config->format;

    if (in->device == AUDIO_DEVICE_IN_TELEPHONY_RX) {
    if (in->device == AUDIO_DEVICE_IN_TELEPHONY_RX ||
        (adev->voice.in_call && adev->mode == AUDIO_MODE_IN_CALL)) {
        if (adev->mode != AUDIO_MODE_IN_CALL) {
            ret = -EINVAL;
            goto err_open;
+2 −0
Original line number Diff line number Diff line
@@ -256,6 +256,7 @@ int voice_check_and_set_incall_rec_usecase(struct audio_device *adev,

    if (voice_is_call_state_active(adev)) {
        switch (in->source) {
        case AUDIO_SOURCE_MIC:
        case AUDIO_SOURCE_VOICE_UPLINK:
            if (audio_extn_compr_cap_enabled() &&
                audio_extn_compr_cap_format_supported(in->config.format)) {
@@ -273,6 +274,7 @@ int voice_check_and_set_incall_rec_usecase(struct audio_device *adev,
            rec_mode = INCALL_REC_DOWNLINK;
            break;
        case AUDIO_SOURCE_VOICE_CALL:
        case AUDIO_SOURCE_VOICE_COMMUNICATION:
            if (audio_extn_compr_cap_enabled() &&
                audio_extn_compr_cap_format_supported(in->config.format)) {
                in->usecase = USECASE_INCALL_REC_UPLINK_AND_DOWNLINK_COMPRESS;