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

Skip to content
Commit ad4dfc3e authored by Aniket Kumar Lata's avatar Aniket Kumar Lata Committed by Eric Laurent
Browse files

hal: Update output device to speaker on USB disconnect

If USB device is disconnected and reconnected quickly and
music playback is started, there is a race condition where
sound device and audio route for USB are not being disabled
and reenabled. This results in no audio on USB.

Unplugging and replugging the USB device without disabling
USB sound device leaves the driver in a bad state.

AudioPolicyManager sends routing to speaker on a disconnect
which causes a device switch. USB sound device is disabled in
audio HAL and reference count is set to zero.

In failure scenario, audio HAL does not receive routing to
speaker. Policy manager sends routing to USB as the device is
now available. Since USB sound device is already active, it is
not reenabled.

Fix this problem by selecting speaker on receiving a USB device
disconnect. This results in a device switch as soon as USB is
disconnected and USB sound device is disabled.

Bug: 111315812
Test: repro steps in bug.
Change-Id: I7fb0813792ea95f9d47da96a57ab3b3895a47776
parent e9d64f9c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment