pulseaudio crashes when connecting to bluetooth headphones (due to ubuntu changes?)

Bug #1574324 reported by ian_hawdon
256
This bug affects 46 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Fix Released
High
Luke Yelavich
Xenial
Fix Released
Undecided
Luke Yelavich
Yakkety
Fix Released
Undecided
Luke Yelavich

Bug Description

Impact:

A patch we carry for Ubuntu touch introduced a change that originally was required to make sure PulseAudio did not crash. This patch was ported to PulseAudio 8 in Xenial, but the patch author's bluetooth hardware that was to hand at the time worked so was assumed to be ok. However, the opposite is now happening, i.e PulseAudio is crashing with a subset of Bluetooth hardware.

Regression potential:

Very low to none. As can be read in this report, much debugging and testing has been done to find the problem, and the eventual fix. Moreover the change is the removal of a patch hunk that removed a line of code originally present in PulseAudio.

Test case:

NOTE that this test case applies to bluetooth hardware that is identified as not working in this bug report.

1. Install, or upgrade to Xenial or yakkety.
2. Pair your bluetooth device in the bluetooth settings in the relevant settings application for your desktop environment.
3. Once paired, you will notice that sound stops working, as pulseaudio has thrown an assertion error.
4. You do not have to remove your audio device from the paired device list, but it may be easier to do so for the next part of the testing.
5. Update to the version of PulseAudio in xenial-proposed which is 1:8.0-0ubuntu3.1, or in yakkety-proposed, which is 1:9.0-2ubuntu2.1.
6. Re-pair your device. Audio should continue to work, and you should be able to switch to your bluetooth device and use it.

Original bug report:

When I attempt to connect my Jaybird Bluebuds X to Ubuntu 16.04 pulseaudio crashes, this does *NOT* happen with a Jambox which leads me to believe it's an intermittent problem with some hardware. This did not happen on Ubuntu 15.10 (which was an upgrade of 15.04).

Ubuntu Release:

Description: Ubuntu 16.04 LTS
Release: 16.04

Pulseaudio Version:

pulseaudio:
  Installed: 1:8.0-0ubuntu3
  Candidate: 1:8.0-0ubuntu3
  Version table:
 *** 1:8.0-0ubuntu3 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

Device info:

[bluetooth]# info 44:5E:F3:B4:07:29
Device 44:5E:F3:B4:07:29
 Name: BlueBuds X
 Alias: BlueBuds X
 Class: 0x240404
 Icon: audio-card
 Paired: yes
 Trusted: yes
 Blocked: no
 Connected: no
 LegacyPairing: no
 UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
 UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
 UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
 UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
 UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)
 UUID: Unknown (000080ff-0000-1000-8000-00805f9b34fb)

I have also attached a debug dump of Pulseaudio when attempting to connect to the headphones.

Revision history for this message
ian_hawdon (ian-hawdon) wrote :
Revision history for this message
Blake Levine (penguindude2691) wrote :

I am having the same issue. Same headphones. Worked on 15.10. Broke after update.

Revision history for this message
Blake Levine (penguindude2691) wrote :

I did a clean install of 16.04. Still crashing with BlueBuds X. Working with another Bluetooth speaker.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Revision history for this message
ian_hawdon (ian-hawdon) wrote :

I can also confirm the issue remains when using a live USB of 16.04 on different hardware with the same headphones.

Revision history for this message
Blake Levine (penguindude2691) wrote :

I use this command in the terminal to check a little deeper as to what might be causing it. I attached my results.

cat /var/log/syslog* | grep -i pulse

Revision history for this message
ian_hawdon (ian-hawdon) wrote :

Can also confirm the issue is still present on the latest build of Ubuntu 16.10 with pulseaudio upgraded to version 1:8.0-2ubuntu1

ian_hawdon (ian-hawdon)
no longer affects: pulseaudio
Revision history for this message
Joakim Koed (vooze) wrote :
Revision history for this message
Joakim Koed (vooze) wrote :

Also just tested with arch, and it works just fine. So it has something to do with Ubuntu.

Revision history for this message
pcjason (jasonkrichard) wrote :

I believe that I may be encountering the same issue with my Plantronics BackBeat Go 2 (PLT_BBTGO2) bluetooth headphones. They connect and then disconnect about 1 to 2 seconds later. I am using a Broadcom BCM20702A0 bluetooth dongle.

Please let me know what info I can provide that would confirm that I am encountering the same problem, as well as what logs are required to help in debugging this.

Joakim Koed (vooze)
tags: added: yakkety
tags: added: xenial
Changed in pulseaudio (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Joakim Koed (vooze) wrote :

I just downgraded to 6.0 from wily in xenial, now bluetooth is perfect. Will hold those packages until this is resolved.

Revision history for this message
Sajan Parikh (sajanparikh) wrote :

Clean install of 16.04. Can successfully pair, connect, and play music through Amazon's Echo. However, Jaybird X can pair, and when it connects, it disconnects within 3 seconds.

With the Jaybird, it even notifies me with the successful connection, but disconnects a couple seconds later.

Revision history for this message
Joakim Koed (vooze) wrote :

Sajan: Yeah, same here: all other devices just fine. I suspect it's a bug in 8.0. When I get home in a few days, I will test 9.0 from yakkety to see if that works. At the time I downgraded to 6.0 from wily, yekkety were still on 8.0 (same version as xenial) but we will see if 9.0 is better. If it is, I will post a short guide to upgrade it :)

Revision history for this message
Joakim Koed (vooze) wrote :

pulseaudio 1:9.0-1.1ubuntu1 from yakkety is affected as well... Only 6.0 from wily works :(

Revision history for this message
Joakim Koed (vooze) wrote :

Okay guys and girls.. I have the solution...

The problem is all the ubuntu-touch patches applied to pulseaudio.. So What I did what download pulseaudio8 from ubuntu archives and build it without those patches..

The ones marked with # are not applied. It now works perfectly... I don't have the patience, to try to patch all the rest one by one, to see which one is affected, but you can certain it have something to do with those patches..

# Ubuntu/Debian specific config/fixes
0001-volume-config-changes.patch
0005-dont-load-cork-music-on-phone.patch
0006-load-module-x11-bell.patch
0016-nodisplay-autostart.patch
0022-inotify-wrapper-Quit-daemon-if-pid-file-is-removed.patch
0024-alsa-mixer-Quick-workaround-for-potential-index-out-.patch

# Cherry-picked from upstream
0100-switch-on-port-available-Switch-from-HDMI-to-analog-.patch

# Ubuntu touch stuff
#0202-dont-probe-ucm.patch
#0203-card-Add-hook-before-profile-changes.patch
#0206-module-bluetooth-discover-adding-module-option-profi.patch
#0207-Enable-pulseaudio-droid.patch
#0208-module-bluetooth-device-Allow-leaving-transport-runn.patch
#0209-module-switch-on-connect-adding-parameter-to-allow-s.patch
#0210-module-device-restore-adding-property-to-skip.patch
#0211-corking-a-sink-input-stream-when-stalled.patch

# Ubuntu touch: support for trust-store
#0406-tagstruct-add-copy-method.patch
#0407-access-Add-access-control-hooks.patch
#0408-protocol-native-add-access-checks.patch
#0409-Trust-store-patch.patch
#0410-Add-thread-to-activate-trust-store-interface.patch
#0417-increase-timeout-check-apparmor.patch

# Ubuntu touch: enable bluez5 HFP over ofono support
#0501-bluetooth-bluez5-ofono-add-support-for-HFP-gateway-r.patch
#0502-bluetooth-bluez5-bring-back-SCO-over-PCM-support.patch
#0503-bluetooth-bluez5-ofono-add-support-for-spekaer-micro.patch
#0504-bluetooth-bluez5-add-support-for-both-mode.patch
#0505-bluetooth-bluez5-let-user-specify-a-default-profile-.patch
#0506-bluetooth-bluez5-prevent-SCO-sink-source-to-be-suspe.patch
#0507-bluetooth-bluez5-drop-save-restore-of-SCO-sink-sourc.patch
#0508-bluetooth-bluez5-add-guards-to-prevent-HFP-and-HSP-c.patch
#0509-bluetooth-bluez5-don-t-reactivate-default-profile-wh.patch
#0510-Further-fixes-for-HFP-A2DP-with-BlueZ-5.x.patch

# Ubuntu touch: add support for Android 5.x
#0600-droid-sync-with-upstream-for-Android-5-support-and-b.patch
#0601-droid-alternative-hw-module-id.patch
#0602-droid-inputstream-config-parameters.pach
#0603-droid-port-priority-and-availability.patch

I also had to delete some droid + store .install files for it to build.

Now the rest is up to ubuntu-devs to figure out what patch is broken. I have done all I can for a non-dev.. Hope this helps some people... If you want my .debs files feel free to ask. I'm not sure if it's okay to post links to such things..

Revision history for this message
Sebastien Bacher (seb128) wrote :

Luke, could you have a look to this one?

Changed in pulseaudio (Ubuntu):
assignee: nobody → Luke Yelavich (themuso)
importance: Medium → High
tags: added: rls-x-incoming
summary: - pulseaudio crashes when connecting to bluetooth headphones
+ pulseaudio crashes when connecting to bluetooth headphones (due to
+ ubuntu changes?)
Revision history for this message
Will Cooke (willcooke) wrote : Automatically added comment
tags: added: desktop-trello-import
tags: removed: desktop-trello-import
Luke Yelavich (themuso)
Changed in pulseaudio (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 1574324] Re: pulseaudio crashes when connecting to bluetooth headphones (due to ubuntu changes?)

Ok, an update. I can reproduce this in a way. My bluetooth earbuds seem to work after the first pairing, and then after subsequent restart/login, they may show up, but when selected don't work, and sometimes they don't even show up at all, this is on yakkety.

I think the problem I'm experiencing is related somehow, but things may be different since I am on pulse 9 in yakkety. I'll try and reproduce in xenial as well again, but I otherwise still have something to work on fixing.

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, false alarm. It wasn't showing up because it doesn't seem to reconnect automatically if I leave the headset on during a relog/reboot. After using bluetoothctl to reconnect the headset, pulse seems to work perfectly every time, so I am unable to reproduce the problem.

Given the original reporter's bluetoothctl info, I notice only one difference between my headset and the one in the report, and that is an unknown UUID. Here is mine for reference:

Device 00:19:7F:69:B0:7D
 Name: 8XXPlantronics
 Alias: 8XXPlantronics
 Class: 0x240404
 Icon: audio-card
 Paired: yes
 Trusted: yes
 Blocked: no
 Connected: yes
 LegacyPairing: no
 UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
 UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
 UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
 UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
 UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
 UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb

If people who are experiencing this problem could use a working pulseaudio to obtain info about their bluetooth devices via the pacmd list-cards command, that would be useful.

Thanks.

Revision history for this message
Joakim Koed (vooze) wrote :

Sure. It works now (for me) using the method I mentioned.

 name: <bluez_card.44_5E_F3_B5_64_94>
 driver: <module-bluez5-device.c>
 owner module: 26
 properties:
  device.description = "Jaybird X2"
  device.string = "44:5E:F3:B5:64:94"
  device.api = "bluez"
  device.class = "sound"
  device.bus = "bluetooth"
  device.form_factor = "headset"
  bluez.path = "/org/bluez/hci0/dev_44_5E_F3_B5_64_94"
  bluez.class = "0x240404"
  bluez.alias = "Jaybird X2"
  device.icon_name = "audio-headset-bluetooth"
  device.intended_roles = "phone"
 profiles:
  headset_head_unit: Headset Head Unit (HSP/HFP) (priority 20, available: unknown)
  a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 10, available: unknown)
  off: Off (priority 0, available: yes)
 active profile: <headset_head_unit>
 sinks:
  bluez_sink.44_5E_F3_B5_64_94/#2: Jaybird X2
 sources:
  bluez_sink.44_5E_F3_B5_64_94.monitor/#3: Monitor of Jaybird X2
  bluez_source.44_5E_F3_B5_64_94/#4: Jaybird X2
 ports:
  headset-output: Headset (priority 0, latency offset 0 usec, available: unknown)
   properties:

  headset-input: Headset (priority 0, latency offset 0 usec, available: unknown)
   properties:

Hope this helps :)

