On Thu, 13 Oct 2022 22:14:33 +0200
Alexandre Ratchov <a...@caoua.org> wrote:

> On Thu, Oct 13, 2022 at 03:11:50AM +0000, s...@skolma.com wrote:
> > in summary, audio works.. just not bit-perfectly :)
> > does anyone know if SNDIO supports such mode ? and how i might configure it.
> 
> bit-perfect is practical for one thing only: avoid questionings about
> whether the processing adds audible noise & distortion. I've tryed
> various hacks, including bypassing sndiod and neither was very
> practical.
> 
> IMHO, the sndiod resampler covers 99% of the cases. To handle the
> remaining 1%, I just resample the files off-line. audio/sox is
> excellent for that.
> 
> So, I'd suggest you to add "-e s24" to sndiod_flags and resample
> off-line when needed.
> 
> HTH
 
There is possibly one more use case for "bit-perfect". I have a small
collection of surround sound (5.1, 4.1, quad, etc) recordings extracted
from various DVDs, SACDs, and other sources. They are encoded in DTS
and Dolby Digital formats, as plain WAV files, and "compressed" to flac
format to prevent "smart" applications, such as ffmpeg, mpd, etc. from
trying to decode them and convert to stereo.

My desktop is connected to a receiver via optical SPDIF cable. To get
the surround sound, I use mpd with 'device "snd/0"' option and Ario to
control the mpd daemon. mpd decodes the top layer (flac), but stops
there and sends DTS-wav to the sndiod without mangling it further.
However, if sndiod's sample rate does not match that of the recording,
it resamples the stream, which ruins the DTS and results in white noise.

I found out that I have to restart sndiod with either
'sndiod_flags="-m play -r 44100"' or 'sndiod_flags="-m play -r 48000"'
flags in /etc/rc.conf.local depending on the files I am playing,
and then it gets to the receiver without issues.

I have each music directory annotated with the sample rate used, like so:

HAMLET: /storage $ ls music/dts/Pink\ Floyd/
(1970) Atom Heart Mother (Quadrophonic Vinyl Conversion) (Dolby Digital Quad 
16-48)
(1973) Dark Side of the Moon (Alan Parson's Mix) (DVD-Audio) (DTS 4.1 24-48)
(1971) Echoes (Original 4.0 Quad Mix) (From Pink Floyd the Early Years 
1965-1972, Volume 5) (DTS Quad 16-48)
(1973) Dark Side of the Moon (Analogue Transfer From SACD) (DTS 5.1 16-44.1)
(1971) Meddle (From Pink Floyd the Early Years 1965-1972, Volume 5) (DTS 5.1 
16-48)
(1994) The Division Bell (2014, Warner Music Group, 20th Anniversary Edition) 
(DTS 5.1 16-48)
Live: (1974) Live at Pompeii (DTS Quad 24-48)

For '16-48' and '24-48' (bit depth-samplerate), I start sndiod with
        sndiod_flags="-m play -r 48000"
for '16-44.1', I restart sndiod with
        sndiod_flags="-m play -r 44100"

Bit depth does not seem to matter. I don't care about "bit-perfect", but
only about sending the dts stream to the receiver as-is, which works.

--
Andre




Reply via email to