GStreamer sndio sink fails silently in jails – no fallback to OSS

From: ftimmer <ml_at_ft-c.de>
Date: Fri, 17 Apr 2026 03:17:42 UTC
Hello,

I would like to report a usability issue with GStreamer's sndio sink in
FreeBSD jails.

System: FreeBSD 15.0-RELEASE-p1 (amd64)
Affected package: audio/gstreamer1-plugins-bad (sndio plugin)

## Problem

In a jail without access to the sndio socket (/tmp/sndio/sock0),
GStreamer selects GstSndioSink as the default audio sink. Since the
socket is not available inside the jail, playback fails with:

  sink not negotiated
  ../gst-libs/gst/audio/gstaudiobasesink.c(1193):
  gst_audio_base_sink_preroll(): GstSndioSink: sink not negotiated.

This affects OGG/Vorbis files. Interestingly, MP3 playback works,
apparently because it follows a different decoder pipeline that ends up
using OSS instead.

GStreamer does not fall back to OSS (osssink) automatically when sndio
is unavailable. This makes audio completely broken in jails without
explicit configuration.

## Workaround

The issue can be resolved in two ways:

1. Disable the sndio sink via environment variable:
   export GST_PLUGIN_FEATURE_RANK=sndiosink:NONE

2. Mount the sndio socket directory into the jail:
   - Start sndiod on the host (sysrc sndiod_enable="YES")
   - Mount /tmp/sndio into the jail via nullfs
   - Add to /etc/jail.conf:
     exec.prestart += "mkdir -p /path/to/jail/tmp/sndio";
     mount += "/tmp/sndio /path/to/jail/tmp/sndio nullfs rw 0 0";

## Suggestion

It would be helpful if GstSndioSink would detect at runtime whether the
sndio socket is accessible and fall back to the next available sink if
not.

I am happy to provide further information or test patches if needed.

Best regards
Franz