Workaround: Do not send command to a disconnected usb subsystem
After usb headset disconnection,
the audio policy receives two separate messages warning it of a
usb recoding device and usb playback device disconnection.
If the recording message is handled before the playback one,
the policy transiently switches from headset to headphone then speaker.
Thus temporally rerouting existing streams to a device that no longer exists.
This rerouting causes all usb commands and audio writes to freeze (for 2sec).
Delaying the subsequent routing to speaker by ~8sec.
If the unnecessary routing was to be removed this workaround might not
be necessary.
Taking the problem the other way around, an other fix would
be for the usb drivers to fail immediately if no
usb is present. This fix is targeted for the next release.
In the meantime, this commit patches the primary hal to intercept
routing requests towards a disconnected usb device
and immediately return an error.
Test: disconnect usb headset while playing video in Photo
Bug: 62815577
Change-Id: Ica8305db04f923a2120be7ec9944e99e64a9c75a
Signed-off-by:
Kevin Rocard <krocard@google.com>
Loading
Please register or sign in to comment