Revision history for this message
Luke Yelavich (themuso) wrote :

Sorry for taking so long to get back. Unfortunately without hardware that exhibits this behavior, I don't feel I can easily work out what is going on.

If someone is willing to test pulseaudio packages one at a time as I disable and progressively enable ubuntu-touch patches to find the culpret, it would be much appreciated. If you wish to do so, please make sure you have a known working set of uplseaudio packages on your system so you can re-install them after testing so you have a working system again.

Revision history for this message
Joakim Koed (vooze) wrote :

Hey Luke

I'll be glad to help you :)

You can contact me here, email or IRC or whatever you prefer.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Could somebody maybe get a backtrace of the segfault? (https://wiki.ubuntu.com/DebuggingProgramCrash)

Revision history for this message
Luke Yelavich (themuso) wrote :

From the log I saw from the original reporter, there was no crash, it was an assertion error, and pulse just shut down.

Revision history for this message
Sebastien Bacher (seb128) wrote :

it might still be possible to get a stacktrace to get an idea of what code is involved?

Revision history for this message
Joakim Koed (vooze) wrote :

Luke: I have not heard from you. Are you still interested in helping with test?

Revision history for this message
Luke Yelavich (themuso) wrote :

I am terribly sorry, been busy with other things. I will reply again to this bug when I have the first package for you to test. Please let me know whether you prefer Xenial or yakkety for doing the testing.

Thanks

Luke

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok. I have uploaded the first debug package to my personal package archive. You can find how to set it up at https://launchpad.net/~themuso/+archive/ppa. As we go along, you will not need to re-add this PPA, and you will be able to upgrade from one package to another.

The first one for xenial is available there now, and should be built shortly. Please report back as to whether things are ok with this version.

For those following along, I am basically commenting out all bluez5/ofono patches except for the first, and will graduilally re-enable as we go, since I think that is where the problem is.

Revision history for this message
Joakim Koed (vooze) wrote :

Hey Luke, Xenial is just fine :)

I just tested it, and it works perfectly. So it seems you are correct about bluez5/ofono.

Feel free to upload another test if you wanna figure out which patch exactly.

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, another package is on its way with another patch enabled.

Revision history for this message
Yura Nosenko (yuranos87) wrote :

I can confirm the same issue on Ubuntu 16.04/4.4.0-31-generic with Jaybird X2. It connects and then disconnects immediately.

Revision history for this message
Joakim Koed (vooze) wrote :

Luke: The build seemed to have failed. Can't test :/

Revision history for this message
Yura Nosenko (yuranos87) wrote :

I can help to test with my configuration but I'm relatively new to Ubuntu. Will probably need some help.

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok sorry for the delay, I was off last week and was not regularly checking mail.

I have uploaded a fixed package, which appears to have been built.

Revision history for this message
Joakim Koed (vooze) wrote :

Hey luke.

With these patches, I can connect it, but A2DP is not working, only HFS/HFP, which sound terrible and its only mono.

Revision history for this message
Eyal Zekaria (eyal-ez) wrote :

BTW Joakim, installing your patched .deb worked well for A2DP, but it broke other stuff for me (mainly skype). I had to re-install libpulse0:i386 in order to fix it, according to:
http://askubuntu.com/questions/506259/skype-shows-virtual-device-for-microphone-speakers-and-ringing

It also remove a bunch of packages which I had to re-install due to version mismatching...

Revision history for this message
Joakim Koed (vooze) wrote :

Eyal: thats because you need 32bit pulseaudio for skype. Write me an email and I will build those for you :)

Revision history for this message
Joakim Koed (vooze) wrote :

Eyal: I found your email and sent 32bit debs to you.

Revision history for this message
Luke Yelavich (themuso) wrote :

Hi Joakim.
What we will do for now is contiue to the point where it crashes, and then we can address the issue you pointed out here.

Next one is just uploaded and all being well should be available soon.

Revision history for this message
Joakim Koed (vooze) wrote :

Hi Luke

just upgraded and now it's crashing.

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, could you again get a log from PulseAudio as per https://wiki.ubuntu.com/PulseAudio/Log.

Thanks.

Revision history for this message
Joakim Koed (vooze) wrote :

Hey Luke, sorry for the delay, was at school :)

See attachment.

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok thanks, pretty much the same failure as the original log shows.

So, for my and others record, the patch that makes things fail for you is 0503-bluetooth-bluez5-ofono-add-support-for-spekaer-micro.patch. The patch that reduces quality and makes A2DP unusuable is probably 0502-bluetooth-bluez5-bring-back-SCO-over-PCM-support.patch.

Ill start looking at these tomorrow. I'll first see about fixing the assertion error, then look into why A2DP is not working properly. Based on what I find, I'll reply again once I think I have a fix for you to test.

Thanks again for your help.

Brad Larson (bklarson)
description: updated
Revision history for this message
pcjason (jasonkrichard) wrote :

Hello,
I am just chiming in to confirm that rebuilding the PulseAudio package without the 05XX and 06XX series of patches included resolves this issue on my Plantronics BackBeat Go 2 (PLT_BBTGO2) bluetooth headphones. If there is anything that I can do to help debug the issue, please let me know.

-Jason

Revision history for this message
sven-ola (sven-ola) wrote :

To second #44: recompile pulseaudio without 05xx patches brings back may A2DP. I still need to disconnect/reconnect in BlueMan, but at least it plays sound now.

Note1: does not compile without 06xx patches.

Note2: before that I have the "[pulseaudio] bluez5-util.c: Transport TryAcquire() failed for transport /org/bluez/hci0/dev_00_18_09_21_36_F0/fd1 (Operation Not Authorized)" message in my syslog. Now this message has vanished.

Revision history for this message
Daniel (djtecha) wrote :

Just installed the patch and still experiencing the 3 second disconnect with jaybird headphones. I am on tryin it on the 4.7 Kernel so that might be adding insult to injury here. But here our my syslogs:

Sep 10 14:06:02 lick pulseaudio[6209]: [pulseaudio] backend-native.c: connect(): Connection refused
Sep 10 14:06:02 lick pulseaudio[6209]: [pulseaudio] volume.c: Assertion 'pa_channels_valid(channels)' failed at pulse/volume.c:74, function pa_cvolume_set(). Aborting.
Sep 10 14:06:02 lick bluetoothd[3173]: Endpoint unregistered: sender=:1.119 path=/MediaEndpoint/A2DPSource
Sep 10 14:06:02 lick bluetoothd[3173]: Endpoint unregistered: sender=:1.119 path=/MediaEndpoint/A2DPSink
Sep 10 14:06:02 lick bluetoothd[3173]: Unable to select SEP
Sep 10 14:06:04 lick pulseaudio[6263]: [pulseaudio] main.c: User-configured server at {4eec44de592e47e2a2b6adc10835a907}unix:/run/user/1000/pulse/native, which appears to be local. Probing deeper.
Sep 10 14:06:04 lick rtkit-daemon[3600]: Successfully made thread 6266 of process 6266 (n/a) owned by '1000' high priority at nice level -11.
Sep 10 14:06:04 lick rtkit-daemon[3600]: Supervising 1 threads of 1 processes of 1 users.
Sep 10 14:06:04 lick pulseaudio[6266]: [pulseaudio] pid.c: Stale PID file, overwriting.
Sep 10 14:06:04 lick rtkit-daemon[3600]: Supervising 1 threads of 1 processes of 1 users.
Sep 10 14:06:04 lick rtkit-daemon[3600]: Successfully made thread 6267 of process 6266 (n/a) owned by '1000' RT at priority 5.
Sep 10 14:06:04 lick rtkit-daemon[3600]: Supervising 2 threads of 1 processes of 1 users.
Sep 10 14:06:04 lick rtkit-daemon[3600]: Supervising 2 threads of 1 processes of 1 users.
Sep 10 14:06:04 lick rtkit-daemon[3600]: Successfully made thread 6268 of process 6266 (n/a) owned by '1000' RT at priority 5.
Sep 10 14:06:04 lick rtkit-daemon[3600]: Supervising 3 threads of 1 processes of 1 users.
Sep 10 14:06:04 lick bluetoothd[3173]: Endpoint registered: sender=:1.123 path=/MediaEndpoint/A2DPSource
Sep 10 14:06:04 lick bluetoothd[3173]: Endpoint registered: sender=:1.123 path=/MediaEndpoint/A2DPSink

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok folks, I am unable to go any further on this, mostly because I don't have hardware that I can reproduce this problem with, so I can't experiment with the code, since I don't yet understand it well
enough.

Simon, could you please take a look when you have a moment? Seems the Bluez 5 patches, i.e 05xx are causing an assersion failure on Pulse in 16.04, and commenting them out and rebuilding the package works
for the folks affected in this bug.

Thanks in advance.

Changed in pulseaudio (Ubuntu):
assignee: Luke Yelavich (themuso) → Simon Fels (morphis)
Revision history for this message
Joakim Koed (vooze) wrote :

Why not just NOT use these patches? Are they so really important? :) Everything seems to work perfectly without them with all my BT-devices.

Revision history for this message
Scott Garman (sgarman) wrote :

Just to chime in as well, I've been using the PA packages that Joakim rebuilt without that patch set, and as an end-user it's totally resolved this bug on my laptop and desktop. If we can't move forward with The Right Way (TM) to fix this, perhaps someone could create a PPA with these packages in the meantime?

