BimmerGestalt / AAIdrive

Implementations of some Android Auto features as unofficial IDrive apps
MIT License
526 stars 89 forks source link

ID4 HUD Shows artist instead of track #728

Open dergizzle opened 11 months ago

dergizzle commented 11 months ago

First of all - thank you for this! After some fiddling and going through old phones I now got a setup that can play via USB and connects more often than not (using the Connected Classic as gateway app instead of Connected Drive 6.4 helped a lot).

Two issues I have noticed, one is already under discussion (Spotify Icon opening car info display).

My setup: 2014 ID4 5 series, Oneplus 2 with OxygenOS 3.6.1 (based on 6.0.1), latest Spotify, USB connection.

When playing music via Spotify the HUD shows the artist instead of the track. I have found no settings to adjust this. Is this intebtional or a bug, any chance to change it or get a way to change the behavior?

(Any way to integegrate a playlist into the HUD like its shown with the native Deezer Integration?)

Thanks!

hufman commented 11 months ago

Looking in the code, the app only sends the title to the Instrument Cluster. The MultimediaInfoEvent is used to set the ID4 sidebar's two lines of text, and as far as I know it doesn't affect the HUD. I don't have an ID4 car to test, so I'd need someone with an ID4 car to try changing the code and reproducing and fixing this bug.

dergizzle commented 11 months ago

Guess I'd have to try my luck setting up the dev environment, never did anything on Android though. Looking at the code and if that is the only place where that info is sent my best guess (without any Insight into any of it) would be that multimediaInfoEvent has them in the wrong order so I'd probably just switch what gets sent to the cluster and see what happens.

dergizzle commented 11 months ago

Looking in the code, the app only sends the title to the Instrument Cluster. The MultimediaInfoEvent is used to set the ID4 sidebar's two lines of text, and as far as I know it doesn't affect the HUD. I don't have an ID4 car to test, so I'd need someone with an ID4 car to try changing the code and reproducing and fixing this bug.

So I managed to get the Dev Environment working and as a first test compiled it with the output simply changed to:

instrumentCluster.getTextModel()?.asRaDataModel()?.value = UnicodeCleaner.clean(song.artist ?: "")

Same output, so they are not just reversed or something. Now, not being a dev, things get a little difficult for me, maybe you have some pointers for me what I could test. Since the song info comes from the controller object, so my next step would be to find out where that gets set up and go on from there... wich is ... where? :)

I wonder if this may be related to Spotify and it's API? Thinking about it I should try another music app and see how the output is looking there ...

hufman commented 11 months ago

I'm glad you figured out the dev environment, I tried to make the instructions clear :) That's interesting that changing the instrumentCluster to show the artist didn't update in the car. What happens when you swap the lines of the multimedia event? I had understood them to just be the order shown in the side bar. If it does matter, feel free to send a PR fixing it! The song data comes relatively directly from the music controller, and so the same song.title that shows up in the main view and the PhoneUI miniplayer will also be available as song.title in GlobalMetadata. You can use Android Studio's navigation-by-reference to help track how the data flows. Of course, the SpotifyAppController is separate from the GenericMusicController used by other music apps, so trying a different music app would be a useful test.