PulseAudio setting by Terminal


#1

Hi all,

I want to change PulseAudio Output/Input Devices port by terminal.
Then I send the command:
root@linaro-alip:/home/linaro# pactl set-sink-port alsa_output.platform-7702000.sound.HiFi__plughw_0_1__sink '[Out] Speaker’
root@linaro-alip:/home/linaro# pactl set-source-port alsa_input.platform-7702000.sound.HiFi__plughw_0_2__source ‘[In] Primarymic’

By the same command, I want to use UART1 console to send it, but it occurs ERROR:
root@linaro-alip:/home/linaro# pactl set-sink-port alsa_output.platform-7702000.sound.HiFi__plughw_0_1__sink '[Out] Speaker’
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
root@linaro-alip:/home/linaro# pactl set-source-port alsa_input.platform-7702000.sound.HiFi__plughw_0_2__source '[In] Primarymic’
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
root@linaro-alip:/home/linaro#

How can I fix this bug?
version: Linaro Linux version 16.06

Thanks


#2

pulseaudio is running for a specific user, not for root. so you need to run this command from a terminal logged as ‘linaro’ (assuming you are logged as linaro in your desktop env).


#3

Hi ndec,

I try to modify UART console from a terminal logged as ‘linaro’, but failed as follows:

root@linaro-alip:~# su linaro
linaro@linaro-alip:/root$ cd
linaro@linaro-alip:~$ pactl set-sink-port alsa_output.platform-7702000.sound.HiFi__plughw_0_1__sink '[Out] Speaker’
XDG_RUNTIME_DIR (/run/user/0) is not owned by us (uid 1000), but by uid 0! (This could e g happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don’t do that.)
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
linaro@linaro-alip:~$

Is there any method that I can logged as ‘linaro’ by using UART?

thanks.