- Created a new file by sudo vi /etc/asound.conf and added the following as its sole content (if you know the MAC address of your Bluetooth device, substitute it already now; otherwise you can change it also later in step 9):
This was a very important reason why "pa rescan " had failed for me previously: I had defined the devices in the .asoundrc of the user pi, but freeswitch was running with the user "freeswitch" who has no login shell and hence cannot have any .asoundrc --> device configuration had to go to a user-independent level.
The suggested content for this file tried to get a better output quality by making use of the "a2dp" profile whereas for the mic you have to use the "sco" profile. However, in this combination pa is eventually working in a pretty unstable way. Therefore, we can simplify the content the following way:
pcm.btAudioIO {
type plug
slave.pcm {
type bluealsa
service "org.bluealsa"
device "00:11:09:94:14:3D"
profile "sco"
delay 10000
}
hint {
show on
description "Bluetooth Audio Input/Output Dvice"
}
}
ctl.btAudioIO {
type bluealsa
service "org.bluealsa"
battery yes
}
- Test your device with the following two commands (five seconds recording):
arecord -D btAudioIO -d 5 test.wav
aplay -D btAudioIO test.wav
You may also perform a loop test:
arecord -D btAudioIO | aplay -D btAudioIO
After a reboot, after which also FreeSwitch and my application start, everything was working for me just fine :-)
I forgot to say that you can test the working of the setup in fs_cli the following way:
KR,
-- Saied