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

Commit 0ecfe3d8 authored by Haynes Mathew George's avatar Haynes Mathew George Committed by David Lin
Browse files

audio: Force select device whenever a stream on speaker_safe goes to standby

When speaker-safe device is enabled, all active usecases on
speaker will be re-routed to speaker-safe as we cannot have
co-existance of speaker and speaker-safe. However, the
outputs forced to speaker-safe are not moved back to speaker
when the output on speaker-safe finishes. Call select_devices
to force change to the previous devices, if required.

Bug: 64360927
Test: manual audio test
Change-Id: Icaa3b296088d789006e9eab4a73450aab94bfb1c
parent 2cfb8392
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1801,6 +1801,15 @@ static int stop_output_stream(struct stream_out *out)
    /* Must be called after removing the usecase from list */
    if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)
        check_and_set_hdmi_channels(adev, DEFAULT_HDMI_OUT_CHANNELS);
    else if (out->devices & AUDIO_DEVICE_OUT_SPEAKER_SAFE) {
        struct listnode *node;
        struct audio_usecase *usecase;
        list_for_each(node, &adev->usecase_list) {
            usecase = node_to_item(node, struct audio_usecase, list);
            if (usecase->devices & AUDIO_DEVICE_OUT_SPEAKER)
                select_devices(adev, usecase->id);
        }
    }

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