-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NullPointerException when switching to next track #48
Comments
The logcat output:
EDIT: formatting |
Thanks for providing this crash report and especially the stack backtrace. We'll investigate. It looks like the callback for the second MP is trying to access the primary MP that is not available any longer (for some reason) |
Are you able to reproduce the issue? If yes I would like to send you an test apk with the commit above applied? Updated It is signed with the release key so depending on your install (F-Droid or Google) you need to reinstall. |
Thanks for your quick response. I tried the APK you gave me, however the issue still persists, though it seems it is at a different place this time:
|
Thanks for your time in investigating this, is this the complete crash log? Looks like there might be missing something above? |
No problem. I think this is the full log but I can test it again in half an hour and see if there's anything else. |
Now, I got this error instead:
It seems like the same error happened. |
Also, I didn't write out my device details, would that help? |
Really strange. Should not be happening, I have to recheck every edge case. Of course a if(null != ...) could help but actually it really shouldn't occur :). |
The weird thing is, it happens completely randomly. It sometimes plays fine for an entire day and starts crashing every 2 songs the next day. Anyway, thanks for spending time on this. |
Just to be sure. Does this happen when manually switching to the next track or when a track finishes and the next starts? |
It only happens when the track automatically changes, if I change the track myself it never crashes. |
I should also mention that this also only happens when Odyssey is in the background and/or swiped off in the recents list. We already know it is a PlaybackService issue, maybe this is ART going a bit overboard and GC'ing mCurrentPlayer when it finishes playing? |
Ok, I assumed the other case. Now I think I know what happens on your Phone. Usually it is: Now for your phone it has to be like: This can be the only case where mCurrentMediaPlayer is null. The case that the second MP prepares after the primary MP is finished never happend to any of our devices and is simply not implemented. We can do it but actual it is a bit weird that this happens. Looks like your MediaPlayer is blocked some how. I'll think about a workaround. Should be possible to catch this and start the second MP then. The GC cannot wipe the current MP if GaplessPlayer holds a reference to it. Are you absolutely sure this only happens in the background? Sounds like a coincidence |
https://owncloud.djselbeck.de/index.php/s/fzC9ViB4pVgJrYs include a new test version with the WO above. I can only debug with the head so I can not guarantee any progress ;). Please report back if it changes anything. |
Sorry for not replying yesterday. The last APK you gave me fixed it I think, no crashes so far. Also I think the second player not loading might be my phone being outdated ;P |
Thanks for your response. Glad to hear that the issue has disappeared. If it reoccurs feel free to write again :) |
Which release are you pushing this as? I'd be really glad if you pushed this bugfix to F-Droid. |
We are releasing a new version today. If we integrate this fix or not is not yet set. But if not we try to release it as fast as possible. |
We released a new version which includes the fix for your issue. It will be available on F-Droid in the next few days we think. If your issue reoccurs please reopen the issue. |
Sometimes (not always), when switching to the next track, a null pointer exception occurs at this line:
https:/gateship-one/odyssey/blob/master/app/src/main/java/org/gateshipone/odyssey/playbackservice/GaplessPlayer.java#L491
(I don't have the exception traceback atm, will attach when I get the error again.)
My suggestion is to check mCurrentPlayer against null and if it is null just assign mNextPlayer to mCurrentPlayer and start playing mCurrentPlayer.
The text was updated successfully, but these errors were encountered: