How to transfer a bluetooth headset microphone from Debian 11 to Home Assistant, in the Rhasspy Assistant addon. There is a bluetooth headset with a microphone. Home Assistant is installed on Debian 11, on a Beelink U59 Pro mini PC, which has built-in bluetooth. In Debian 11, the bluetooth headset works properly, plays sound and records from the microphone, but in the Home Assistant, the microphone does not work, only the sound works. I need a microphone for Rhasspy Assistant so that I can connect a bluetooth speaker with a microphone and control the smart home by voice, but unfortunately the microphone does not want to work in Rhasspy Assistant.
What have I done?
Brought out the available sound cards with the command
pacmd list-cards
Displayed the available active profiles with the command
Microphone recording works in Debian 11. Checking the recording from the microphone. The command to record from the microphone.
arecord -d 5 test_record.wav
5 - recording time in seconds, you can specify any number of seconds
test_record - file name
Run the recorded file
aplay test_record.wav
Next, open the SSH & Web Terminal in the Home Assistant and enter the command pacmd list cards, where the available sound cards are displayed and it has a bluetooth headset
but in fact, it’s better not to do this, since the sound still works, and the microphone is not transmitted, but we lose the ability to control the device in Debian 11, the Dummy Output device is selected all the time. So I left the default-server as it is. The sound is transmitted to the speaker from both Debian 11 and Home Assistant
Did you look at this Select default audio device - #5 by arminJacobson , it look like HA need to assign the default input or it will not work, you probably need to change the profile of the sound device
" How to change the profile of a sound device
Thanks to this page from the Arch wiki, I was able to change the profile using pactl. The syntax is as follows: pactl set-card-profile <symbolic-name> <profilename>
Thanks for the reply. I note that razer’s built-in sound and usb sound card work fine and transmit sound to the addon Rhasspy Assistant, if you add /etc/pulse/client.conf to the config, but this does not help for a bluetooth headset
My earbuds profiles were A2DP, AVRCP and HFP and no support for HSP. Pulseaudio only supports HSP out-of-the-box. That’s why I couldn’t switch to HSP/HFP. In order to make HSP/HFP work, you have to enable HFP on pulseaudio which needs ofono.
I installed ofono using this instruction and it didn’t help. I note that ofono did not start successfully for me right away, since not everything went smoothly as in the instructions, but after I figured it out, I managed to launch ofono. Here’s how I made ofono run on Debian 11.6
Then you need to fix the OS version in the repository, specify focal instead of lunar. For understanding, Debian 11.6 has the name bullseye, and Ubuntu 20.04, which is built on the Debian build, has the name focal and impish. You need to edit all the files in the /etc/apt/sources.list.d folder/
ls /etc/apt/sources.list.d/
It was
Changing lunar to focal in the smoser-ubuntu-ppa-lunar.list file
cd /etc/apt/sources.list.d/
sed -i 's/\lunar\b/focal/g' smoser-ubuntu-ppa-lunar.list
After replacing lunar with focal, it should be like this
I go to the Home Assistant in the SSH & Web Terminal and enter
ha audio info
there are no devices
next, I enter the pactl list cards and see my Sony DR-BT50 bluetooth headphones with the A2DP profile activated, and the headset_head_unit profile deactivated
pactl list cards
далее я пытаюсь активировать профиль headset_head_unit командами
Спасибо за ответ. Отмечу, что встроенная звуковая и usb звуковая карта razer отлично работают и передают звук в аддон Rhasspy Assistant, если добавить в конфиг /etc/pulse/client.conf, но это не помогает для bluetooth гарнитуры
My earbuds profiles were A2DP, AVRCP and HFP and no support for HSP. Pulseaudio only supports HSP out-of-the-box. That’s why I couldn’t switch to HSP/HFP. In order to make HSP/HFP work, you have to enable HFP on pulseaudio which needs ofono.
Я установил ofono по этой инструкции и это не помогло. Отмечу, что ofono не сразу у меня успешно запустилось, так как не все шло гладко как в инструкции, но разобравшись, у меня получилось запустить ofono. Вот как я сделал, чтобы ofono запустилось на Debian 11.6
То нужно исправить версию ОС в репозитории, вместо lunar указать focal. Для понимания, Debian 11.6 имеет имя bullseye, а Ubuntu 20.04 которая собрана на сборке Debian имеет имя focal и impish. Нужно отредактировать все файлы в папке /etc/apt/sources.list.d/
ls /etc/apt/sources.list.d/
Было
Меняем lunar на focal в файле smoser-ubuntu-ppa-lunar.list
cd /etc/apt/sources.list.d/
sed -i 's/\lunar\b/focal/g' smoser-ubuntu-ppa-lunar.list
And so, many hours of attempts to make the bluetooth microphone work were unsuccessful. I even installed Debian 11 on a virtual machine, installed a portainer and deployed a Rhasspy container with such parameters. There are only built-in sound cards, but there is no usb bluetooth headset. As they say, for the bluetooth headset to work in Rhasspy Assistant, you need to install bluez-alsa on Debian, but I can’t install and run bluez-alsa, even if I just compile according to this instructions, there are no necessary packages for Debian 10 and 11, which also need to be built.