OxygenCobalt / Auxio

A simple, rational music player for android
GNU General Public License v3.0
2k stars 131 forks source link

ReplayGain value is not reset upon switching music for a short period of time #389

Open ryenyuku opened 1 year ago

ryenyuku commented 1 year ago

Describe the Bug/Crash

  1. Play an audio with a high RG's loudness value
  2. Then play another audio with lower loudness value
  3. Enjoy earrape jumpscare for a split second

Describe the intended behavior

Auxio should reset the loudness value directly after playing a music

What android version do you use?

Android 13

What device model do you use?

Infinix Note 8 (LineageOS 20 GSI)

Duplicates

ryenyuku commented 1 year ago

Here's the screen recording (I still can't upload it directly here 😅)

OxygenCobalt commented 1 year ago

I can't be sure if this is caused by a delay in metadata extraction or a delay in audio processing. I would have to look into it further.

OxygenCobalt commented 1 year ago

By the way, I can reproduce this issue. It really is an issue where the audio processor starts before it can actually apply the adjustment. I'll need to track the ReplayGain fields beforehand and apply them on song changes instead @ryenyuku. Not sure when this change will land.

OxygenCobalt commented 1 year ago

Hey @ryenyuku, can you try this APK? I've made the app cache applied adjustments instead of dynamically applying them. This seemingly works for me.

Auxio_Canary.zip

ryenyuku commented 1 year ago

Hey @ryenyuku, can you try this APK? I've made the app cache applied adjustments instead of dynamically applying them. This seemingly works for me.

Auxio_Canary.zip

Hmm, this build seems to completely ignore the RG tag.

ryenyuku commented 1 year ago

Nvm, upon further testing it looks like that it ignores RG tags from some audio. It seems to work for flac audio but not mp3?

ryenyuku commented 1 year ago

Uhh wait, this is weird. It seems to work for other mp3 audio too, but not for one audio. I'm sure that I've tagged it with a ReplayGain tag, and Musicolet (Pro) seems to confirm that. I'll send the audio as a sample.

ryenyuku commented 1 year ago

https://cdn.discordapp.com/attachments/718610371916726292/1116609507724902432/Bad_Wolves_-_Zombie_Orchestral_version.mp3

ryenyuku commented 1 year ago

I rechecked it with the latest stable release and it works fine too. Also I set the reference loudness to 98 dB for all of my music collections and it seems to make quieter audio to be more louder and a bit distorted, so I recommend to turn the volume lower

OxygenCobalt commented 1 year ago

Okay, I identified the issue. Your files had partial adjustments (missing track or missing album) that Auxio was not recognizing due to a regression. Here's a new APK @ryenyuku:

Auxio_Canary.zip

ryenyuku commented 1 year ago

Okay, I identified the issue. Your files had partial adjustments (missing track or missing album) that Auxio was not recognizing due to a regression. Here's a new APK @ryenyuku:

Auxio_Canary.zip

Thanks, this seems to fix the issue. But I've noticed that when I paused a song, the song got louder briefly before it got paused. It seems to very rarely happen as I can't reproduce it afterwards.

OxygenCobalt commented 1 year ago

Thanks, this seems to fix the issue. But I've noticed that when I paused a song, the song got louder briefly before it got paused. It seems to very rarely happen as I can't reproduce it afterwards.

I've encountered this before and it seems to be a weird android-specific problem. Otherwise, this is great. Closing this issue.

breversa commented 3 months ago

Hello! As of Auxio 3.4.3, I’m still having a similar-sounding issue: when switching from track to track (automatically or manually), sometimes ReplayGain seems to not be applied for the first 0-2 seconds.

OxygenCobalt commented 3 months ago

Hello! As of Auxio 3.4.3, I’m still having a similar-sounding issue: when switching from track to track (automatically or manually), sometimes ReplayGain seems to not be applied for the first 0-2 seconds.

Yep, noticed this too. I need to make the audio processor solely use the player state rather than relying on callbacks.

OxygenCobalt commented 2 months ago

Update @breversa, this actually is a fundamental ExoPlayer issue documented at https://github.com/androidx/media/issues/418.

I'll have to understand the fork change that was steadily chipped away at in the issue discussion and then mangle my ExoPlayer fork to add it myself without destroying the entire audio playback system. Putting this on the backburner for now.