Audio doesn't switch to bluetooth headset automatically

Bug #1065380 reported by quequotion
160
This bug affects 37 people
Affects Status Importance Assigned to Milestone
Bluez Utilities
New
Undecided
Unassigned
Linux
New
Undecided
Unassigned
PulseAudio
New
Undecided
Unassigned

Bug Description

This should be happening hands-free, but I still have to configure it manually.

This is the behavior I expect:

0. During any audio stream (music, movie, game, whatever)

1. Activate bluetooth headset.
2. Audio redirects to the headset.
3. Deactivate bluetooth headset.
4. Audio redirects to the speakers.
5. Rinse and repeat.

What is actually happening:

1. On activation, headset connects, but no profile is selected, so nothing appears to happen.
2. Manually select "Audio Sink" in blueman (cannot be done in gnome-bluetooth-applet)
3. Audio redirects to the headset.
4. Deactivate the headset.
5. Audio redirects to the speakers.
6. If bluetooth is still working, it is possible to repeat this procedure.

Ubuntu 12.04.1 LTS

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: bluetooth 4.98-2ubuntu7
ProcVersionSignature: Ubuntu 3.5.0-15.22-generic 3.5.4
Uname: Linux 3.5.0-15-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu14
Architecture: amd64
Date: Thu Oct 11 13:21:16 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120407)
InterestingModules: rfcomm bnep btusb bluetooth
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.5.0-15-generic root=UUID=3f22dbab-9a50-4c6b-8593-91862b0e9356 ro quiet splash nomodeset video=uvesafb:mode_option=1680x1050-24,mtrr=3,scroll=ywrap vt.handoff=7
SourcePackage: bluez
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 06/08/2012
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P2.20
dmi.board.name: Z68 Extreme4 Gen3
dmi.board.vendor: ASRock
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP2.20:bd06/08/2012:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rnZ68Extreme4Gen3:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.
hciconfig:
 hci0: Type: BR/EDR Bus: USB
  BD Address: 00:1B:DC:0F:E6:FB ACL MTU: 310:10 SCO MTU: 64:8
  UP RUNNING PSCAN
  RX bytes:42758 acl:230 sco:0 events:5095 errors:0
  TX bytes:1932791 acl:7196 sco:0 commands:211 errors:0
rfkill:
 0: hci0: Bluetooth
  Soft blocked: no
  Hard blocked: no
syslog:

Revision history for this message
quequotion (quequotion) wrote :
Revision history for this message
quequotion (quequotion) wrote :

The output of "sudo hcidump -XYt > hci.log" as requested by apport.

Revision history for this message
quequotion (quequotion) wrote :

I think I should make clear what I mean by "no profile is selected" as I just realized a problem with that statement while on #bluez.

There are bluetooth profiles and audio profiles. Bluez must determine the bluetooth profile (is it a headset, a remote control, etc) and Pulseaudio must determine the audio profile (HD Stereo, Telephony full-duplex, etc).

I don't think any bluetooth profile is chosen by bluez, so pulseaudio doesn't know there's any device to chose an audo profile for. Once the bluetooth profile is chosen manually, in blueman, pulseaudio immediately connects and redirects audio.

quequotion (quequotion)
Changed in blueman:
status: New → Invalid
no longer affects: blueman
no longer affects: bluez
no longer affects: bluez (Ubuntu)
no longer affects: gnome-bluetooth
Revision history for this message
quequotion (quequotion) wrote :

Nevermind that, it turns out that everything is still quite broken.

Bluez is having trouble maintaining itself after handing off control to pulseaudio. I don't know exactly why, but it eventually crashes and bluetooth support cannot be recovered (by any means whatsoever) until reboot.

Pulseaudio's module-bluetooth-discover only activates the HSP profile, on the rare occasion that it does work. More often it doesn't do anything, crashes pulseaudio, crashes bluez, never gets loaded to begin with, or quietly unloads itself.

For a full description of my frustration, please read this forum thread:

http://ubuntuforums.org/showthread.php?p=12294143

Revision history for this message
quequotion (quequotion) wrote :

