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

Commit a158e86d authored by Aniket Kumar Lata's avatar Aniket Kumar Lata Committed by Eric Laurent
Browse files

hal: Start A2DP playback after fetching parameters for audio route

Start A2DP playback after all parameters have been fetched
successfully for enabling audio route.

Bug: 78773915
Test: music playback over A2DP
Change-Id: Ida1260fa592c03cb64092b672758bf529574392d
parent 7f137fbf
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -678,12 +678,6 @@ int enable_snd_device(struct audio_device *adev,

    audio_extn_dsm_feedback_enable(adev, snd_device, true);

    if (is_a2dp_device(snd_device) &&
        (audio_extn_a2dp_start_playback() < 0)) {
           ALOGE("%s: failed to configure A2DP control path", __func__);
           goto on_error;
    }

    if ((snd_device == SND_DEVICE_OUT_SPEAKER ||
        snd_device == SND_DEVICE_OUT_SPEAKER_SAFE ||
        snd_device == SND_DEVICE_OUT_SPEAKER_REVERSE ||
@@ -711,6 +705,13 @@ int enable_snd_device(struct audio_device *adev,
        }

        ALOGD("%s: snd_device(%d: %s)", __func__, snd_device, device_name);

        if (is_a2dp_device(snd_device) &&
            (audio_extn_a2dp_start_playback() < 0)) {
               ALOGE("%s: failed to configure A2DP control path", __func__);
               goto on_error;
        }

        audio_route_apply_and_update_path(adev->audio_route, device_name);
    }
on_success:
+1 −0
Original line number Diff line number Diff line
@@ -1893,6 +1893,7 @@ int platform_get_snd_device_name_extn(void *platform, snd_device_t snd_device,
        hw_info_append_hw_type(my_data->hw_info, snd_device, device_name);
    } else {
        strlcpy(device_name, "none", DEVICE_NAME_MAX_SIZE);
        return -EINVAL;
    }

    return 0;