Tauon icon indicating copy to clipboard operation
Tauon copied to clipboard

Disable resampling option

Open k9bbzJavftZaqAqSW3dY opened this issue 3 years ago • 7 comments

Wonderful music player! I have no idea how you do it but this looks and feels better than what some trillion dollar companies are trying to peddle.

I remember there was an option to use phazor or gstreamer, and this option seems to have vanished recently. I actually made use of it, and changed it from phazor to gstreamer for the following reason:

  • I use pipewire, and have it configured to dynamically change the hardware sound device bitrate to match the source material
  • gstreamer happened to not deal with the bitrate, so that pipewire played at the accurate, non-resampled bitrate
  • phazor on the other hand always made it 48kHz, and pipewire thus was forced to played the resampled sound.

Since the option is gone, I noticed pipe reporting 48kHz, i.e. I'm assuming that phazor or something similar is the default now. Is there any chance to bring back gstreamer or somehow tell phazor not to resample?

Cheers!

k9bbzJavftZaqAqSW3dY avatar Aug 11 '22 14:08 k9bbzJavftZaqAqSW3dY

From a vanilla arch pipewire setup, this is how I set up the dynamic sampling rate:

sudo mkdir /etc/pipewire
sudo cp /usr/share/pipewire/pipewire.conf /etc/pipewire/
sudo sed -i 's/#default.clock.allowed-rates = \[ 48000 \]/default.clock.allowed-rates = \[ 44100 48000 96000 192000 \]/g' /etc/pipewire/pipewire.conf

To verify what the current sampling rate is, you need pipewire-alsa, and run this: cat /proc/asound/card*/*/sub*/hw_params

k9bbzJavftZaqAqSW3dY avatar Aug 11 '22 14:08 k9bbzJavftZaqAqSW3dY

I dropped the GStreamer option. Phazor is now the default and only option.

So yeah, what phazor does is it asks the server what its single preferred samplerate is, then Tauon will just output at that samplerate for the remainder of the session, resampling when needed.

Dynamically changing samplerate based on the track isn't supported currently. Early in development of phazor it worked like that, but I dropped support as I judged it wasn't worth the additional maintenance.

Taiko2k avatar Aug 11 '22 15:08 Taiko2k

Alright, I guess sometimes it is what it is. Still, nice work altogether.

k9bbzJavftZaqAqSW3dY avatar Aug 11 '22 22:08 k9bbzJavftZaqAqSW3dY

This! I was wondering why my audio was being resampled. I use an external DAC which is very very good at resampling and playing audio files at their native resolutions. Please offer a way to disable the built in resampling and play audio files at the native resolution & bitrate

Koneko349 avatar Aug 14 '22 22:08 Koneko349

Update: Actually doesnt seem to be working, ill look into it.

Update 2: This is working, but waiting for upstream miniaudio release.


OK, Ive added a setting for this now under MENU > Settings > Audio > Avoid resampling

Limitation: It only works properly for FLAC, MP3, OGG and OPUS.

Remember, in any case you need special Pipewire config so that Pipewire wont resample either.

Flatpak beta should now be updated with this. Let me know if it appears to be working.

Status:

Codec Preserve high resolution? Preserve Samplerate?
Category 1 FLAC Yes, 24bit supported Yes with "Avoid Resampling" on
Category 2 MP3, OGG, OPUS Only 16bit supported Yes with "Avoid Resampling" on
Category 3 WAV, M4A(AAC, ALAC), APE, TTA, WMA No, downscaled to 16bit No, uses resampling

Taiko2k avatar Aug 15 '22 01:08 Taiko2k

Sorry, I am unable to test the functionality, all my audio is ALAC as M4A files.

Koneko349 avatar Aug 15 '22 14:08 Koneko349

Ah, unfortunately this feature won't work for ALAC. I currently don't plan to move ALAC out from category 3 as per above table.

Taiko2k avatar Aug 17 '22 10:08 Taiko2k

@k9bbzJavftZaqAqSW3dY wrote:

Alright, I guess sometimes it is what it is. Still, nice work altogether.

While you wait for an avoid resampling option to be added to phazor, you can shrimply use the flatpak package of tauonmb that corresponds to release v7.1.3 (latest pre-7.2.0 version). Unsurprisingly, tauonmb v7.1.3 still exists in that form, still has the gstreamer backend option and still works, thanks to flatpak, albeit without features that were added after v7.1.3. If you wanted to perform a per-user installation of the flatpak package of tauon from flathub with the latest commit id before 7.2.0, you'd run:

$ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$ flatpak --user install com.github.taiko2k.tauonmb
$ flatpak --user update --commit=b0ca3109f352a104629cc5743fe161efab71dc25f88a36a1d3a721ac2f157471 com.github.taiko2k.tauonmb

And then adjust flatpaks sandboxing options for tauon if you need. I keep all my music in my xdg music dir which I've configured to be ~/mu, so I didn't have to change anything.

yuraih avatar Oct 30 '22 10:10 yuraih

@yuraih This feature made to release a while ago now, forgot why I had this issue open

Taiko2k avatar Oct 30 '22 13:10 Taiko2k