Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

in a headless device where only root user is available, pulse audio server starts automatically in startup using pulseaudio -D --disallow-exit. It runs fine so far. When the system starts the bluetooth headspeaker connects automatically. upon giving hcitool con I see the device

hcitool con connections:

ACL 00:0B:D5:F5:xx:xx:xx handle 11 state 1 im Master auth encrypt

upon giving pactl list cards I get empty output

Note that i start dbus with following command before i run pulseaudio eval "export $(dbus-launch)"

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
309 views
Welcome To Ask or Share your Answers For Others

1 Answer

i could solve it as follows:

1- add a new user to the system and to group audio adduser pi usermod -a -G audio pi

2- before running pulseaudio i ran eval "export $(dbus-launch --sh-syntax)"

3- DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}

4- su -c 'pulseaudio --start' - pi

sudo reboot -> if it does not connect automatically, do pactl list follwed by bluetoothctl and connect to the speaker.

hcitool con -> connection xx:xx:xx:xx:xx:xx

pactl list cards short i get the output


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...