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

Skip to content
Commit f9f241e4 authored by Kevin Rocard's avatar Kevin Rocard
Browse files

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: default avatarKevin Rocard <krocard@google.com>
parent d9653bdb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment