humpty promotes - Linux - Lubuntu

Lubuntu linux Tips
Setting Up Bluetooth Audio with Alsa
Installing Bluetooth Headphones or Speakers

Bluetooth probably already came installed on your Ubuntu-like distro, but just incase
it didn't,
you uninstalled by mistake,
you can't get pulse-audio working,

then here is a way to get your headset or speakers working with Alsa alone.

1. Install

That's right (!), that's all you need !

2. Edit Config file
The alsa config file is searched for in many places;
I recommend creating and editing the last one. It begins with a priority number (70) it can be any number and the system reads the files in order of this number. That's not interesting, what is interesting is the content;


pcm.btspeakers {
   type plug
   slave {
       pcm {
           type bluetooth
           device FC:58:FA:C3:03:96
           profile "auto"
   hint {
       show on
       description "BT Speakers"
ctl.btspeakers {
  type bluetooth

The HEX values specify the device ID. You get this by issueing the command;
hcitool scan
Scanning ...
    FC:58:FA:C3:03:96    DOSS hurricane3

Make up your own name e.g btspeakers, btheadset..,, etc  and give it a description e.g "BT Speakers"

3. Restart Bluetooth

sudo service bluetooth restart

4. Pair and Connect

Preferences > Bluetooth Manager

Adapter > Search

Search and pair the headphones or speakers...
Connect and pair to "Audio Sink"

5. Play

Audacious : File > Preferences > Audio > Output Settings >
ALSA-Preferences > PCM device: btspeakers

Mplayer : -ao alsa:device=btspeakers

(for SMplayer, paste alsa:device=btspeakers into the "output driver>user defined" box

That's it!

How to set the default ALSA pcm device.

If you want Alsa to select your device by default then create another config file or append this code after ;

pcm.!default {
    type plug
    slave.pcm "btspeakers"

Alternatively (and preferred) you can create a ".asoundrc"  file in your home directory like this;

   type softvol
   slave.pcm "btspeakers" "Bluetooth"
   control.card 0

#pcm.!default front:Intel # main
#pcm.!default btspeakers # bluetooth speakers
pcm.!default btspeakers_softvol # bluetooth speakers with software volume control

The first part enables the device to be controlled with compatible software (e.g smplayer). It is not
needed, but it's nice to have.

The bottom part is the important part. Un-comment the line that you want as the default device.
There is no need to 'bluetooth restart', just close and re-open your software.

To get a list of device names type : > aplay -L

The main card is something like;
which is used as pcm.!default front:Intel

The bluetooth device is something like;
is used as pcm.!default btspeakers_softvol

The main (base) volume can be set by using the command line tool: alsamixer.
There will be a column which you can tab to called Bluetooth.



More Lubuntu Tips

Leading Cloud Surveillance, Recording and Storage service; IP camera live viewing

Leading Enterprise Cloud IT Service; cloud file server, FTP Hosting, Online Storage, Backup and Sharing

Powered by, a division of DriveHQ, the leading Cloud IT and Cloud Surveillance Service provider since 2003.