Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
321 views
in Technique[技术] by (71.8m points)

linux pactl card list in headless devices for pulseaudio

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

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

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...