TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.56k stars 3.07k forks source link

Seeking YouTube video removes LineageOS AudioFX equalizer settings #7033

Closed 0x416c6578 closed 8 months ago

0x416c6578 commented 3 years ago

Checklist

Steps to reproduce the bug

  1. Play video with an equalizer profile enabled in the AudioFX app
  2. Double tap to seek forward / back (this works for any time skip, also with fast seek enabled), or just tap on the seekbar to skip to a different part of the video
  3. Equalizer will stop working, audio returns to un-equalized volume
    • This bug seems to occur when loading from an un-preloaded part of a video (i.e. the seekbar doesn't have the lighter red colour), or when the video buffers (i.e. the buffering wheel appears on screen). When the skip is instant (i.e. no buffering happens), the bug doesn't occur. This isn't 100% effective in causing the bug however, so there might be some race condition happening. It seems to be when there is a shorter buffering time, the crash happens (and the EQ settings are removed), and when there is a longer buffering time, the EQ settings don't get removed
    • When closing the video player and loading the video again, the EQ settings are restored
    • The bug doesn't happen when seeking whilst in background mode
    • It also seems to be YouTube specific

Actual behavior

Expected behavior

Logs

Nothing in LogCat indicates that AudioFX / AudioServer is crashing, however I suspect this is probably device / LineageOS version specific.

Device info

triallax commented 3 years ago

Can you try the APK in #6993 and tell us if the issue is present there?

0x416c6578 commented 3 years ago

Hmm, ive tried both the APK and building a release APK and the bug occurs in both still. notifyAudioSessionUpdate is only called when the player is created / destroyed, not when the video is seeked. I have made a small change that calls that method on every seekTo call, and adding a breakpoint will on that call will cause EQ settings to stop until i continue code running, at which point it the EQ kicks in again. Disabling the breakpoint causes the EQ to fail on skip like before, so it seems like there is some race condition happening

0x416c6578 commented 3 years ago

Calling notifyAudioSessionUpdate(active:true) on forward/back seek does seem to fix if the EQ does fail, however probably 1/5 times (some race condition happening here) the EQ turns off like before until I skip again, at which point it is reenabled (thanks to the call to notifyAudioSessionUpdate).

Also is the fast inexact seeking preference just not used anymore? I can't find any references to it in the sources

I must add I am pretty out of my depth here, I don't really know ExoPlayer that well so I'm kinda just messing with stuff.

XiangRongLin commented 3 years ago

There were other bugs in relation to LineageOS und AudioFX

2833 #1359

Could this also be one of those, were we can't do anything.

0x416c6578 commented 3 years ago

Yeah it could be a LineageOS problem, however I feel like there could be a workaround with a call to notifyAudioSessionUpdate, since my experiments somewhat fixed the bug. I have noticed very similar behaviour regarding EQ settings being disabled in musicolet, and have submitted a bug report there. If you do think it is a LineageOS problem, I can close this issue if you want.

comicsansgreenki commented 1 year ago

I'm also running LineageOS on a Pixel 2 XL, and I'm noticing that the player just bypasses AudioFX entirely.

ShareASmile commented 8 months ago

Is it still an issue on 0.26.1? & if yes, after a year or so with later LineageOS updates, did anything change ?

comicsansgreenki commented 8 months ago

@ShareASmile Still an issue, but it looks like AudioFX's usability on other apps got tanked hard after Google rewrote the audio stack in Android 12. 😞 https://www.reddit.com/r/CalyxOS/comments/tulksr/comment/i37czyd/

/offtopic I don't find switching to VLC to be a very elegant experience, though...I wonder if I should dare to feature request a built-in EQ.

opusforlife2 commented 8 months ago

So then, since AudioFX is dead, there's no more reason to leave this open.