Summary: | PulseAudio is crashing when connecting AD2P device | ||
---|---|---|---|
Product: | PulseAudio | Reporter: | mikefender |
Component: | modules | Assignee: | pulseaudio-bugs |
Status: | RESOLVED FIXED | QA Contact: | pulseaudio-bugs |
Severity: | normal | ||
Priority: | medium | CC: | anthony.louis.eden, dominik, lennart, rdieter, yousef.su.2000 |
Version: | unspecified | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 107071 | ||
Attachments: |
Debug level log.
Patched Pulseaudio debug level log |
Description
mikefender
2018-06-26 11:09:00 UTC
I managed to make it work by resetting the pair list on both devices and repairing. For some reason it seems that the issue may be related to Low Energy Bluetooth pairing not working fine. https://askubuntu.com/questions/833322/pair-bose-quietcomfort-35-with-ubuntu-over-bluetooth Also, I removed tlp as it seems to cause issues with the bluetooth adapter. The crash indicates a bug in PulseAudio, even if there were other things somehow broken when this happened. Here's what I found out from the stack trace: As the assertion error shows, u->thread is non-NULL when start_thread() is called, so we need to find out how that is possible. The crash happens in start_thread(), which is only called from set_profile_cb() and pa__init(), and we can ignore pa__init() because pa__init() can't be running when the native protocol calls pa_card_set_profile(). set_profile_cb() calls stop_thread() before calling start_thread(), and stop_thread() sets u->thread to NULL. Therefore, something must set u->thread back to non-NULL before the execution gets to the start_thread() call. That can only be done by set_profile_cb(), so apparently another card profile change was made while the original profile change was still ongoing. The init_profile() call that set_profile_cb() does between stop_thread() and start_thread() can cause some hooks to fire, and I suspect that some module is setting the profile in those hooks. The main candidates are module-bluetooth-policy and module-switch-on-port-available. module-bluetooth-policy probably isn't the culprit, because it only sets card profiles when new record streams appear or go away and when the bluetooth device is initially connected. module-switch-on-port-available seems like a plausible explanation, if the previous profile was "off" (if the previous profile was HSP, then module-switch-on-port-available shouldn't switch the profile, because that would make the source go away, and the module tries to avoid such actions). Can you try setting the headset profile to off and then back to a2dp? Does PulseAudio crash? (I can't try that myself, as I don't have a functional bluetooth setup.) Actually I tried again this evening and it seems that it's failing again, with the same error... I'll provide the full log with --log-level=debug. Let me know if you need more info. Created attachment 140371 [details]
Debug level log.
It looks like my theory about module-switch-on-port-connect meddling with the profile change process was right. I submitted a patch to the mailing list, can you test it? Here's the patch in patchwork: https://patchwork.freedesktop.org/patch/233880/ Link to the raw patch: https://patchwork.freedesktop.org/patch/233880/mbox/ Marking this as a 13.0 release blocker (although I suspect we'll release the fix already in 12.1). The patch seems to work properly. I can now switch from "off" to "ad2p_sink" profiles without crashing Pulseaudio. I'll attach a debug log for the patched Pulseaudio. Cheers. Created attachment 140391 [details]
Patched Pulseaudio debug level log
*** Bug 107081 has been marked as a duplicate of this bug. *** (In reply to Tanu Kaskinen from comment #5) > It looks like my theory about module-switch-on-port-connect meddling with > the profile change process was right. I submitted a patch to the mailing > list, can you test it? > > Here's the patch in patchwork: > https://patchwork.freedesktop.org/patch/233880/ > > Link to the raw patch: > https://patchwork.freedesktop.org/patch/233880/mbox/ This patch (included in Fedora package version 12.0-2.fc28) fixes the crash for me. Thanks to you and Rex. The fix is in master now. *** Bug 107134 has been marked as a duplicate of this bug. *** *** Bug 107228 has been marked as a duplicate of this bug. *** |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.