audio: add DSD-over-PCM pass-through - #18312
Open
kasper93 wants to merge 4 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For DST playback, need https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23939 patch. DSD doesn't need it.