Skip to content
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

App no longer connceting to car #197

Closed
ronniebadmf opened this issue Jan 31, 2021 · 40 comments
Closed

App no longer connceting to car #197

ronniebadmf opened this issue Jan 31, 2021 · 40 comments

Comments

@ronniebadmf
Copy link

Screenshot_20210131-200232

App stopped connecting to BMW idrive 6. Several restarts and reconnections did not solve the problem. Under car phone settings the app selection switches on and off regularly, which shows that it is trying to connect and for whatever reason it fails.

@hufman
Copy link
Collaborator

hufman commented Feb 1, 2021

Good evening, and thanks for the question!

The Apps checkmark in your car is a direct representation of the status of the Apps connection from the car. When BMW Connected establishes the tunnel to the car (even before running any apps over it) this checkmark lights up. Similarly, if this tunnel is shut down for some reason, this checkmark will uncheck.

As such, it is directly controlled by the BMW Connected app. It runs a watchdog process that pings the car every few seconds or so, and will close the connection if this watchdog thinks the connection is stuck. So, we have to figure out why the BMW Connected app is closing the connection in your case.

In your connection debugging, have you tried force-killing the BMW Connected app entirely, not just restarting the connection? I've also experienced a few false starts like you describe when my phone hasn't restarted in a few weeks, I suspect memory pressure causing troubles.
I also removed the other brand from my phone, because I've seen occasional evidence of both BMW and Mini Connected trying to run the tunnel and conflicting, but your screenshot shows that you already don't have Mini Connected installed.

I hope this helps! Since you haven't changed app versions, and BMW Connected hasn't upgraded much recently, it should be a temporary issue that can be figured out.

@Sven31415
Copy link

Hello!
I've actually got the same issue. Also iDrive 6. When the check box is turning on and of over and over again I can fix it by opening the AndroidAuto IDrive App. After that the connection is stable and everything runs fine. So I think the problem is that the AndroidAuto IDrive App has some issues with running in background?
In December I had the same issue, that connection didn't seem to work at all, so I updated to a newer version, but a describe I've still got a similar issue

@donsaimon
Copy link

Same problem here. Connection is very unstable in the last month...

@Sven31415
Copy link

Yes but it must have to do something with background processes, because when I open the App everything works fine immediately

@donsaimon
Copy link

You mean that if you open tha app AndroidAutoIdrive everything is OK?
If yes, I will do a routine to open AndroidAutoIdrive automatically as soon as my phone connects to the car

@Sven31415
Copy link

Exactly!
I think this "bug" could also be fixed internally, but until it is I consider this as a great workaround.

@donsaimon
Copy link

Ok I will try. I have not used AndroidAutoIdrive since December as it connected only once every 4 or 5 times... If this workaround will work, I can use this fantastic app again!

@hufman
Copy link
Collaborator

hufman commented Feb 6, 2021

I sincerely apologize for any instability! I really try to keep the latest build stable during development, but some things might slip through. I know I fixed some bugs on Jan 14th regarding initial module startup (which might have been causing random problems for a few months) and on Jan 23rd about continuing to start up after discovering the car's language (which definitely did break automatic connections until opening the phone app).

I do see that a new BMW Connected 6.4.1 came out in November in the USA, and a new 6.5.0 version came out in January for Europe, I hope that's just coincidental! If you are able to peek in adb logcat to find any suspicious messages from the BMW Connected or AndroidAutoIdrive apps, those would be useful clues! I think the behavior of the Apps checkmark appearing and disappearing indicates a problem with the BMW Connected tunnel, so it might be a valuable test to downgrade the Connected app version and see if it helps (I'm running a modified version of Mini Connected 6.3.0 with extra debug logging).

The initial screenshot shows the old Phone UI, please try upgrading to the latest build to see if it helps. The new UI, merged Dec 27, brings the connection details forward to the main screen, including any hints needed to unblock the next stage of the connection.

@Sven31415
Copy link

