3

i am connecting from a laptop:

$ uname -a
Linux fedora 5.11.18-200.fc33.x86_64 #1 SMP Mon May 3 15:05:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

to a single-board-computer:

$ uname -a
Linux mobian 5.10-sunxi64 #2 SMP PREEMPT Tue Jan 12 09:55:56 UTC 2021 aarch64 GNU/Linux

over SSH with compressed X11 forwarding:

ssh -YC user@mobian

everything seems great except for the fact, that audio plays in the laptop and I want it to play in the remote machine. how is this achieved?


P.S. I suspect this is something fedora-specific as the same ssh -YC user@mobian connection from a different device:

$ uname -a
Linux sxmo 5.11.0 #1-postmarketos-allwinner SMP Sat Mar 27 14:48:00 UTC 2021 aarch64 GNU/Linux

leaves the audio-output on the remote machine.


EDIT based on comments:

locally on fedora:

[user@fedora ~]$ xprop -root | grep PULSE
PULSE_COOKIE(STRING) = "28d747cacea4736118f778c450628a4b88489d1158cc10899f3bc54a078fe37b843810ebeb397abece2533b0d988569f3d01b838b2f7fa560712c78cc9d64cbba2d0e9e34f602b348ccf589d4f0bf159c9a078bf1a6e9a8140f930b2d5e4cb21cb31bf8f22112b2cfd2476f02694e3060ae9f3918e58629a49ec1fbb730c2af4dee1f42de13c0046b2f7fc664302724fbc3d27a0863e98dcede752d9451644d6f8b5e10f0a1ec88320b8686b292b6225c02c043719818a4d4041fcb60bfeef97ebfb6601f83c5d8052a64489c5507ac02876d171a6bb942f20991e0a31271c97d2ba3b9f8baef66a06affb5d33aa198be394f798622d6ffd8d2a5926a8402a08"
PULSE_SERVER(STRING) = "{f5e96850fbf948e19c0eba4f100fa72a}unix:/run/user/1000/pulse/native tcp:fedora.localdomain:4713 tcp6:fedora.localdomain:4713"
PULSE_SESSION_ID(STRING) = "2"
PULSE_ID(STRING) = "1000@f5e96850fbf948e19c0eba4f100fa72a/1985"

remotely on mobian without -YC:

user@mobian:~$ xprop -root | grep PULSE
xprop:  unable to open display ''

remotely on mobian with -YC:

[user@fedora ~]$ ssh user@mobian -YC

...

user@mobian:~$ xprop -root | grep PULSE
PULSE_COOKIE(STRING) = "28d747cacea4736118f778c450628a4b88489d1158cc10899f3bc54a078fe37b843810ebeb397abece2533b0d988569f3d01b838b2f7fa560712c78cc9d64cbba2d0e9e34f602b348ccf589d4f0bf159c9a078bf1a6e9a8140f930b2d5e4cb21cb31bf8f22112b2cfd2476f02694e3060ae9f3918e58629a49ec1fbb730c2af4dee1f42de13c0046b2f7fc664302724fbc3d27a0863e98dcede752d9451644d6f8b5e10f0a1ec88320b8686b292b6225c02c043719818a4d4041fcb60bfeef97ebfb6601f83c5d8052a64489c5507ac02876d171a6bb942f20991e0a31271c97d2ba3b9f8baef66a06affb5d33aa198be394f798622d6ffd8d2a5926a8402a08"
PULSE_SERVER(STRING) = "{f5e96850fbf948e19c0eba4f100fa72a}unix:/run/user/1000/pulse/native tcp:fedora.localdomain:4713 tcp6:fedora.localdomain:4713"
PULSE_SESSION_ID(STRING) = "2"
PULSE_ID(STRING) = "1000@f5e96850fbf948e19c0eba4f100fa72a/1985"

locally on mobian:

user@mobian:~$ xprop -root | grep PULSE
PULSE_COOKIE(STRING) = "8139d0fdc04752954ff9018ca4006d741d1b8aef9ed8fdd041184fda6080bad0fbf0e0ca00ecc6eacd5b4adde99d84ac33932773da3b8dd99a2adaeb085cd622daefbd75ab193690185f856457ac9541a1e4075a8217484df1bd136d00bc6c0c80abef6e3ee86daed144c33fece49cd9a896c3bb7dcb6520441f21c48a7f045693d9d6e47e2f7bc32ce6ce4b958df2842f8d7298d690e48a1343fbed5310fa50475acaf928047802978cf0f417502c298332b56e5a66a75b97e9ddb59a739e4d34c8f63fbb7ce883b35ed115c44639db11d5e543665978dfcbe43b5d8d41677ee68195c153103986283d80b2ce3239559f12d2928b9ffb05054e3cca70ff277d"
PULSE_SERVER(STRING) = "{e5ca38bfe5be445f838be0328a1c5f33}unix:/run/user/1000/pulse/native tcp:mobian.localdomain:4713 tcp6:mobian.localdomain:4713"
PULSE_ID(STRING) = "1000@e5ca38bfe5be445f838be0328a1c5f33/615"
9
  • Exactly how are you trying to produce audio on the remote machine? If it's just the terminal beep (e.g. echo -e '\a'), the remote system just outputs a "bell" character and the terminal emulator on your local system decides how it is presented: some audible sound, a visual notification ("visible bell") or nothing at all.
    – telcoM
    May 16 at 17:46
  • audio is played per web-browser.
    – scjorge
    May 16 at 17:50
  • 1
    I think the specific tools on mobian pick up the information available through fedora's xprop root display to use remotely pulseaudio. As I don't have a tool doing this (it's related to mobian more than fedora here), I can't test if that's really what happened. I believe the answer(s) is there: askubuntu.com/questions/607820/… . Try xprop -root |grep PULSE to get an idea (this should work the same if run remotely through ssh or locally: get local display information). I also don't know what channel would be used to tunnel through.
    – A.B
    May 16 at 19:17
  • 1
    Both display "tcp:fedora.localdomain:4713" in the results. Like if pulseaudio is advertising this, but I wouln't know more on the subject.
    – A.B
    May 19 at 17:55
  • 1
    If you install paprefs - an addon for pulseaudio, you can setup pulseaudio to stream audio with a direct connection when you establish your X11 forwarding. Unfortuantly, I don't remember how to do it - I know it works on debian so it should work on any linux. May 19 at 21:08
0

it seems that the solution is described here:
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/#xforwarding

it's all about the PULSE_SERVER "variable". So starting a process with PULSE_SERVER=localhost appenden before ensures the audio protocols run on the host machine. In my case the single board computer and not the laptop.

I have only had the chance to test this once, so I am not sure it works on all scenarios but here it is:

[user@fedora ~]$ ssh user@mobian -YC

...


user@mobian:~$ PULSE_SERVER=localhost [YOUR_APLICATION]

I'll try to update if I get more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.