-
Notifications
You must be signed in to change notification settings - Fork 8
[Bug] "Skipping" behavior in offline mode #148
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
Comments
hello, It sounds like you’re experiencing network connection issues, which become more noticeable with FLAC files (which are very large usually). The app is set to automatically skip to the next song after encountering three connection errors, which is likely why you're seeing these skips. To improve your experience, you could try downloading the music you want to play. Alternatively, I can adjust the app to increase the number of retry attempts for connection errors. I would also suggest to keep your ampache backend updated, and maybe try to restart your server to clear cache and memory. |
Hey @icefields , I'm actually experiencing this in offline mode. I've been testing this morning on PA2 1.00-65. My Ampache backend is on the latest stable (6.6.0). Mobile is a Pixel 7 Pro, in case there's a local resource question. Should be plenty of power. |
ok that is a different bug then. The best way for me to check on this would be if you gave me a test account for your server (if you're comfortable with this) so I can check the logs from my LogCat with the app in debug mode |
Hmm, certainly don't mean any disrespect, but not sure I'm comfortable at this point. I'll think about it. Trying to understand how the server is at play if the app is in offline mode. The skips occur even when I turn off mobile data and wifi. Bluetooth is at play, so not testing in airplane mode. I'm gonna run an extended test while hardwired. My gut is telling me it's a bluetooth thing, although I have zero proof of that lol. I'm not having similar issues in other apps. Coming from many years of using DSub and have been going back to it to compare and not experiencing anything similar, again while offline. |
No worries, I understand completely. I know where to look (and put a debugger breakpoint to analyze the issue) for player errors, so if you change your mind and decide to create test account for me, I'll give you my email, or you can dm me in person on telegram (links on the readme and on power.ampache.dev). Let me know how the situation evolves if you do more testing. |
Hi @icefields, I have the same issue but for me the app crashed while glitching and trying to skip the offline song that was playing, so I was able to generate a This issue happens with a bunch of songs, no matter if they're flac or not. If you're comfortable with a discord call, I could also supply some credentials for you to give it a try. |
hello @CrazyStevenz , thanks for reaching out and for providing crash info. The crash report doesn't contain personal info, but it does contain some device info. |
@JoeDat I had the same issue with my wireless earbuds, but I tested with Bluetooth turned off and the crash still occurs, so not the culprit. My current way of crashing the app is the following (performed on an offline songs library that included both flac and mp3 songs, with and without cover images):
|
Thanks @CrazyStevenz, I've never encountered any freezes or full on crashes. Just the stutter before it skips to the next track in the playlist. 99% of my catalog contains songs with cover art, so I'm rarely playing anything that isn't. I haven't posted recently because the problem has been elusive for me (of course lol) . But, I'll definitely give the steps above a repro attempt and report back. |
I got a little lost in your steps a bit, but there seems to be something there regarding air-gapping the device, restoring connectivity, etc. I notice this more when I'm wandering around my property and likely floating in and out of wifi availability (where the phone is constantly trying to find a connection). Manually skipping songs from the notification bar, there's considerable flicker and occasionally corresponding stutter at the very start of the track (something I never see while online). This is very similar behavior I'll notice when it happens in the middle of the track, and the flicker and stutter is seen in both the in app player and notification bar. I've gotten accustomed to running in offline mode when I know I'll be away because I'm coming from DSub and there wasn't another way to see your offline tracks. PA2 grants that capability without explicitly being offline, so I'll do this network connectivity test while PA2 is online to see if I can repro. I haven't yet been able to repro your OMM and eventual freeze or crash. Maybe a difference in phone hardware between us (ie, I have more available resources?). I'm on a pixel 7 pro. |
I'm on a Pixel 7 128/8 with GrapheneOS. Maximum ram usage from the app was <500MB before it crashed, and I had over 3GB of ram free. Funny thing is that, without restarting my phone or changing anything, I can no longer reproduce the issue with my own reproduction steps. I wonder if it's related to the server, like when my Nextcloud instance is really slow the requests pile up and it eventually runs out of memory. With no solid reproduction steps and if Icefields doesn't by now have an idea of what might be causing this, I don't think we're getting a solution. |
@JoeDat @CrazyStevenz Thank you for your detailed reports. I started running some tests using your steps while monitoring the logs, unfortunately LogCat is not telling me much. I also monitor the memory for leaks all the time during my pre-release tests, and haven’t observed any zombie threads or processes consuming excessive memory. But I'll keep digging. It’s possible the bug could be related to the server, the specific phone model, or the API level, but it’s challenging to pinpoint the exact cause without more detailed logs. I’ll continue to investigate and will keep you updated. If you discover any additional information or observations, please share them here. |
@icefields Only new thing I can tell you is that after playing one song in online mode, I switched to offline mode, and after ~15 minutes of playing music offline, browsing twitter and switching songs from the media widget and the lock screen, the issue happened again. After the app crashed and I opened it again, I left it in offline mode and the bug didn't occur after hours of playback. Would a version of the app with extra logging, or a way to setup some kind of debugging on it while it's installed on my phone, help? I want to do whatever's possible to help, since this issue is very infuriating when it happens, and it'll probably affect more people as the app's usage grows. |
@CrazyStevenz ok, yes we need to solve this, sounds annoying. I will send you a version with extra logging. Thanks for helping. |
If you want to include me in this debugging test, I'm all for it as well. I've recently been testing in airplane mode, and I can get the issue to happen there. The server backend can't possibly be a factor. |
@JoeDat awesome, thanks! I will make a build with extra logging enabled and I will post the link here in this thread (most likey tomorrow, but I will try tonight if I can). |
@JoeDat @CrazyStevenz find the apk with extra logging here. If you previously downloaded from FDroid or PlayStore, this will not replace your official version, they will live together on your phone: The git branch where I'm working on this is Thanks again for helping. |
@icefields I use Obtainium, so I have the latest apk from Github as soon as you release it. That said, I tested version 66 and the issue keeps happening, so you can cross that fix out. I'll install the custom version on my work profile, so I can keep my signed installation and test the debug apk in parallel. I'll let you know how it goes. |
@CrazyStevenz that apk is signed with the same key as the Github releases (but it won't replace it because they're the same version), I can make you a FDroid apk tomorrow, so you don't have to go through the trouble of switching profiles. |
You don't need to switch profiles to use work apps on Android, I just open the "work" version of PA2, so don't worry about that. My main worry is that the issue won't happen on the work profile, if the cause is something unrelated to the app. If I don't observe the issue with this setup I'll try replacing the main app and testing it again. If the issue happens, I'll message you logs and the exact timestamp on Telegram. |
@JoeDat @icefields Since we are now fairly sure it's not the flac files causing this issue, please remove that part from the title, as it creates confusion for users who are having this issue with mp3s, as can be seen in the linked PR above this message. |
@JoeDat thanks for changing the title, it was indeed inaccurate. But I think the issue is reproducible online as well, anyone please confirm before I change the title again. |
Oo interesting. I'd be down to test any builds :) |
I'm going link a test release in this thread in the next few days. |
I’m going to delay the official release by a few days. I usually work on Power Ampache 2 after hours and on weekends, but this past week has been particularly busy, including the weekend. I have several fixes in commits that I haven't pushed yet, related to the issues you’ve reported, in addition the attempted fixes already in the debug build. I’ve added a timer to reset the player error counter after a minute of no errors, as currently, the song skips after a certain number of errors without a reset. I’m also checking if the service is active before playing a song, since I suspect it might be getting killed due to memory constraints. There are also a few other minor fixes being addressed. As I previously mentioned, I will share a debug build here as soon as it's ready. |
@CrazyStevenz @JoeDat this is the pre-release that fixes some (hopefully all) of the issue pointed out in this thread. |
Thank you! Will try it out today :) |
Hi! really sorry to say that I'm still personally experiencing the same issue :/ Another bit of information (not sure if it's useful) is that the app continues trying to play music even when it is swiped away and i have to force close it to stop it. Here is the log of the issue |
@icefields With this version the issue happened pretty much immediately. I started with the tune spinner and on the 3rd song, it played the 1st second and then played from the beginning again. Every song after that became worse and worse. Then, for the first time ever, the app completely froze for about 30 seconds. After the system finally prompted me to force stop it, I managed to also extract an Android ANR log. Logging In-app debug logs: I checked the timestamp the issue happened and the printed entries are empty (as in, just a timestamp and an empty body). Empty entries are also printed randomly, so not sure if this is related. |
The steps required to reliably make the glitch happen are now much fewer.
To me, it seems like a weird interaction between the image cache and Nextcloud. |
@CrazyStevenz @looowizz looks like I solved nothing for you with this update. To test this more properly, I created a virtual machine with Ubuntu Server and I installed the Nextcloud Snap package (I'm surprised how easiy it was to set up!), I'll do some more tests today. Thanks for the steps to reproduce and for keeping helping debugging the issue. @looowizz can you provide:
Thanks. |
To confirm, I'm also still experiencing the issue on the latest test build. I'm on Ampache 6.7.0. The steps above might be sufficient to force the issue to happen, but it might be good to consider that it's not the only way. As reported above, I see this in airplane mode, which if I'm not the only one, kinda turns this issue on its head. I get album art while offline, If I am the only one with this specific behavior, I'll step aside and see how this shakes out. If the issue here is resolved and I'm still experiencing a completely offline version of this problem, I'll submit a new issue report. EDIT: Seems like I completely missed the point that images are cached and not read from metatags locally. |
@JoeDat thanks. I will keep trying, and I hope it will be resolved soon. The fact that I cannot reproduce this on any of my devices and emulators is making the debugging process very slow. |
Hi! My phone model is the Google Pixel 4a (5G) |
@icefields When I installed this version of the app in my work profile 2 weeks ago, I never managed to make it crash. It seemed really weird to me that after all the work you did the crash still happens in the latest RC, so I went back and installed the oom version on my main profile and I managed to crash it almost immediately. The only major difference between the 2 profiles (on the level I control, not sure what happens under the hood by Android) is that the work profile contains the GrapheneOS sandboxed Google Play Services, while the main profile does not. |
@CrazyStevenz that is odd, I have absolutely no interaction with google, not even in the playstore version, and I personally don't have play services on any of my devices. I'm not sure what Android is doing here under the hood or how Work Profiles are handled by the system. On my GrapheneOS I have a completely different user account that has microG, so I never used work profiles. |
Another update after more than 1 month of usage: I noticed that even when the app is in offline mode, it still makes network requests for music cover art, which drove up my mobile data usage. I decided to revoke the Network permission from the app, to prevent that from happening, and from that point on, the frequency of this issue was reduced by 99%. It still happens occasionally, when the phone is really hot, or ram usage is high, or I'm switching songs too rapidly, but it nearly never glitches or skips songs anymore, and is how I'm using the app day-to-day now. |
@CrazyStevenz Thanks so much for keeping testing this! |
I mentioned similar behavior earlier regarding network traffic while offline and thought it was interesting, specifically surrounding image art retrieval. It's not just a Nextcloud backend issue, as I'm seeing the same behavior with it struggling to pull album art from Ampache. |
@JoeDat @CrazyStevenz |
Coming back after a week to say that the situation has improved a lot in the last few updates. Together with the Player Advanced Settings in this update (which I have all set to the lowest values possible, since I only listen to downloaded songs), track glitching has become extremely rare. It still happens maybe once an hour, but it only happens once and doesn't skip the song. A new issue that appeared 2-3 updates ago is that some songs immediately skip when being played. It can happen to any song, although it usually happens to the first song in a listening session. This might be a different issue though, I'll let you be the judge. |
Agree with CrazyStevenz assessment, feel like things are much better for me as well. I'll report back here if the situation changes. Keep up the good work with this app! |
This is a difficult issue to describe.
Occasionally I'll experience what I can only describe as "skipping" behavior in some tracks. I believe the issue only occurs with FLACs, although I don't have many non-FLAC files to experiment with. When viewing the app during the behavior, the player appears to quickly pause and resume the track. The repeated behavior typically happens in short bursts, and can sometimes only last a few seconds. However, if it happens longer, the app seems to give up on the track, starts playing the next track, where sometimes that track plays fine, or exhibits the same behavior. In some extreme cases, it'll do this pause/resume/start next track thing for 2 or 3 songs in quick succession.
I tend to use the app while connected to a BT device such as my Sony WH-1000XM4 headphones, or a JBL PartyBox 110. I don't believe I've heard this issue when not connect via BT, but I admittedly don't play music without an external speaker often.
I can supply debug logs for the last occurrence, however I can't seem to figure out how to get the logs. I can see the log list, but touching a log file does nothing.
The text was updated successfully, but these errors were encountered: