mer-hybris / pulseaudio-modules-droid

multimedia-pulseaudio-modules-droid
GNU Lesser General Public License v2.1
16 stars 42 forks source link

Support for "audio patch" - when a devicePort connects to another devicePort #118

Open peat-psuwit opened 1 year ago

peat-psuwit commented 1 year ago

Devices such as Volla Phone 22 seems to have an audio policy config, in which routes do connect a devicePort to another devicePort e.g. from Voice Call In to Earpiece. This seems to make droid-util.c conclude that Internal data structures are confused, thus crashing itself [1].

This, however, seems to be something Android support. I see a method called supportsPatch() [2] which seems to check if 2 ports are connected in a route. This then is called by a method called createAudioPatchInternal() [3], which leads me to believe that this is called "audio patch".

I have a patch which currently just skip (with warning) any such route, but I'm not sure what are plan for developers here. Thus, this issue.

The device's audio_policy_configuration.xml is attached.

[1] https://github.com/mer-hybris/pulseaudio-modules-droid/blob/master/src/common/droid-util.c#L277 [2] https://cs.android.com/android/platform/superproject/+/master:frameworks/av/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp;l=242;drc=a9c339200bd4e6a81cacbaf63d59a9221de47dbb [3] https://cs.android.com/android/platform/superproject/+/master:frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp;l=4349;drc=a9c339200bd4e6a81cacbaf63d59a9221de47dbb

peat-psuwit commented 1 year ago

The patch I added to workaround this issue: https://gitlab.com/ubports/development/core/packaging/pulseaudio-modules-droid/-/merge_requests/3

piggz commented 1 year ago

This also affects the Volla X23 ping @jusa