我从笔记本电脑连接:
$ 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
到单板计算机:
$ uname -a
Linux mobian 5.10-sunxi64 #2 SMP PREEMPT Tue Jan 12 09:55:56 UTC 2021 aarch64 GNU/Linux
通过 SSH 并使用压缩的 X11 转发:
ssh -YC user@mobian
一切看起来都很棒,除了音频在笔记本电脑中播放并且我希望它在远程计算机中播放这一事实之外。这是如何实现的?
PS 我怀疑这是 Fedora 特有的东西,因为ssh -YC user@mobian
来自不同设备的相同连接:
$ uname -a
Linux sxmo 5.11.0 #1-postmarketos-allwinner SMP Sat Mar 27 14:48:00 UTC 2021 aarch64 GNU/Linux
将音频输出留在远程计算机上。
编辑根据评论:
本地 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"
在 mobian 上远程,无需-YC
:
user@mobian:~$ xprop -root | grep PULSE
xprop: unable to open display ''
在 mobian 上远程使用-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"
本地在 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"
答案1
似乎这里描述了解决方案:
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/#xforwarding
这都是关于PULSE_SERVER
“变量”的。因此,在之前使用append启动进程PULSE_SERVER=localhost
可确保音频协议在主机上运行。就我而言,是单板计算机而不是笔记本电脑。
我只有一次机会对此进行测试,所以我不确定它是否适用于所有场景,但它是:
[user@fedora ~]$ ssh user@mobian -YC
...
user@mobian:~$ PULSE_SERVER=localhost [YOUR_APLICATION]
如果我得到更多信息,我会尝试更新。