Track information via Bluetooth in Android client

Got an idea? Missing something? Post your feature request here.

Moderator: moderators

Track information via Bluetooth in Android client

Postby henkieheld » Tue Oct 04, 2011 9:45 am

Hi,

First of all. I LOVE SUBSONIC. Its great to listen to all my music in the car. But sometimes it would be nice to see wich song is playing. Is it possible to send track information via bluetooth. I am using your Android client.

Thanks (even if it is not possible),

Henk
henkieheld
 
Posts: 8
Joined: Tue Mar 01, 2011 3:35 pm

Re: Track information via Bluetooth in Android client

Postby mozster » Tue Oct 04, 2011 10:30 am

I've been trying this out lately... I have a Parrot MKi 9200 installed in my car that's recently got an update that supports AVRCP 1.3, my android phone (ZTE Blade) has recently got an update that supports AVRCP 1.3 too (CyanogenMod nightly 210)...

I can get metadata displayed on the car kit screen when using the Android native music app but Subsonic doesn't appear to be sending/updating this info... (The previously cached data from native player gets displayed)

I wonder if there's an API change that needs to be made in the Subsonic Android app?
mozster
 
Posts: 12
Joined: Wed Aug 31, 2011 11:41 pm

Re: Track information via Bluetooth in Android client

Postby mozster » Tue Oct 04, 2011 5:47 pm

I've had a bit of a dig around and it looks like this comment lists the changes made in the CyanogenMod source that enables the functionality...

http://code.google.com/p/android/issues ... =5450#c122

and the changes made to the stock music player are these?

http://review.cyanogenmod.com/#change,7006

I've got no experience developing for android, but maybe it wouldn't be too difficult to add these changes to the Android app? I might dip my toe and give it a try....
mozster
 
Posts: 12
Joined: Wed Aug 31, 2011 11:41 pm

Re: Track information via Bluetooth in Android client

Postby ace518 » Mon Oct 10, 2011 7:56 am

+1 to this request. That would be awesome.
ace518
 
Posts: 13
Joined: Mon Apr 04, 2011 3:32 pm

Re: Track information via Bluetooth in Android client

Postby Trupal00p » Sat Dec 10, 2011 7:16 pm

Hey people:

I have successfully implemented this feature for CM7 and submitted a patch for review as seen here: https://sourceforge.net/tracker/?func=d ... tid=705134

There is one little snafu if you are running CM7 however. The current stable version includes an error in its AVRCP 1.3 implementation. The error AND ITS FIX are described here: http://code.google.com/p/cyanogenmod/is ... il?id=4363

So basically, for you to get the meta data to display on your cars dash you will need to fix the implementation of AVRCP in CM7 by replacing the audio.so file as described in the thread above and use a version of subsonic that supplies the meta data to your car. I can upload an apk if anyone wants to test it out.

Dave
~ Dave
Trupal00p
 
Posts: 6
Joined: Tue Jul 05, 2011 2:34 pm

Re: Track information via Bluetooth in Android client

Postby henkieheld » Thu Dec 29, 2011 10:37 am

Hi sorry for the late reply. And kudos for implementing! And hopefully this is not a very dumb question, but what do you mean with CM7? And how do I start using this?
henkieheld
 
Posts: 8
Joined: Tue Mar 01, 2011 3:35 pm

Re: Track information via Bluetooth in Android client

Postby Trupal00p » Thu Dec 29, 2011 8:35 pm

CM7 is CyanogenMod 7. See here: http://www.cyanogenmod.com/

To use the patch I submitted you need to be running the most recent stable version of CyanogenMod (rooted phone required), with the fixed audio.so file as described in my post above. You will also need to wait for the patch to be included in a release of the subsonic android app ( or you can download the subsonic android apps source code, apply the patch and build the APK file yourself :D ).
~ Dave
Trupal00p
 
Posts: 6
Joined: Tue Jul 05, 2011 2:34 pm

Re: Track information via Bluetooth in Android client

Postby jebaker » Thu Dec 29, 2011 9:13 pm

Trupal00p wrote:CM7 is CyanogenMod 7. See here: http://www.cyanogenmod.com/

To use the patch I submitted you need to be running the most recent stable version of CyanogenMod (rooted phone required), with the fixed audio.so file as described in my post above. You will also need to wait for the patch to be included in a release of the subsonic android app ( or you can download the subsonic android apps source code, apply the patch and build the APK file yourself :D ).


