# bluetooth speakers : paired OK, Alsa Ok, PulseAudio KO

## jlm_devel

I'm trying to make my speaker work with my gentoo.... so far when I do bluetoothclt, I can pair and the device connect automatically when powered on. 

I followed https://wiki.gentoo.org/wiki/Bluetooth_headset

with alsa I created a .asoundrc

```

# Bluetooth headset

defaults.bluealsa {

     interface "hci0"            # host Bluetooth adapter

     device "FC:58:FA:A7:82:A4"  # Bluetooth headset MAC address

     profile "a2dp"

}

```

when I play 

```
mpv --audio-device=alsa/bluealsa filename
```

 everything is fine.... but I can't make pulse audio use it, Pulse Audio Volume control only show my builtin audio card....

any idea?

----------

## Ant P.

Did you configure pulseaudio with bluetooth support? Is the bluez5-discover driver loaded?

----------

## jlm_devel

```

# equery u pulseaudio

[ Legend : U - final flag setting for installation]

[        : I - package is installed with flag     ]

[ Colors : set, unset                             ]

 * Found these USE flags for media-sound/pulseaudio-13.0:

 U I

 + + X              : Build the X11 publish module to export PulseAudio information through X11 protocol for clients to make use. Don't enable

                      this flag if you want to use a system wide instance. If unsure, enable this flag. 

 - - abi_x86_32     : 32-bit (x86) libraries

 + + alsa           : Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture)

 + + alsa-plugin    : Request installing media-plugins/alsa-plugins with PulseAudio plugin enabled. This ensures that clients supporting ALSA

                      only will use PulseAudio. 

 + + asyncns        : Use libasyncns for asynchronous name resolution.

 + + bluetooth      : Enable Bluetooth Support

 + + caps           : Use Linux capabilities library to control privilege

 + + dbus           : Enable dbus support for anything that needs it (gpsd, gnomemeeting, etc)

 - - doc            : Build the doxygen-described API documentation.

 - - elogind        : Use sys-auth/elogind for giving each session a PA client

 - - equalizer      : Enable the equalizer module (requires sci-libs/fftw). 

 - - gconf          : Ensure gnome-base/gconf is present for pulseaudio GConf to GSettings module automatic migration (keeping the user

                      configuration) 

 + + gdbm           : Use sys-libs/gdbm to store PulseAudio databases. Recommended for desktop usage. This flag causes the whole package to be

                      licensed under GPL-2 or later. 

 + + glib           : Add support to dev-libs/glib-based mainloop for the libpulse client library, to allow using libpulse on glib-based

                      programs. Build the GSettings PA module. 

 + + gtk            : Add support for x11-libs/gtk+ (The GIMP Toolkit)

 + + ipv6           : Add support for IP version 6

 - - jack           : Add support for the JACK Audio Connection Kit

 - - libressl       : Use dev-libs/libressl instead of dev-libs/openssl when applicable (see also the ssl useflag)

 - - libsamplerate  : Build with support for converting sample rates using libsamplerate

 - - lirc           : Add support for lirc (Linux's Infra-Red Remote Control)

 - - native-headset : Build with native HSP backend for bluez 5. 

 - - ofono-headset  : Build with oFono HFP backend for bluez 5, requires net-misc/ofono. 

 + + orc            : Use dev-lang/orc for just-in-time optimization of array operations

 + + qt5            : Add support for the Qt 5 application and UI framework

 - - realtime       : Makes PulseAudio use RealtimeKit (sys-auth/rtkit) to get real-time priority while running. 

 - - sox            : Add support for Sound eXchange (SoX)

 + + ssl            : Use dev-libs/openssl to provide support for RAOP (AirPort) streaming. 

 - - systemd        : Build with sys-apps/systemd support to replace standalone ConsoleKit. 

 + + tcpd           : Add support for TCP wrappers

 - - test           : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled

                      independently)

 + + udev           : Enable virtual/udev integration (device discovery, power and storage device support, etc)

 + + webrtc-aec     : Uses the webrtc.org AudioProcessing library for enhancing VoIP calls greatly in applications that support it by performing

                      acoustic echo cancellation, analog gain control, noise suppression and other processing. 

 - - zeroconf       : Support for DNS Service Discovery (DNS-SD)

```

```

# grep -i bluez /etc/pulse/* 

/etc/pulse/system.pa:.ifexists module-bluez5-device.so

/etc/pulse/system.pa:load-module module-bluez5-device

/etc/pulse/system.pa:.ifexists module-bluez5-discover.so

/etc/pulse/system.pa:load-module module-bluez5-discover

```

----------

## jlm_devel

I addded 

```

### Automatically load driver modules for Bluetooth hardware

.ifexists module-bluez5-device.so

load-module module-bluez5-device

.endif

.ifexists module-bluez5-discover.so

load-module module-bluez5-discover

.endif

```

into /etc/pulse/default.pa

and now it works!!!!!  :Very Happy: 

----------

## danilovicente

I did everything, but my pulseaudio still dont show my headset.

Any ideas?

----------

## kaltwulx

 *jlm_devel wrote:*   

> I addded 
> 
> ```
> 
> ### Automatically load driver modules for Bluetooth hardware
> ...

 

I want to say thank you, it works for me.

```

kalt@wulx-lenovo ~ $ sudo inxi -Fxxxza

