Hello Alexandre and Christian!

thank you very much for all your precious suggestions, now something is
moving.
This is the current status quo:

1. sndiod for ubuntu compiled and installed; had to manually create the
user/group sndiod like this:
sndiod:x:1002:1002::/run/sndiod:/usr/sbin/nologin
also, the make install did not create a unit for systemctl, so right now I
am launching the service manually with:
# sndiod -dd -m play     (no "-L localhost" listen feature as recommended,
will eventually work out a service)

2. I changed .profile on the openbsd user with the following:
AUDIODEVICE=snd@localhost/default

3. I started sndiod on openbsd server as mpg123 was giving a specific error
about that.
btw connection is still without "-fN" as I am still debugging, and, also,
I'd like to have the interactive window so that I can decide what music I
run either by CLI or GUI. So right now connection from ubuntu is:
$ ssh -R 11025:/tmp/sndio/sock0 -p port -X [email protected]


WHAT I GOT:
on ubuntu *finally* something is moving, there is some talking:
# sndiod -dd -m play
default: alt -> rsnd/0
default: play 0:1, dup, vol = 8388608
0: alt -> rsnd/0
0: play 0:1, dup, vol = 8388608
1: alt -> rsnd/1
1: play 0:1, dup, vol = 8388608
2: alt -> rsnd/2
2: play 0:1, dup, vol = 8388608
3: alt -> rsnd/3
3: play 0:1, dup, vol = 8388608
ctl1: 3/server.mode[play] = 1 at opt_mode:3/play: added
ctl2: 3/server.mode[rec] = 0 at opt_mode:3/rec: added
ctl3: 3/server.mode[mon] = 0 at opt_mode:3/mon: added
ctl4: 2/server.mode[play] = 1 at opt_mode:2/play: added
ctl5: 2/server.mode[rec] = 0 at opt_mode:2/rec: added
ctl6: 2/server.mode[mon] = 0 at opt_mode:2/mon: added
ctl7: 1/server.mode[play] = 1 at opt_mode:1/play: added
ctl8: 1/server.mode[rec] = 0 at opt_mode:1/rec: added
ctl9: 1/server.mode[mon] = 0 at opt_mode:1/mon: added
ctl10: 0/server.mode[play] = 1 at opt_mode:0/play: added
ctl11: 0/server.mode[rec] = 0 at opt_mode:0/rec: added
ctl12: 0/server.mode[mon] = 0 at opt_mode:0/mon: added
ctl13: default/server.mode[play] = 1 at opt_mode:default/play: added
ctl14: default/server.mode[rec] = 0 at opt_mode:default/rec: added
ctl15: default/server.mode[mon] = 0 at opt_mode:default/mon: added

THIS IS WHAT READS WHEN I START mpv/mpg123 on openbsd:
Failed to create secure directory (/root/.config/pulse): Permission denied
  <---- VERY STRANGE, user is root!
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
couldn't open play stream: No such file or directory
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
couldn't open play stream: No such file or directory
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
couldn't open rec stream: No such file or directory
ctl16: app/mpv.level = 127 at app_level:default/mpv: added
rsnd/0: failed to open audio device

this is their CLI output on openbsd:

$ AUDIODEVICE=snd@localhost/default mpv test.mp3
● Audio  --aid=1  (mp3 2ch 48000 Hz 128 kbps)
[ao/sndio] Can't open audio device default.
[ao] Failed to initialize audio driver 'sndio'
Could not open/initialize audio device -> no sound.
Audio: no audio
: 00:00:00 / 00:03:14 (0%)
Exiting... (Errors when loading file)

$ AUDIODEVICE=snd@localhost/default mpg123 test.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.33.7; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
connect to /tmp/sndio/sock0 port -2 failed: Connection refused
[src/libout123/modules/sndio.c:open_sndio():133] error: Got nothing from
sio_open().
[src/libout123/libout123.c:check_output_module():1167] error: Module
'sndio' device open failed.
[src/libout123/libout123.c:out123_open():485] error: Found no driver out of
[sndio] working with device <default>.
main: [src/mpg123.c:check_fatal_output():338] error: out123 error 3:
failure loading driver module

I feel that we are very close, but still cannot get the very last glitch
where the mechanism is getting blocked.
I got a sensation like the sndiod daemon on ubuntu is not really talking
with the soundcard, but maybe I am wrong.

Any further suggestions?
Thanks!
P


On Fri, Oct 23, 2026 at 4:40 PM Christian Weisgerber <[email protected]>
wrote:

> Paolo Aglialoro:
>
> > I'm trying to forward audio from an OpenBSD 8.0 VM running on a remote
> > server (NO SOUNDCARD) to an Ubuntu laptop over an SSH tunnel leveraging
> > sndiod.
> >
> > # sndiod -dd -L localhost -m play
>
> BTW, sndiod doesn't need to listen on a network port ...
>
> > SSH tunnel is established this way:
> > $ ssh -R 11025:localhost:11025 -X [email protected]
>
> ... you can forward the remote port to sndiod's Unix domain socket:
>
> $ ssh -fN -R 11025:/tmp/sndio/sock0 [email protected]
>
> --
> Christian "naddy" Weisgerber                          [email protected]
>

Reply via email to