Hello,
I loaded a build from scratch to test this. Here are the steps I followed:
uname -a
Linux NIIRA-06894995 5.15.77-6.3.0-devel+git.ddc6ca4d76ea #1 SMP PREEMPT Thu Jun 29 10:14:22 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
To run Pulseaudio, I first stopped the following services:
systemctl stop bluealsa
systemctl stop ofono
systemctl disable bluealsa
systemctl disable ofono
Then, I created a non-root user named test
with the following commands:
adduser test
usermod -aG audio test
Additionally, I modified the /etc/dbus-1/system.d/bluetooth.conf
file by adding the following lines:
<policy user="pulse">
<allow send_destination="org.bluez"/>
</policy>
I also modified the /etc/asound.conf
file, replacing the original content with:
pcm.!default {
type pulse
hint.description "Default Audio Device"
}
ctl.!default {
type pulse
}
I want to indicate that I executed the script in the WebRTC thread like this:
Run as root:
echo "Killing and unblocking bluetooth"
rfkill unblock bluetooth
sleep 1
echo "Powering bluetooth"
bluetoothctl power on
echo "Turn on agent"
bluetoothctl agent on
sleep 1
echo "setting default agent"
bluetoothctl default-agent
# Check for PulseAudio processes
process_id=$(ps aux | grep -i pulseaudio | grep -v grep | awk '{print $2}')
# If a PulseAudio process is found
if [ ! -z "$process_id" ]; then
echo "PulseAudio process found with PID: $process_id"
# Kill the PulseAudio process
kill -9 $process_id
# Verify if the process is killed
if [ $? -eq 0 ]; then
echo "PulseAudio process killed successfully."
else
echo "Failed to kill the PulseAudio process."
fi
else
echo "No PulseAudio process found."
fi
Run as test user:
# to check if PulseAudio is running
check_pulseaudio() {
ps aux | grep -i pulseaudio | grep -v grep > /dev/null
return $?
}
echo "starting Pulseaudio"
pulseaudio -v
# Wait for PulseAudio process to start
while ! check_pulseaudio; do
echo "Waiting for PulseAudio to start..."
sleep 1
done
echo "PulseAudio is now running."
echo "Loading sink/output device"
pactl load-module module-alsa-sink device=hw:0,0
sleep 1
echo "Setting default sink/output"
pactl set-default-sink alsa_output.hw_0_0
echo "Loading source/input"
pactl load-module module-alsa-source device=hw:0,0
Run as root:
echo "Enabling SCO"
hcitool -i hci0 cmd 0x3F 0x001D 0x00
I also executed the entire script as root and with the test user. However, none of these tests worked; the audio was choppy, and the receiver could not hear me.
Thanks,
Ferran