LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-14-2016, 08:27 AM   #1
thethinker
Member
 
Registered: Jul 2006
Location: Peabody, MA, USA
Distribution: Xubuntu, Slackware, Pop!_OS
Posts: 297
Blog Entries: 2

Rep: Reputation: 37
Want to set up an automatic bluetooth connection


Running Xubuntu 14.03 on a MacBook Pro. In order to get my bluetooth speaker connected and working, I need to perform the following steps:

1) Turn on the speaker (it then appears in bluetooth device list, but not in sound device list)
2) Run the command

Code:
pactl load-module module-bluetooth-discover
3) Open bluetooth connections. It claims that the speaker is connected via "Headset Service", but it does not appear in the sound device list. If I disconnect this service, run the setup assistant, and choose A2DP Sink, the connection becomes active (now appears in sound device list).
4) Goto Volume Control, Output Devices, and set the bluetooth speaker as Fallback. (whatever this means exactly, there is a green check mark, currently on my internal speakers, which I then switch over to the bluetooth).
5) Now I click play on something (say Amazon streaming) and the sounds comes through the speaker. The volume controls on the keyboard work as well, which is cool.

The behavior I would like is to default to the bluetooth speaker whenever I turn it on. It seems like this might be possible, since it shows up in the bluetooth menu as soon as I turn the power on, but I need to load the module, manually make the connection, and also set it to default (fallback?). Anyone have a suggestion?

NOTE: I tried this question as the Ubuntu forums and they moved it over to "Mac Hardware" before I could get any useful advice. I don't see this as a hardware problem, since I *can* get it working via a software solution. I want to automate that solution!

Last edited by thethinker; 01-14-2016 at 08:34 AM. Reason: Just a bit more detail about disconnecting the audio devices first.
 
Old 01-14-2016, 01:07 PM   #2
jon lee
Member
 
Registered: Jul 2013
Posts: 113

Rep: Reputation: Disabled
You can goto <preferences>, <Startup Applications>, <add>
name and comment whatever, but the command field to be:
Code:
bash -c "sleep 7; pactl load-module module-bluetooth-discover"
I put a fairly long sleep period in there because there's a bit of a race condition somewhere and occasionally it doesn't work like it should.

With that done, when the speaker is turned on (most of the time) it connects automatically. I still have to switch the default sink in the volume control to bluetooth manually though. So if anyone has a solution for that bit...
 
Old 01-15-2016, 01:41 PM   #3
thethinker
Member
 
Registered: Jul 2006
Location: Peabody, MA, USA
Distribution: Xubuntu, Slackware, Pop!_OS
Posts: 297

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by jon lee View Post
You can goto <preferences>, <Startup Applications>, <add>
name and comment whatever, but the command field to be:
Code:
bash -c "sleep 7; pactl load-module module-bluetooth-discover"
So that's a good solution to loading the module, but that doesn't make my speaker show up in the volume control panel - I still have to go into bluetooth connections, disconnect the headset service, run A2DP Sync, and click the green button in volume control.
 
Old 01-15-2016, 05:05 PM   #4
jon lee
Member
 
Registered: Jul 2013
Posts: 113

Rep: Reputation: Disabled
Quote:
Originally Posted by thethinker View Post
So that's a good solution to loading the module, but that doesn't make my speaker show up in the volume control panel - I still have to go into bluetooth connections, disconnect the headset service, run A2DP Sync, and click the green button in volume control.
I use the MATE desktop which may be setup a little better. It uses Blueman Device Manager which enables for automatic connections (once paired and trusted). The only thing I have to do is select the sink in pasystray (Pulse Audio System Tray), to get my volume control. I don't know what your answer would be for the Unity desktop. I have a feeling there's not much of one, but I could most certainly be wrong.
 
  


Reply

Tags
bluetooth, macbook pro, xubuntu



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] automatic firewall set up? mark_alfred Ubuntu 5 05-06-2010 11:57 AM
Any way to set up automatic network connection refresh in Puppy Linux 4.1.2? swellbarney Puppy 1 07-28-2009 02:41 PM
Automatic set no password SSH login Ricio Programming 2 08-02-2008 09:03 AM
dir and group ownership automatic set thllgo Linux - Newbie 3 06-13-2008 10:36 AM
can I set ip address to automatic in Mandrake 10? virtthemaest Linux - Networking 3 08-20-2004 06:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration