daneren2005 / Subsonic

Home of the DSub Android client fork
GNU General Public License v3.0
580 stars 162 forks source link

Occasional skipped song when clicking next track #1139

Open dessalines opened 1 year ago

dessalines commented 1 year ago

Clicking the next track button will occasionally skip the next song. I then go back a track, and sometimes have to click the track before the one I want to play.

I'm not sure what causes this.

navidrome server, must recent deployed dsub.

eddik1970 commented 11 months ago

This happens to me too. I use Subsonic-server.

gravelld commented 1 month ago

I've had reports of this happening very often for some of my users; it occurs both when clicking the next track but also when clicking on a track - sometimes this plays the following track (which sounds a bit like the rectification mentioned in the original post). That was on Android 14. I don't experience this myself; I'm on 13.

The server in this case is Astiga.

gravelld commented 1 month ago

I have managed to replicate this today, basically by clicking next very quickly. I see error messages like this (the E/ lines, note I also added some extra logs for the next button and DownloadService):

D/NowPlayingFragment: nextButton::onClick
D/DownloadService: next
D/AutoRepeatButton: nextButton::MotionEvent.ACTION_DOWN
V/MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
I/DownloadService: STARTED -> IDLE (DownloadFile (Market de solday))
E/MediaPlayerNative: error (-38, 0)
E/MediaPlayerNative: setAudioSessionId called in state 0
I/DownloadFile: Downloaded 52.80 MB of Renard
I/DownloadService: IDLE -> PREPARING (DownloadFile (Market de solday))
I/DownloadService: Next: IDLE -> IDLE (DownloadFile (Market de solday))
W/ga.asti.android: Long monitor contention with owner BackgroundTask_7 (12722) at void github.daneren2005.dsub.service.DownloadService.setPlayerState(github.daneren2005.dsub.domain.PlayerState)(DownloadService.java:1612) waiters=0 in void github.daneren2005.dsub.service.DownloadService.onSongProgress(boolean) for 321ms
W/ga.asti.android: Long monitor contention with owner BackgroundTask_7 (12722) at void github.daneren2005.dsub.service.DownloadService.setPlayerState(github.daneren2005.dsub.domain.PlayerState)(DownloadService.java:1612) waiters=2 in void github.daneren2005.dsub.service.DownloadService.onSongProgress(boolean) for 264ms
E/MediaPlayer: Error (-38,0)
W/DownloadService: Error on playing file (-38, 0): DownloadFile (Market de solday)
I/DownloadService: PREPARING -> IDLE (DownloadFile (Market de solday))
D/AutoRepeatButton: nextButton::MotionEvent.ACTION_UP
D/NowPlayingFragment: nextButton::onClick
V/MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
I/DownloadService: IDLE -> COMPLETED (DownloadFile (Market de solday))
E/MediaPlayerNative: Attempt to call getDuration in wrong state: mPlayer=0x0, mCurrentState=1
E/MediaPlayerNative: error (-38, 0)
V/MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false

I think this relates to the MediaPlayer's state model.