Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Hey Pedroski,
How are you using Bluetooth on your computer ? I use it regularly, but exclusively via the command line, so I may or may not be of any help to you.
First thing, using Bluetooth for audio requires additional packages compared to using it for simple file transfer type connections. You need:
bluez
bluez-libs
bluez-utils
pulseuadio
pulseaudio-alsa
pulseaudio-bluetooth
pavucontrol
... so make sure you have all that installed, first.
Afterwards, what I do is:
Enable the bluetooth systemd service
Start the bluetooth service
Start bluetoothctl
Issue the commands: power on, then : agent on, then: scan on,
This will list devices and their MAC addresses. Identify which one is your speaker.
Put your bluetooth speaker in pairing mode.
Issue the command pair [device MAC address here] in bluetoothctl.
Wait for positive result to pair command.
Issue the command connect [device MAC address here].
If you are successful, your bluetooth speaker will connect.
You then have to configure pulseaudio to output sound to the bluetooth speaker using pavucontrol.
... That's it in a nutshell - hope this helps.
Again, if you use some kind if GUI tools to manage Bluetooth, and if all of the required software is already installed on your computer, the solution to your situation may be different.
lsusb gives: Atheros Communications, Inc. AR3012 Bluetooth 4.0
Here the results of stage 1. I am using Ubuntu 16.04. 2. and 3. do not look good. Any tips?
1.
Quote:
pedro@pedro-school:~$ sudo apt-get install bluez
Reading package lists... Done
Building dependency tree
Reading state information... Done
bluez is already the newest version (5.37-0ubuntu5.1).
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
pedro@pedro-school:~$
2.
Quote:
pedro@pedro-school:~$ sudo apt-get install bluez-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package bluez-libs
3.
Quote:
pedro@pedro-school:~$ sudo apt-get install bluez-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package bluez-utils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
bluez:i386 bluez
E: Package 'bluez-utils' has no installation candidate
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Hey Pedroski,
#1 is no problem - bluez was simply already installed that's fine.
I should have mentioned that the names of the packages may vary slightly between distros. I use Arch so the names for Ubuntu may be slightly different. OR ... perhaps the bluez package in Ubuntu already includes what Arch packages in those 2 separate packages. Perhaps best to check the Synaptics Package Manager for anything with "bluez" in the name.
I can connect my laptop to my phone, send and receive files via bluetooth. I can connect my phone to my speakers and play music via bluetooth. Therefore, I think everything works.
pulseaudio needs this module in Ubuntu. It was not installed. But it still does not work, nothing shows in pulseaudio's output tab. And no sound via bluetooth!
Quote:
sudo apt-get install pulseaudio-module-bluetooth
But I still cannot connect to the speakers and stream audio! Any further tips?
Quote:
This is from lsusb
Bus 004 Device 002: ID 0cf3:3004 Atheros Communications, Inc. AR3012 Bluetooth 4.0
Quote:
pedro@pedro-school:~$ lsmod | grep -i bluetooth
bluetooth 520192 40 bnep,ath3k,btbcm,btrtl,btusb,rfcomm,btintel
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Hi Pedroski,
Since you're able to transfer files with Bluetooth on your Ubuntu computer, we can safely assume that the bluetooth systemd service is running.
From the command line, have you tried running bluetoothctl and issuing the commands I mentioned in a earlier post ? I realize that with Ubuntu you might usually manage this graphically, but perhaps this will provide clues as to what is not working.
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Hey Pedroski,
Just a thought ... make sure your phone isn't connected to your speaker while you're trying to connect your laptop to it .. This happened to me once ... seems to me I got similar behaviour from bluetoothctl ...
phone bluetooth is off. Unless a neighbour is blocking access somehow, but like I said, I can connect my phone to the robot no trouble, so I do not think it is otherwise paired, or that would not work.
Did my link work? Ubuntu 16 04 has some problems with Bluetooth out of the box. I found after editing that file, I have to remove/unpair the device from the built in Bluetooth setting gui than add it to trusted(star button) before pairing/connecting.
I read that link, thanks. I had already changed that main.conf file as suggested a couple of weeks ago.
I just deleted the device C89, then reinstalled it. When I go to System Settings>Bluetooth I see C89 connection OFF, and there is no way to turn it on. Why is the device connected: yes then a second later connected: no. Something is wrong.
Quote:
pedro@pedro-school:~$ bluetoothctl
[NEW] Controller 24:F5:AA:B7:5E:7C pedro-school [default]
[NEW] Device FC:58:FA:1D:06:09 C-89
[NEW] Device 74:23:44:4C:31:F9 PedrosPhone
[NEW] Device 3C:C2:43:93:9D:85 3C-C2-43-93-9D-85
[bluetooth]# pair FC:58:FA:1D:06:09
Attempting to pair with FC:58:FA:1D:06:09
Failed to pair: org.bluez.Error.AlreadyExists
[bluetooth]# pair FC:58:FA:1D:06:09
Attempting to pair with FC:58:FA:1D:06:09
Failed to pair: org.bluez.Error.AlreadyExists
[CHG] Device FC:58:FA:1D:06:09 Connected: yes
[CHG] Device FC:58:FA:1D:06:09 Connected: no
[CHG] Device FC:58:FA:1D:06:09 Connected: yes
[CHG] Device FC:58:FA:1D:06:09 Connected: no
[CHG] Device FC:58:FA:1D:06:09 Connected: yes
[CHG] Device FC:58:FA:1D:06:09 Connected: no
[bluetooth]#
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.