[meta-freescale] PulseAudio abort with BT/A2DP disconnect

Takashi Matsuzawa tmatsuzawa at uievolution.com
Sat Sep 3 17:17:10 PDT 2016


Hello, SABRE community.

I am trying bluetooth A2DP sink on SABRE-AI board, using Jethro-based BSP with some customization.
(As you know BT/Audio configuration for this is Bluez5 + PulseAudio 6.0, with the patches enabling PulseAudio to run as root).

It is working fine with very simple scenario (I can play music on Anroid/iPhone and I can hear them it clearly on USB-speaker connected to SABRE-AI).

The problem is, PA crashes when I disable Bluetooth while the music is still playing.
This prevent me from doing switching source between Phone1 and Phone2, or even just off/on BT connection so that switching between SABRE-AI speaker and phone speaker.

i) Play music on the Phone.
ii) pair and connect Phone w/ SABRE-AI using bluetoothctl command.
iii) After connection complets, the music starts to be heard on SABE-AI speaker.
iv) Now I unlink BT connection using bluetoothctl 'disconnect' command.
v) PA seems to be crashed (see PA log in the bottom).
vi) Musinc is no longer heard, and since PA does not restart automatically.
vii) I have to reboot SABRE-I to recover (though there may be better way to do so.)

I searched on google, and a few similar reports on PA were found, but so far I do not have patches, or information that solved my problem.

Once thing I have noticed is that if before iv) step above, if I do 'pacmd suspend', the crash does not happen.
(Perhaps this is related to the PA steaming task/activity that still exist when BT/A2DP is disconnected and shutdown.)

Any similar experience or workaround information is highly appreciated.
(As I can see w/ 'paced suspend', I feel I can workaround by manipulating PA before doing BT operation.  But I am not sure if this is the way PA is designed and to be operated.
Also, this does not work when BT is disconnected on the Phone side.)

PA log (you can see Assertion at the end):

====
...
D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.usb-Polycom_Inc._Polycom_Communicator_L81003099EF3-00-Communicator.analog-stereo becomes idle, timeout in 5 seconds.
D: [pulseaudio] core.c: Hmm, no streams around, trying to vacuum.
I: [pulseaudio] sink-input.c: Freeing input 0 "Loopback from iPod touch m00027"
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to remove event.
D: [bluetooth] module-bluez5-device.c: IO thread shutdown requested, stopping cleanly
D: [bluetooth] module-bluez5-device.c: Releasing transport /org/bluez/hci0/dev_00_61_71_E6_A2_F9/fd0
I: [bluetooth] bluez5-util.c: Transport /org/bluez/hci0/dev_00_61_71_E6_A2_F9/fd0 auto-released by BlueZ or already released
D: [bluetooth] module-bluez5-device.c: Audio stream torn down
D: [bluetooth] module-bluez5-device.c: IO thread shutting down
D: [pulseaudio] bluez5-util.c: Transport /org/bluez/hci0/dev_00_61_71_E6_A2_F9/fd0 state changed from disconnected to idle
D: [pulseaudio] card.c: Setting card bluez_card.00_61_71_E6_A2_F9 profile a2dp_source to availability status unknown
D: [pulseaudio] module-bluetooth-policy.c: Setting card 'bluez_card.00_61_71_E6_A2_F9' to profile 'off'
I: [pulseaudio] source.c: Freeing source 4 "bluez_source.00_61_71_E6_A2_F9"
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
I: [pulseaudio] card.c: Changed profile of card 3 "bluez_card.00_61_71_E6_A2_F9" to off
D: [pulseaudio] device-port.c: Setting port portable-input to status unknown
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
E: [pulseaudio] asyncmsgq.c: Assertion 'pa_atomic_load(&(a)->_ref) > 0' failed at /xxxx/cortexa9hf-vfp-neon-mx6qdl-poky-linux-gnueabi/pulseaudio/6.0-r0/pulseaudio-6.0/src/pulsecore/asyncmsgq.c:172, function pa_asyncmsgq_get(). Aborting.
====

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-freescale/attachments/20160904/5e26dd67/attachment.html>


More information about the meta-freescale mailing list