Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Playing sound from account accessed with su or ssh

I have two accounts. jamesk and other

I can run X windows applictions using the other account in a couple of ways:

  1. ssh -X other@localhost
  2. xhost + followed by su - other and the then export DISPLAY=:0.0

With either of these I can run, for example xeyes and open a window.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

However I can’t get any sound from the other account.

I’d like to run

jamesk$ ssh -X other@localhost
(password)
other@localhost$ ffplay yesterday.mp3

I’ve looked at paprefs, however any attempt to install any of the modules required for network sound cause paprefs to crash with SIGTRAP

When I do this I don’t get any sound played, but I do see the ffplay visualiation of the sound.

>Solution :

To make the connection you need an open tcp port.

So connect to the second account with ssh

jamesk$ ssh -R 22753:localhost:4713 -X other@localhost

This opens a port for sound.

Then set pulseaudio on the other account to use that tcp port

other$ export PULSE_SERVER="tcp:localhost:22753"

Pulseaudio then connects back through the ssh connection to the main account, where the sound is picked up and played.

This requires the tcp module to be enabled on the main account.
jamesk$ pactl load-module module-native-protocol-tcp auth-anonymous=1
27
jamesk$ pactl list modules short

module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/24

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading