Page 1 of 2
Android client exiting after ~45 minutes

Posted:
Fri Aug 12, 2011 11:18 am
by id628
Am I the only person seeing this issue?
After about 45 minutes of playing an album (fully downloaded, not streaming), the Android client stops/exits in mid-song.
This happened with my Nexus One, with my stock Transformer Tablet, and now with my G2x running CM7.1-RC1.
Is anyone else seeing this issue? It's pretty annoying. When I restart Subsonic, it remembers which song was playing, but not the position, so it starts at the beginning.

Posted:
Fri Aug 12, 2011 2:04 pm
by alphawave7
This appears to be an Android issue. After'sleeping' the screen, there seems to be a time limit for the app to be auto-killed by the OS, barring any additional inputs/screenwakes. Some folks use Tasker from Market to create a 'pause' for three seconds to create this interruption, until Google can fix this bug.

Posted:
Fri Aug 12, 2011 2:33 pm
by id628
alphawave7 wrote:This appears to be an Android issue. After'sleeping' the screen, there seems to be a time limit for the app to be auto-killed by the OS, barring any additional inputs/screenwakes. Some folks use Tasker from Market to create a 'pause' for three seconds to create this interruption, until Google can fix this bug.
Since no other music player exhibits this problem, I don't think it's a bug in Android, but rather an omission in Subsonic.
Can the author of the Android app confirm that Service.startForeground() is being called to inform the system that it would annoy the user if Android stopped this process?
http://groups.google.com/group/android-developers/browse_thread/thread/422bf837cfdb61a1?pli=1
http://android-developers.blogspot.com/2010/02/service-api-changes-starting-with.html

Posted:
Sat Aug 13, 2011 3:39 am
by alphawave7
I beg to differ..in my experience, ALL apps I use related to music, die at 30 minute intervals, and need to be restarted. Pandora, LastFM, Slacker, etc. have all done this, on my G1, Nexus One, and now my Sensation. There are similar reports on many fora across the Android platform that discuss this.

Posted:
Mon Aug 15, 2011 12:39 am
by id628
alphawave7 wrote:I beg to differ..in my experience, ALL apps I use related to music, die at 30 minute intervals, and need to be restarted. Pandora, LastFM, Slacker, etc. have all done this, on my G1, Nexus One, and now my Sensation. There are similar reports on many fora across the Android platform that discuss this.
Honestly, I don't use any streaming apps. I use mainly the built-in Music app and a couple in the past where I have not had it exit on any commute home at all. Subsonic does it regularly, however.
But that doesn't answer the question, which was:

Posted:
Mon Aug 15, 2011 11:17 am
by bile
It happens regularly for me. Always when loosing or picking up a signal. WiFi -> 3G, loosing 3G, etc. I've submitted logcats but never heard back about it. The logs didn't really provide much detail. It appeared that suddenly the audio device errors.
Re:

Posted:
Mon Aug 15, 2011 6:26 pm
by alphawave7
bile wrote:It happens regularly for me. Always when loosing or picking up a signal. WiFi -> 3G, loosing 3G, etc. I've submitted logcats but never heard back about it. The logs didn't really provide much detail. It appeared that suddenly the audio device errors.
That would be more related to data pauses/drop-outs. What OP and I describe is a simple time-out with the app being killed off by the OS. Logs would not show much/any details when the OS 'cleans' by auto-kill.
Re: Android client exiting after ~45 minutes

Posted:
Mon Aug 15, 2011 6:37 pm
by bile
There is no reason that the subsonic service should exit or be killed. The app is playing music which is pinned. I walk from the subway, the phone starts to establish a connection and the music stops and the app exits.
Re: Android client exiting after ~45 minutes

Posted:
Mon Aug 15, 2011 6:51 pm
by alphawave7
bile wrote:There is no reason that the subsonic service should exit or be killed. The app is playing music which is pinned.
Precisely. Just sitting on my desk, the app will begin playing, screen goes to sleep, and 30 minutes later, POOF! (so long as other events haven't disrupted the auto-kill timer). I think this is what OP (and I) experience.
I walk from the subway, the phone starts to establish a connection and the music stops and the app exits.
That's the data interruption I mentioned above..unrelated to OS auto-kill.

Both issues need resolution, but I suspect by different means.
Re: Android client exiting after ~45 minutes

Posted:
Fri Aug 19, 2011 4:00 pm
by mbern1008
I think my issue may be more related to gingerbread and the way the new version of android handles background tasks. I used to be able to run subsonic in the background with no issue. Now if I run google maps and go to check mail or a text, Subsonic will stop in the background... So for multitasking it has been hurt. I have the original droid X.
Re:

Posted:
Fri Aug 19, 2011 6:29 pm
by sindre_mehus
id628 wrote:Can the author of the Android app confirm that Service.startForeground() is being called to inform the system that it would annoy the user if Android stopped this process?
No, I am not using Service.startForeground(), but I will definitely look into it. Thank you for bringing it to my attention!
Sindre
Re: Android client exiting after ~45 minutes

Posted:
Sun Aug 28, 2011 7:16 pm
by sindre_mehus
I'm gonna look into this tomorrow. Can you please confirm that the Subsonic app sometimes exits in the middle of a song? I don't wanna keep the service in the foreground more than necessary, and it seems logical to do it only when it's actually playing something.
Thanks in advance!
Sindre
Re: Android client exiting after ~45 minutes

Posted:
Sun Aug 28, 2011 7:23 pm
by bile
It absolutely does exit at any point. Anything that should never be interrupted should be a foreground service. Music, downloads, etc.
A fix will be greatly appreciated. It is very frustrating having your music stop apparently randomly and the app exit. The other thing that is frustrating is lack of integration with different button events. Should I enable music controls on the lock screen set a button to start playing music it will spawn the native music app rather than Subsonic. Also the controls on my Bluetooth speaker are useless due to the same responses.
Re: Android client exiting after ~45 minutes

Posted:
Mon Aug 29, 2011 4:06 pm
by id628
sindre_mehus wrote:I'm gonna look into this tomorrow. Can you please confirm that the Subsonic app sometimes exits in the middle of a song? I don't wanna keep the service in the foreground more than necessary, and it seems logical to do it only when it's actually playing something.
Thanks in advance!
Sindre
Yes, it stops mid-song. Suddenly, without notice or warning.
Re: Android client exiting after ~45 minutes

Posted:
Tue Aug 30, 2011 9:32 pm
by sindre_mehus
Ok, as suggested I've changed the app so that it brings the service into foreground while playing music.
Could you please install the attached APK and let me know if it works?
subsonic-release.apk
Thanks!
Sindre