Revision history for this message
Joakim Koed (vooze) wrote :

Scott: Good idea. I will look into that this weekend and see if I can figure it out :)

Revision history for this message
Yura Nosenko (yuranos87) wrote :

Hi, guys! I was also trying to apply the packages from Joakim. By the way, he was really helpful with giving some advice and providing both i386 and amd64 packs. Thanks!
However, I am still failing to connect my Jaybird X2. They are disconnected a couple of second after the connection.
My pulseaudio packages are as follows:
yuranos@yuranos-XPS-15-9550:~$ dpkg -l | grep -e 'pulseaudio' -e 'libpulse'
ii gstreamer1.0-pulseaudio:amd64 1.8.2-1ubuntu0.1 amd64 GStreamer plugin for PulseAudio
ii libpulse-mainloop-glib0:amd64 1:8.0-0ubuntu3-vooze amd64 PulseAudio client libraries (glib support)
ii libpulse0:amd64 1:8.0-0ubuntu3-vooze amd64 PulseAudio client libraries
ii libpulse0:i386 1:8.0-0ubuntu3-vooze i386 PulseAudio client libraries
ii libpulsedsp:amd64 1:8.0-0ubuntu3-vooze amd64 PulseAudio OSS pre-load library
ii pulseaudio 1:8.0-0ubuntu3-vooze amd64 PulseAudio sound server
ii pulseaudio-module-bluetooth 1:8.0-0ubuntu3-vooze amd64 Bluetooth module for PulseAudio sound server
ii pulseaudio-module-x11 1:8.0-0ubuntu3-vooze amd64 X11 module for PulseAudio sound server
ii pulseaudio-utils 1:8.0-0ubuntu3-vooze amd64 Command line tools for the PulseAudio sound server

Any thoughts? Am I missing something or is there some other issue that is not fixed by the patch?

Revision history for this message
Joakim Koed (vooze) wrote :

Yura: Just to be sure, did you remove the headset from BT-menu and add it again? Does pulseaudio still crash for you like with the original packages?

Revision history for this message
Yura Nosenko (yuranos87) wrote :

Joakim, sure I removed and re-paired the device. I also tried it with 2 identical devices and the issue is reproducible for both of them.
My syslog: bluetoothd[3172]: a2dp-sink profile connect failed for 44:5E:F3:BD:87:41: Protocol not available
That can probably happen in pulseaudio-module-bluetooth absence, but it's not the case.

Revision history for this message
Joakim Koed (vooze) wrote :

Yura, could you try to install all my packages again? Maybe you are missing something?

Remember to run: sudo dpkg -i *.deb in the folder you extracted them in.

You could apt search for all these, to make sure you have installed them all:

libpulse0_8.0-0ubuntu3-vooze_amd64.deb
libpulsedsp_8.0-0ubuntu3-vooze_amd64.deb
libpulse-mainloop-glib0_8.0-0ubuntu3-vooze_amd64.deb
pulseaudio_8.0-0ubuntu3-vooze_amd64.deb
pulseaudio-module-bluetooth_8.0-0ubuntu3-vooze_amd64.deb
pulseaudio-module-x11_8.0-0ubuntu3-vooze_amd64.deb
pulseaudio-utils_8.0-0ubuntu3-vooze_amd64.deb

I'm not sure 100% exactly which 32bits you will need, maybe someone with skype or something can check that :)

Revision history for this message
Joakim Koed (vooze) wrote :

Btw. maybe Eyal Zekaria can help you? I think he solved it with my patches and skype.

Revision history for this message
Yura Nosenko (yuranos87) wrote :

Joakim, I listed everything I have installed 2 messages back. All your 7 debs seems to be included. Plus 32bit libpulse. I can try to reinstall them today.

Revision history for this message
Joakim Koed (vooze) wrote :

Okay guys.. I made a PPA for you, never done it before, kind of happy I could do it :D

https://launchpad.net/~vooze/+archive/ubuntu/pulseaudio-fix - Still building, should be ready soon.

Revision history for this message
Joakim Koed (vooze) wrote :

Try the new PPA.

https://launchpad.net/~vooze/+archive/ubuntu/pulseaudio-fix

Regards

Joakim Koed
<email address hidden>
+45 42800042

Tjelevej 32, 7.th
8240 Risskov
Denmark

On 15 September 2016 at 17:46, Yura Nosenko <email address hidden> wrote:

> Joakim, I listed everything I have installed 2 messages back. All your 7
> debs seems to be included. Plus 32bit libpulse. I can try to reinstall
> them today.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1574324
>
> Title:
> pulseaudio crashes when connecting to bluetooth headphones (due to
> ubuntu changes?)
>
> Status in pulseaudio package in Ubuntu:
> In Progress
>
> Bug description:
> When I attempt to connect my Jaybird Bluebuds X to Ubuntu 16.04
> pulseaudio crashes, this does *NOT* happen with a Jambox which leads
> me to believe it's an intermittent problem with some hardware. This
> did not happen on Ubuntu 15.10 (which was an upgrade of 15.04).
>
> Ubuntu Release:
>
> Description: Ubuntu 16.04 LTS
> Release: 16.04
>
> Pulseaudio Version:
>
> pulseaudio:
> Installed: 1:8.0-0ubuntu3
> Candidate: 1:8.0-0ubuntu3
> Version table:
> *** 1:8.0-0ubuntu3 500
> 500 http://gb.archive.ubuntu.com/ubuntu xenial/main amd64
> Packages
> 100 /var/lib/dpkg/status
>
> Device info:
>
> [bluetooth]# info 44:5E:F3:B4:07:29
> Device 44:5E:F3:B4:07:29
> Name: BlueBuds X
> Alias: BlueBuds X
> Class: 0x240404
> Icon: audio-card
> Paired: yes
> Trusted: yes
> Blocked: no
> Connected: no
> LegacyPairing: no
> UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
> UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
> UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
> UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
> UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)
> UUID: Unknown (000080ff-0000-1000-8000-00805f9b34fb)
>
> I have also attached a debug dump of Pulseaudio when attempting to
> connect to the headphones.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+
> bug/1574324/+subscriptions
>

Revision history for this message
Patrick Pedersen (pat9) wrote :

Thx Joakim for beeing a exemplary person for the comunity! And of course Luke and Simon who are doing there best to permanently fix this bug :)

Revision history for this message
Joakim Koed (vooze) wrote :

You are very welcome Patrick. Hope you can figure out how to install it :) (you said you were new to Linux) make sure to reboot after updating the packages, to make sure everything is working.

Revision history for this message
Yura Nosenko (yuranos87) wrote :
Download full text (5.3 KiB)

Guys, I have tried to install Joakim's debs in the past but it didn't work for me. I wanted to uninstall/purge the old once I installed and try it one more time from scratch using a new PPA.
Since I relatively new to Ubuntu, can you recommend on how to properly do that without compromising the whole OS?
sudo apt-get purge "all 7 packages one by one"
Is this the preferred way? Since it's apt-get it will remove a lot of dependent packages. Is it safe to do? Will the PPA install them back if required?
Can I purge all 7 packages with one command?
Example of apt-get purge:
yuranos@yuranos-XPS-15-9550:~$ sudo apt-get purge libpulse0
[sudo] password for yuranos:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  account-plugin-tools accountsservice-ubuntu-schemas dbus-property-service
  dleyna-server espeak-data ethtool fonts-droid-fallback fonts-noto-mono
  gnome-control-center-data gnome-icon-theme-symbolic gnome-online-accounts
  iio-sensor-proxy indicator-network libandroid-properties1 libao-common
  libao4 libboost-log1.58.0 libboost-regex1.58.0 libboost-thread1.58.0
  libc-ares2 libcolord-gtk1 libconnectivity-qt1 libcontent-hub0 libdbus-cpp5
  libdleyna-connector-dbus-1.0-1 libdleyna-core-1.0-3 libdotconf0 libgflags2v5
  libgoa-backend-1.0-1 libgoogle-glog0v5 libgssdp-1.0-3 libgupnp-1.0-4
  libgupnp-av-1.0-2 libgupnp-dlna-2.0-3 libhardware2 libhud2 libhybris
  libhybris-common1 libhybris-utils liblibertine1 liblttng-ust-ctl2
  liblttng-ust0 libmedia1 libonline-accounts-client1
  libonline-accounts-daemon1 libonline-accounts-qt1 libpkcs11-helper1
  libprocess-cpp3 libqmenumodel0 libqofono-qt5-0 libqt5organizer5
  libqt5positioning5 libqt5quicktest5 libqt5systeminfo5 libqt5test5
  libqt5xmlpatterns5 libsonic0 libspeechd2 libsystemsettings1 libtrust-store2
  libubuntu-app-launch2 libubuntu-download-manager-client1
  libubuntu-download-manager-common1 libubuntugestures5-gles
  libubuntuoneauth-2.0-0 libubuntutoolkit5-gles libudm-common1
  libunity-action-qt1 liburcu4 libx86-1 network-manager-openvpn ofono openvpn
  plainbox-provider-checkbox plainbox-provider-resource-generic
  plainbox-secure-policy pm-utils pyotherside python3-brlapi
  python3-checkbox-support python3-gnupg python3-guacamole python3-jinja2
  python3-louis python3-padme python3-plainbox python3-pyatspi
  python3-pyparsing python3-speechd python3-xlsxwriter qmenumodel-qml
  qml-module-io-thp-pyotherside qml-module-qt-labs-folderlistmodel
  qml-module-qt-labs-settings qml-module-qtgraphicaleffects
  qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2
  qml-module-qtsysteminfo qml-module-qttest qml-module-qtwebkit
  qml-module-ubuntu-connectivity qml-module-ubuntu-layouts
  qml-module-ubuntu-onlineaccounts qml-module-ubuntu-onlineaccounts2
  qml-module-ubuntu-performancemetrics qmlscene qtdeclarative5-accounts-plugin
  qtdeclarative5-dev-tools qtdeclarative5-gsettings1.0 qtdeclarative5-ofono0.2
  qtdeclarative5-qtquick2-plugin qtdeclarative5-test-plugin
  qtdeclarative5-ubuntu-content1 qtdeclarative5-unity-action-plugin realmd
  sqlite...

Read more...

Revision history for this message
Joakim Koed (vooze) wrote :

Just add the PPA, it should replace all your old packages after update & upgrade.

Revision history for this message
Yura Nosenko (yuranos87) wrote :
Download full text (7.0 KiB)

Ok, I added the PPA and undated/upgraded.

