New pa_shared based API for calling HAL functions so that other modules
needing these functions don't need to link with libdroid.
[common] New API for calling HAL functions. JB#55832
When a profile doesn't have any supported channels, pa_conversion_parse_*_channels
returns false even though the parsing itself succeeded.
This in turn makes the parsing to be aborted altogether.
Handle this case by properly ignoring the profile.
This commit changes the pa_conversion_parse_*_channels functions so that
they return the channel count, or -1 if the parsing has been unsuccessful.
[common] Handle profiles with no supported channels
Signed-off-by: Eugenio Paolantonio (g7) <me@medesimo.eu>
Some adaptations don't check for NULL before using the address which
leads to a crash. Let's just use empty string for address.
[common] Fix segfault with adaptations which assume empty adress is not NULL. Fixes JB#55831
Use updated functions from common which utilize proplist when reconfiguring
input stream.
[source] Use source-output proplist when reconfiguring input stream. JB#55711
When reconfiguring input stream set custom audio source if one
is defined in droid.input.source property. Allowed values are
audio source fancy names listed in
string_conversion_table_audio_source_fancy.
[common] Allow custom audio source based on property. JB#55711
Set route to speaker before changing audio mode to AUDIO_MODE_IN_CALL.
Some devices don't get routing right if the route is something else
(like AUDIO_DEVICE_OUT_WIRED_HEADSET) before calling set_mode().
[common] Add quirk speaker_before_voice. JB#53992
Some devices don't like to receive set_parameters() call while they
are in write(), even if it seems the mutexes are correctly in place.
Standby is another synchronization point which seems to work better.
[common] Add quirk standby_set_route. JB#53992
Some adaptations need parameter BT_SCO set before enabling Bluetooth
HFP/HSP routes. It should be fine to set this parameter for adaptations
which don't need it as they would just ignore a parameter that is
unknown.
[common] Set BT_SCO parameter for Bluetooth routes. Fixes JB#53996
Calling pa_sink_set_write_volume_callback() from main
thread changes a callback pointer in pa_sink which is
accessed from io thread.
When audio is playing and voice call starts there is a
window where the callback is changed to NULL while io
thread is using it, causing a segfault.
[sink] Avoid segfault when voice call starts with deferred volume. JB#53687
In some cases silence prewrite needs to be done even if the target
device is already active. In this case new "/always" modifier can
be used to enable prewriting always. For example:
prewrite_on_resume=deep_buffer=AUDIO_DEVICE_OUT_SPEAKER:2/always
[sink] Add option to prewrite silence always. JB#53590
Make sure volume changes are applied in between writing to hardware
to avoid volume glitches. As the writing is blocking we cannot synchronize
the changes from main thread easily so better to apply the changes
when nothing is written.
[sink] Enable deferred volume for hw volume control. JB#53590
If there is a device which runs threaded audio calibration after hw
module open we need to wait for a while after opening the first output
stream.
Also when the calibration is already done and we are starting we again
need to wait for a while for the calibration loading to finish.
[common] Add quirk audio_cal_wait. JB#52328
Right now quirks can be used only after hw module is created.
In order to have quirks in the hw module loading phase as well
we need to have a mechanism to have quirk parsing earlier.
[common] Refactor quirks parsing. JB#52328