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

Commit d305a4ac authored by Jaideep Sharma's avatar Jaideep Sharma
Browse files

hal: fix concurrent call-recordings with normal recordings .

if one recording is ongoing then currently second open_input_stream
takes uc for compress record.However, if this input is opened for
call recording then it changes the usecase in-between for
call recording leading to a state where inputs are configured
at c_in but not reset because of this in-between change of usecase.
for virtual sources like uplink, downlink, which actually don't record
form hardware input source,  don't assign a compress usecase.

Change-Id: I154446fe867af63f0f6e0cb0de6d4a567658050f
parent 5709e17e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -9301,7 +9301,11 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
                goto err_open;
            }
        }
        if (audio_extn_is_concurrent_capture_enabled()) {

        /* assign concurrent capture usecase if record has to caried out from
         * actual hardware input source */
        if (audio_extn_is_concurrent_capture_enabled() &&
            !audio_is_virtual_input_source(in->source)) {
            /* Acquire lock to avoid two concurrent use cases initialized to
               same pcm record use case */

+15 −0
Original line number Diff line number Diff line
@@ -796,6 +796,21 @@ static inline bool is_loopback_input_device(audio_devices_t device) {
        return false;
}

static inline bool audio_is_virtual_input_source(audio_source_t source) {
    bool result = false;
    switch(source) {
        case AUDIO_SOURCE_VOICE_UPLINK :
        case AUDIO_SOURCE_VOICE_DOWNLINK :
        case AUDIO_SOURCE_VOICE_CALL :
        case AUDIO_SOURCE_FM_TUNER :
            result = true;
            break;
        default:
            break;
    }
    return result;
}

int route_output_stream(struct stream_out *stream,
                        struct listnode *devices);
int route_input_stream(struct stream_in *stream,