View previous topic :: View next topic |
Author |
Message |
Krotos n00b
Joined: 14 Oct 2006 Posts: 27
|
Posted: Thu Jan 22, 2015 2:06 am Post subject: Missing Bluetooth library for ALSA [Solved] |
|
|
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 |
|
|
BT Guru
Joined: 13 Jun 2004 Posts: 318
|
Posted: Thu Jan 22, 2015 2:44 am Post subject: |
|
|
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 |
|
|
Krotos n00b
Joined: 14 Oct 2006 Posts: 27
|
Posted: Fri Jan 23, 2015 5:10 pm Post subject: |
|
|
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 |
|
|
Krotos n00b
Joined: 14 Oct 2006 Posts: 27
|
Posted: Fri Jan 23, 2015 7:06 pm Post subject: Missing Bluetooth library for ALSA [Solved] |
|
|
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:
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 |
|
|
|
|
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
|
|