clementine-player / Clementine

:tangerine: Clementine Music Player
https://www.clementine-player.org/
GNU General Public License v3.0
3.77k stars 679 forks source link

Playback limited to s16le? #6383

Open idl0r opened 5 years ago

idl0r commented 5 years ago

Hi,

base on #3091 I seem to be able to let it upscale to 196kHz but it keeps sticking to s16le even though float32le has been set as default for pulseaudio. I was looking at it using "pulseeffects" which shows the actual information. So to me it looks like s16le is max/hardcoded or something.

http://www.2l.no/hires/ http://www.lindberg.no/hires/test/2L-145/2L-45_stereo_01_FLAC_176k_24b.flac % file 2L-45_stereo_01_FLAC_176k_24b.flac 2L-45_stereo_01_FLAC_176k_24b.flac: FLAC audio bitstream data, 24 bit, stereo, 176.4 kHz, 54206544 samples

Playing with mplayer works just fine. It even seems to upsample 16bit stuff.

Also, my settings are on "Choose automatically" and it still doesn't work. It also doesn't work when I select anything else in that list.

In my case it's clementine 1.3.1 based on 9af827b6acaabb2331246f58436cd34b11548b6c

v-fox commented 5 years ago

What exactly you think is limited ? Seems like you've made some wrong assessments in what encodes what and how:

I use native JACK GST backend in Clementine, so it bypasses PA altogether. It seem to use default GST logic for upsampling, as I complained about in https://github.com/clementine-player/Clementine/issues/6132

idl0r commented 5 years ago

Well, "file" says it's 24bit flac, mplayer plays it that way and pulseaudio/pulseeffects shows it that way. When I play that via clementine it always sticks to s16le, not higher, even though pulse is configured to a higher option.

jonaski commented 5 years ago

@idl0r is right. The bit depth is limited because the caps set for the probe is also affecting the other caps (audio queue / converter). The analyzer needs signed 16 bit (S16LE) to work. We use a tee element to split the pipeline. The splitting is supposed work so that the audio queue and converter is unaffected, but this isn't working, and have never worked. After commit https://github.com/clementine-player/Clementine/commit/1c0891202d582b8a7ca96f73e517b24120b6ac09#diff-a1f8da8007e51dcea858c84fe1eedba2 it definitely won't work, because the probe queue is forced to 16 bit, but the audio queue is set to be auto negotiated, that means that the both will go to 16 bit anyway which means the whole splitting is a waste. For it to work you must force the format on the other caps too. I've tried that too, and had no luck, I can get it to work using gst-launch-1.0, but not in code. If I had the solution I would have proposed a change already. Even though it shows up to be playing at S24LE, it's not actually, the buffer is already converted, I see it because I have a DAC that shows bit depth. Even though some people will probably think they are playing 24 bit (or whatever), they are are actually fooled by the capabilities of their DAC. The relevant code is here: https://github.com/clementine-player/Clementine/blob/master/src/engines/gstenginepipeline.cpp#L441 In my fork I have removed the limiting, but it has the disadvantage that the analyzer doesn't work for all formats.

v-fox commented 5 years ago

@jonaski Damn, I can't believe they would screw the pooch that hard ! …although, after years of being qt4-only, tied to deprecated, disabled by default, sqlite FTS function and transcoding garbling up AAC, I should.

Does this happen even with JACK as output, it downconverts then upconverts ? Anyway, I guess it's time to check out the fork. As long as it has moodbar and JACK output.

jonaski commented 5 years ago

Yes it happens with all formats and any output.