Recent Android devices start to provide headphone availability via input
device instead of h2w switch. This renders droid-extcon useless.
This commit introduce droid-extevdev, a simple code that will read
headphone availability from the input device, using libevdev as an
abstraction layer. This means the code now depends on libevdev (but it
can be made optional later on if needed).
This should make headphone availability works on newer Android devices
without having to resort to h2w kernel driver.
This applies changes from pulseaudio-packaging for detecting
headset & headphones via the h2w virtual switch file and udev.
Compared to pulseaudio-packaging this now forces udev as a requirement
rather than providing a compile-time switch.
Mode change is applied only after next set_parameters call with route
is made. Usually it's ok to switch to whatever route after mode switch
but some devices don't like it and we end up with silent audio. To work
around these devices always set earpiece as the initial route after
mode change. Correct route is then applied later when other parts of
the system decide what the route should be.
[common] Always set earpiece routing after enabling voice call mode. Fixes JB#47194
Virtual profiles don't have output or input mappings so calling park_profile()
for one is no-op. To correctly park the sink and source ports we need to call
park_profiles() for the last active real profile.
[card] Park profiles correctly when switching between virtual profiles. JB#47194
When the quirks are enabled everything works the same as before. Setting
them disabled will affect the behaviour.
[common] Add quirks for FAST and DEEP_BUFFER sinks. JB#48097
Refactor reconfiguring part a bit and add a workaround for fm-radio
loopback. As the loopback module is instantiated without defined sink
or source, it uses as default really silly values. But since our source
is reconfiguring itself to whatever is requested things get a bit
hairy. To ensure good values for the source in case of loopback module
connection use metrics from our primary output stream.
[source] Add a workaround for fm-radio loopback. JB#48080
With some adaptations audio_source_t does not have any effect when
opening the input stream. To ensure proper routing we need to set
input parameters immediately after opening the stream just in case.
We need to be more careful with input streams as due to dynamic
source reconfiguring it may be that bizarre combinations are requested.
Try to make sure that sane combination is actually requested when
opening the input stream.
Instead of needing to free the input stream completely to
reconfigure its metrics allow reconfiguring in-place. Rollback
to previous good values on failure.