jmshrv / finamp

A Jellyfin music client for mobile
Mozilla Public License 2.0
1.67k stars 117 forks source link

redesign-beta: Volume Normalization short delay noticable #769

Open Emporea opened 3 weeks ago

Emporea commented 3 weeks ago

The moment a song is finished and a new one begins finamp takes around 0.1~ seconds to adapt to the new normalization dB. This is especially noticable if the following song has higher volume than the first one (eg from -10dB to -4dB) because then the first 0.1-0.2 seconds are very loud, thus "ruining" gapless play.

Sorry if I mixxed things up with the dB values. I am always confused about which value means a lower volume, and which one is louder.

Chaphasilor commented 3 weeks ago

Is this on Android or iOS?

I can try to change when/how the new gain is applied, but it will probably be hard to time it exactly. Maybe a gradual fade over a short duration would work better 🤔

Emporea commented 3 weeks ago

Android. v0.9.7. I believe a short-duration fade is a good idea. However, the fade should complete just before the next track starts to avoid any noticeable transitions.

Is the volume normalization data for the next track already pre-buffered? If no further calculation is required, simply setting the new volume at the moment the next track begins should solve the issue.

Chaphasilor commented 3 weeks ago

simply setting the new volume at the moment the next track begins should solve the issue

Well, in a way that's exactly what we're currently doing. We wait for an event that tells us that a different track is playing. It seems like the event might be slightly delayed in some cases, so maybe we can improve the timing somehow.

Which phone are you using?

solidsnake1298 commented 3 weeks ago

I noticed the same issue on my Pixel 6a. But only for tracks with vastly different normalization. In my case going from a +5dB song to a -4dB song that starts right at the beginning of the file.