How Kalinka converts DSD to PCM
A DSD album can now play through a PCM-only DAC in Kalinka 5.20.0. Conversion also lets you use the renderer’s software volume control. We measured what happens between the DSD file and the PCM samples sent on for playback, then compared a music recording with Weiss Saracon and FFmpeg. On Raspberry Pi 4 and 5, we also timed Kalinka, FFmpeg, Music Player Daemon (MPD) and Squeezelite converting the same DSD input.
DSD represents a waveform by the changing density of ones in a very fast, one-bit stream. PCM records its amplitude directly as a multi-bit number at each sample time. Those numbers are what a PCM DAC accepts and what familiar DSP operations, such as applying gain or an EQ filter, work on. Release notes · Reproduce the measurements
Playback settings
In Now Playing, select the current output name, open the Output settings gear beside it, and find the DSD section. Leave DSD output on Automatic for everyday playback. For each track, Kalinka sends native DSD when the direct output supports the track’s DSD rate and the volume is fixed. Otherwise it converts to a PCM rate the output supports. If you specifically want the renderer to process every DSD track, select Convert to PCM and press Apply. The separate DoP option carries the original DSD bits in PCM frames for a DoP-capable DAC.
To try the default DSD64 chain measured below, choose Convert to PCM, then select 176.4 or 192 kHz under DSD to PCM rate and 30 kHz under DSD to PCM filter. A standard 2.8224 MHz DSD64 track then converts to 176.4 kHz on a DAC that accepts it. To match the measured level as well, open Expert settings, find DSD to PCM level (output.dsd_gain_db), select 0 dB, and apply the change. For listening, the default Safe, +2.8 dB brings DSD closer to typical PCM playback levels while leaving room for peaks. Renderer settings and supported rates
Conversion stages
For every 16 input bits per channel in that DSD64 track, Kalinka produces one PCM sample. Keeping just one bit in sixteen would fold ultrasonic noise back into the audio band. Kalinka first filters the incoming stream, then reduces its sample rate in stages. The last filter controls how much ultrasonic content reaches the DAC.
The first stage works a byte at a time. A lookup table holds the weighted contribution of each possible byte, producing an intermediate rate of 352.8 kHz. The half-band filter halves that to 176.4 kHz. The final low-pass filter runs at the output rate and delivers 64-bit floating-point samples. Higher conversion ratios add more divide-by-two stages. Filter design and supported chains
Filter frequency response
The 30 kHz preset is flat to 20 kHz and attenuates the signal by at least 110 dB from 40 kHz to the output’s 88.2 kHz Nyquist limit. The name refers to the middle of that transition. The measured −3 dB point is 27.4 kHz. The 50 kHz preset moves the passband edge to 40 kHz and the stopband edge to 60 kHz. Wide stays flat to 79.38 kHz, passing more of both the ultrasonic signal and DSD’s rising noise.
For the default chain, the largest measured departure from unity gain in the first 20 kHz was 0.00066 dB. We also checked every FFT bin above the output Nyquist frequency that would fold into those first 20 kHz. The least attenuated was −181.6 dB, using a 262,144-point FFT at the DSD bit rate.
If you leave the filter on Automatic, Kalinka selects 30 kHz for DSD64 and 50 kHz for DSD128 and higher. The output rate sets a practical limit. At 88.2 or 96 kHz PCM the 50 kHz choice uses the Wide response. At 44.1 or 48 kHz all three choices share the same final transition.
Impulse response
The same filters can be measured in time. We fed the release converter the repeating DSD idle pattern 0x69, which produces digital zero, then flipped one bit. We divided the resulting PCM samples by the size of that bit change (±2). With the 30 kHz preset the peak arrives about 0.22 ms later.
The lobes either side of the peak are symmetric because the filters have linear phase. A wider passband narrows the central peak, though the complete filter can still take longer to produce it. Kalinka reports delays of 38, 47 and 60 PCM frames for 30 kHz, 50 kHz and Wide respectively. Release impulse test
Distortion and noise on Pi and Intel
A DSD test tone already contains noise from the modulator that created it. To measure the change during conversion, the release benchmark analyses both the original one-bit signal and the PCM made from it. Each machine generates a quarter-second 1 kHz sine at half modulation (−6.02 dBFS relative to full modulation) using a seventh-order modulator.
Both paths receive a 22 kHz low-pass. The analyser aligns their delays, trims 5% at each end, fits a sine and DC offset, and integrates the residual with a seven-term Blackman–Harris window. THD+N is the unweighted residual power from 20 Hz to 20 kHz relative to the fitted tone. Release tone test and analyser
| Conversion | Pi 4 and Pi 5, input → output | Intel Core Ultra 9 185H, input → output |
|---|---|---|
| DSD64 → 176.4 kHz, 30 kHz filter | −127.94 → −127.94 dB | −128.33 → −128.33 dB |
| DSD128 → 176.4 kHz, 50 kHz filter | −172.48 → −172.41 dB | −172.42 → −172.38 dB |
| DSD256 → 352.8 kHz, 50 kHz filter | −195.01 → −190.79 dB | −193.87 → −190.19 dB |
At DSD64 the change rounds to 0.000 dB on all three machines. At DSD128 it is +0.073 dB on each Pi and +0.040 dB on Intel. Both rates meet the release target of 0.1 dB. The two Pis ran the same arm64 binary and gave identical results. The Intel modulator generated slightly different DSD bits, so the meaningful comparison is the change within each column. Measurements by machine (CSV)
DSD256 shows a larger change, about 4.2 dB on the Pis and 3.7 dB on Intel, ending near −190 dB relative to the tone. Its cause remains open. A separate check using the DSD idle pattern produced exact digital zero on all three machines. All these readings are taken in software, before playback gain, final word length, dither and the DAC. Release acceptance results
Music comparison with Saracon and FFmpeg
For a comparison on music, we used Looking for a Home by Keith Greeninger and Dayan Kai, from Blue Coast Records. BitPerfect published the stereo DSD64 original alongside a Weiss Saracon conversion. We converted the original with Kalinka’s 30 kHz preset and with FFmpeg 9.0.2 using its standard swr resampler.
We compared the same ten seconds, 30–40 s, at 176.4 kHz stereo. We checked timing in both channels at 10, 30 and 50 seconds and aligned each file to the nearest PCM frame. We rounded the two new renders to 24 bits without added dither and matched levels over 200 Hz–2 kHz, using one gain for both channels. The archived Saracon render needed −6.229 dB to match Kalinka. FFmpeg needed less than 0.001 dB. We calculated mean stereo power density with 16,384-sample Hann windows, 50% overlap and 1 kHz plotting bins, relative to the power of a full-scale sine.
Integrated over 20 Hz–20 kHz, the three outputs were within 0.001 dB of each other at about −31.955 dBFS. The difference is much easier to see above the audio band. From 30 to 40 kHz, the same passage measured −92.31 dBFS with Kalinka, −82.90 dBFS with Saracon and −71.29 dBFS with FFmpeg. These are levels of everything present in the recording and render, including ultrasonic DSD noise. The publisher gives no Saracon filter or dither settings. Measuring Saracon’s THD+N would require a render of a known test tone. Integrated band powers (CSV)
Archimago’s published Saracon experiment is worth reading alongside this one. It starts with a 24-bit/96 kHz RightMark signal, encodes it to DSD, and measures the round trip back to PCM. Its A-weighted noise and 96 kHz frequency-response figures belong to that experiment. Archimago’s methodology and original graphs
Converter measurements on Raspberry Pi
Every converter received the same DSD64 file, so each started with exactly the same source noise. The file contains 16 isolated bit changes for measuring frequency response, followed by a half-second 1 kHz tone for measuring distortion and noise.
Squeezelite, MPD and FFmpeg all use Sebastian Gesemann’s 96-tap filter to turn eight DSD bits into one PCM sample. We captured their output twice on each Pi, first at 352.8 kHz, where that filter finishes, and again at the 176.4 kHz playback rate.
At 352.8 kHz, Squeezelite and MPD produced identical float32 values for all 246,032 samples of the test file on both boards. FFmpeg uses the same coefficients with double-precision lookup tables. Its largest difference from Squeezelite was 5.96 × 10⁻⁸ of full scale. Native sample comparison (CSV) · Gesemann’s filter in Squeezelite · MPD’s implementation · FFmpeg’s implementation
To reach 176.4 kHz, each path halves that PCM rate. Squeezelite packs to signed 32-bit PCM and uses libsoxr. We selected its HQ linear-phase setting with 0 dB attenuation to match the others. Its usual resampling setting applies 1 dB of attenuation. MPD used libsamplerate’s fastest sinc filter (type 2), and FFmpeg used its standard swr resampler. The graph compares those three paths with Kalinka’s default 30 kHz preset and Wide on the same DSD64 input. Squeezelite PCM packing · Squeezelite resampler settings · MPD resampler settings
For each path, the analyser aligned the PCM to the first bit change, fitted and removed the tone and DC offset from the central 250 ms, then measured the remaining power from 20 Hz to 20 kHz with the same seven-term Blackman–Harris window. That gives the THD+N column below. Tone analyser
For the CPU columns, each trial converted the same in-memory stereo DSD64 input at unity gain and delivered interleaved float64 PCM. The percentages are medians over ten balanced rounds on each board. 1% of one core means 10 ms of CPU time per second of stereo output.
| Conversion path | Pi 4 | Pi 5 | 1 kHz THD+N |
|---|---|---|---|
| Kalinka · 30 kHz | 1.78% | 0.61% | −128.10 dB |
| Kalinka · Wide | 3.56% | 1.23% | −128.10 dB |
| FFmpeg · swr | 3.36% | 1.29% | −127.80 dB |
| MPD · libsamplerate | 13.46% | 6.40% | −128.05 dB |
| Squeezelite · libsoxr HQ | 3.40% | 1.80% | −127.86 dB |
Kalinka’s 30 kHz preset used 47% less CPU than FFmpeg on the Pi 4 and 53% less on the Pi 5. Wide extended Kalinka’s −3 dB point to 87.1 kHz and put its CPU use much closer to FFmpeg’s. All five paths fell within 0.30 dB of each other on the 20 Hz–20 kHz tone measurement. These results show a difference in processing cost and ultrasonic bandwidth. An audible preference would need a level-matched listening test.
Each timed pass covered 23.78 seconds of stereo input after warm-up. We pinned the same arm64 binary to one core per board and counted process CPU time through final PCM packing. File I/O, playback services and the DAC were outside the timer. The five tone renders matched sample for sample between boards. The Pi libraries were FFmpeg 7.1.5, libsamplerate 0.2.2 and libsoxr 0.1.3. All 100 CPU readings (CSV) · Timing ranges, cutoff and THD+N (CSV) · Board conditions · Timing code
Kalinka CPU use across DSD rates
For a view across input rates and processor families, the earlier Kalinka timing benchmark used blocks of 1,024 stereo PCM frames. These medians refer to the same channel-pair implementation on all three machines, before the later release optimisations.
| Conversion | Pi 4 · Cortex-A72 | Pi 5 · Cortex-A76 | Intel Core Ultra 9 185H |
|---|---|---|---|
| DSD64 → 176.4 kHz, 30 kHz filter | 3.43% | 1.07% | 0.32% |
| DSD256 → 352.8 kHz, 50 kHz filter | 11.5% | 3.85% | 1.15% |
The Pi 4 figures are medians of ten runs, the Pi 5 and Intel figures of three. To repeat these timing runs, the script uses the converter revision that produced the table. Clock speed, cooling and other activity affect the result. Benchmark results and run conditions · Original timing code
For a PCM-only DAC, leaving the rate and filter on Automatic gives you the 30 kHz filter on DSD64 and a wider passband for higher DSD rates. If you try the other presets, hold the output rate and gain fixed. On the DSD64 tests here, the clearest difference is how much ultrasonic energy each preset sends downstream.
Reproduce the measurements
From a full KalinkaPlayer clone containing the benchmark scripts, run the following on Linux with FFmpeg, a C++23 compiler, Highway, GoogleTest and the Python scientific packages listed in the run instructions. The script builds the pinned Kalinka converter, checks the DSD file’s SHA-256, renders it with Kalinka and FFmpeg, and writes the PCM captures, CSV tables, figures and a machine and version record.
python3 benchmarks/dsp/decoder-comparison/reproduce.py --output ./dsd-results
The Intel run of this script also covers Kalinka’s 50 kHz preset. All three Kalinka presets measured −128.10 dB THD+N to two decimal places on the shared tone, and FFmpeg 9.0.2 measured −127.85 dB. Intel cutoff, tone level and THD+N (CSV)
For the five-path Pi comparison, run the separate driver on each Raspberry Pi. It builds the pinned Kalinka, MPD and Squeezelite converters and uses the installed FFmpeg, libsamplerate and libsoxr libraries. It writes the CPU trials, native-rate comparison, tone measurements and ultrasonic response plot. Pi build requirements and procedure
python3 benchmarks/dsp/decoder-comparison/compare_pi.py --output ./pi-results
The first script also reproduces the release’s paired tone measurements on Pi or Intel. Add --timing-runs 10 on a Pi 4 or --timing-runs 3 on a Pi 5 or Intel to repeat the CPU test. For the music spectra, supply the archived DSD with --music-dsf and, optionally, the historical render with --saracon-aiff. The run instructions give the source checksums and exact filenames. Benchmark source and instructions · Download the scripts, fixed input, PCM captures and measured data