yuranos@yuranos-XPS-15-9550:~$ sudo add-apt-repository ppa:vooze/pulseaudio-fix
[sudo] password for yuranos:
 This PPA is meant to fix this: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1574324
 More info: https://launchpad.net/~vooze/+archive/ubuntu/pulseaudio-fix
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmp21agbal2/secring.gpg' created
gpg: keyring `/tmp/tmp21agbal2/pubring.gpg' created
gpg: requesting key FB9F376A from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp21agbal2/trustdb.gpg: trustdb created
gpg: key FB9F376A: public key "Launchpad PPA for Joakim Koed" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
yuranos@yuranos-XPS-15-9550:~$ sudo apt-get update && upgrade
Ign:1 http://linux.dropbox.com/ubuntu wily InRelease
Get:2 http://linux.dropbox.com/ubuntu wily Release [6,596 B]
Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:4 http://dl.google.com/linux/chrome/deb stable Release
Hit:5 http://archive.canonical.com/ubuntu xenial InRelease
Hit:7 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:8 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu xenial InRelease
Hit:9 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:11 http://ppa.launchpad.net/vooze/pulseaudio-fix/ubuntu xenial InRelease [18.1 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]
Get:13 http://ppa.launchpad.net/vooze/pulseaudio-fix/ubuntu xenial/main amd64 Packages [3,364 B]
Get:14 http://ppa.launchpad.net/vooze/pulseaudio-fix/ubuntu xenial/main i386 Packages [3,352 B]
Get:15 http://ppa.launchpad.net/vooze/pulseaudio-fix/ubuntu xenial/main Translation-en [2,220 B]
Hit:16 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:17 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [326 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [323 kB]
Fetched 778 kB in 2s (378 kB/s)
Reading package lists... Done
upgrade: command not found
yuranos@yuranos-XPS-15-9550:~$ sudo apt-get update
Ign:1 http://linux.dropbox.com/ubuntu wily InRelease
Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease
Get:3 http://linux.dropbox.com/ubuntu wily Release [6,596 B]
Hit:4 http://archive.canonical.com/ubuntu xenial InRelease
Hit:5 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:6 http://dl.google.com/linux/chrome/deb stable Release
Hit:7 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu xenial InRelease
Hit:8 http://ppa.launchpad.net/vooze/pulseaudio-fix/ubuntu xenial InRelease
Hit:9 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Hit:11 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:13 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
Fetched 6,596 B in 0s (9,216 B/s)
Reading package lists... Done
yuranos@yuranos-XPS-...

Read more...

Revision history for this message
Joakim Koed (vooze) wrote :

Yura: I'm so sorry, I have no idea how to fix it then :( It seems to work for everyone else. Maybe try to reinstall?

Revision history for this message
Luke Yelavich (themuso) wrote :

Yura, I suspect you have a different problem.

Looking back on your comments, you say that you try and connect your device, but then it disconnects immediately. Does pulseaudio crash/stop working entirely at that point?

Revision history for this message
Jeff (jdferron) wrote :

Joakim,

Thank you for creating the PPA and making the fixes. This worked on GalliumOS (ubuntu base).

Revision history for this message
Felipe Lemos (felipelemos) wrote :

I added the PPA and upgraded, but I am still getting this error:
"pulseaudio[1800]: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink: Not connected"
when I have tried to change from HSP to A2DP.

Revision history for this message
Joakim Koed (vooze) wrote :

Felipe: have you tried reboot and remove and add the device again?

Revision history for this message
Felipe Lemos (felipelemos) wrote :

Joakim, I think my problem is related to gdm. Additionally to your packages I needed to apply this fix: https://askubuntu.com/questions/689281/pulseaudio-can-not-load-bluetooth-module-15-10-16-04

Now everything is working nicely, thanks!

Revision history for this message
Joakim Koed (vooze) wrote :

I see. It seems to work just fine for lightdm. Glad you figured it out though. And you are very welcome.

Revision history for this message
Yura Nosenko (yuranos87) wrote :

Luke, based on a comment from Sajan:
"Jaybird X can pair, and when it connects, it disconnects within 3 seconds.
With the Jaybird, it even notifies me with the successful connection, but disconnects a couple seconds later."
I have an exact same issue.
Joakim confirmed that the behaviour was similar for him.
My syslog says:
bluetoothd[1034]: message repeated 6 times: [ a2dp-sink profile connect failed for 44:5E:F3:C2:C7:8C: Protocol not available]
Do you think it's a different issue? Should I report it separate.

Revision history for this message
Joakim Koed (vooze) wrote :

I think Sajas problem was before the "patch"

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok sounds like it could certainly be the same or very similar.

As to moving forward with this, the various Ubuntu touch patches are needed to support various hardware that is used on Ubuntu phones.

I am also getting hold of similar hardware and will be looking into this again once it arrives.

Revision history for this message
draco (draco31-fr) wrote :

I have the same issue with my Aventree Audition bluetooth headphone.

After multiple trial and errors, it sounds like unloading both module-bluetooth-policy and module-bluetooth-discover, then reloading them *in this order*, could fix the problem :
$ pactl unload-module module-bluetooth-policy
$ pactl unload-module module-bluetooth-discover
$ pactl load-module module-bluetooth-policy
$ pactl load-module module-bluetooth-discover

However, I have to do that each time I want to (re)connect the headphone, even if I do not restart pulseaudio, but I was not trying the PPA fix.

NOTE: Since I was working on the issue before finding this bug report, I also try some various other fixes. I don't know in with proportion they are all needed or not.

I have edited /etc/pulse/default.pa like this :

--- /etc/pulse/default.pa 2016-07-28 16:34:59.387935171 +0200
+++ /etc/pulse/default.pa_backup 2016-07-28 16:12:01.650390871 +0200
@@ -70,10 +70,9 @@
 load-module module-bluetooth-policy
 .endif

-# draco : Disabled see https://bbs.archlinux.org/viewtopic.php?id=197482
-#.ifexists module-bluetooth-discover.so
-#load-module module-bluetooth-discover
-#.endif
+.ifexists module-bluetooth-discover.so
+load-module module-bluetooth-discover
+.endif

 ### Load several protocols
 .ifexists module-esound-protocol-unix.so
@@ -163,8 +162,3 @@
 ### Make some devices default
 #set-default-sink output
 #set-default-source input
-
-## draco : added lines, see https://wiki.archlinux.org/index.php/Bluetooth_headset#Pairing_works.2C_but_connecting_does_not
-# automatically switch to newly-connected devices
-load-module module-switch-on-connect
-

And I have also edited /usr/bin/start-pulseaudio-x11 like this :

--- /usr/bin/start-pulseaudio-x11 2016-07-28 16:14:25.092044700 +0200
+++ /usr/bin/start-pulseaudio-x11_backup 2016-07-28 16:13:17.369151920 +0200
@@ -30,8 +30,4 @@
     if [ x"$SESSION_MANAGER" != x ] ; then
  /usr/bin/pactl load-module module-x11-xsmp "display=$DISPLAY session_manager=$SESSION_MANAGER" > /dev/null
     fi
-
- ## draco : Added lines, see https://bbs.archlinux.org/viewtopic.php?id=197482
- /usr/bin/pactl load-module module-bluetooth-discover
-
 fi

Can someone explains the purpose and dependencies between module-bluetooth-policy versus module-bluetooth-discover ? Should I remove the previous modification before trying the PPA version ?

Revision history for this message
draco (draco31-fr) wrote :

The patch I tried for /etc/pulse/default.pa

Revision history for this message
Joakim Koed (vooze) wrote :

You can use that tweak with the PPA just fine. It's not necessary if using unity with lightdm though. But just leave it.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Avoid loading of module-bluetooth-discover to early and auto switch to bluetooth headphone on connect" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
draco (draco31-fr) wrote :

The patch I tried for /usr/bin/start-pulseaudio-x11

Revision history for this message
draco (draco31-fr) wrote :

Sorry for the huge comment, I was thinking I could edit it later to remove patch in text.

Thanks for your reply Joakim, I will try the PPA living my tweaks in place.

Revision history for this message
Simon Fels (morphis) wrote :
Download full text (3.3 KiB)

Sorry, for seeing this one a bit late.

First of all the relevant problem is

( 15.152| 0.000) E: [pulseaudio] volume.c: Assertion 'pa_channels_valid(channels)' failed at pulse/volume.c:74, function pa_cvolume_set(). Aborting.

Which basically means there is a volume level being set for an invalid channel (simply a number which is out of range once passed to pa_cvolume_set).

Looking into the code the function source_set_volume_cb in src/modules/bluetooth/module-bluez5-device.c (line 961) calls pa_cvolume_set and also sink_set_volume_cb (line 1187). Each gets called for either when a source or sink is added to the device and the profile being used is PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT. The sample_spec struct being used to provide the channel is configured in transport_config which is according to the log file attached in comment #1 never called before the abort happens. The function transport_acquire is called before and returns an error according to:

( 14.894| 0.000) D: [pulseaudio] module-bluez5-device.c: Acquiring transport /org/bluez/hci0/dev_44_5E_F3_B4_07_29/fd49
( 14.894| 0.000) I: [pulseaudio] backend-native.c: doing connect
( 15.151| 0.257) E: [pulseaudio] backend-native.c: connect(): Function not implemented

That the connect() syscall returns "Function no implemented" is suspicious.

If we're going further in the log file we see

( 15.152| 0.000) D: [pulseaudio] backend-native.c: Transport /org/bluez/hci0/dev_44_5E_F3_B4_07_29/fd49 available for profile headset_head_unit

which happens inside src/modules/bluetooth/backend-native.c in function profile_new_connection when we get called back from bluez if the HFP profile you get connected with the remote side.

The next line is the interesting one:

( 15.152| 0.000) D: [pulseaudio] backend-native.c: RFCOMM << AT+VGS=8

This actually comes from set_speaker_gain in src/modules/bluetooth/backend-native.c line 276 and is called by sink_set_volume_cb in src/modules/bluetooth/module-bluez5-device.c (line 1187) which is called subsequently from add_sink -> init_profile. As set_speaker_gain prints out the string "RFCOMM << AT+VGS=8" AFTER it has the set volume in sink_set_volume_cb the first call to pa_cvolume_set already happened and went through without the assert in pa_cvolume_set failing for an incorrect channel. The only left candidate then is source_set_volume_cb but that one is using the same u->sample_spec.channels value as we used before and it shouldn't have changed in between.

What somebody should now look into: Add pa_log_debug lines before and after the actual pa_cvolume_set calls in src/modules/bluetooth/module-bluez5-device.c so that we can verify which is actually causing the abort. These should also print the value of u->sample_spec.channels. With that we have at least the line which is causing the abort and can then look into possible reasons why this is happening. I suspect the order of a specific code flow has change slightly with the SCO-over-PCM changes we did for Ubuntu Touch.

Also it would be great if someone who removed the patches can provide a log file for pulseaudio in debug mode where the headset gets connected and no abort occurs.

@L...

Read more...

Revision history for this message
Luke Yelavich (themuso) wrote :

On Thu, Sep 22, 2016 at 04:25:26PM AEST, Simon Fels wrote:
> What somebody should now look into: Add pa_log_debug lines before and
> after the actual pa_cvolume_set calls in src/modules/bluetooth/module-
> bluez5-device.c so that we can verify which is actually causing the
> abort. These should also print the value of u->sample_spec.channels.
> With that we have at least the line which is causing the abort and can
> then look into possible reasons why this is happening. I suspect the
> order of a specific code flow has change slightly with the SCO-over-PCM
> changes we did for Ubuntu Touch.
>
> Also it would be great if someone who removed the patches can provide a
> log file for pulseaudio in debug mode where the headset gets connected
> and no abort occurs.

Thanks Simon for your help.

> @Luke: Can you provide packages with the necessary changes so that
> people expiring the abort can install these and provide new log files?

Will be testing and logging myself, but yes I can do that. I've just got hold of hardware that may exhibit this problem, still need to test, so I can join the effort to log/debug.

Thanks again.

Luke

Revision history for this message
Yura Nosenko (yuranos87) wrote :

Guys, the patch from Joakim did work for me!
It turns out all I needed after installing pulseaudio suite from Joakim's PPA is:
pactl load-module module-bluetooth-discover
I'm pretty sure I have tried it before I applied the PPA and it didn't work. Since there was no mention of it in this conversation until recently, I totally forgot to check it.
Thanks everyone! I will try to figure out now if it's possible to connect 2 Jaybird devices simultaneously. It works like a charm on Mac.

Revision history for this message
Kathy Reid (kathyreid) wrote :

Hi guys, I am experiencing the same issue from my Plantronics Backbeat Go 2 bluetooth headphones (PLT_BBTGO2). The headphones pair correctly, but then disconnect 2 seconds afterwards.

The headphones are confirmed to be pairing and working correctly on Nexus 5 stock Android, and Windows 10.

I am running Xenial: Ubuntu 16.04.1 LTS with kernel 4.4.0-38-generic

Prior to this I was running 12.04 LTS and they worked correctly.

My pulseaudio log shows (among less relevant stuff):

Sep 25 12:51:13 kathyreid-N76VZ pulseaudio[13654]: [pulseaudio] backend-native.c: connect(): Function not implemented
Sep 25 12:51:13 kathyreid-N76VZ pulseaudio[13654]: [pulseaudio] volume.c: Assertion 'pa_channels_valid(channels)' failed at pulse/volume.c:74, function pa_cvolume_set(). Aborting.

The pulseaudio bluetooth module is installed.
ofono is installed (I installed it to try and get it working)
I am NOT using blueant.

Before installing Joakim's PPA is there anything you'd like me to test / get logs of? I'd be very happy to test Joakim's PPA / provide any other debug information that may be of assistance.

(A huge thanks to all the people in this thread - this is excellent debugging information).

Kind regards,
Kathy

Revision history for this message
Joakim Koed (vooze) wrote :

Kathy: sounds like you have the exact same problem as the rest of us. I would recommend just using the PPA, until Luke and Simon have an chance to take a further look at it.. Hope it works for your hardware.

Revision history for this message
Kathy Reid (kathyreid) wrote :

@vooze: This worked PERFECTLY. The PLT_BBTGO2 is now paired and connected successfully and I can adjust controls in the Sound settings panel. I had to run

sudo pactl load-module module-bluetooth-discover

after I'd added the PPA, updated pulseaudio and rebooted.

A huge thank you for all your help.

Do you need specifics on the hardware I'm using?

Kind regards,
Kathy

Revision history for this message
Luke Yelavich (themuso) wrote :

 affects ubuntu/pulseaudio
 assignee themuso

Changed in pulseaudio (Ubuntu):
assignee: Simon Fels (morphis) → Luke Yelavich (themuso)
Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 1574324] [NEW] pulseaudio crashes when connecting to bluetooth headphones (due to ubuntu changes?)

Ok, as suggested by Simon, I've added some extra debugging to PulseAudio, with the Ubuntu Touch patches re-enabled. At the time of writing, this has just been pushed to my personal package archive for Xenial.

If folks experiencing this problem could install the version of PulseAudio from my PPA, and get a log as outlined at https://wiki.ubuntu.com/PulseAudio/Log that would be great.I suggest starting pulseaudio, then turning on your bluetooth device.

Attached is my own log, for reference.

Revision history for this message
Erik Brinkman (erik-brinkman) wrote :

Attached are two logs with Luke's modified package. I attached two because I couldn't replicate the bug with the modified logging package. Instead of immediately crashing and disconnecting after a pair, instead, the pair would succeed, but audio would not play when set to "High Fidelity Playback (A2DP Sink)" mode. Figuring that this may be an issue with the initial pair, I restarted and ran it again creating a second log. Pulse still didn't crash. This time I tried changing the mode to "Headset Head Unit (HSP/HFP)". In this mode, the test sound would play, but it would only come through as static. Attempts to change back to A2DP resulted in the device being removed and readded in HSP/HFP mode.

Despite not reproducing the bug with the logging package, I was still able to replicate the bug with the stock package, and fix it with Joakim's package.

Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 1574324] Re: pulseaudio crashes when connecting to bluetooth headphones (due to ubuntu changes?)

Ok, I've added more logging to module-bluez5-device.c, this time I logged whenever the channels value is set, which helps determine the code flow somewhat. I haven't yet tested with a working headset, but I am not seeing any of the additional lgoging I added when attempting to connect a known non-working headset with touch patches to pulseaudio, which suggests to me that so far, the code doesn't even get that far...

I've uploaded an updated package to my PPA with this additional logging. If you can provide logs, either for a working or non-working bluetooth device, that would be great.

Thanks.

Revision history for this message
Erik Brinkman (erik-brinkman) wrote :

New log attached. This time I was able to get a crash. Pulse didn't crash with the initial pair, but would still refuse to play audio as before. However, rebooting the headphones in the presence of the computer and having them reestablish the pair automatically did cause a crash. This log has both, e.g. initial pair after a reboot, no audio playing, headphones restarted, pulse crash.

Revision history for this message
mouzfun (mouzfun) wrote :

Hmm... This is very weird, until recently I couldn't connect my BT headphones as a2dp or change audio profile to a2dp before I executed

bluetoothctl
connect headphone_adress

After i added luke's PPA and did
 sudo apt-get update && sudo apt-get upgrade
I still can't initially connect as a2dp sink, and pulse throws this

( 247.652| 0.000) E: [pulseaudio] bluez5-util.c: Transport TryAcquire() failed for transport /org/bluez/hci0/dev_00_12_3D_00_15_82/fd2 (Operation Not Authorized)

However, after that i can change audio profile to HSP/HFP and back to a2dp and it works.

Revision history for this message
Alex Tu (alextu) wrote :

I can reproduce it on my lenovo X240 with 16.04.1 and pulseaudio 1:8.0-0ubuntu3 + "Plantronics BackBeat Go 2",

There are brief description of my understanding by adding debug message there[1].

The correct path to set channels looks should be setup_transport() -> transport_config()
However, it would get a return (-1) in setup_transport() -> transport_acquire(u, true);
But that (-1) return value not be handled and transport_config(u); is the expected next step.

But somehow the flow get into
profile_new_connection() -> rfcomm_io_callback() -> transport_speaker_gain_changed_cb() ->pa_cvolume_set() -> get channels 0 assertion
instead of expected flow:
setup_transport() -> transport_config()

So, might worth to check why these message was printed:
( 19.680| 0.000) I: [pulseaudio] backend-native.c: doing connect
( 19.755| 0.075) E: [pulseaudio] backend-native.c: connect(): Function not implemented

What looks need to check but I do check yet:
1. remove patches after 0600-droid-sync-with-upstream-for-Android-5-support-and-b.patch to check if it works.
2. remove patches after 0501-bluetooth-bluez5-ofono-add-support-for-HFP-gateway-r.patch to check if it works.
3. based 1, or 2. to check if it could get transport_config() without error.

this is my debug message of pulseaudio:
http://paste.ubuntu.com/23266287/

and I followed the way[2] to execute pulseaudio manually by :
$/usr/bin/pulseaudio -vvvv --log-level=debug --log-target=newfile:/tmp/pulseverbose.log --log-time=1

[1] https://code.launchpad.net/~alextu/pulseaudio/+git/lp1574324_bt_headset_crashed/+ref/master
[2] https://wiki.ubuntu.com/PulseAudio/Log

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, I am pretty sure it is patch 0502 in the bluez5 patch set. If I enable only 0501 and 0502, and move some code required by 0502 from 0506 and build pulse, enabling 0502 causes Pulse to assert as previously logged. Am in the process of digging through that patch to work out how it changes things such that things don't work as they should... And I don't think its just one patch hunk either. I will update when I have more info.

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, I've found the problem, and reverting this one small change allows all the bluetooth audio hardware I have here to connect and work.

For those following along with the technical side, I reverted/removed one hunk from 0502-bluetooth-bluez5-bring-back-SCO-over-PCM-support.patch:

@@ -1582,7 +1738,8 @@ static void stop_thread(struct userdata *u) {

     if (u->transport) {
         transport_release(u);
- u->transport = NULL;
+ /* Do not set transport pointer to NULL. When failing to switch
+ * profile NULL u->transport would assert. */
     }

     if (u->sink) {

I can only summise that this was relevant for vivid, but work on pulse's bluez5 module between pulse in Vivid and pulse in Xenial improved this situation.

As such, I've uploaded a new revision of pulseaudio to my PPA for Xenial, ppa:themuso/ppa, with this hunk reverted.

Could everybody affected by *this* bug on Xenial please add my PPA, update to pulseaudio in my Xenial PPA and report back and let me know whether things are working for you.

Thanks

Revision history for this message
Patrick Pedersen (pat9) wrote :

Hi, i'm kinda new to Ubuntu and linux. I get this message when I'm trying to install the package from you'r ppa:
The following packages have unmet dependencies:
pulseaudio : Depends: libpulse0 (= 1:8.0-0ubuntu3.1~xenial9) but 1:8.0-0ubuntu3-voozeppa1 is to be installed
Recommends: pulseaudio-module-x11 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

It's probably a easy command or so to get around this, but I have no clue for what I need to look for.

Throwing in some more information her:

patrick@patrick-lap:~/Downloads $ sudo apt policy pulseaudio
pulseaudio:
  Installed: 1:8.0-0ubuntu3-voozeppa1
  Candidate: 1:8.0-0ubuntu3-voozeppa1
  Version table:
 *** 1:8.0-0ubuntu3-voozeppa1 100
        100 /var/lib/dpkg/status
     1:8.0-0ubuntu3.1~xenial9 500
        500 http://ppa.launchpad.net/themuso/ppa/ubuntu xenial/main amd64 Packages
     1:8.0-0ubuntu3 500
        500 http://archive.mirror.blix.com/ubuntu xenial/main amd64 Packages
patrick@patrick-lap:~/Downloads $ sudo apt install pulseaudio=1:8.0-0ubuntu3.1~xenial9
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 pulseaudio : Depends: libpulse0 (= 1:8.0-0ubuntu3.1~xenial9) but 1:8.0-0ubuntu3-voozeppa1 is to be installed
              Recommends: pulseaudio-module-x11 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Thx inn advanced :)

Revision history for this message
Joakim Koed (vooze) wrote :

Luke: I will test your PPA tonight.

Patrick: You can remove my PPA like to:

sudo apt install ppa-purge
sudo ppa-purge ppa:vooze/pulseaudio-fix

See if that will fix it :)

What happens is my PPA and Luke's are in conflict. So you can't see both at the same time.

Revision history for this message
Joakim Koed (vooze) wrote :

Okay, my phone screwed that up.

Trying again:

Patrick: You can remove my PPA like so:

sudo apt install ppa-purge
sudo ppa-purge ppa:vooze/pulseaudio-fix

See if that will fix it :)

What happens is my PPA and Luke's are in conflict. So you can't use both at the same time.

Revision history for this message
Joakim Koed (vooze) wrote :

Okay, so I can connect it just fine now, as A2DP still does not work. When selecting it under sound settings, it just reverts back to another audio source or not no sound coming out.

I think you need to look into the 03 patch as well maybe?

Revision history for this message
Jeremy (wa113y3s) wrote :

Luke and Joakim, thanks for your effort in this bug.

With Luke's latest PPA, things still don't work unless I use a terminal command I found on askubuntu

pacmd set-card-profile `pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}'` off; sleep 2 ; echo -e "disconnect xx:xx:xx:xx:xx:xx\n quit"|bluetoothctl;sleep 5; echo -e "connect xx:xx:xx:xx:xx:xx\n quit"|bluetoothctl; sleep 5; pacmd set-card-profile `pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}'` a2dp_sink

Where xx:xx:xx:xx:xx:xx is the MAC address of my headphones

Revision history for this message
Luke Yelavich (themuso) wrote :

On Thu, Oct 13, 2016 at 11:44:50PM AEDT, Joakim Koed wrote:
> Okay, so I can connect it just fine now, as A2DP still does not work.
> When selecting it under sound settings, it just reverts back to another
> audio source or not no sound coming out.
>
> I think you need to look into the 03 patch as well maybe?

No, this is an issue with bluez. I've just checked myself with this fix aplied to the yakkety package, and whilst it defaults to the wrong profile by default, I can switch it to the A2DP profile, and the audio quality does improve. In addition there were no changes to the pulseaudio bluetooth module code between upstream version 8 in xenial and version 9 in yakkety.

Luke

Revision history for this message
Luke Yelavich (themuso) wrote :

On Fri, Oct 14, 2016 at 09:00:04AM AEDT, Jeremy wrote:
> Luke and Joakim, thanks for your effort in this bug.
>
> With Luke's latest PPA, things still don't work unless I use a terminal
> command I found on askubuntu

When you say things don't work, could you please be more specific? Does pulseaudio still stop working/crash?

Luke

Revision history for this message
pcjason (jasonkrichard) wrote :

Hi Luke,
I did a clean install of Ubuntu GNOME 16.04.1 just a few days ago. With the Ubuntu-provided Pulseaudio packages, my Plantronics BackBeat Go 2 (PLT_BBTGO2) bluetooth headphones would connect and then disconnect. I have now added your PPA and confirmed that the headphones connect and stay connected. Oddly enough, the headphone profile was set to "Analog" by default. Upon clicking the dropdown to select the profile, "Analog" was not an option, and it immediately auto-selected HSP/HFP. I then changed it to A2DP and I was able to hear nice, high quality audio through my headphones! :)

Unfortunately, after turning the headphones off/on, the headphones immediately reconnected and defaulted to the A2DP profile, but there was no sound. I then changed the profile to HSP/HSF and heard low quality audio. Changing back to A2DP resulted in silence. I toggled between the two profiles a few times and the issue persisted.

I then powered off/on once again, and this time I was able to properly select the A2DP profile and hear perfect audio!

So, the connection issue seems to be fixed (for me, atleast)! There seems to be something that is a little bit strange with the audio profile selection, although there may be some user error involved here. I'll try and repeat my power cycling tests a few more times and see if the issue is a software problem or a user problem.

Thanks for looking into this!

-Jason

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, the profile selection stuff is a separate bug, but it seems things are resolved with people's bluetooth audio devices not even connecting.

Thanks everybody, I'll now work on getting a stable update ready for Xenial and yakkety.

Revision history for this message
Jeremy (wa113y3s) wrote :

Luke, I haven't had a pulseaudio crash and I have been able to connect to 2 different headsets since installing 16.04 however getting A2DP to work by switching it in sound settings is usually impossible. Both headsets have volume controls and microphones. A little bluetooth speaker without microphone or volume controls uses A2DP without issues

The behavior I see is similar to your comment #18

Revision history for this message
Joakim Koed (vooze) wrote :

Luke: Should we open a new bug in regard to the profile switching bug? I see something similar to #103 with your PPA.

I will personally continue to use my own ppa, and will probably publish a version 4, when this pushes, so profile switching still works 100%, until that other bug is resolved.

Thank you again. Great work figure out where in the patch the error was/is.

Revision history for this message
Luke Yelavich (themuso) wrote :

On Sat, Oct 15, 2016 at 08:06:33PM AEDT, Joakim Koed wrote:
> Luke: Should we open a new bug in regard to the profile switching bug? I
> see something similar to #103 with your PPA.

I will when I know for sure where the bug is. I still need to do more testing with regards to the profiles not working properly, with and without various patches in the PulseAudio package for xenial. Will keep you all posted.

Luke

Revision history for this message
Jeremy (wa113y3s) wrote :
Revision history for this message
Felipe Lemos (felipelemos) wrote :

I've just upgraded to yakkety and the bug is back.

Revision history for this message
Luke Yelavich (themuso) wrote :

Yes, the bug is present in yakkety as well. I am sorry if that has not already been made clear in this bug.

I am away this week, but will be preparing stable updates for Xenial and Yakkety when I return next week.

Revision history for this message
Ethan Reynolds (ethayng) wrote :

Whoops! Sorry about that.

I can confirm that this bug exists on Ubuntu 16.10.

Random info about my laptop that could prove useful:
 - 64 bit AMD dual core (Turion II P540)
 - 8 gigs of memory
 - 120gb Samsung SSD

 * Bluetooth DONGLE. v4.0 / LE (http://amzn.to/2eanIHp). Just bought this for use with my DS4 and
     Plantronics BackBeat Pro headphones. I'm interested to see if the problem is restricted to the
     use of Bluetooth dongles (or just some dongles), Bluetooth LE devices, or a combination of the
     two.

P.S: Why does pulseaudio suck so much? It's problems are well known (right up there with linux
       graphics driver problems).

Revision history for this message
Joakim Koed (vooze) wrote :

Ethan: This is NOT a upstream pulseaudio problem. The bug here is some ubuntu-patches for unity8/phones (I think) had you read all the comments and just not commenting, you would know that :)

Also Luke knows about 16.10 (its' like one comment before yours!)

Sorry for rant.

Revision history for this message
Jeremy (wa113y3s) wrote :

Joakim Koed

I would like to hear a comment about the commit I mentioned
https://github.com/pulseaudio/pulseaudio/commit/e32a462cc4201d9c3c7305d0f806d16a09f08875

It does seem to be related to the switching profiles issues

Revision history for this message
Luke Yelavich (themuso) wrote :

That commit is not relevant to this bug. The profile problems will be tracked in another bug, once the exact cause of the bug is known.

Having said that, thanks for the pointer, I will apply that commit when doing some more testing in the coming days.

Luke Yelavich (themuso)
Changed in pulseaudio (Ubuntu Xenial):
assignee: nobody → Luke Yelavich (themuso)
status: New → In Progress
Changed in pulseaudio (Ubuntu Yakkety):
assignee: nobody → Luke Yelavich (themuso)
status: New → In Progress
Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, so it seems that whilst a freshly paired set of Bluebuds X defaults to HFP, I am able to switch to A2DP and have it work properly on a freshly installed and updated Xenial, with the pulseaudio package for Xenial in my PPA. Can anybody else confirm, at least with at least an up to date Xenial and pulse from my PPA?

In other news, the fix for *THIS* bug is now in Zesty, and I will be preparing updates for Xenial and Yakkety. The only thing I have to test is whether the previously mentioned patch makes the out of the box experience worth the risk of backporting.

Revision history for this message
Luke Yelavich (themuso) wrote :

Never mind my last post. I did another fresh install, updated, and A2DP didn't work again...

Well at least I know using a newer version of Pulse in xenial allows things to work, now to hunt down the patch(es) that fix things.

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok... Seems that if I kill pulseaudio with killall pulseaudio, and get it to automatically reload by playing some audio, I am able to then successfully switch to the A2DP profile, and it seems to work fine, even after a reboot...

I think there is a race condition, that newer versions of Pulse have fixed.

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, the profile selectino issue seems to be a race condition. I've just been able to reproduce the problem on xenial with bluez and pulse from yakkety, and restarting pulse always seems to fix the problem, and then it seems to work afterwards, no idea why.

Time to look at bluetooth patches since pulse 9 to see which one may fix the problem, although from a quick glance, this won't be easy to work out.

Revision history for this message
Luke Yelavich (themuso) wrote :

Is anybody able to reproduce my findings on Xenial with pulse from my PPA, i.e trying to select A2DP doesn't work, but when you manually kill and restart pulse A2DP works?

I just tried on yakkety with another bluetooth controller with pulse from zesty and I didn't even need to select A2DP, it was selected and worked... Something weird is going on here, so I think I will push the fix for this bug through such that people can actually use their devices, and try and track this profile issue down. Not even sure its a race at this point...

Revision history for this message
José Tomás Atria (jtatria) wrote :

I can confirm that Luke's PPA works with my Jaybird X2 on Kunbutu Xenial.

A2DP was not selected by default upon connection, but it is possible to select it manually in the hardware panel in Phonon (Using kde here), and it works like a charm.

The only funny thing in my setup is that there's an extra entry for a Jaybird X2 in the audio hardware conf dialog that shows up as unavailable. I assume it's from earlier attempts at connecting before upgrading pulseaudio to Luke's version.

Thanks for the hard work, Luke

Revision history for this message
Jeremy (wa113y3s) wrote :

Luke
Using your PPA, manually killing pulse and restarting it doesn't make any changes and the only way to use A2DP is the command I put in comment 100

The bug only affects audio devices that support HSP/HFP as I have a small bluetooth speaker that automatically uses A2DP without fail

Luke Yelavich (themuso)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello ian_hawdon, or anyone else affected,

Accepted pulseaudio into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:9.0-2ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in pulseaudio (Ubuntu Yakkety):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in pulseaudio (Ubuntu Xenial):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello ian_hawdon, or anyone else affected,

Accepted pulseaudio into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:8.0-0ubuntu3.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Jeremy (wa113y3s) wrote :

That works much better for switching profiles with 1:8.0-0ubuntu3.1

Jeremy (wa113y3s)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Felipe Lemos (felipelemos) wrote : Re: [Bug 1574324] Please test proposed package
Download full text (4.7 KiB)

Is it possible to create a yakkety proposed package too?

On Thu, 3 Nov 2016 at 16:29 Brian Murray <email address hidden> wrote:

> Hello ian_hawdon, or anyone else affected,
>
> Accepted pulseaudio into xenial-proposed. The package will build now and
> be available at
> https://launchpad.net/ubuntu/+source/pulseaudio/1:8.0-0ubuntu3.1 in a
> few hours, and then in the -proposed repository.
>
> Please help us by testing this new package. See
> https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to
> enable and use -proposed. Your feedback will aid us getting this update
> out to other Ubuntu users.
>
> If this package fixes the bug for you, please add a comment to this bug,
> mentioning the version of the package you tested, and change the tag
> from verification-needed to verification-done. If it does not fix the
> bug for you, please add a comment stating that, and change the tag to
> verification-failed. In either case, details of your testing will help
> us make a better decision.
>
> Further information regarding the verification process can be found at
> https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
> advance!
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1574324
>
> Title:
> pulseaudio crashes when connecting to bluetooth headphones (due to
> ubuntu changes?)
>
> Status in pulseaudio package in Ubuntu:
> In Progress
> Status in pulseaudio source package in Xenial:
> Fix Committed
> Status in pulseaudio source package in Yakkety:
> Fix Committed
>
> Bug description:
> Impact:
>
> A patch we carry for Ubuntu touch introduced a change that originally
> was required to make sure PulseAudio did not crash. This patch was
> ported to PulseAudio 8 in Xenial, but the patch author's bluetooth
> hardware that was to hand at the time worked so was assumed to be ok.
> However, the opposite is now happening, i.e PulseAudio is crashing
> with a subset of Bluetooth hardware.
>
> Regression potential:
>
> Very low to none. As can be read in this report, much debugging and
> testing has been done to find the problem, and the eventual fix.
> Moreover the change is the removal of a patch hunk that removed a line
> of code originally present in PulseAudio.
>
> Test case:
>
> NOTE that this test case applies to bluetooth hardware that is
> identified as not working in this bug report.
>
> 1. Install, or upgrade to Xenial or yakkety.
> 2. Pair your bluetooth device in the bluetooth settings in the relevant
> settings application for your desktop environment.
> 3. Once paired, you will notice that sound stops working, as pulseaudio
> has thrown an assertion error.
> 4. You do not have to remove your audio device from the paired device
> list, but it may be easier to do so for the next part of the testing.
> 5. Update to the version of PulseAudio in xenial-proposed which is
> 1:8.0-0ubuntu3.1, or in yakkety-proposed, which is 1:9.0-2ubuntu2.1.
> 6. Re-pair your device. Audio should continue to work, and you should be
> able to switch to your bluetooth device and use it.
>
>
> Original bu...

Read more...

Revision history for this message
Luke Yelavich (themuso) wrote :

There is a version of PulseAudio in yakkety-proposed as well, please follow the above instructions, but for yakkety instead.

tags: added: verification-done-xenial verification-needed
removed: verification-done
Revision history for this message
Erik Brinkman (erik-brinkman) wrote :

The proposed packages worked for me on yakkety.

Revision history for this message
Felipe Lemos (felipelemos) wrote :

The proposed package did not worked for me on yakkety.
I've got the same problem: To switching profiles I still need to:

1. Change to HSP/HFP
2. Disconnect
3. Reconnect
4. Change it back to A2DP

Version:
ii pulseaudio 1:9.0-2ubuntu2.1 amd64 PulseAudio sound server

Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 1574324] Re: pulseaudio crashes when connecting to bluetooth headphones (due to ubuntu changes?)

The proposed package does *NOT* fix any bugs relating to profile switching.

Revision history for this message
Felipe Lemos (felipelemos) wrote :
Download full text (4.0 KiB)

OK, so maybe I'm experiencing another bug.
The PPA did in fact fixed my problem (profile switching) when I was using
16.04, and I was hoping your proposed package could fixed it for me in
16.10.
I was having a impression that was the same problem, but apparently it is
not.

On Wed, 9 Nov 2016, 20:54 Luke Yelavich, <email address hidden>
wrote:

> The proposed package does *NOT* fix any bugs relating to profile
> switching.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1574324
>
> Title:
> pulseaudio crashes when connecting to bluetooth headphones (due to
> ubuntu changes?)
>
> Status in pulseaudio package in Ubuntu:
> In Progress
> Status in pulseaudio source package in Xenial:
> Fix Committed
> Status in pulseaudio source package in Yakkety:
> Fix Committed
>
> Bug description:
> Impact:
>
> A patch we carry for Ubuntu touch introduced a change that originally
> was required to make sure PulseAudio did not crash. This patch was
> ported to PulseAudio 8 in Xenial, but the patch author's bluetooth
> hardware that was to hand at the time worked so was assumed to be ok.
> However, the opposite is now happening, i.e PulseAudio is crashing
> with a subset of Bluetooth hardware.
>
> Regression potential:
>
> Very low to none. As can be read in this report, much debugging and
> testing has been done to find the problem, and the eventual fix.
> Moreover the change is the removal of a patch hunk that removed a line
> of code originally present in PulseAudio.
>
> Test case:
>
> NOTE that this test case applies to bluetooth hardware that is
> identified as not working in this bug report.
>
> 1. Install, or upgrade to Xenial or yakkety.
> 2. Pair your bluetooth device in the bluetooth settings in the relevant
> settings application for your desktop environment.
> 3. Once paired, you will notice that sound stops working, as pulseaudio
> has thrown an assertion error.
> 4. You do not have to remove your audio device from the paired device
> list, but it may be easier to do so for the next part of the testing.
> 5. Update to the version of PulseAudio in xenial-proposed which is
> 1:8.0-0ubuntu3.1, or in yakkety-proposed, which is 1:9.0-2ubuntu2.1.
> 6. Re-pair your device. Audio should continue to work, and you should be
> able to switch to your bluetooth device and use it.
>
>
> Original bug report:
>
> When I attempt to connect my Jaybird Bluebuds X to Ubuntu 16.04
> pulseaudio crashes, this does *NOT* happen with a Jambox which leads
> me to believe it's an intermittent problem with some hardware. This
> did not happen on Ubuntu 15.10 (which was an upgrade of 15.04).
>
> Ubuntu Release:
>
> Description: Ubuntu 16.04 LTS
> Release: 16.04
>
> Pulseaudio Version:
>
> pulseaudio:
> Installed: 1:8.0-0ubuntu3
> Candidate: 1:8.0-0ubuntu3
> Version table:
> *** 1:8.0-0ubuntu3 500
> 500 http://gb.archive.ubuntu.com/ubuntu xenial/main amd64
> Packages
> 100 /var/lib/dpkg/status
>
> Device info:
>
> [bluetooth]# info 44:5E:F3:B4:07:29
> Device 44:5E:F3:B4:07:29
>...

Read more...

Revision history for this message
draco (draco31-fr) wrote :

Hi Felipe
Have a look to Bug #1577197, I have this problem on switching profile, may
it be the same case.

Revision history for this message
Felipe Lemos (felipelemos) wrote :
Download full text (3.8 KiB)

I think you are right, thank you.

On Thu, 10 Nov 2016, 05:54 draco, <email address hidden> wrote:

> Hi Felipe
> Have a look to Bug #1577197, I have this problem on switching profile, may
> it be the same case.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1574324
>
> Title:
> pulseaudio crashes when connecting to bluetooth headphones (due to
> ubuntu changes?)
>
> Status in pulseaudio package in Ubuntu:
> In Progress
> Status in pulseaudio source package in Xenial:
> Fix Committed
> Status in pulseaudio source package in Yakkety:
> Fix Committed
>
> Bug description:
> Impact:
>
> A patch we carry for Ubuntu touch introduced a change that originally
> was required to make sure PulseAudio did not crash. This patch was
> ported to PulseAudio 8 in Xenial, but the patch author's bluetooth
> hardware that was to hand at the time worked so was assumed to be ok.
> However, the opposite is now happening, i.e PulseAudio is crashing
> with a subset of Bluetooth hardware.
>
> Regression potential:
>
> Very low to none. As can be read in this report, much debugging and
> testing has been done to find the problem, and the eventual fix.
> Moreover the change is the removal of a patch hunk that removed a line
> of code originally present in PulseAudio.
>
> Test case:
>
> NOTE that this test case applies to bluetooth hardware that is
> identified as not working in this bug report.
>
> 1. Install, or upgrade to Xenial or yakkety.
> 2. Pair your bluetooth device in the bluetooth settings in the relevant
> settings application for your desktop environment.
> 3. Once paired, you will notice that sound stops working, as pulseaudio
> has thrown an assertion error.
> 4. You do not have to remove your audio device from the paired device
> list, but it may be easier to do so for the next part of the testing.
> 5. Update to the version of PulseAudio in xenial-proposed which is
> 1:8.0-0ubuntu3.1, or in yakkety-proposed, which is 1:9.0-2ubuntu2.1.
> 6. Re-pair your device. Audio should continue to work, and you should be
> able to switch to your bluetooth device and use it.
>
>
> Original bug report:
>
> When I attempt to connect my Jaybird Bluebuds X to Ubuntu 16.04
> pulseaudio crashes, this does *NOT* happen with a Jambox which leads
> me to believe it's an intermittent problem with some hardware. This
> did not happen on Ubuntu 15.10 (which was an upgrade of 15.04).
>
> Ubuntu Release:
>
> Description: Ubuntu 16.04 LTS
> Release: 16.04
>
> Pulseaudio Version:
>
> pulseaudio:
> Installed: 1:8.0-0ubuntu3
> Candidate: 1:8.0-0ubuntu3
> Version table:
> *** 1:8.0-0ubuntu3 500
> 500 http://gb.archive.ubuntu.com/ubuntu xenial/main amd64
> Packages
> 100 /var/lib/dpkg/status
>
> Device info:
>
> [bluetooth]# info 44:5E:F3:B4:07:29
> Device 44:5E:F3:B4:07:29
> Name: BlueBuds X
> Alias: BlueBuds X
> Class: 0x240404
> Icon: audio-card
> Paired: yes
> Trusted: yes
> Blocked: no
> Connected: no
> LegacyPairing: no
> UUID: Headset ...

Read more...

Revision history for this message
Martin Pitt (pitti) wrote :

Comment #123 provided verification in yakkety.

tags: added: verification-done
removed: verification-done-xenial verification-needed
Revision history for this message
Martin Pitt (pitti) wrote : Update Released

The verification of the Stable Release Update for pulseaudio has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:9.0-2ubuntu2.1

---------------
pulseaudio (1:9.0-2ubuntu2.1) yakkety; urgency=medium

  * 0502-bluetooth-bluez5-bring-back-SCO-over-PCM-support.patch:
    - Remove patch hunk that set u->transport to NULL. At the time this
      code was written for 15.10, it was to prevent an assertion. Now with
      newer versions of pulse, the opposite is happening in some circumstances
      (LP: #1574324)

 -- Luke Yelavich <email address hidden> Thu, 03 Nov 2016 16:57:47 +1100

Changed in pulseaudio (Ubuntu Yakkety):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:8.0-0ubuntu3.1

---------------
pulseaudio (1:8.0-0ubuntu3.1) xenial; urgency=medium

  * debian/pulseaudio.maintscript: Bump versions for files that need to be
    removed as they are obsolete (LP: #1573296)
  * 0502-bluetooth-bluez5-bring-back-SCO-over-PCM-support.patch:
    - Remove patch hunk that set u->transport to NULL. At the time this
      code was written for 15.10, it was to prevent an assertion. Now with
      newer versions of pulse, the opposite is happening in some circumstances
      (LP: #1574324)

 -- Luke Yelavich <email address hidden> Thu, 03 Nov 2016 16:58:35 +1100

Changed in pulseaudio (Ubuntu Xenial):
status: Fix Committed → Fix Released
Martin Pitt (pitti)
Changed in pulseaudio (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Florian Stalzer (gofurygo) wrote :

Unfortunately, the update released recently is exactly what broke it for me :-(

Before that, all was okay and my Philips headset connected fine, also A2DP was ok. But for about 1 week, it is completely broken.

Now after the update, I can't even pair it anymore. When I start from scratch to pair, it pairs for 1 or 2 seconds, then disconnects immediately. When trying to "turn on" the pairing again via the settings/bluetooth gui, it won't even let me move from off to on.

I am running Ubuntu Gnome 16.04 LTS.

Anybody got an idea how to fix it...? It really is annoying to use earphones with cable :-)

Revision history for this message
Martynas Venckus (martynas-1-deactivatedaccount) wrote :

The update did fix Bluebuds X for me on 16.04. Before pulseaudio was crashing and now it's been working for a week.

@gofurygo perhaps start with "grep pulse /var/log/syslog*"

Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 1574324] Re: pulseaudio crashes when connecting to bluetooth headphones (due to ubuntu changes?)

Well, for a start, could you please get a log from PulseAudio as per https://wiki.ubuntu.com/PulseAudio/Log?

Thanks.

Revision history for this message
Jeff (jdferron) wrote :

Luke,

Just an FYI: Your fix resolved an issue with using bluetooth speakers to connect via A2DP. I was finally able to validate the fix once it was pushed to stable. So, thank you and I apologize for not testing this during the "proposed" testing!

It appears there may be multiple issues given what others are reporting.

Revision history for this message
Florian Stalzer (gofurygo) wrote :

Martynas, Luke

Here it goes, without headphones paired it gives me this:
/var/log/syslog:Nov 30 18:53:11 fury-M90z pulseaudio[1082]: [pulseaudio] source.c: Default and alternate sample rates are the same.
/var/log/syslog:Nov 30 18:53:37 fury-M90z pulseaudio[1403]: [pulseaudio] source.c: Default and alternate sample rates are the same.
/var/log/syslog:Nov 30 18:53:37 fury-M90z pulseaudio[1419]: [pulseaudio] pid.c: Daemon already running.
/var/log/syslog.1:Nov 29 19:52:54 fury-M90z pulseaudio[1404]: [pulseaudio] source.c: Default and alternate sample rates are the same.
/var/log/syslog.1:Nov 29 19:54:26 fury-M90z pulseaudio[2328]: [pulseaudio] source.c: Default and alternate sample rates are the same.
/var/log/syslog.1:Nov 29 19:54:26 fury-M90z pulseaudio[2346]: [pulseaudio] pid.c: Daemon already running.

After I paired for a 1 second (and it crashes), it gives me this:

/var/log/syslog:Nov 30 18:53:11 fury-M90z pulseaudio[1082]: [pulseaudio] source.c: Default and alternate sample rates are the same.
/var/log/syslog:Nov 30 18:53:37 fury-M90z pulseaudio[1403]: [pulseaudio] source.c: Default and alternate sample rates are the same.
/var/log/syslog:Nov 30 18:53:37 fury-M90z pulseaudio[1419]: [pulseaudio] pid.c: Daemon already running.
/var/log/syslog.1:Nov 29 19:52:54 fury-M90z pulseaudio[1404]: [pulseaudio] source.c: Default and alternate sample rates are the same.
/var/log/syslog.1:Nov 29 19:54:26 fury-M90z pulseaudio[2328]: [pulseaudio] source.c: Default and alternate sample rates are the same.
/var/log/syslog.1:Nov 29 19:54:26 fury-M90z pulseaudio[2346]: [pulseaudio] pid.c: Daemon already running.

Revision history for this message
Luke Yelavich (themuso) wrote :

Florian, please get a log from PulseAudio as I described earlier in this bug report.

Revision history for this message
Florian Stalzer (gofurygo) wrote :

Sorry Luke, here it is... reproduced the problem as described earlier

Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, I do not see anything obvious from the log. Did you attempt to pair your headphones whilst pulseaudio was running? TO be sure, delete the pairing from bluetooth preferences if it exists, and start fresh. Load pulse as per instructions to get the log, attempt to pair the bluetooth headphones, wait till the pair fails/pulse seems to crash. If pulse is still running, terminate it and then submit the log to the bug.

Thanks.

Revision history for this message
scarline (scarline) wrote :
Download full text (8.7 KiB)

On Xubuntu 16.04, 4.4.0-57-generic jaybird x2 does not work via bluetooh.

user@user-pc:~$ grep pulse /var/log/syslog*
/var/log/syslog:Dec 24 00:08:38 user-pc pulseaudio[1938]: [pulseaudio] module-bluez5-device.c: Default profile not connected, selecting off profile
/var/log/syslog:Dec 24 00:08:38 user-pc pulseaudio[1938]: [pulseaudio] bluez5-util.c: Transport TryAcquire() failed for transport /org/bluez/hci0/dev_44_5E_F3_C0_BD_E6/fd3 (Operation Not Authorized)
/var/log/syslog:Dec 24 00:19:09 user-pc pulseaudio[1938]: [pulseaudio] module.c: Module "module-bluetooth-discover" should be loaded once at most. Refusing to load.
/var/log/syslog:Dec 24 00:22:19 user-pc pulseaudio[1938]: [pulseaudio] bluez5-util.c: Transport Acquire() failed for transport /org/bluez/hci0/dev_44_5E_F3_C0_BD_E6/fd3 (Operation Not Authorized)
/var/log/syslog:Dec 24 03:19:57 user-pc pulseaudio[8105]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
/var/log/syslog:Dec 24 13:39:00 user-pc pulseaudio[8820]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
/var/log/syslog:Dec 24 14:13:17 user-pc pulseaudio[9286]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
/var/log/syslog:Dec 24 15:06:48 user-pc pulseaudio[10012]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
/var/log/syslog:Dec 24 16:18:08 user-pc pulseaudio[1938]: [alsa-sink-ALC668 Analog] alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write.
/var/log/syslog:Dec 24 16:18:08 user-pc pulseaudio[1938]: [alsa-sink-ALC668 Analog] alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
/var/log/syslog:Dec 24 16:18:08 user-pc pulseaudio[1938]: [alsa-sink-ALC668 Analog] alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
/var/log/syslog:Dec 24 17:01:41 user-pc pulseaudio[10995]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
/var/log/syslog:Dec 24 18:55:36 user-pc pulseaudio[12243]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
/var/log/syslog.1:Dec 23 18:00:30 user-pc pulseaudio[1960]: [alsa-sink-ALC668 Analog] alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write.
/var/log/syslog.1:Dec 23 18:00:30 user-pc pulseaudio[1960]: [alsa-sink-ALC668 Analog] alsa-s...

Read more...

Revision history for this message
scarline (scarline) wrote :

*but I can't get any output from them with headphone or HIFI-profile*

Revision history for this message
Luke Boga Mitchell (lukebm) wrote :

This bug seems to be affecting me, specifically a UE Megaboom (device info below). Pairs fine, but doesn't show up in output devices, therefore audio continues to play via internal speakers.

I'm using Ubuntu 16.10 with Gnome 3.20.4 on a Dell XPS 13 (9350). Attached are some log files using 'grep pulse /var/log/syslog*', as mentioned above.

This is somewhat outside of my comfort zone, so if you need more details, you may have to bear with me - many thanks...

(Please ignore the device name - someone next door kept trying to connect...)
Device 88:C6:26:89:0F:A2
 Name: sysERR
 Alias: sysERR
 Class: 0x240418
 Icon: audio-card
 Paired: yes
 Trusted: yes
 Blocked: no
 Connected: yes
 LegacyPairing: no
 UUID: Serial Port (00001101-0000-1000-8000-00805f9b34fb)
 UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
 UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
 UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
 UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
 UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)
 UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
 UUID: Unknown (000061fe-0000-1000-8000-00805f9b34fb)
 Modalias: bluetooth:v000ApFFFFdFFFF

Revision history for this message
Jim Hobbs (hobbsy) wrote :

I found this thread via Google, trying to fix the Bluetooth pairing of my Bose QC35 (version 1) running Ubuntu 16.0.4.6 on a ThinkPad X230. Whilst trying out a few things I managed to solve my problem by temporarily disabling my VPN. Might have been a random coincidence but I wanted to leave this here in case it helped others. Worth a try anyway :)

Revision history for this message
udippel (udippel) wrote :

Affects me on Kubuntu 20.04.
Somehow it didn't before I upgraded from 18.04. But now I have session crashes once per few hours. Meaning, I'm thrown back to the login screen. No VPN here.
I did have to uninstall pavucontrol-qt (it segfaulted) and installed pavucontrol instead, though. No idea if it might have to do with pavucontrol?

My drain isn't a headphone, but a Bose Solo 5.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This bug has been closed for 4 years. If you experience any crashes in 18.04 or 20.04 then please open a new bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.