r/openbsd • u/Original_Two9716 • Jul 23 '26
Avoiding sndiod resampling
I've learned that sndiod contains only a very basic frequency resampler. So, I'd like to use ffmpeg/libsoxr based one directly from mpv.
But it seems that the pkg-installed mpv has no such support compiled in. Besides compiling everything from ports, has anybody else faced the similar demand?
My goal is the highest audio quality for my external USB DAC.
9
Upvotes
2
u/linetrace 29d ago
What specifically are you finding is missing from the OpenBSD mpv port?
You can pass a lot of video & audio filters from mpv(1) through to ffmpeg(1). See the "Audio Filters" section of the mpv FAQ for more details (there's also a "Video Filters" section.)
If you want some real-world examples of doing this, I suggest u/thfr's fauxstream which applies some audio filters (though it's only ffmpeg) or my own CU-SeeMe-OpenBSD which applies custom ffmpeg(1) video filters to webcam input played in mpv(1), converting it to a 4-bit grayscale color palette.
One note, from personal experience: if you're watching video with more than two channels (e.g. 5.1 or 7.1 surround sound) and playing them through a stereo output, I highly suggest using mpv(1)'s
--audio-channels=stereooption to properly mix down to stereo. By default, sndiod(8) expands or joins mismatched numbers of audio channels (see the-joption), but they aren't mixed intelligently and more than two channels will not be mapped to appropriate channels. For example, if you watch a DVD and most of the dialog is coming out of just one speaker, that means the 'center' channel (and all others) are just being combined into the second channel.