Adding Bluetooth Speakers to Linux
Playing Music on Multiple Sets of Speakers
Here was the plan:
I've used a stereo audio Y cable
to connect my Linux desktop both to standard powered speakers
on a shelf above the computer, and to the Line In port
on a receiver driving speakers in the bedroom.
The bedroom is through the wall, and I ran the speaker wire through the wall by removing the plates on the cable TV connections.
The receiver, dating from the late 1980s, was getting flakey. And the speaker wire was questionable. I wanted to avoid wires.
I would put a Bluetooth speaker on the shelf over the bed.
I also needed to add a Bluetooth transceiver to the Linux desktop. Setting it up was simple. Plug the Bluetooth transceiver into a USB port, and plug the speaker into a smartphone charger. Then bring up the Bluetooth configuration panel from the Settings menu, click to "flip the switch" by "Connection", and the Bluetooth link is good.
The music that was playing through the wired speakers immediately switched to the Bluetooth speakers. I could switch it back and forth, but I didn't see a way to make it send output to both the wired speakers and the Bluetooth speaker simultaneously.
The Solution — Add a Virtual Output DeviceAdding MP3/MPEG Support to RHEL, Oracle, and Fedora Linux
which has it own package on Mint and Ubuntu.
That command starts the PulseAudio Preferences
graphical configuration tool.
module-gconf loaded in the sound server.
Also make sure you have the
You very likely have everything except
paprefs, select the Simultaneous Output tab,
and check the box for "Add virtual output device for
simultaneous output on all local sound cards" as you see here.
Select the New Virtual Output Device
I haven't figured out the plumbing of PulseAudio and other sound modules. Once I saw that I might be in for a long experimental struggle with various services, I simply rebooted.
Now the Sound panel from the Settings menu gave me a third Output choice. It wasn't there before. Select it.
You should now be hearing audio through both devices simultaneously.
Adjust Levels As Needed
pavucontrol command to bring up a tool
to configure your audio, including adjusting the relative
levels of the Line Out device (wired speakers) versus the
Headphones (Bluetooth speakers).
Note that the Bluetooth device likely has some latency, it will be a little behind the wired speakers. This might matter to you if you're putting your wired and Bluetooth speakers at either end of a large shared space. If so, the Advance option in this tool lets you adjust latency.
Now take the Bluetooth speakers into the other room!
If you bought a really low-end Bluetooth speaker without a volume control, you may need to make a few back-and-forth trips to adjust the relative levels.
Enjoy! Or Go Deeper
Above I have France Bleu Provence playing.
The Bluetooth player will appear in
$ lsusb Bus 002 Device 005: ID 062a:727a MosArt Semiconductor Corp. Bus 002 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub Bus 002 Device 003: ID 03f0:c311 HP, Inc Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) Bus 001 Device 005: ID 046d:c52b Logitech, Inc. Unifying Receiver Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
You can ask for a verbose description by specifying its bus and device number. For example:
$ lsusb -v -s 001:006 [... much output deleted ...]USB ID
You can look up the vendor and device IDs at the
USB ID Repository.
For example, mine appears as
"Cambridge Silicon Radio, Ltd",
and device ID
"Bluetooth Dongle (HCI Mode)",
both as reported by
bluez-tools package contains some
useful commands, see their manual pages for details:
$ dpkg --listfiles bluez-tools | grep 'bin/' /usr/bin/bt-adapter /usr/bin/bt-agent /usr/bin/bt-device /usr/bin/bt-network /usr/bin/bt-obex $ bt-adapter -l Available adapters: desktop (00:1B:DC:06:77:A2) $ bt-adapter -i [hci0] Name: desktop Address: 00:1B:DC:06:77:A2 Alias: desktop [rw] Class: 0x1c0104 Discoverable: 1 [rw] DiscoverableTimeout: 0 [rw] Discovering: 0 Pairable: 0 [rw] PairableTimeout: 0 [rw] Powered: 1 [rw] UUIDs: [00001133-0000-1000-8000-00805f9b34fb, AVRemoteControl, OBEXObjectPush, 00001132-0000-1000-8000-00805f9b34fb, PnPInformation, IrMCSync, 00005005-0000-1000-8000-0002ee000001, HeadsetAudioGateway, AVRemoteControlTarget, PhoneBookAccess, 00001801-0000-1000-8000-00805f9b34fb, AudioSink, 00001800-0000-1000-8000-00805f9b34fb, Headset, AudioSource, OBEXFileTransfer] $ bt-device -l Added devices: onn. Indoor SPK MD GRY (F4:4E:FD:C2:C8:14) $ bt-device --info=--info=F4:4E:FD:C2:C8:14 [F4:4E:FD:C2:C8:14] Name: onn. Indoor SPK MD GRY Alias: onn. Indoor SPK MD GRY [rw] Address: F4:4E:FD:C2:C8:14 Icon: audio-card Class: 0x240404 Paired: 1 Trusted: 1 [rw] Blocked: 0 [rw] Connected: 1 UUIDs: [AudioSource, AudioSink, AVRemoteControlTarget, AVRemoteControl, Handsfree]
Building a Media Player with Kodi/OSMC Fix for: My Microphone Is Not Working Back to the Linux page