Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Missing Bluetooth library for ALSA [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Krotos
n00b
n00b


Joined: 14 Oct 2006
Posts: 27

PostPosted: Thu Jan 22, 2015 2:06 am    Post subject: Missing Bluetooth library for ALSA [Solved] Reply with quote

Hello,

I'm trying to use mplayer to play a sound file to a Bluetooth-connected speaker. I believe the actual Bluetooth connection is working fine (I am able to pair and connect with bluetoothctl). I followed the instructions in the Gentoo Wiki for Bluetooth headset devices, and accordingly the .asoundrc file in my home directory contains:

Code:

pcm.bluetooth {
type bluetooth
device [my bluetooth controller's MACID]
profile "auto"
}



However, when I try to play an MP3 file and direct the output to bluetooth:

Code:

mplayer -ao alsa:device=bluetooth [mp3 file]


I get this error:

Code:

[AO_ALSA] alsa-lib: /var/tmp/portage/media-libs/alsa-lib-1.0.28/work/alsa-lib-1.0.28/src/dlmisc.c:252:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib64/alsa-lib/libasound_module_pcm_bluetooth.so
[AO_ALSA] Playback open error: No such device or address
Failed to initialize audio driver 'alsa:device=bluetooth'
Could not open/initialize audio device -> no sound.
Audio: no sound
Video: no video


I verified that libasound_module_pcm_bluetooth.so is not present in the directory /usr/lib64/alsa-lib/, and I could not find it anywhere else on my system. Also, bluetooth.conf, mentioned in the Wiki article, is not in /usr/share/alsa.

Does anyone know how I can get this library? Despite much hunting around I could not figure out which USE flags, kernel options, etc., I should change, or find a solution online. (I followed the Wiki instructions for the installation of bluez and remerged -uDN @world after adding a global "bluetooth" USE flag, as directed.)

Many thanks,
Krotos


Last edited by Krotos on Fri Jan 23, 2015 7:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
BT
Guru
Guru


Joined: 13 Jun 2004
Posts: 318

PostPosted: Thu Jan 22, 2015 2:44 am    Post subject: Reply with quote

Since you're using BlueZ 5 (bluetoothctl), you also need PulseAudio 5 in order to use a Bluetooth headset/speaker. If you don't want to use PulseAudio, then you need to use BlueZ 4.
Back to top
View user's profile Send private message
Krotos
n00b
n00b


Joined: 14 Oct 2006
Posts: 27

PostPosted: Fri Jan 23, 2015 5:10 pm    Post subject: Reply with quote

BT wrote:
Since you're using BlueZ 5 (bluetoothctl), you also need PulseAudio 5 in order to use a Bluetooth headset/speaker. If you don't want to use PulseAudio, then you need to use BlueZ 4.


I have PulseAudio v. 5.0-r4 and Bluez v. 5.25 installed. I remerged them both, but the missing library did not appear. I also remerged alsa-lib, which equery shows as the source of the other libraries in /usr/lib64/alsa-lib, but the Bluetooth library still did not show up. I will try re-syncing and emerging -uDN world.
Back to top
View user's profile Send private message
Krotos
n00b
n00b


Joined: 14 Oct 2006
Posts: 27

PostPosted: Fri Jan 23, 2015 7:06 pm    Post subject: Missing Bluetooth library for ALSA [Solved] Reply with quote

Krotos wrote:
BT wrote:
Since you're using BlueZ 5 (bluetoothctl), you also need PulseAudio 5 in order to use a Bluetooth headset/speaker. If you don't want to use PulseAudio, then you need to use BlueZ 4.


I have PulseAudio v. 5.0-r4 and Bluez v. 5.25 installed. I remerged them both, but the missing library did not appear. I also remerged alsa-lib, which equery shows as the source of the other libraries in /usr/lib64/alsa-lib, but the Bluetooth library still did not show up. I will try re-syncing and emerging -uDN world.


Finally got it working after finding an Arch usergroup post on the subject. The key was to redirect the output to PulseAudio rather than (as specified on the Gentoo Wiki) ALSA. My $HOME/.asoundrc is now:

Code:

pcm.pulse {
    type pulse
}

ctl.pulse {
    type pulse
}

pcm.!default {
    type pulse
}

ctl.!default {
    type pulse
}



I also emerged media-sound/pavucontrol:

Code:

emerge pavucontrol


The pavucontrol program detected my Bluetooth speaker automatically (after I had connected to it with bluetoothctl) and I used it to specify the speaker as the default output.

Finally, I ran mplayer as:

Code:

mplayer -ao pulse [MP3 file]


and the sound is coming out fine.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum