TeamNewPipe / NewPipe

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

Background player stops responding after disconnecting from car bluetooth #2397

Open Makaque opened 5 years ago

Makaque commented 5 years ago

If I shut my vehicle off while streaming youtube over bluetooth on the background player, the media stream can no longer be played. The app doesn't crash, and I can navigate, but I cannot resume play on the background player. Tapping play does nothing. Skipping forward or back in a playlist causes it to move to the next or previous item as expected, but does not begin to play, and tapping play still does not work. Tapping along the media progress slider to attempt to force it to load causes the progress indicator to flash and move forward slightly, then return to the beginning, simultaneously a small black rectangle appears momentarily above the play button.

Sometimes if I shut my car off only briefly, then turn it back on, media will resume play, suggesting the failure happens over some time.

gkeegan commented 5 years ago

Try attempting to do this with something like Spotify or any other music streaming app and report results please. Some info about your device might also be helpful.

Makaque commented 5 years ago

Tried with Spotify. Played playlist in car, and shut car off in the middle of the song. After 20 minutes I pressed play and playback resumed as normal.

My phone is a Xiaomi redmi note 4x (mido).

Additional details. The Newpipe app continues to function after playback stops working. I don't need to kill the whole app to get it to begin working again, I only need to close the background player, then select background play again.

Redirion commented 5 years ago

this might be related to the first issue described in #1989. I have noticed it too.

Fusseldieb commented 5 years ago

Yes, confirmed. Also happens on my car.

I shut it off, the player itself pauses and the controls freeze. I cannot resume playback, the controls do nothing and it only works again if I press "X" on the notification and open a new song/playlist.

Note: Not even changing the song on the same playlist do anything. It stays on 0:00 with the play triangle in the middle and that's it. Pressing it does nothing, as described above.

Other apps handle that fine


this might be related to the first issue described in #1989.

This issue you mentioned isn't related to this one.

Skylead commented 4 years ago

This bug isn't limited to background player, it's breaking main player too when the car is shutoff and the phone loses bluetooth connection. All playback will fail as will reselecting the same video. Can be fixed by loading a different video and then returning to the original content.

I will do more testing to confirm it in the popup player as well as check it's effect on playlists

Skylead commented 4 years ago

Update, pausing the video before shutting off the car doesn't help it hold onto the stream. However, disabling bluetooth from the phone before shutting off the car keeps everything working without reloading the video. Maybe a lost bluetooth connection isn't being handled properly?

Redirion commented 4 years ago

reading the release notes of the upcoming ExoPlayer 2.11.5 I have found something interesting: MediaSession extension: Only set the playback state to BUFFERING if playWhenReady is true

I wonder if this is the cause for the issue, the state might always be in "BUFFERING" instead of "PAUSED", so that when on resuming later the media source is not refreshed properly even though it should, leaving to an endless seek on an invalid source.

Skylead commented 4 years ago

ExoPlayer patched apk doesn't seem to have changed this bug behavior for me

stiw47 commented 4 years ago

I can confirm everything what OP said. My phones are Mi 6 custom ROM Havoc OS Pie and Samsung S9 Duos latest stock Q firmware Whatever player is working, video or background, it will not continue or be responsive after car turn off. Also, all other streaming apps, Spotify for example, will continue playback on car bluetooth reconnecting.

Stypox commented 4 years ago

Is this fixed in the apk provided in #3178?

Redirion commented 4 years ago

Initial testing shows indeed that this problem might have been resolved! @Stypox

Stypox commented 4 years ago

Great! Let's close this now, since #3178 will be merged surely

opusforlife2 commented 4 years ago

will be merged surely

Dear god I don't even want to imagine the possibility that it won't. :|

Makaque commented 4 years ago

I'm still experiencing this issue with the apk provided in #3178.

Redirion commented 4 years ago

For me the issue still appears to be resolved with the test apk from pr #3178

Can anyone else give feedback?

opusforlife2 commented 4 years ago

@Makaque Could you try the latest debug apk? You can find it from the pinned issue.

opusforlife2 commented 4 years ago

See https://github.com/TeamNewPipe/NewPipe/issues/4355#issuecomment-701015687

Flashwalker commented 4 years ago

I have the same problem. The player suddenly stops and hangs with an endless preloading cycle. The only way to get it play is wipe whole queue (kill app) and enqueue anew. Also sometimes helps if to open description page, tap playback and then tap Background icon, but the queue is lost. It happens each time i use background player.

Stypox commented 4 years ago

@Flashwalker the specific issue you are having, i.e. stopping suddenly during playback, may be fixed by 0.20.3. Could you test the RC in the pinned issue?

Flashwalker commented 3 years ago

@Stypox It got even worse. Stream is lost more often than in the previous version. I have 2 versions installed.

Stypox commented 3 years ago

@Flashwalker currently there is an issue when there are multiple versions installed, try to keep installed only the latest one (0.20.6)

mzhubail commented 4 months ago

@opusforlife2 @Stypox

I'm affected by the same issue, but I'm not familiar with native android development. How can I get around to tackling it? see logs, use debug apk?

Stypox commented 6 days ago

@mzhubail I think you start the debug APK via Android Studio and try to understand what happens while in debug mode. If debug mode does not work or is too complicated too use, you can also add Log.e(TAG, "...") calls around and do print-debugging. Sorry for the late reply, I saw this only now.