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

Commit 104fdfd7 authored by Haynes Mathew George's avatar Haynes Mathew George Committed by Andy Hung
Browse files

audio: Fix realtime stream routing behavior

Update adm of pending routing event before handling
routing in audio_hw.

Test: Loopback App
Bug: 31770169
Bug: 32053844
CRs-Fixed: 1061281
Change-Id: Iea6f28a27c9c86406edad558b533ed4a5d9aff43
parent edf0b4c6
Loading
Loading
Loading
Loading
+10 −14
Original line number Diff line number Diff line
@@ -345,12 +345,6 @@ static void request_out_focus(struct stream_out *out, long ns)
{
    struct audio_device *adev = out->dev;

    if (out->routing_change) {
        out->routing_change = false;
        if (adev->adm_on_routing_change)
            adev->adm_on_routing_change(adev->adm_data, out->handle);
    }

    if (adev->adm_request_focus_v2) {
        adev->adm_request_focus_v2(adev->adm_data, out->handle, ns);
    } else if (adev->adm_request_focus) {
@@ -362,12 +356,6 @@ static void request_in_focus(struct stream_in *in, long ns)
{
    struct audio_device *adev = in->dev;

    if (in->routing_change) {
        in->routing_change = false;
        if (adev->adm_on_routing_change)
            adev->adm_on_routing_change(adev->adm_data, in->capture_handle);
    }

    if (adev->adm_request_focus_v2) {
        adev->adm_request_focus_v2(adev->adm_data, in->capture_handle, ns);
    } else if (adev->adm_request_focus) {
@@ -2039,7 +2027,11 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs)
            if (!out->standby) {
                if (!same_dev) {
                    ALOGV("update routing change");
                    out->routing_change = true;
                    // inform adm before actual routing to prevent glitches.
                    if (adev->adm_on_routing_change) {
                        adev->adm_on_routing_change(adev->adm_data,
                                                    out->handle);
                    }
                }
                select_devices(adev, out->usecase);
                audio_extn_tfa_98xx_update();
@@ -2791,7 +2783,11 @@ static int in_set_parameters(struct audio_stream *stream, const char *kvpairs)
            /* If recording is in progress, change the tx device to new device */
            if (!in->standby) {
                ALOGV("update input routing change");
                in->routing_change = true;
                // inform adm before actual routing to prevent glitches.
                if (adev->adm_on_routing_change) {
                    adev->adm_on_routing_change(adev->adm_data,
                                                in->capture_handle);
                }
                select_devices(adev, in->usecase);
            }
        }
+0 −2
Original line number Diff line number Diff line
@@ -204,7 +204,6 @@ struct stream_out {
    int send_new_metadata;
    bool realtime;
    int af_period_multiplier;
    bool routing_change;
    struct audio_device *dev;
    card_status_t card_status;

@@ -234,7 +233,6 @@ struct stream_in {
    bool is_st_session_active;
    bool realtime;
    int af_period_multiplier;
    bool routing_change;
    struct audio_device *dev;
    audio_format_t format;
    card_status_t card_status;