Feature request: option to apply 6dB gain to DSD files during playback #368

Closed
opened 2023-07-14 23:38:56 -04:00 by bmastenbrook · 1 comment
bmastenbrook commented 2023-07-14 23:38:56 -04:00 (Migrated from github.com)

DSD content is typically mastered at -6dB full scale per the Scarlet Book SACD specification. The result of this is that playback levels can vary dramatically between DSD and PCM content. It would be nice to have an option to apply 6dB of gain to DSD files during playback to level this out.

DSD content is typically mastered at -6dB full scale per the Scarlet Book SACD specification. The result of this is that playback levels can vary dramatically between DSD and PCM content. It would be nice to have an option to apply 6dB of gain to DSD files during playback to level this out.
kode54 commented 2023-07-15 01:09:57 -04:00 (Migrated from github.com)

I may add an option for this. I wasn't aware that DSD mastering targeted a reduced volume level. That may explain why the decimator I borrowed in the first place was built to apply a 2.0x / +6 dB gain, instead of targeting 0 gain.

Interestingly enough, both FFmpeg and WavPack default to outputting through their own decimators which target 0 gain. FFmpeg, in fact, cannot output anything but PCM, unless you go in and dodge using libavcodec with the output of libavformat just for the four DSD codecs. (2x2 matrix of: Most significant bit first or least significant bit first, planar or interleaved. My decoder normalizes these to MSB interleaved, because that's what the decimator expects.)

Cog currently commands WavPack (easy) and FFmpeg (a bit complicated) to output DSD directly to the player. Maybe if someone wants me to figure out some way to bypass macOS's sound output and output directly to a DSD capable sound device, and wants to send me the hardware or the money to buy the hardware that can do this, I may look into supporting it. For now, it takes the path of least resistance and converts DSD to high sample rate PCM.

Oh, yeah, and also, due to limitations of the sound output API I use now (mainly to support the AirPods positional audio), I can only output 192 kHz mono/stereo, or 352800 Hz surround, "safe" values I found from testing. I'm not sure if newer macOS fixed these limitations. I found that exceeding the limitations would cause the sound output to do funny things or even crash. I also keep another downsampler running to run the visualizations at a consistent sample rate.

I may add an option for this. I wasn't aware that DSD mastering targeted a reduced volume level. That may explain why the decimator I borrowed in the first place was built to apply a 2.0x / +6 dB gain, instead of targeting 0 gain. Interestingly enough, both FFmpeg and WavPack default to outputting through their own decimators which target 0 gain. FFmpeg, in fact, cannot output anything *but* PCM, unless you go in and dodge using libavcodec with the output of libavformat just for the four DSD codecs. (2x2 matrix of: Most significant bit first or least significant bit first, planar or interleaved. My decoder normalizes these to MSB interleaved, because that's what the decimator expects.) Cog currently commands WavPack (easy) and FFmpeg (a bit complicated) to output DSD directly to the player. Maybe if someone wants me to figure out some way to bypass macOS's sound output and output directly to a DSD capable sound device, and wants to send me the hardware or the money to buy the hardware that can do this, I may look into supporting it. For now, it takes the path of least resistance and converts DSD to high sample rate PCM. Oh, yeah, and also, due to limitations of the sound output API I use now (mainly to support the AirPods positional audio), I can only output 192 kHz mono/stereo, or 352800 Hz surround, "safe" values I found from testing. I'm not sure if newer macOS fixed these limitations. I found that exceeding the limitations would cause the sound output to do funny things or even crash. I also keep another downsampler running to run the visualizations at a consistent sample rate.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: chris/Cog#368
No description provided.