linux pactl card list in headless devices for pulseaudio

前提是你 提交于 2019-12-26 03:54:16

问题


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)"


回答1:


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



来源:https://stackoverflow.com/questions/50327504/linux-pactl-card-list-in-headless-devices-for-pulseaudio

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!