No need to apologize at all, you're doing such a good job!
I'm always using the latest version (max 1 week delay) and it got better again, but not as it was once. Maybe every 10th connection has those difficulties.

@donsaimon
Copy link

Thanks a lot for your job hufman! How can I upgrade to last version your app? I am currently using 1.2.2 that I thought was the last one...

@hufman
Copy link
Collaborator

hufman commented Feb 6, 2021

Indeed, 1.2.2 is the most recent release. Additionally, every successful build is also posted soon after the code is pushed, with links to the sentry and nonalytics builds hidden in the main Readme page.

@hufman
Copy link
Collaborator

hufman commented May 19, 2021

Good afternoon! I pushed up a few fixes for connection instability over the last few months, and I'm checking to see if you are still experiencing this problem in the most recent versions of the app?

@donsaimon
Copy link

donsaimon commented May 19, 2021 via email

hufman added a commit that referenced this issue May 28, 2021
This broadcast Intent is used by the Connected app
to progress through the state machine towards starting
the apps protocol. By calling fetchUuidsWithSdp,
Android will send out another BLUETOOTH_UUID broadcast
and so let's keep doing that until the apps are connected

Hopefully should fix connection randomness, such as #244 and #197
@hufman
Copy link
Collaborator

hufman commented May 29, 2021

I pushed up a new build that tries triggering Connected to continue connecting, maybe it'll help? It's hard to tell whether it helped in my tests or if I was just in a lucky period and it would've worked anyways! I think this change should help connect in the scenario when the Car Is Connected popup is showing but the Apps connection doesn't start.

@donsaimon This Spotify icon is the new interface that allows for global coverart, the Audioplayer is built only for ID4 and didn't provide the new coverart feature or the more native interface.

@donsaimon
Copy link

donsaimon commented May 29, 2021 via email

@hufman
Copy link
Collaborator

hufman commented May 30, 2021

The app will run as Audioplayer by default. The most recent release only supports Audioplayer mode. After upgrading to a recent build, it will automatically run in Spotify mode if a new enough Spotify is detected.
That Force Spotify Mode checkbox allows it to run as Spotify even without new Spotify installed. If you have old Spotify installed, then both the official Spotify app and this app's Spotify icon will show up. If you don't have any Spotify installed, then the car will still have a Spotify icon installed from this app. So, to reduce confusion, it will only run as Spotify in the right condition by default.

@donsaimon
Copy link

donsaimon commented May 30, 2021 via email

@hufman
Copy link
Collaborator

hufman commented May 30, 2021

Indeed, that is the confusing icon situation that I hope to avoid. If you want it to run as Audioplayer mode now, you'd also need to uncheck that checkbox.
May I ask why you want it to run as Audioplayer? I think Spotify mode includes better functionality.

@donsaimon
Copy link

donsaimon commented May 30, 2021 via email

@hufman
Copy link
Collaborator

hufman commented May 30, 2021

Alright, to run as Audioplayer mode, just keep the old Spotify installed (or uninstall entirely) and then uncheck the advanced option.

Please check out the discussion in #251, where I'm planning to add an option to run as Spotify mode, to retain the global coverart functionality, but use the old Audioplayer main screen for the compact layout.

@donsaimon
Copy link

donsaimon commented May 30, 2021 via email

@donsaimon
Copy link

donsaimon commented Jun 2, 2021 via email

@hufman
Copy link
Collaborator

hufman commented Jun 2, 2021

Please look in discussion #255 for links to download the latest version of Spotify with official IDrive support. With this version is installed, AAI will run by default as Audioplayer. It sounds like you installed this version already, and just need to uncheck the Appear As Spotify button in AAI.

If there is an error connecting to Spotify to browse, there should be an error message there with more details. You may be experiencing #254 (problems browsing Spotify on a second connection attempt), try force closing Spotify and connecting again. If you are in this state, Spotify doesn't respond properly to the connection attempt, and will time out after some 30 seconds or so, and the error field in the Music tab will stay blank until this time out happens.

@donsaimon
Copy link

donsaimon commented Jun 2, 2021 via email

