How to use Bluetooth Speaker + Mic with Rhasspy

Hi guys!

I’ve got a Samsung Bluetooth Speaker with integrated Mic (called Level Box Slim) and i would use it with Rhasspy.
I succeded in configuring the “Speaker part” and it works but it doesn’t listen my vocal command through the mic.

Can anybody of you teach me how to solve this problem and also tell me if it’s possible to connect and use more Bluetooth Speaker simultaneously (one in each room of my house) to HA?

Thanks

1 Like

Are you running Rhasspy within docker? If so, I found it very challenging to get bluetooth audio (especially the mic) working. The good news is I DID finally get it working.
Shoot me a message if you are using docker (or docker-compose) and I’ll gather the references that I used to get mine working.

I would love to know this as well. Currently have Docker but could install docker compose as well

No, i’m an hassio user…

My understanding is that Bluetooth is a simple one-to-one connection. However I have noticed one model of speaker with a “feature” that two units could be used to give stereo sound.

Rhasspy configuration only selects one audio input or output device - so the way around this is to have a small Rhasspy satellite in each room with its own mic and speaker. Since each rhasspy satellite is named, this also allows the rhasspy base (and through this HA) to respond intelligently based on which room the voice command was given.

I use hassio too, but never even managed to get a bluetooth speaker to work. Could you please explain me how to do this?

It would be awesome if you could post your manual here.

Besides my hassio-Raspberry I use a docker setup on my satellite-Raspberry.

I definetely would try to follow your manual, I would love to use a bluetooth mic and speaker for Rhasspy! Until now I have only an AUX-speaker which switches to standby every 14 minutes after no Noise was heard.

I am very interested in knowing how you were able to get it working.

A manual would be much appreciated. I am running Rhasspy in a docker. So far, I have managed to get audio on my bluetooth speaker but the mic is still not working. Funny thing is, if I enter the wake word in the “Speak” section of Rhasspy homepage and play it, the wake word is detected. But the mic does not work otherwise.

by terminal tape

bluetoothctl
(enter)
help
(enter)

then read the list of command you can use. it’s simple but i don’t remember all the steps now…

the problem is that the integrated mic doesn’t work.
i don’t know why but hassio only read the “speaker part” of the device!!

I finally made it work today

I tried to create a detailed guide of sorts for you folks but I think the exact steps that will be required depend on your setup. So I am just posting the general steps here and you can ask for more details based on your own setup.

  1. Verify that you can change the profile of your bluetooth speaker. Most likely, the default profile would be a2dp-sink. You need to change this profile to head_head_unit.

You can check this using the pactl commands link

If headset_head_unit profile is not available, mic cannot be used for Rhasspy.
I had tried to do this with Libreelec and Ubuntu 20.04, both of which did not allow me to change the speaker profile. Currently running Ubuntu 22.04.

  1. For Haasio, this change should be enough to access the mic in my opinion.
    For docker users. add this mapping to your docker run command and run again:

-v “/run/user/$UID/pulse:/run/pulse”
-v “$HOME/.config/pulse/cookie:/.config/pulse/cookie”

And this is it. I was able to access the mic and the speaker at the same time in rhasspy.

The key is definitely being able to change the bluetooth speaker’s profile.

2 Likes

The hardest part is getting BT working with a headset. A BT speaker is easier, but a headset is more problematic. Here are my final steps to getting my headset working:

  • REF: FIX: Bluetooth Audio on a Raspberry Pi - YouTube
    • start with fresh Raspbian 64-bit LITE image

    • sudo apt -y purge “pulseaudio*” #note this is ALL pulseaudio stuff

    • sudo apt update

    • sudo apt -y full-upgrade

    • sudo apt update

    • sudo apt -y dist-upgrade

    • sudo apt -y purge “pulseaudio*” #note this is ALL pulseaudio stuff

    • sudo reboot now

    • sudo apt install pulseaudio pulseaudio-module-bluetooth -y

    • sudo nano /lib/systemd/system/bluetooth.service

      • Edit the ExecStart=/usr/lib/bluetooth/bluetoothd line to add --noplugin=sap
    • systemctl daemon-reload

    • sudo systemctl restart bluetooth.service

    • sudo systemctl status bluetooth.service

      • Final line is an error: “Failed to set privacy: Rejected (0x0b)”
    • sudo reboot now

    • #sudo apt-get install pulseaudio-module-bluetooth

    • sudo nano /etc/pulse/default.pa

      • Append the line:
        load-module module-bluez5-discover
    • add the PI user to the bluetooth group

      • sudo usermod -a -G bluetooth pi
    • sudo reboot now

    • If you need to determine your device id:

      • bluetoothctl scan on
    • bluetoothctl pair 20:74:CF:A6:93:CC

    • bluetoothctl trust 20:74:CF:A6:93:CC

    • bluetoothctl info 20:74:CF:A6:93:CC

    • reboot

      • For some reason, I have to reboot before I’m able to successfully connect
    • bluetoothctl connect 20:74:CF:A6:93:CC

      • Ensure the headset is in the ready to connect mode
    • pactl set-card-profile YOURBTUNIT headset_head_unit

      • If you don’t do this, you won’t have access to the mic of your headset
      • pactl set-card-profile bluez_card.20_74_CF_A6_93_CC headset_head_unit
    • Verification:

      • arecord -d 3 test3.wav
        talk for 3 seconds
      • aplay test3.wav

Could you clarify how to use it if Home Assistant with Supervisor is installed on Debian 11? I’m still trying to throw a bluetooth headset with Debian 11 into the Home Assistant, into the rhasspy addon. I get sound on the bluetooth headset, but the microphone does not work, although in Debian 11 both headphones and microphone work for me. The HFS profile is activated, the HFS profile is not available in the Home Assistant. Do you know how to reset the microphone? Here i described in detail everything i did