Score:0

Playing sound from account accessed with su or ssh

cn flag

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.

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.

raj avatar
cn flag
raj
X protocol is transferring only display, not sound. So you won't get any sound from the remote machine using X alone. You need to use something else for that purpose, for example PulseAudio remote sound feature that you mentioned. However, I don't know why it crashes. Maybe this answer helps you: https://unix.stackexchange.com/questions/470961/how-to-set-up-pulseaudio-remote-properly-and-securely
Score:0
cn flag

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.