3 ms·
(edit: I might have misunderstood your comment, but see my edit at the end) If you use PulseAudio or pipewire-pulse on your local computer and that both comput
by jraph 4y ago
(edit: I might have misunderstood your comment, but see my edit at the end)
If you use PulseAudio or pipewire-pulse on your local computer and that both computers are on the same network (or at least the machine you ssh into can access your local machine, possibly through a tunnel - PulseAudio listen to port 4713 by default), you can set the PULSE_SERVER environment variable.
PULSE_SERVER=X.X.X.X whatever_should_play_a_sound
Where X.X.X.X is the domain or IP of your local machine. Your local machine needs to be configured to allow remote computers to play sound locally (by loading module module-native-protocol-tcp as far as I know - a papref setting is available for PulseAudio).
If the computer you ssh into has Pulseaudio or pipewire-pulse, on your local machine you can run:
PULSE_SERVER=Y.Y.Y.Y pavucontrol
Where Y.Y.Y.Y is your ssh server, and set the default output sink to your local computer's. Then it will play things through your local computer. You need to setup your local computer so it advertises its PulseAudio service, and your server needs to have the module-zeroconf-discover module loaded.
You can load a module with pactl (for both PulseAudio or pipewire-pulse):
pactl load-module module-zeroconf-discover
pactl load-module module-native-protocol-tcp listen=0.0.0.0
edit: and if you just want to play something on your remote machine, then `PULSE_SERVER=localhost` can work. export $(dbus-launch) instead of your command possibly works too. With Pipewire on Debian I noticed it works out of the box though.
- aidenn0 4y agoYou are misunderstanding; I want to play audio on the remote machine, not on the local machine. The remote machine is running pipewire-pulse.
- deleted 4y ago[deleted]
- jraph 4y agoYes sorry, I figured it out before seeing your comment and edited my reply. PULSE_SERVER=localhost or export $(dbus-launch) could work.
- aidenn0 4y agoAha, I found more details, and also think I've solved it: 1. I misremembered it was an alsa-client that couldn't use the pipewire virtual device. 2. your mention of dbus did help though; setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus seems to do the trick.