souch / SMP

SicMu Player for android
GNU General Public License v3.0
29 stars 8 forks source link

randomly takes long time to play next shuffle track #14

Open Geek648 opened 8 years ago

Geek648 commented 8 years ago

Works OK most of the time (thanks btw, I like the interface) as a random music player on shuffle. But now and then a track finishes and there's silence for a while (at least 30 seconds, maybe more) before a new track starts. Is there any reason for this you can think of? Thanks

souch commented 8 years ago

I never had this bug, I don't know where it could come from. Perhaps it is because I almost never use random mode. You have set in the settings "Shuffle" checkbox is'nt it? On which version of Android this bug appears?

Geek648 commented 8 years ago

I'm on an LG bought just over a year ago, on Jellybean

souch commented 8 years ago

I review a bit the code and can't see what can make this, sorry. When the silence occurs does the player show that he is playing the new song or he stays (song is red) on the last track. What does the seek bar show too?

souch commented 8 years ago

Not enough input data. I close the issue.

edo9k commented 8 years ago

I have the same problem, and not only on random mode, the player selectively decides when to play the song or just wait for as long as it feels like to play the next one.

My current phone is also a an LG phone, running Android 4.4.2.

I can try recording the bug using adb, does that help?

souch commented 8 years ago

I got an LG on JellyBean too and there is no such problem. But I'll have a look taking into account that it appears also in normal mode.

souch commented 8 years ago

Yep, if you can have debug information it can help.

The code that trigger playing the next song roughly start from the onCompletion function in MusicService.java. But the problem can also be anywhere in between the end of the track and the start of the onCompletion function.

Perhaps you can try invert startNotification and playSong to see if it comes from the notification. Like this :

playSong();

if(foreground)
    startNotification();

Have you got the same bug using another music player (as the problem could come from the MediaPlayer class that comes along with Android)?

edo9k commented 8 years ago

No, the stock music player plays tracks normally in all modes. Could it possibly be something related to permissions? I installed SMP from F-Droid, and all F-Droid apps seem to have less privileged permissions than the rest on the system.

Anyhow, I'll record the adb variable dump this weekend and post it here.

Thanks a lot!

souch commented 8 years ago

I don't think it could be related to permissions, especially if the problem appears randomly.

souch commented 7 years ago

The problem appears to me too, when the phone was locked and an audio jack was plugged to the phone. Did this appear to you in the same context?

edo9k commented 7 years ago

No, the audio would stop playing randomly both with and without earphones plugged into the audio jack. But I no longer have the device, so I cannot reproduce the error anymore. (if no one else is complaining about this, I suggest you close the issue)

souch commented 7 years ago

Ok, thanks to answer. You mean the error does not reproduce with the new device, or that mean you do not use anymore SicMu player?

edo9k commented 7 years ago

I still use it, and the error is gone.