<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - PulseAudio crashes when remote device is unpaired during A2DP streaming"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89672#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - PulseAudio crashes when remote device is unpaired during A2DP streaming"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89672">bug 89672</a>
from <span class="vcard"><a class="email" href="mailto:rakesh.mk@samsung.com" title="Rakesh M K <rakesh.mk@samsung.com>"> <span class="fn">Rakesh M K</span></a>
</span></b>
<pre>In addition to the issue explained by Mr. Sagar, please find the root cause for
the issue.
//When remote headset is unpaired or disconnected, blueZ will call
"ClearConfiguration" Dbus method. Which will update the transport state to
disconnected.
16:19:35.027+0900 375 375 I PULSEAUDIO: [pulseaudio] bluez5-util.c: dbus:
path=/MediaEndpoint/A2DPSource, interface=org.bluez.MediaEndpoint1,
member=ClearConfiguration
16:19:35.027+0900 375 375 I PULSEAUDIO: [pulseaudio] bluez5-util.c:
Clearing transport /org/bluez/hci0/dev_00_18_09_24_68_25/fd0 profile a2dp_sink
//Due to which the STOP thread will be handled.
transport_state_changed_cb() -> pa_card_set_profile() -> set_profile_cb() ->
stop_thread().
//When Stop thread handling is in progress, rendering thread will post the
"BLUETOOTH_MESSAGE_IO_THREAD_FAILED" due to audio packet pa_write() fail.
thread_func() -> a2dp_process_render() -> goto fail; -> pa_asyncmsgq_post(with
IO thread fail).
16:19:35.032+0900 375 620 E PULSEAUDIO: [bluetooth] module-bluez5-device.c:
Failed to write data to socket: Broken pipe
16:19:35.032+0900 375 620 I PULSEAUDIO: [bluetooth] module-bluez5-device.c:
IO thread failed
//Since processing of message is done inside the stop_thread() which internally
calls the Stop_thread() one more time.
stop_thread() -> pa_thread_mq_done() -> pa_asyncmsgq_flush() ->
pa_asyncmsgq_dispatch() -> device_process_msg() for
BLUETOOTH_MESSAGE_IO_THREAD_FAILED -> pa_card_set_profile() -> set_profile_cb()
-> stop_thread().</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>