@hufman
Copy link
Collaborator

hufman commented Jun 2, 2021

I only experience the issue occasionally, maybe once a month or so. It only impacts Spotify, not any of the other music apps I use.
I definitely intend to try to resolve it before the next release. Please watch that #254 issue for updates.

@donsaimon
Copy link

donsaimon commented Jun 2, 2021 via email

@donsaimon
Copy link

donsaimon commented Jun 4, 2021 via email

@hufman
Copy link
Collaborator

hufman commented Jun 4, 2021

If the Browse functionality is working, then the car app is successfully connected to the music app, and the music app itself isn't behaving nicely. I experience this with the RMC Radio Monte Carlo app, and there isn't much the car app can do. Even when trying to control RMC with Android Auto, it jumps right to the Browse functionality and doesn't offer an option for resuming playback.
Install the Android Auto app on your phone and try using Energy Radio in it and see what it does. The best thing to do would be to write to Energy Radio and suggest they support resuming playback when Android Auto connects: It's inconvenient (and relatively unsafe) to fiddle with the Android Auto interface just to get music playing again, so resuming the previous playback would make sense.

@donsaimon
Copy link

donsaimon commented Jun 4, 2021 via email

@berseker
Copy link

berseker commented Jun 5, 2021

I noticed you are talking about "energy radio" app, below a screenshot showing some strange behaviour of this app (I do not know if the cause it's the app itself, or AAI not tracking properly the tags given by this app)

image

@hufman
Copy link
Collaborator

hufman commented Jun 5, 2021

AAI logs the tags that it receives from the app, look in your adb logcat for the keyword MediaMetadata. The PhoneUI player uses the same code, so you can leave it connected to your computer to watch the logs while trying different songs or apps.

@berseker
Copy link

berseker commented Jun 5, 2021

https://pastebin.com/8iCrDi8G here is the log of the minutes I was testing the app

@hufman
Copy link
Collaborator

hufman commented Jun 5, 2021

The log didn't catch anything, because it only logs if the MediaMetadata's MEDIA_ID has changed. This app doesn't provide very much metadata at all:
Parsing MediaMetadata Bundle{ android.media.metadata.DISPLAY_SUBTITLE -> Tout l'univers - Gjon's Tears, android.media.metadata.COMPILATION -> Energy Basel, android.media.metadata.ALBUM_ART_URI -> https://cdn.energy.ch/energych-broadcast/covers/songs/500x500-c-q40/32719_1621237106.jpg, android.media.metadata.DISPLAY_TITLE -> Energy Basel, android.media.metadata.ALBUM -> Tout l'univers }
For this song, for example, Tout l'univers is the song's title (and I suppose the name of the Single album) and Gjon's Tears is the artist. There isn't a good generic way to extract the artist from this (I definitely don't want to start special-casing parsing logic for each app), but the full DISPLAY_SUBTITLE might be able to be displayed.
I'll try to come up with a generic way to improve this, but the Energy app really should be emitting proper data.

hufman added a commit that referenced this issue Jun 5, 2021
Energy Radio doesn't send an artist or title
SomaFM has a strange mixture
Should help the weird information fields in #197
@berseker
Copy link

berseker commented Jun 5, 2021

I would leave a comment on the app page on Google Play if I would be able to express properly which is the problem of their app :D

@berseker
Copy link

berseker commented Jun 6, 2021

@hufman Much Better :)
IMG_20210606_113408

@donsaimon
Copy link

How may I have this layout???

@hufman
Copy link
Collaborator

hufman commented Jun 6, 2021

Which layout do you refer to? The screenshots show the NRJ Energy Radio app, the AAI Spotify mode playback screen, and the ID6L home screen music tile.

@donsaimon
Copy link

donsaimon commented Jun 6, 2021 via email

@hufman
Copy link
Collaborator

hufman commented Jun 24, 2021

This particular type of instability seems resolved, so I'll close it out.

@hufman hufman closed this as completed Jun 24, 2021
@donsaimon
Copy link

donsaimon commented Sep 27, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants