Automatically switch to connected Bluetooth headset and enable A2DP mode (ask for preferrence)

Bug #1493051 reported by Or Schiro
This bug report is a duplicate of:  Bug #1378501: Better Bluetooth Audio Control. Edit Remove
34
This bug affects 8 people
Affects Status Importance Assigned to Milestone
elementary OS
New
Undecided
Unassigned

Bug Description

Dear all,

I'm migrating this request from the eOS StackExchange community:

http://elementaryos.stackexchange.com/questions/1460/how-to-automatically-switch-to-connected-bluetooth-headset-and-enable-a2dp-mode/1825?noredirect=1#comment3768_1825

My request concerns the use of A2DP and automatic headset detection. The default state how A2DP is handled is as follows:

1. Enable bluetooth
2. Connect to paired bluetooth headset
3. Sound > Output > "Device for sound output" remains "Speakers - Built-in Audio"
4. Switch "Device for sound output" to bluetooth headset
5. Set Profile from HSP/HFP to A2DP

The desired state from a user perspective could be simplified as follows:

1. Enable bluetooth
2. Connect to paired bluetooth headset
3. Sound > Output > Device for sound output is automatically switched to the bluetooth headset
4. Profile is automatically switched from HSP/HFP to A2DP

I would love to hear your opinion on this request.

Thankfully,

Robert

Revision history for this message
Maccer (maccer) wrote :

Hey. I've found a script that will do what you want.

First you need to go to https://gist.github.com/pylover/d68be364adac5f946887b85e6ed6e7ae#file-a2dp-py and copy the script. Then save it with the name a2dp.py and give execute permissions.
Now connect your BT headset, just connect it and run the script.

If right click > run doesn't work, open a shell in the folder you saved the script and type: python3.5 a2dp.py

Revision history for this message
Or Schiro (orschiro) wrote :

Hi Nicolas,

Thanks a lot for sharing the script with me!

Zisu Andrei (matzipan)
summary: - [Request for Bluetooth] Automatically switch to connected Bluetooth
- headset and enable A2DP mode
+ Automatically switch to connected Bluetooth headset and enable A2DP mode
+ (ask for preferrence)
Revision history for this message
Peter Uithoven (p7ter) wrote :

Add the following line to: /etc/pulse/default.pa
load-module module-switch-on-connect

Source: https://askubuntu.com/questions/8409/autoconnecting-bluetooth-devices

My laptop, with Elementary OS already automatically switched it's sound output to my bluetooth headphones, but it didn't switch the sound controls yet (Speakers where still selected in the Sound settings). After doing the above it now automatically selects my headphone.

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.