System:

  Kernel: 5.10.52-gentoo-x86_64 x86_64 bits: 64 compiler: N/A 

  parameters: BOOT_IMAGE=/vmlinuz-5.10.52-gentoo-x86_64 

  root=UUID=70f6f26a-3a8c-4e31-a5cd-a361c7b1e2d6 ro acpi_backlight=native 

  Desktop: GNOME 40.2 tk: GTK 3.24.29 wm: gnome-shell dm: GDM 40.0 

  Distro: Gentoo Base System release 2.7 

Machine:

  Type: Laptop System: LENOVO product: 81N8 v: Lenovo IdeaPad S340-15IWL 

  serial: <filter> Chassis: type: 10 v: Lenovo IdeaPad S340-15IWL 

  serial: <filter> 

  Mobo: LENOVO model: LNVNB161216 v: SDK0J40679 WIN serial: <filter> 

  UEFI: LENOVO v: ALCN31WW(V2.08) date: 07/08/2020 

Battery:

  ID-1: BAT1 charge: 17.7 Wh condition: 31.8/36.0 Wh (88%) volts: 11.6/11.2 

  model: Celxpert L18C3PF6 type: Li-ion serial: <filter> status: Unknown 

  cycles: 374 

CPU:

  Info: Quad Core model: Intel Core i5-8265U bits: 64 type: MT MCP 

  arch: Kaby Lake family: 6 model-id: 8E (142) stepping: B (11) 

  microcode: D6 L2 cache: 6144 KiB 

  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 

  bogomips: 28808 

  Speed: 3590 MHz min/max: 400/3900 MHz Core speeds (MHz): 1: 3590 2: 3799 

  3: 3775 4: 3792 5: 3798 6: 3808 7: 3772 8: 3735 

  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 

  Type: l1tf status: Not affected 

  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 

  Type: meltdown status: Not affected 

  Type: spec_store_bypass 

  mitigation: Speculative Store Bypass disabled via prctl and seccomp 

  Type: spectre_v1 

  mitigation: usercopy/swapgs barriers and __user pointer sanitization 

  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 

  IBRS_FW, STIBP: conditional, RSB filling 

  Type: srbds mitigation: Microcode 

  Type: tsx_async_abort status: Not affected 

Graphics:

  Device-1: Intel UHD Graphics 620 vendor: Lenovo driver: i915 v: kernel 

  bus ID: 00:02.0 chip ID: 8086:3ea0 

  Device-2: Chicony Integrated Camera type: USB driver: uvcvideo 

  bus ID: 1-6:4 chip ID: 04f2:b61e serial: <filter> 

  Display: server: X.org 1.20.11 compositor: gnome-shell driver: modesetting 

  alternate: fbdev,intel,vesa resolution: <xdpyinfo missing> 

  OpenGL: renderer: Mesa Intel UHD Graphics 620 (WHL GT2) v: 4.6 Mesa 21.1.4 

  direct render: Yes 

Audio:

  Device-1: Intel Cannon Point-LP High Definition Audio vendor: Lenovo 

  driver: snd_hda_intel v: kernel alternate: snd_soc_skl,snd_sof_pci 

  bus ID: 00:1f.3 chip ID: 8086:9dc8 

  Sound Server: ALSA v: k5.10.52-gentoo-x86_64 

Network:

  Device-1: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter 

  vendor: Lenovo driver: ath10k_pci v: kernel port: 3040 bus ID: 02:00.0 

  chip ID: 168c:0042 

  IF: wlp2s0 state: up mac: <filter> 

  Device-2: Qualcomm Atheros type: USB driver: btusb bus ID: 1-10:5 

  chip ID: 0cf3:e500 

Drives:

  Local Storage: total: 232.89 GiB used: 81.93 GiB (35.2%) 

  ID-1: /dev/sda vendor: Samsung model: SSD 860 EVO 250GB family: based SSDs 

  size: 232.89 GiB block size: physical: 512 B logical: 512 B sata: 3.2 

  speed: 6.0 Gb/s serial: <filter> rev: 4B6Q temp: 39 C scheme: GPT 

  SMART: yes state: enabled health: PASSED on: 139d 22h cycles: 23525 

  written: 3.74 TiB 

RAID:

  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci 

  v: 3.0 port: 3060 bus ID: 00:17.0 chip ID: 8086.282a rev: 30 

Partition:

  ID-1: / raw size: 225.07 GiB size: 220.54 GiB (97.99%) 

  used: 81.93 GiB (37.2%) fs: ext4 block size: 4096 B dev: /dev/sda3 

Swap:

  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 

  ID-1: swap-1 type: partition size: 7.67 GiB used: 0 KiB (0.0%) 

  priority: -2 dev: /dev/sda2 

Sensors:

  System Temperatures: cpu: 46.0 C mobo: N/A 

  Fan Speeds (RPM): N/A 

Info:

  Processes: 230 Uptime: 2m Memory: 7.50 GiB used: 993.8 MiB (12.9%) 

  Init: SysVinit v: 2.99 rc: OpenRC v: 0.42.1 runlevel: default default: 3 

  Compilers: gcc: 10.3.0 alt: 10.3.0 Packages: emerge: 1254 lib: 205 

  flatpak: 0 Shell: Bash (sudo) v: 5.1.8 running in: gnome-terminal 

  inxi: 3.1.06
```

Bye!

----------

