goodev / a2dpvolume

Automatically exported from code.google.com/p/a2dpvolume
1 stars 0 forks source link

Auto-close Spotify app fails #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Device (phone) brand: HTC
Device (phone) model: Desire
Android OS version: 2.3.5
App version: 2.8.0 beta
What steps will reproduce the problem?
1. Connect to BT device --> OK
2. Auto startup Spotify app --> OK
3. Listen to music via Spotify --> OK
4. Disconnect from BT device --> OK
5. Auto close Spotify app --> NOK, Spotify remains open. Front window closes, 
but Spotify keeps running in the background and icon remains visible in the 
notification bar.

What is the expected output? What do you see instead?
Auto close Spotify app properly. 
Please provide any additional information below.

Original issue reported on code.google.com by maartenv...@gmail.com on 24 Apr 2012 at 6:51

GoogleCodeExporter commented 9 years ago
I have the same issue with Pandora.  Most other music players close OK.  I have 
tried many times in the past to fix it with no luck yet.  Once I get the next 
release out I will give it another look.  Today I try several methods to stop 
the apps.  First I send a media pause command which stops the music from 
playing and normally removes the notify icon from the status bar. Then I reload 
the home screen to make sure the app is not in the foreground. This makes the 
apps background so they can be stopped.  I do this on disconnect even if you 
don't have the "stop app on disconnect" checked.  Next I use the intent from 
when I launched the app to stop the app.  After that I cycle through every 
active PID (all running processes) and kill every process from the package the 
app came from.  I cycle through that 3 times, waiting a few seconds between 
attempts.  This should do it but for some apps like Pandora and now Spotify it 
does not.  I suspect they are just not responding to the pause command.  I 
tested with Pandora for quite a while and found it to be very random.  
Sometimes it would close it, other times not.  Many of these apps have active 
processes that interface to the web and this causes long delays.  I think it is 
a timing issue when these delays happen versus when I am trying to stop 
processes.  I have scoured the web for solutions and tried them all.  If anyone 
finds a solution let me know.  

Original comment by JimR...@gmail.com on 24 Apr 2012 at 11:10

GoogleCodeExporter commented 9 years ago
There is hope for Spotify.  They actually have a published API!  I wish Pandora 
would do this.
https://developer.spotify.com/technologies/libspotify/docs/11.1.60/index.html
I could probably add more Spotify integration such as play lists too.

Original comment by JimR...@gmail.com on 24 Apr 2012 at 11:12

GoogleCodeExporter commented 9 years ago
Try unckecking the "stop app on disconnect" and see what happens.  This should 
leave Spotify paused but it won't kill it.  At least it should stop playing 
though.  Let me know how that goes.

Original comment by JimR...@gmail.com on 24 Apr 2012 at 11:23

GoogleCodeExporter commented 9 years ago
I just posted 2.8.1 beta for testing.  I am hoping it fixes Spotify and 
Pandora.  i tested with Pandora (which had the same issue, see issue 105) and 
it now works on my Droid 3.

Original comment by JimR...@gmail.com on 25 Apr 2012 at 2:41

GoogleCodeExporter commented 9 years ago
First of all, thanks so much for your help!
Today I did some testing with the 2.8.1 beta version, here are my findings.

4 different situations while disconnecting BT connection:

A2DP (no app close) + Spotify (no song playing) --> OK

A2DP (no app close) + Spotify (song playing) --> NOK:
++ Spotify closed / to background (?)
++ No Spotify visible in task manager
++ Icon with Artist and Song title visible in notification bar

A2DP (app close) + Spotify (no song playing) --> OK! 

A2DP (app close) + Spotify (song playing) --> NOK:
++ Spotify closed / to background (?)
++ No Spotify visible in task manager
++ Icon with Artist and Song title visible in notification bar.

Original comment by maartenv...@gmail.com on 25 Apr 2012 at 7:50

GoogleCodeExporter commented 9 years ago
I finally broke down and installed Spotify so I could test it.  I tested on 
2.8.1.  Here is what I found using Droid 3.

Use A2DP Volume to launch Spotify.

A2DP (no app close), Spotify playing a song, device disconnects -> Spotify 
paused.  In fact it even acknowledged the pause with a pop-up.  No icon visible 
after pause.

A2DP (app close), Spotify playing a song, device disconnects -> Spotify paused. 
 In fact it even acknowledged the pause with a pop-up.  Then Spotify was 
closed.  No icon visible after pause.

This worked exactly as I would have expected.  Now I am wondering what is 
happening on your device. My Droid 3 has Android 2.3.4.  Are you using the 
notify icon?  It is possible that A2DP Volume is getting killed.  Please enable 
the notify in foreground feature and watch to make sure the A2DP Volume icon 
stays active.  That is very strange that your icon stays visible but Spotify is 
not visible in task manager.  

I suspect there is a problem on your specific device.  Often these strange 
issues can be resolved with a factory reset.  You can find that in the privacy 
settings.  If you used Google backup all your contacts, logins, apps 
(eventually, this can take some time), etc will be restored once you log back 
into your Google account.  You will still have to redo all your shortcuts, etc. 
 Not pleasant but not as bad as it may sound at first.  This will clear the 
cache and often makes the device much more responsive too.

Original comment by JimR...@gmail.com on 25 Apr 2012 at 10:04

GoogleCodeExporter commented 9 years ago
I just changed the trigger from BT connection to Power connection, because it's 
easier to test. It seems to work fine when Spotify is not playing music. 
Connect/disconnect --> Spotify opens/closes perfectly.

But when I start playing a song, Spotify won't close when power is 
disconnected. The music keeps playing (new info) and the task is still visible 
(!) in the task manager! (I don't understand, it seems to behave a little 
different now...)

I'm running Runnymede AIO 6.1.1 on a HTC Desire:
http://forum.xda-developers.com/showthread.php?t=1315961
--> Maybe this ROM is causing the issue? (App2SD issue?)

In a few hours, my Girlfriend will be home, so I can try A2DP Volume on her HTC 
Desire S with stock software. I will update my findings asap!
--> If it works fine on her device I'm going to change to another ROM.

Original comment by maartenv...@gmail.com on 25 Apr 2012 at 12:28

GoogleCodeExporter commented 9 years ago
I checked on my girlfriends phone, HTC desire S with android 2.3.5 stock 
software and I encountered exactly the same issue. Spotify won't close when 
playing music. When no music is started yet or music is pauzed, Spotify closes 
without any problem...

On my phone and on my girlfriends phone the A2DP Volume notify icon is enabled 
and is always visible. Also when Spotify close is unsuccesful, the A2DP Volume 
icon is still present. It's still running at that moment.

Could it be related to android 2.3.5? I hope not...

Original comment by maartenv...@gmail.com on 25 Apr 2012 at 7:59

GoogleCodeExporter commented 9 years ago

Original comment by JimR...@gmail.com on 26 Apr 2012 at 12:21