jellyfin / jellyfin-android

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

[Issue]: Audio doesn't autoplay on Android App #1007

Closed asbestinuS closed 1 year ago

asbestinuS commented 1 year ago

Please describe your bug

Hello, I have a problem with Jellyfin using an android phone. If I start to play a mp3-file and press the off-button to let the music play in the background, it plays it without issue, but at the end 99% of the time the playback just stops. No error, the playback is stuck at the end. Sometimes it will switch to the next track in the playlist, but only like 1 time out of 15. If I "reopen" the app I can just play it again or just choose a different track. Playing the same track or playlist on a Windows machine with a browser works flawlessly, 100% of the time. I tried reinstalling the app, doens't work. I tried using an external player like VLC, same behaviour. I can not say why it works a few times. I tried shuffle, I tried Instant Mix, I tried enabling shuffle in the created playlist, no dice.

It maybe started after updating my Ubuntu VM, but I don't know when it started, in the beginning I hadn't that issue and I use jellyfin a few months now already. I did completely delete my music libraries at one point, shuffled the media around, created folders, subfolders, added and remove tags, combined artists, you know sorting the music library and stuff. I then created new libraries (not a single one like I had before) and kept a few folders out of the library. Also, I purposely deactivated every single Metadata downloader for this library, I don't want jellyfin to shuffle my music around too much as I created non existing album folders and stuff to get around the problem how jellyfin handles Singles (ripped radio tracks, painstakingly adding manual mp3tags)

However, because I have no problems playing with my browser on a desktop (haven't tried using the browser on Android yet) I don't think that my problem has anything to do with the metadata.

I don't know what to do, what the problem is. Can someone help me, please? Thanks in advance

-Max

Jellyfin Version

Other

if other:

10.8.9

Environment

- OS: Ubuntu Server 22 LTS
- Virtualization: Proxmox virtual maschine (no container or something)
- Clients: Android v10 (autoplay not working properly)
- Browser: Waterfox (works without issue)
- Hardware Acceleration: no
- Reverse Proxy: no
- Storage: NFS

Jellyfin logs

[2023-03-31 21:40:42.499 +00:00] [INF] User policy for "max". EnableAudioPlaybackTranscoding: True
[2023-03-31 21:40:42.520 +00:00] [INF] GetPostedPlaybackInfo profile: DeviceProfile { Name: null, Id: null, Identification: null, FriendlyName: null, Manufacturer: null, ManufacturerUrl: null, ModelName: null, ModelDescription: null, ModelNumber: null, ModelUrl: null, SerialNumber: null, EnableAlbumArtInDidl: False, EnableSingleAlbumArtLimit: False, EnableSingleSubtitleLimit: False, SupportedMediaTypes: "Audio,Photo,Video", UserId: null, AlbumArtPn: null, MaxAlbumArtWidth: null, MaxAlbumArtHeight: null, MaxIconWidth: null, MaxIconHeight: null, MaxStreamingBitrate: 8000000, MaxStaticBitrate: 8000000, MusicStreamingTranscodingBitrate: 128000, MaxStaticMusicBitrate: 8000000, SonyAggregationFlags: null, ProtocolInfo: null, TimelineOffsetSeconds: 0, RequiresPlainVideoItems: False, RequiresPlainFolders: False, EnableMSMediaReceiverRegistrar: False, IgnoreTranscodeByteRangeRequests: False, XmlRootAttributes: [], DirectPlayProfiles: [DirectPlayProfile { Container: "opus", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "webm", AudioCodec: "opus", VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "mp3", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "aac", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "m4a", AudioCodec: "aac", VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "m4b", AudioCodec: "aac", VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "flac", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "webma", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "webm", AudioCodec: "webma", VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "wav", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "ogg", AudioCodec: null, VideoCodec: null, Type: Audio }], TranscodingProfiles: [TranscodingProfile { Container: "ts", Type: Audio, VideoCodec: "", AudioCodec: "aac", Protocol: "hls", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Streaming, EnableSubtitlesInManifest: False, MaxAudioChannels: null, MinSegments: 0, SegmentLength: 0, BreakOnNonKeyFrames: False, Conditions: [] }], ContainerProfiles: [], CodecProfiles: [], ResponseProfiles: [], SubtitleProfiles: [] }
[2023-03-31 21:40:42.521 +00:00] [INF] User policy for "max". EnableAudioPlaybackTranscoding: True
[2023-03-31 21:40:44.172 +00:00] [INF] Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-03-31 21:40:56.172 +00:00] [INF] Lost 1 WebSockets.
[2023-03-31 21:42:35.755 +00:00] [INF] Playback stopped reported by app "Jellyfin Android" "2.4.4" playing "Returns A King". Stopped at "144491" ms
[2023-03-31 21:43:19.151 +00:00] [WRN] WS "192.168.10.104" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
[2023-03-31 21:43:19.158 +00:00] [INF] WS "192.168.10.104" closed
[2023-03-31 21:52:24.767 +00:00] [INF] WS "192.168.10.104" request
[2023-03-31 21:53:20.256 +00:00] [INF] Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-03-31 21:53:32.258 +00:00] [INF] Lost 1 WebSockets.

FFmpeg logs

no FFmpeg log

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

asbestinuS commented 1 year ago

Hey! I didn't even know that there is an android app github (I really have problems understanding the whole github thing). I thought my issue was deleted. I didn't get any notification via mail. However, I searched the issue thread and found a possible solution from @pouncer29 https://github.com/jellyfin/jellyfin-android/issues/948 "Setting power usage to allow background data and setting optimized battery usage to "not optimized" seems to have fixed this for me."

xfengfeng commented 1 year ago

I also encountered a similar situation. It works fine on the browser and TV side, but the next song cannot be played automatically on the mobile phone. After changing the power saving policy to unlimited, it works fine.

JAlexoid commented 1 year ago

Can this be optimized, like YT Music, Spotify, SoundCloud etc work on devices?

I still have this issue.

This should not be closed - as it persists and there's no information about setting this to unrestricted.

If I weren't a developer, I would have just set 1 star review on the app in the store.

Could we, as engineers, not assume that everyone is an engineer and is going to be looking at CLOSED issues in GitHub?