Closed BlueNalgene closed 4 months ago
thanks, music not playing is major issue. are you trying to play a flac file by any chance? those are not supported yet
Nope. Everything I have (mostly) is 320 MP3.
Edit: specific info:
$ file /media/storage2/Sounds/B/Belzebubs/Belzebubs\ -\ 2019\ -\ Pantheon\ Of\ The\ Nightside\ Gods/01\ Cathedrals\ of\ Mourning.mp3
/media/storage2/Sounds/B/Belzebubs/Belzebubs - 2019 - Pantheon Of The Nightside Gods/01 Cathedrals of Mourning.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 320 kbps, 44.1 kHz, Stereo
@BlueNalgene
ok, thanks so much for your help, I don't have any playback issue on my devices so I cannot reproduce the issue, but the bug NEEDS to be fixed, music playback is pretty major. Can you try the following things please? whenever you have a minute, it would be very helpful.
Thanks again for helping
This is almost certainly a server or PEBKAC issue.
* Is this something that happens only on some particular songs or everywhere?
All songs. I was clicking from "Recent", but I also tried searching for specific artists.
* Can you try to kill and restart the app and try again?
Done.
* Can you go on Settings, debug logs, and copy what's in there if there's anything?
No logs appear.
* What version of the Ampache server are you using?
5.4.0-release. It looks like I'm a few versions old. I will try updating first.
* I want to rule out that the issue is on the server. Can you try to log out and on the login to "Dogmazic demo Server", there's a button on the loging page for that, and then try to play any song from that server.
The demo server works. There must be something in my config not playing nice. In addition to the version update, do I need to have specific settings in my .htaccess or redirects for this API?
I see, on that version the data is structured a bit differently, I just checked, and I'm adding the fix to the release I'll be making in a few minutes (along with other fixes and enhancements).
Anyway, I think in general you should update to the latest server, the guys at Ampache are always working on improvements and new features.
For now, please wait that I push this new release (in about 15 mins, just the time to prepare the release log) and let's try this fix I just made.
I'm currently updating my server to 6.2.1, and I am finishing the catalog update.
Edit: updated server to 6.2.1 and the playback problem persists.
Ok got it, the fix I just made might still work. Let me know. https://github.com/icefields/Power-Ampache-2/releases/tag/v0.20-beta
With v0.20-beta Power Ampache 2 and v6.2.1 Ampache, the problem still occurs. No music.
I also tried a device reset and a shutting down ad blocking apps. No effect.
By pressing play on the same song after it fails to play, the app crashes. This is not new, it occurred each time the song failed to play. However, this was the first time I had Gmail open to receive the crash report. I sent it via email since it contains real info. It may be related to this issue. Let me know if I should open a new one for that separately.
I got the bug report, what I see from the stack trace is a UI bug, most likely caused by the previous issue. I could get the stack trace of the errors directly if you enable bug reporting in the settings screen, here's a sample of the data I'll be receiving:
--------------------------------------------
2024-02-08 20:11:48
"retrofit2.HttpException: HTTP 404 { \"exception\" : \"Failed to connect to /106.380.10.105:8320\" }\n\tat retrofit2.KotlinExtensions$await$2$2.onResponse(KotlinExtensions.kt:53)\n\tat retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:161)\n\tat okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:535)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)\n\tat java.lang.Thread.run(Thread.java:1012)\n"
--------------------------------------------
2024-02-08 20:11:50
"getPlaylists() - cannot load data HttpException retrofit2.HttpException: HTTP 404 { \"exception\" : \"Failed to connect to /106.380.10.105:8320\" }"
--------------------------------------------
Basically just the stack trace of the error that I'm capturing in a try catch
.
Anyway, you could try one more thing with the new version if you haven't yet. Since the issue was with the user object, maybe try to log out and back in.
Thanks for sending the report btw. I decided to use email to report bugs because I wanted the app to be 100% private and free of trackers. A "silent" bug reporting tool might register too much info, while with emails the data you're sending is 100% transparent.
No luck with the logout. The demo server works fine. Can you share the config for it? Can you share the apache config?
I'm happy to send reports and break other people's code.
This is the config, but I'm not sure you'll find the solution in it. I asked the developers of Ampache about your issue, since that's their expertise. Ideally if someone has a similar issue I'd like to handle the error graciously (instead of the app just crashing on you) and show a dialog with instructions on how to enable music playback, or whatever the solution is. In the meantime it would be very useful to see the stack trace of the error. If you go to Settings in Power Ampache 2, enable "remote debug logging", and crash the app, I'll get the error on my end and can start examine it. Thanks.
config_version = 69
web_path = ""
session_length = 3600
stream_length = 7200
remember_length = 604800
session_cookielife = 0
session_cookiesecure = 0
auth_methods = "mysql"
access_control = "true"
require_session = "true"
require_localnet_session = "true"
getid3_tag_order = "vorbiscomment,id3v2,id3v1,quicktime,matroska,ape,asf,avi,mpeg,riff"
metadata_order = "getID3,MusicBrainz,TheAudioDb,filename"
metadata_order_video = "filename,getID3"
deferred_ext_metadata = "true"
additional_genre_delimiters = "[/]{2}|[_/\\|,;]"
catalog_file_pattern = "mp3|mpc|m4p|m4a|aac|ogg|oga|wav|aif|aiff|rm|wma|asf|flac|opus|spx|ra|ape|shn|wv"
catalog_video_pattern = "avi|mpg|mpeg|flv|m4v|mp4|webm|mkv|wmv|ogv|mov|divx|m2ts"
catalog_playlist_pattern = "m3u|m3u8|pls|asx|xspf"
catalog_prefix_pattern = "The|An|A|Die|Das|Ein|Eine|Les|Le|La"
waveform = "true"
use_auth = "true"
default_auth_level = "guest"
ratings = "true"
directplay = "true"
sociable = "true"
licensing = "false"
album_art_min_width = 30
album_art_min_height = 30
playlist_art = "true"
art_order = "db,tags,folder,spotify,musicbrainz"
wanted = "false"
wanted_types = "album,official"
live_stream = "true"
podcast = "true"
refresh_limit = "60"
show_footer_statistics = "true"
debug_level = 5
site_charset = "UTF-8"
cookie_disclaimer = "false"
registration_display_fields = "fullname,website"
registration_mandatory_fields = "fullname"
transcode_m4a = "required"
transcode_flac = "required"
transcode_mpc = "required"
transcode_ogg = "allowed"
transcode_wav = "required"
transcode_mp3 = "allowed"
transcode_avi = "allowed"
transcode_mkv = "allowed"
transcode_mpg = "allowed"
encode_target = "mp3"
encode_video_target = "webm"
transcode_player_customize = "true"
transcode_cmd = "ffmpeg"
transcode_input = "-i %FILE%"
encode_args_mp3 = "-vn -b:a %BITRATE%K -c:a libmp3lame -f mp3 pipe:1"
encode_args_ogg = "-vn -b:a %BITRATE%K -c:a libvorbis -f ogg pipe:1"
encode_args_opus = "-vn -b:a %BITRATE%K -c:a libopus -compression_level 10 -f ogg pipe:1"
encode_args_m4a = "-vn -b:a %BITRATE%K -c:a libfdk_aac -f adts pipe:1"
encode_args_wav = "-vn -b:a %BITRATE%K -c:a pcm_s16le -f wav pipe:1"
encode_args_flv = "-b:a %BITRATE%K -ar 44100 -ac 2 -v 0 -f flv -c:v libx264 -preset superfast -threads 0 pipe:1"
encode_args_webm = "-b:a %BITRATE%K -f webm -c:v libvpx -preset superfast -threads 0 pipe:1"
encode_args_ts = "-q %QUALITY% -s %RESOLUTION% -f mpegts -c:v libx264 -c:a libmp3lame -maxrate %MAXBITRATE%k -preset superfast -threads 0 pipe:1"
encode_args_ogv = "-codec:v libtheora -qscale:v 7 -codec:a libvorbis -qscale:a 5 -f ogg pipe:1"
encode_get_image = "-ss %TIME% -f image2 -vframes 1 pipe:1"
encode_srt = "-vf \"subtitles='%SRTFILE%'\""
encode_ss_frame = "-ss %TIME%"
encode_ss_duration = "-t %DURATION%"
send_full_stream = "webplayer"
common_abbr = "divx,xvid,dvdrip,hdtv,lol,axxo,repack,xor,pdtv,real,vtv,caph,2hd,proper,fqm,uncut,topaz,tvt,notv,fpn,fov,orenji,0tv,omicron,dsr,ws,sys,crimson,wat,hiqt,internal,brrip,boheme,vost,vostfr,fastsub,addiction,x264,LOL,720p,1080p,YIFY,evolve,fihtv,first,bokutox,bluray,tvboom,info"
I have 2 updates from the Ampache developers, I'll copy their suggestions here:
I think I will start an issue on the Ampache side to see if the server is configured correctly upstream.
yes, that's what I was going to suggest, try to figure this out with the Ampache developers, they're usually very responsive.
I have one last test I suggest you to try, can you call this url from your browser and tell me the result?
http://<your.ampache.server>/server/json.server.php?action=ping
you should either get something like this or a 404.
{
"server": "6.2.1",
"version": "6.2.1",
"compatible": "350001"
}
Yes, my result is as expected:
server | "6.2.1"
version | "6.2.1"
compatible | "350001"
I downloaded Android Studio and emulated the app, and I can generate the following error:
Playback error
androidx.media3.exoplayer.ExoPlaybackException: Source error
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:701)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:673)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: androidx.media3.datasource.HttpDataSource$InvalidResponseCodeException: Response code: 302
at androidx.media3.datasource.DefaultHttpDataSource.open(DefaultHttpDataSource.java:436)
at androidx.media3.datasource.DefaultDataSource.open(DefaultDataSource.java:272)
at androidx.media3.datasource.StatsDataSource.open(StatsDataSource.java:86)
at androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1029)
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:417)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
It looks like the problem is upstream from this app. I will follow up with this.
that's interesting, you might have a problem redirecting to the url of the stream. You're also getting a source error, that means the player cannot read that url (obviously, due to the failed redirect).
The stream url is in fact a redirect url, it looks like this:
<serverUrl>/json.server.php?action=stream&auth=<authToken>&type=song&id=<mediaId>&bitrate=<bitrate>
Ampache will parse that and generate and redirect you to something like this:
<serverUrl>/play/index.php?ssid=<authToken>&type=song&oid=21863&uid=2&player=api&name=songFileName.mp3
Looks like your server is facing issues with redirecting urls (in general maybe). This is supported by the fact that you have no trouble playing directly from the website (no redirection). I would take a look at the general server configuration.
I'm linking the Ampache discussion thread here: https://github.com/ampache/ampache/discussions/3839
since we moved the issue to Ampache, and there's already a ticket to handle those error responses graciously, I'm going to close this thread
@BlueNalgene hello, would you mind testing the new release(v0.40-rc1)? It's not going to fix your backend issues, but I worked on some workarounds for when the app doesn't receive the User object from the server, and other edge cases. I added some safety nets and the app should now be able to handle some missing data from the server (at least in theory, I can't really test every single edge case).
LINK: https://github.com/icefields/Power-Ampache-2/releases/tag/v0.40-rc1
Acknowledged in both locations.
Apologies for the late reply. I've been AFK doing field work. I might be a tad slow to reply while I get caught back up on desk work and my teaching materials.
I'm currently testing the release. I get some friendly error messages that let me know that files cannot be played due to connection/corrupt/server issues. It looks likes when playing an album, it tries to loop through each song to play, and it issues an error for each one. I assume this is expected behavior. If not, I can open another issue.
no worries at all! I'd be interested in seeing what's the stacktrace of the error after a song is not played and skipped, because I think I know what's throwing the exception. The error that you told me sounds like it's been thrown by the player service, the hints are the text of the error, and the fact that it automatically skips to the next song (I added skip on error recently). Unfortunately this can mean that the issue is that the player cannot read the song from the server, ie. the server is not streaming, or the file is in a format that the player doesn't recognize (are you playing mp3s?), or if you downloaded the file, this could be malformed (I don't think that is the case). If it's throwing an exception it should be logged by the error logger, would it be ok for you to enable remote logging? It's in Settings. If you haven't already.
The remote debugging was already enabled. I am running and playing a song right now at ~1430 UTC time in case you have a deluge of other reports that buried the previous one. Let me know what you see.
@BlueNalgene Thanks so much for providing the time in UTC. I see a succession of identical stacktraces between 2024-04-04 14:31:45 and 2024-04-04 14:52:11 UTC. I'm going to copy a sample below.
The error is Invalid response code 302 - Found
, you are getting a 302 response from the server. I'll keep investigating, but we can almost confirm that the issue is on the server side.
--------------------------------------------
2024-04-04 14:34:32
0.40-rc1 (40) - DB: 80
onPlayerError Invalid response code 302 - Found - PlaybackException
This track cannot be played. The issue could be related to your connection, the file might be corrupt, or issues with your server.
If it's an offline track please try delete and re-download
{"isRecoverable":false,"mediaPeriodId":{"adGroupIndex":-1,"adIndexInAdGroup":-1,"nextAdGroupIndex":-1,"periodUid":{"first":{},"second":{}},"windowSequenceNumber":8},"rendererFormatSupport":4,"rendererIndex":-1,"type":0,"errorCode":2004,"timestampMs":1703345756,"cause":{"headerFields":{"null":["HTTP/1.1 302 Found"],"Access-Control-Allow-Origin":["*"],"Connection":["Keep-Alive"],"Content-Length":["0"],"Content-Type":["application/json; charset\u003dUTF-8"],"Date":["Thu, 04 Apr 2024 14:34:32 GMT"],"Keep-Alive":["timeout\u003d5, max\u003d88"],"Location":["http://bluenalgene.com/ampache/play/index.php?ssid\u003dc68e7b3a7ff40f11833652b4906d0847\u0026type\u003dsong\u0026oid\u003d80815\u0026uid\u003d3\u0026client\u003dapi\u0026player\u003dapi\u0026name\u003dAgalloch%20-%20A%20Desolation%20Song.mp3"],"Server":["Apache/2.4.57 (Ubuntu)"],"X-Android-Received-Millis":["1712241272201"],"X-Android-Response-Source":["NETWORK 302"],"X-Android-Selected-Protocol":["http/1.1"],"X-Android-Sent-Millis":["1712241272026"]},"responseBody":[],"responseCode":302,"responseMessage":"Found","dataSpec":{"absoluteStreamPosition":0,"flags":6,"httpMethod":1,"httpRequestHeaders":{"Icy-MetaData":"1"},"length":-1,"position":0,"uri":{},"uriPositionOffset":0},"type":1,"reason":2004,"detailMessage":"Response code: 302","stackTrace":[{"declaringClass":"androidx.media3.datasource.DefaultHttpDataSource","fileName":"DefaultHttpDataSource.java","lineNumber":436,"methodName":"open"},{"declaringClass":"androidx.media3.datasource.DefaultDataSource","fileName":"DefaultDataSource.java","lineNumber":275,"methodName":"open"},{"declaringClass":"androidx.media3.datasource.StatsDataSource","fileName":"StatsDataSource.java","lineNumber":86,"methodName":"open"},{"declaringClass":"androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable","fileName":"ProgressiveMediaPeriod.java","lineNumber":1029,"methodName":"load"},{"declaringClass":"androidx.media3.exoplayer.upstream.Loader$LoadTask","fileName":"Loader.java","lineNumber":421,"methodName":"run"},{"declaringClass":"java.util.concurrent.ThreadPoolExecutor","fileName":"ThreadPoolExecutor.java","lineNumber":1145,"methodName":"runWorker"},{"declaringClass":"java.util.concurrent.ThreadPoolExecutor$Worker","fileName":"ThreadPoolExecutor.java","lineNumber":644,"methodName":"run"},{"declaringClass":"java.lang.Thread","fileName":"Thread.java","lineNumber":1012,"methodName":"run"}]},"detailMessage":"Source error","stackTrace":[{"declaringClass":"androidx.media3.exoplayer.ExoPlayerImplInternal","fileName":"ExoPlayerImplInternal.java","lineNumber":713,"methodName":"handleIoException"},{"declaringClass":"androidx.media3.exoplayer.ExoPlayerImplInternal","fileName":"ExoPlayerImplInternal.java","lineNumber":685,"methodName":"handleMessage"},{"declaringClass":"android.os.Handler","fileName":"Handler.java","lineNumber":102,"methodName":"dispatchMessage"},{"declaringClass":"android.os.Looper","fileName":"Looper.java","lineNumber":233,"methodName":"loopOnce"},{"declaringClass":"android.os.Looper","fileName":"Looper.java","lineNumber":344,"methodName":"loop"},{"declaringClass":"android.os.HandlerThread","fileName":"HandlerThread.java","lineNumber":67,"methodName":"run"}]}
--------------------------------------------
2024-04-04 14:34:32
0.40-rc1 (40) - DB: 80
androidx.media3.exoplayer.ExoPlaybackException: Source error
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:713)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:685)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:344)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: androidx.media3.datasource.HttpDataSource$InvalidResponseCodeException: Response code: 302
at androidx.media3.datasource.DefaultHttpDataSource.open(DefaultHttpDataSource.java:436)
at androidx.media3.datasource.DefaultDataSource.open(DefaultDataSource.java:275)
at androidx.media3.datasource.StatsDataSource.open(StatsDataSource.java:86)
at androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1029)
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:421)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Power Ampache 2 version: v0.19-beta
Device: OnePlus 7T Processor: Qualcomm Snapdragon 855Plus Octa-core Model: HD1905 Android version: 12 (security update Dec. 5, 2022) Build version: HD1905_11_F.22 Baseband version: Q_V1:P14,Q_V1_P14 Kernel: 4.14.180-perf+
==============================
I can open the app, login, and see my music. When I click something, it pulls up the correct files and album art. However, when I click play....
============================== Ampache debug: