GrapheneOS / os-issue-tracker

Issue tracker for GrapheneOS Android Open Source Project hardening work. Standalone projects like Auditor, AttestationServer and hardened_malloc have their own dedicated trackers.
https://grapheneos.org/
364 stars 21 forks source link

Android Auto disconnecting and reconnecting #4224

Open jooray opened 1 month ago

jooray commented 1 month ago

After fixing https://github.com/GrapheneOS/os-issue-tracker/issues/4139 (thank you!), I have a new error and that is Android Auto constantly disconnecting and successfully reconnecting. I suspect that GrapheneOS does not like the quality of the connection (it shows in network settings as "Low Quality") and it wants to disconnect in order to use mobile data instead. When it disconnects, Android Auto finds the car again and connects back and this happens all the time, every minute or so.

I am not sure if this is the root cause, but the "Low Quality" is there all the time. I tried turning off Internet connectivity checks under Settings / Network & Internet, but it does not help (how does graphene determine that the wifi is "low quality").

Note that before fixing this bug, when I connected to the second network (not Android Auto, but the same hotspot), I could drive for hours without disconnecting. It would ocassionally happen, but not every minute or so like now.

I enabled additional wifi logging and will hopefully bring a more detailed log file.

jooray commented 3 weeks ago

I tried this:

1.) Turned on wifi-logging in networking options 2.) Turned off Mobile data always active in Developer options. 3.) Deleted all the cars in Android Auto and connected the car again from scratch.

Here is the logfile: anonymized_logfile.txt

It seems that the wifi is disconnecting for low quality and then reconnecting again, in a loop. Is there a way to turn this of for Android Auto connection (it is created by Android Auto, although I can connect to wifi directly by choosing it, it is a different connection, see https://github.com/GrapheneOS/os-issue-tracker/issues/4139 )

Any ideas?

de0u commented 3 weeks ago

Is it possible that what you are experiencing is https://github.com/GrapheneOS/os-issue-tracker/issues/3944?

jooray commented 3 weeks ago

I did not know about it. Yes, it's very possible.

jooray commented 3 weeks ago

Is the debug log helpful? Is there anything else I can collect to help debugging the issue?

It seems to me that the client considers the wifi low quality, maybe it's the quality measurement?

jooray commented 3 weeks ago

I tried to see if I can switch the car access point to 2.4GHz or change the channel, unfortunately I can't.

jooray commented 3 weeks ago

OK, found a functioning workaround. Before turning on the car, turn off Wifi on Android. Keep Bluetooth on, so music works. Keep data on, so navigation works.

Sometimes the wifi turns on by itself, so just turn it off again. And connect Pixel 9 Pro Fold to the car with USB cable.

Looking forward to a proper fix, but if you have this problem, this is a good workaround.

de0u commented 3 weeks ago

Thanks for the report. If you are on a Pixel 9 device, note that the 2024103100 release has a workaround for an upstream Wi-Fi bug. If that applies to your device and addresses your issue, a followup would be helpful.

jooray commented 3 weeks ago

Amazing, will do as soon as I get the update and sit in the car!

jooray commented 3 weeks ago

Unfortunately 2024103100 did not fix it. Behaves exactly the same.

jooray commented 2 weeks ago

With latest updates, something changed. Android Auto still disconnects, but far less often. Before it was about once a minute, now over 20 minute ride, I get one or two disconnections.

It's not perfect yet, but much better than before.

thestinger commented 2 weeks ago

The monthly November update may have included Wi-Fi fixes. It may not actually be better for you and might just be a fluke based on rebooting the device for the update though. We did also work around some upstream bugs recently too but we don't think that fully resolved it, only hotspot issues.