--------------------------------
I don't know if is a known bug or something, but a quick search provided nothing... I'm quite the Linux beginner but, at least on Windows, I'm very much not an audio beginner.
So I was poking around with how Linux handles audio playback and, at least with bone-stock Linux Mint 20.3 without PipeWire (whether after install or via a live USB), simply playing bog-standard 44.1kHz 16bit FLAC and 48kHz 16bit FLAC through Celluloid resulted in bit-perfect playback compared to the actual FLAC files.
The way I verify this this is I record PulseAudio via Audacity v2.1.2* with the project rate set to the according sampling rate and every volume slider I can find set to 100%, import the FLAC file as a secondary track, line up the two tracks so that they're exactly matched, invert one of the tracks, mix and render them into a new track, and then amplify the new track - if amplify says "-infinity" then it's 100% identical.
(playing a 192kHz 16bit FLAC through Celluloid gave results that implied that the audio is being resampled despite my hardware being capable of 192kHz 24bit and I have no idea if I can do anything about it other than installing PipeWire, but that's besides the point of this thread)
However, when installing PipeWire (something like version 0.3.4? I can't remember), I can no longer get bit-perfect playback of either 44.1kHz 16bit nor 48kHz 16bit unless the audio is being played through JACK (via Audacious). Interestingly however, 192kHz 16bit is bit-perfect in PipeWire regardless of whether the audio is played through PulseAudio (via Celluloid) or through JACK (via Audacious).
For reference, it's extremely close to bit-perfect in that the results look very similar to if you were taking a 24bit signal and dithering it down to 16bit... except that's clearly not quite what is happening since, after doing the waveform inversion and amplifying the waveform by a LOT (like 90dB), I'm not getting the white noise you'd expect from 24-to->16bit conversion - what I get instead after applying something like 90dB amplification is pretty much what sounds like the actual source audio in question (though perhaps degraded in fidelity?).
The fact so much information is retained even after a ~90dB amplification implies to me that it's clearly something going on in the floating point domain, almost as if PipeWire is changing the gain by the teeniest bit. Manually testing this hypothesis in Audacity, if I amplify one of two duplicated identical tracks by a mere 0.001dB and then invert it and mix the two tracks together, I get results that are extremely similar to what I'm getting with my PipeWire recordings (except that PipeWire, if anything, would be adjusting the gain by even less, like maybe 0.0003dB, but Audacity v2.1.2 won't let me amplify by less than 0.001dB so I can't test that).
And to clarify, before playing a given audio clip in Celluloid or Audacious via PipeWire, I made sure to run the following terminal command to set PireWire's output sampling rate to whatever sampling rate matched the according FLAC file (replacing "<samplerate>" with 44100 or 48000 or 192000):
Code: Select all
pw-metadata -n settings 0 clock.force-rate <samplerate>
*yes 2.1.2 is an old version of Audacity (it was the version that Mint 18.3 provided in its software manager), but it's the last version that lets you use the "Mute" and "Solo" buttons as a way to ABX audio (something I do quite frequently and have done for over a decade now).