Lubuntu
linux Tips (2015-2020) |
Setting Up Bluetooth
Audio with Alsa Installing Bluetooth Headphones or Speakers |
Bluetooth probably
already came installed on your Ubuntu-like distro, but just incase
:
1. Install blueman
bluez-asla That's right (!), that's all you need ! 2. Edit Config file The alsa config file is searched
for in many places;
/etc/alsa.conf
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;/usr/share/alsa/alsa.conf /etc/bluetooth/audio.conf /usr/share/alsa/alsa.conf.d/70-btspeakers.conf /usr/share/alsa/alsa.conf.d/70-btspeakers.conf 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 it by this 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! Extras How to set the default ALSA pcm device. Step 5 (above) can be a real pain everytime you want to switch device. To get Alsa to select your device by default no matter which player you are using, Create a ".asoundrc" file in your home directory like this; ~/.asoundrc pcm.softvol_for_btspeakers
{ type softvol slave.pcm "btspeakers" control.name "Bluetooth" control.card 0 } #pcm.!default front # main (use aplay -L to get this name) #pcm.!default btspeakers # bluetooth speakers WITHOUT software vol ctrl pcm.!default softvol_for_btspeakers # bluetooth speakers WITH software volume control The top part enables the device to
be controlled with compatible software volume control (e.g
smplayer, audacious..etc). It is not needed, but it's nice to have.
The bottom line is the important part. Un-comment the line that you want as the default device and comment out the other ones. There is no need to 'bluetooth restart' (unless you just added a new device), just close and re-open your player. To get a list of device names type : > aplay -L The main card is something
like;
front:CARD=Intel,DEV=0
which is used as pcm.!default front ( you only really need this to find
out the name of your main speakers)
Tip: 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. Switching default devices. Now you can switch between devices
by either
ora) Editing .asoundrc b) Create multiple copies of
asoundrc e.g one for
main-speakers, one for btspeakers, ..etc.
and just copy over the one you need to use. e.g cp ./options/asoundrc.3 ~/.asoundrc /End. |
Advertisement More Lubuntu Tips |