Dave,
Thanks a lot for this patch. I am having a bit of trouble with it though. It seems to work ok for me when I am using my server, but if I select Offline as my server, subsonic crashes when I play something. It looks like the call to getDuration on a song is returning null. I've added a check for null around this in broadcastA2dpMetaDataChange, broadcastA2dpPlayStatusChange, and onReceive in A2dpIntentReceiver, and it is working for me. Any idea why this could be happening? I intend to look in to this more when I have a bit of time.

Jeff
jebaker
 
Posts: 1
Joined: Thu Dec 29, 2011 9:03 pm

Re: Track information via Bluetooth in Android client

Postby mozster » Tue Mar 06, 2012 10:55 pm

thanks Dave - the patch is brilliant! I had tried to implement it earlier but I couldn't get it working and never got around to finishing it...

The project code hasn't changed a massive amount since 10/12/11 but I've merged it with the latest changes in svn and thought I'd share - I've also used downloadService.getPlayerDuration() instead of song.getDuration() beacause it doesn't return null and gets around the crash when offline (I think).

Is this stuff very CyanogenMod specific? Is it a reasonable request for the changes to get passed on to Sindre and merged into the releases? It'd save having to merge it everytime there's a checkin.
mozster
 
Posts: 12
Joined: Wed Aug 31, 2011 11:41 pm

Re: Track information via Bluetooth in Android client

Postby Trupal00p » Tue Mar 06, 2012 11:43 pm

Hi mozster

Good call with downloadService.getPlayerDuration(). It makes way more sense to hit the downloadService than the song object to get this info. Missed that one :P

The intents broadcast by this patch are specific to CM and mods derived from it. Its pretty trivial to duplicate/modify the broadcast to be sent out to accommodate different mods/environments. The tricky part is figuring out what the intent strings are for each environment that this is intended to work in. Also, I'm not sure if ice cream sandwich will standardize these intents and break the functionality in the future. I'm waiting for a stable version of CM9 before I dive into that one :)

It would be awesome if Sindre merged this into the releases, it would save me a bunch of time merging the patches as well.

Thanks for the tweaks! I'll give your version a try.
~ Dave
Trupal00p
 
Posts: 6
Joined: Tue Jul 05, 2011 2:34 pm

Re: Track information via Bluetooth in Android client

Postby mozster » Wed Mar 07, 2012 8:12 pm

it looks like it's done a bit differently in ICS...

I came across this link:

http://developer.android.com/reference/ ... lient.html

While looking through the todo list here:

http://subsonic.svn.sourceforge.net/vie ... n/TODO.TXT
mozster
 
Posts: 12
Joined: Wed Aug 31, 2011 11:41 pm

Re: Track information via Bluetooth in Android client

Postby Trupal00p » Sun Oct 21, 2012 1:29 pm

For those of you still watching this thread here is an updated patch that does not require cyanogenmod. It does however require ICS or above.
~ Dave
Trupal00p
 
Posts: 6
Joined: Tue Jul 05, 2011 2:34 pm

Re: Track information via Bluetooth in Android client

Postby plastikman » Wed Oct 31, 2012 8:14 pm

Trupal00p wrote:For those of you still watching this thread here is an updated patch that does not require cyanogenmod. It does however require ICS or above.


I hope that this can get into mainline soon.
plastikman
 
Posts: 51
Joined: Wed Oct 05, 2011 6:03 pm

Re: Track information via Bluetooth in Android client

Postby mozster » Tue Nov 13, 2012 4:27 pm

Trupal00p wrote:For those of you still watching this thread here is an updated patch that does not require cyanogenmod. It does however require ICS or above.


Thanks for the patch Dave :D

I finally got around to making a build with it included last night and it doesn't appear to send the AVRCP data to my bluetooth car kit... Have you had much success with your hardware?

I've got a Galaxy Note running ICS connecting to a Parrot MKi9200 car kit...
mozster
 
Posts: 12
Joined: Wed Aug 31, 2011 11:41 pm

Re: Track information via Bluetooth in Android client

Postby mozster » Tue Nov 13, 2012 4:43 pm

mozster wrote:it looks like it's done a bit differently in ICS...
I came across this link:
http://developer.android.com/reference/ ... lient.html
While looking through the todo list here:
http://subsonic.svn.sourceforge.net/vie ... n/TODO.TXT


I think I might have been a bit wrong about them implementing AVRCP via the RemoteControlClient, you'd hope they'll plumb it all in that way eventually...
mozster
 
Posts: 12
Joined: Wed Aug 31, 2011 11:41 pm

Next

Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 9 guests