jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.83k stars 481 forks source link

Coonecting or disconnecting a bluetooth keyboard stop playback #1486

Closed Arial-Z closed 2 years ago

Arial-Z commented 2 years ago

Describe the bug

Start playback Connect or disconnect a bluetooth keyboard (only tested with a keyboard) Playback stop

playback should continue when a bluetooth device get connected or disconneted as most of them have a idle disconnect / power off

Maybe related to #1061

adb.log

Logs

No response

FFmpeg logs

No response

Media info of the file

No response

Application version

0.13.0-beta.4

Device information

Nvidia Shield Pro 2019

Android version

Android 11

Jellyfin server version

10.7.7

mueslimak3r commented 2 years ago

Does the system play a sound when you connect/disconnect the keyboard?

If so, it's likely the audio focus loss that stops playback. Currently we don't handle transient audio focus loss and allow playback to pause then resume if focus is regained quickly.

Arial-Z commented 2 years ago

No sound Playback just stop and jellyfin go back to the library and display "Aucun élément à lire" should translate to something like "No media to play" Bluetooth disconnect around line 1000 adb bluetooth.log

ACR-Jeff commented 2 years ago

I have the same exact issue. I have Jellyfin v0.13.0-beta.5 I have a Rii Mini i8+ keyboard that I use with my android tv box. It connects using bluetooth, If I choose any of the built in player options "Automatically choose, ExoPlayer and LibVLC", When playing a video with either of those three options selected in the player preferences. While playing a video then flip the off button on my bluetooth keyboard the player will close instantly and go right back to the video details screen.

I have played with this for some time now, I have tried other players "VLC media player, MX Player and etc." Every external player works fine within Jellyfin and outside of Jellyfin. Only happens with the built in media players within Jellyfin.
logcat.txt

mueslimak3r commented 2 years ago

Assuming the issue is related to audio focus, it's likely that a fix won't come until the playback rewrite is ready. Prior to the rewrite, I fix would require a non-trivial redesign anyway to get things functional. The reason being that switching to using media sessions is the right way to properly handle the variety of playback interrupting events that may occur. Doing that with the current design of the playback code isn't practical.

@ACR-Jeff the log you provided doesn't show any log output from the jellyfin app. If you could re-record it then I'll check again. With logs we may find a fix is feasible right away.

ACR-Jeff commented 2 years ago

Oh sorry about that. I am used to doing it on a different device, I believe I have it figured out now. Hope this helps solve this issue. Thank you

I went through each player two different times to make sure the logs caught everything as best as possible. Hope this helps. logcat.txt

mueslimak3r commented 2 years ago

Oh sorry about that. I am used to doing it on a different device, I believe I have it figured out now. Hope this helps solve this issue. Thank you

I went through each player two different times to make sure the logs caught everything as best as possible. Hope this helps. logcat.txt

From those logs it does look like the issue is caused by losing audio focus.

jellyfin-bot commented 2 years ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

odin81 commented 1 year ago

I'm facing the same problem. When the bluetooth keybord get's disconnected after about 30 minutes, jellyfin restarts.

jadev-projects commented 1 year ago

I have the same problem when my keyboard disconnects itself or when I switch it off. It's very annoying, and the alternative I've found is to download the application on my cell phone that lets me control the box like a remote control. I hope that the community will be able to solve this problem, as the player recovers the event and returns to the film description, which shouldn't happen. Perhaps by being more rigorous about the events used to stop a video, the problem will resolve itself. I hope this problem will no longer be ignored.