Re-added bluez because of mysterious, irrecoverable crashing.

Added linux because I believe the kernel module may have a bug.

Revision history for this message
quequotion (quequotion) wrote :

More and more I think I was right the first time.

This is a bug in bluez.

Bluez does not activate a bluetooth profile for the device.

Pulseaudio is not responsible for selecting the bluetooth profile.

Unfortunately, the bluez bugtracker does not actually exist.

Revision history for this message
Jesse B (jayesbee) wrote :

Ive attached terminal output of me restarting the bluetooth service and restarting the headphones to see what the syslog is recording.

if there are other logs that are useful let me know ill post them.

Revision history for this message
Vairavan Laxman (vayiravan) wrote :

Same here, I'm having the same issue on Ubuntu 12.04

Revision history for this message
Andy Holmes (andyholmes) wrote :

Confirmed in 12.10, Linux 3.5.0-22

Revision history for this message
shideneyu (shideneyu) wrote :

I confirm in Linux Mint 14.

Revision history for this message
Miroslav (dzundam-deactivatedaccount) wrote :

Try this, add:

Disable = Media

into "General" section of /etc/bluetooth/audio.conf

On many forums they recommend adding "Enable = Socket" as well, but in my case it made no difference,
but "Disable = Media" is different coffee, with this all my bluetooth headsets connect again like a charm.

I found the hint in the post from Thu Jan 03, 2013 2:36 pm on spanish raspberry pi forum:

http://www.raspberrypi.org/phpBB3/viewtopic.php?t=26395 (Google Translator will help :)

Anyway, I noticed my bluetooth headset won't connect to my laptop anymore after I moved from Ubuntu 10.04
to 12.04 (and subsequently to Mint 13 Maya).

Strangely the headsets were connected immediately after pairing, but never afterwards...
after pairing, but not later)

Revision history for this message
Andy Holmes (andyholmes) wrote :

I've found this (mostly) fixed using the backported pulseaudio ppa from a recent WebUpd8 post about system-wide equalizer support:

http://www.webupd8.org/2013/03/install-pulseaudio-with-built-in-system.html

Headset connects automagically, however sometimes the volume control isn't connected to the bluetooth sink, but the output always gets sent to the proper sink.

Revision history for this message
quequotion (quequotion) wrote :

For an interm workaround, install blueman and disable gnome-bluetooth running at startup.

blueman has controls to select the bluetooth profile for a connected device by hand.

This means you will have to be near your computer in order to enable your bluetooth headset.

You can read more about Socket and Media options here:

http://www.freedesktop.org/wiki/Software/PulseAudio/Notes/3.0

I am not sure they are intended to affect this bug, although they might.

Has anyone tried "Disable = Socket" ?

Revision history for this message
quequotion (quequotion) wrote :

>>Miroslav

Possible confirmation in Redhat bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=874015

Revision history for this message
Miroslav (dzundam-deactivatedaccount) wrote :

to quequotion:

I already switched to blueman before I used "Disable=Media". Could connect for the first
time, but never later. As I wrote, adding "Disable=Media" did the job for me.

Later I googled ' linux bluez "Disable=Media" ' and I found plethora of recommendations
for addind "Enable=Socket" and "Disable=Media" if using bluez >=4.96 (and that is our case).

bluez 5.0 and newer require new config arguments again, because of programming changes
and code tidying, but this doesn't affect me yet.

Just few references:

http://wiki.debian.org/Bluetooth/Alsa
http://linuxpixies.blogspot.ie/2011/09/how-to-bluetooth-speakers-without.html

For me the case is closed with this workaround and using blueman. I just hope in new
versions of ubuntu/mint they don't introduce new bluetooth bugs or misconfigurated
config files.

Revision history for this message
Cerin (chrisspen) wrote :

This was actually working for me in 12.04, but after I upgraded to 14.04, it stopped auto-switching. It still auto-connects to bluetooth, and even plays audio by default through bluetooth, but the Gnome volume controls still show the PC speakers as the default output and so the volume controls only effect the PC speakers until I manually select bluetooth as the output.

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

Other bug subscribers

Remote bug watches

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