Mastermindzh / tidal-hifi

The web version of Tidal running in electron with hifi support thanks to widevine.
Other
925 stars 53 forks source link

Tidal-Hifi Resampling Audio Output #430

Open jeremy2330 opened 1 week ago

jeremy2330 commented 1 week ago

Tidal-Hifi is resampling the audio bitrate to the default bitrate that Pipewire is using. ie not matter what quality I choose in pipewire conf settings, I can't get Tidal-Hifi to stop resampling the audio. For example, if I play Marvin Gaye - What's Going on at 192khz, Tidal-Hifi outputs 48khz. I have set up Pipewire so that it does not resample, and so I receive 48khz to my DAC. Whereas if I play Pearl Jam - Dark matter which natively outputs 24 Bit / 48khz, it is sent to Pipewire at 48khz and sounds awesome because it hasn't been resampled.

Firefox does not do this (however I can't get Max hifi on Firefox). When using Firefox, it outputs the audio rate that Tidal is playing.

As Tidal-Hifi is based on Chromium (I believe, and this is what pw-top calls it), the problem likely resides there. Here is a more detailed discussion of this issue, but as it applies to Chromium:

https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2828

Ideally if there was the ability to have a .conf file where the audio bitrates could be set, or even better, have an option in the GUI to set these.

Very much appreciate the effort that has gone into creating this software. This one change would make it my go to music player.

enzy commented 6 days ago

Mine outputs F32LE 2 192000 without a problem (Archlinux, Pipewire).

Pipewire config /etc/pipewire/pipewire.conf.d/10-rates.conf:

# Adds more common rates
context.properties = {
    default.clock.allowed-rates = [ 44100 48000 88200 96000 19200 ]
    default.clock.rate = 192000
}
jeremy2330 commented 6 days ago

Yes, I can get Tidal-Hifi to output the default rate.

The issue is if the actual FLAC file is a different rate to the default.clock.rate, Tidal-Hifi resamples the audio to the default.clock.rate

eg if you play a Tidal song that's in 44100, in your case Tidal-Hifi (not Pipewire) will resample the file to 192000. If you run pw-top you will see that +Chromium (that's what it calls Tidal-Hifi) is outputting 192000, even though the FLAC file it's playing is 44100.

In my opinion, the native 44100 output (which I can get from Firefox) sounds significantly better than if it is resampled to a higher rate.