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

Commit 58c8a184 authored by Lei Pi's avatar Lei Pi Committed by Automerger Merge Worker
Browse files

hal: remove out_standby_l when usb headset is unplugged during playback of...

hal: remove out_standby_l when usb headset is unplugged during playback of compress-offload am: 9e85e402 am: c2510cab

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/qcom/audio/+/12628350

Change-Id: If972db65bbf33d132cb14b0ba4f8ed5fcaa68c3f
parents 9c63cee6 c2510cab
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -3002,16 +3002,8 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs)

        lock_output_stream(out);

        // The usb driver needs to be closed after usb device disconnection
        // otherwise audio is no longer played on the new usb devices.
        // By forcing the stream in standby, the usb stack refcount drops to 0
        // and the driver is closed.
        if (val == AUDIO_DEVICE_NONE &&
                audio_is_usb_out_device(out->devices)) {
            if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
                ALOGD("%s() putting the usb device in standby after disconnection", __func__);
                out_standby_l(&out->stream.common);
            }
            val = AUDIO_DEVICE_OUT_SPEAKER;
            forced_speaker_fallback = true;
        }