Skip to content

audio: add DSD-over-PCM pass-through - #18312

Open
kasper93 wants to merge 4 commits into
mpv-player:masterfrom
kasper93:dsd
Open

audio: add DSD-over-PCM pass-through#18312
kasper93 wants to merge 4 commits into
mpv-player:masterfrom
kasper93:dsd

Conversation

@kasper93

Copy link
Copy Markdown
Member

For DST playback, need https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23939 patch. DSD doesn't need it.

kasper93 added 3 commits July 28, 2026 14:46
AF_FORMAT_S_DOP carries pre-packed DoP frames: a marker byte and 16 DSD
bits per channel in the 24 MSBs of 32-bit samples, at 1/16th of the DSD
bit rate. Similar to IEC61937 formats, it's meant to be exclusive not
touched pass-through.
Generalize the spdif PCM fallback and the output format verification to
any bitstream format instead of only IEC61937 formats.
Map AF_FORMAT_S_DOP to 24 bits in 32-bit PCM containers, which is
how DoP is transported over WASAPI in exclusive mode. Force exclusive
mode for any non-PCM format, and don't try alternative formats for DoP.

set_ao_format() now also checks the requested format before touching
the ao configuration, because the DoP wire format reverse-maps to a
plain PCM sample format.
Add ad_dsd, a pass-through decoder converting raw DSD audio to DoP frames, enabled with --audio-spdif=dsd. DST compressed audio is losslessly decompressed to DSD first.

DoP output requires an AO with support for the format (currently
ao_wasapi in exclusive mode) and a DoP capable DAC. Will fallback to PCM
if not supported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant