FP6: Random Wifi driver crashes after FP6.QREL.15.148.0 software upgrade

Since I bought my Fairphone 6 it worked fine without any major issues. But after the first software upgrade (it was FP6.QREL.15.148.0) I started to experience Wifi driver crashes at random moments. Sometimes it looks like a sudden reboot of the phone, sometimes it freezes and reboots after that. But most of the time it just looses Wifi connection and stops seeing any networks. Turning wifi of and on does not help - it just stays off. It’s looks very similar to the issue reported here (and also in the comments here).

Using ADB, I found the following lines in the log

11-05 18:58:56.511 1447 1534 E android.hardware.wifi-service: Could not set interface MAC address for wlan0 (Invalid argument)
11-05 18:58:56.511 1447 1534 E android.hardware.wifi-service: Could not set interface flags for wlan0 (Invalid argument)
11-05 18:58:56.511 1447 1534 E android.hardware.wifi-service: SetUpState(true) failed. Wait for driver ready.

Turing airplane mode on and off gives the following lines:

------ airplane mode on —
11-05 19:17:10.554  1447  1534 I android.hardware.wifi-service: Adding interface handle for wifi-aware0
11-05 19:17:10.554  1447  1534 I android.hardware.wifi-service: Adding interface handle for wlan0
11-05 19:17:10.554  1447  1534 I android.hardware.wifi-service: Adding interface handle for p2p0
11-05 19:17:10.554  1447  1534 W android.hardware.wifi-service: No active wlan interfaces in use! Using default
11-05 19:17:10.609  1447  3368 I CLD80211: android.hardware.wifi-service: Sent msg on exit sock to unblock poll()
11-05 19:17:10.614  1447  3368 I android.hardware.wifi-service: Legacy HAL stop complete callback received
11-05 19:17:10.615  1447  1534 I android.hardware.wifi-service: Wifi HAL stopped

------ airplane mode off ------------
11-05 19:17:31.677  1447  1534 W android.hardware.wifi-service: AIBinder_linkToDeath is being called with a non-null cookie and no onUnlink callback set. This might not be intended. AIBinder_DeathRecipient_setOnUnlinked should be called first.

------ enter internet settings -----------
11-05 19:17:53.133  1447  1534 E android.hardware.wifi-service: Failed to write driver state control param: Invalid argument
11-05 19:17:53.133  1447  1534 E android.hardware.wifi-service: Failed to load WiFi driver
11-05 19:17:53.133  1447  1534 E android.hardware.wifi-service: Failed to initialize firmware mode controller
11-05 19:17:53.133  1447  1534 E android.hardware.wifi-service: Wifi HAL start failed
11-05 19:17:55.165  1447  1534 W android.hardware.wifi-service: AIBinder_linkToDeath is being called with a non-null cookie and no onUnlink callback set. This might not be intended. AIBinder_DeathRecipient_setOnUnlinked should be called first.

----- try to turn on Wifi in the internet settings --------------
11-05 19:18:15.665  1447  1534 E android.hardware.wifi-service: Failed to write driver state control param: Invalid argument
11-05 19:18:15.665  1447  1534 E android.hardware.wifi-service: Failed to load WiFi driver
11-05 19:18:15.665  1447  1534 E android.hardware.wifi-service: Failed to initialize firmware mode controller
11-05 19:18:15.666  1447  1534 E android.hardware.wifi-service: Wifi HAL start failed
11-05 19:18:15.684  1447  1534 W android.hardware.wifi-service: AIBinder_linkToDeath is being called with a non-null cookie and no onUnlink callback set. This might not be intended. AIBinder_DeathRecipient_setOnUnlinked should be called first.

I’ve contacted the official technical support, but without full factory reset they refuse to do anything with my report. Doing factory reset is very painful for me because some Android Apps do not support any forms of backup and you need to restore everything manually.

I’ve also tried the following steps which had no effect on my issue:

  • Reset Bluetooth & Wi-Fi (from System → Reset options)
  • Disable MAC randomization for my Wifi network (Privacy → Use device MAC)

Two firmware updates have been released since, but the issue remains (now in the FP6.QREL.15.162.0 version).

Maybe somebody experienced the same problem and know some workarounds?

1 Like

Found very similar issues:

Some comments suggest disabling Wi-Fi 6 (802.11ax) on the router. I’ll try this to see if it makes a difference.

Disabling Wi-Fi 6 (802.11ax) didn’t resolve the issue for me. Since I disabled 802.11ax on my router, the phone has spontaneously rebooted once and lost Wi-Fi twice. It might have become less frequent, but that could just be wishful thinking. I checked the logs via ADB, it is the same problem:

01-04 19:56:08.444  1453  1453 E android.hardware.wifi-service: Could not set interface MAC address for wlan0 (Invalid argument)
01-04 19:56:08.445  1453  1453 E android.hardware.wifi-service: Could not set interface flags for wlan0 (Invalid argument)
01-04 19:56:08.445  1453  1453 E android.hardware.wifi-service: SetUpState(true) failed. Wait for driver ready.

It seems I’ve found a workaround, at least for my home network. I’ve now been connected to Wi-Fi for 25 hours without any reboots! Previously, reboots happened many times a day.

In addition to disabling 802.11ax (Wi-Fi 6), I changed several router settings:

  • disabled Wi-Fi band steering
  • disabled automatic channel selection (set fixed channels for both 2.4 GHz and 5 GHz)
  • disabled automatic bandwidth selection (set 20 MHz for 2.4 GHz and 40 MHz for 5 GHz
  • disabled various features, which I assume are unrelated to the problem

Next, I plan to enable one feature at a time and see if any of them triggers the problem. Will start with Wi-Fi band steering, which I currently suspect most.

3 Likes

Cool. Someone actually has the same problem that I have. I asked Gemini advanced model to do a research on this issue and it is a known issue with Android 15. It mostly affects Pixels and Samsungs. The problem is that during Doze Mode (deep sleep) a DHCP lease renewal happens and the phone misses the handshake and awakes, then it enters an inconsistent state, which causes wifi driver to crash and it will not recover without a restart. At home I have assigned a static IP for my home network, which is handled like an “indefinite lease”, so the handshake will not happen during Doze Mode. It still crashes sometimes, but less often. My guess is that other manufacturers have fixed the bug, but as Fairphone is almost pure AOSP, then it’s not fixed and the bug is part of AOSP.

Now it’s already 30 hours after enabling Wi-Fi band steering and everything works just fine. So it seems that this is not the main cause of the problem.

experiencing the same problem here. Hope there will be a fix by FP in stead of having to tweak my WiFI access points settings.

I ran a series of experiments and identified a single router setting that triggers the problem. When the 5 GHz Wi-Fi bandwidth is set to “Auto” (which it was by default), the issue occurs several times within a 24-hour period. When I change only this setting to 80 MHz (with “Auto” extension channel), the problem completely vanishes, with zero issues observed over more than 30 hours.

1 Like

I also expected a fix from FP, but after several months of pain with multiple reboots per day, and a completely unhelpful conversation with FP support, I no longer believe they are working on this issue. A fix may eventually come from upstream driver developers, but that could take several more months, so the workaround using AP settings is a big deal for me.

2 Likes

Unfortunately, today - after more than 46 hours without issues - the problem occurred again:

01-17 09:53:38.390  1417  1471 E android.hardware.wifi-service: Could not set interface MAC address for wlan0 (Invalid argument)
01-17 09:53:38.390  1417  1471 E android.hardware.wifi-service: Could not set interface flags for wlan0 (Invalid argument)
01-17 09:53:38.390  1417  1471 E android.hardware.wifi-service: SetUpState(true) failed. Wait for driver ready.

Given that disabling automatic bandwidth selection on 5 GHz improved the situation, I have configured 2.4 GHz to a fixed 20 MHz bandwidth and will monitor the results.

Using 2.4 GHz would significantly reduce your data throughput. Your phone won’t attempt to use it unless you modify your router’s settings, for e.g. to give the frequency bands separate network “names”. I would not therefore expect your latest modification to change anything.

Given the very useful information you’ve already provided, I’m inclined to suspect a problem with certain routers, when they change the characteristics of the network. Hence, setting the 5 GHz bandwidth from Auto to 80 MHz removed one factor with positive results.

Your latest post shows that the same fundamental bug is still active, and in particular results in an error setting the interface MAC address. You might want to try using the device’s interface card’s factory MAC address instead of a randomized address (used by default to improve privacy). To use the static device address, go to
Settings > Network and Internet > Internet > Your_Network > details (cogged wheel).
Tap “Privacy” > Use device MAC

MAC addresses are usually randomized because a fixed address makes the device easy to track.

Disabling MAC randomization was the first thing I tried, before any tinkering with my router. Unfortunately, it didn’t make any difference. I suspect the message in the log is not related to the crash itself; it appears when Android tries to bring the wireless network interface back up after the crash.

Regarding 2.4 GHz, I have Wi-Fi band steering enabled, so the router can ask the phone to switch to 2.4 GHz or back. That’s why I’m hoping that setting a static bandwidth for 2.4 GHz could help.

1 Like

I have an almost guaranteed way to crash the WiFi and often the whole phone which will restart itself.

  1. Have a VPN on. (unsure if required)
  2. Get YouTube Premium.
  3. Set YouTube to keep offline videos on the SD (unsure if required, I’m using a good quality 512GB microSD).
  4. Download a playlist with >200 random videos at 720p or higher (YouTube will only download the first 200 videos if you get a playlist).
  5. Just wait till it downloads. I’ve never managed to download it in one go. Typically it will crash the WiFi 1 or 2 times (needing a restart to fix) and it will ALSO crash the phone 1 or 2 times, making it restart.

I need to try it with ADB turned on to maybe get the error on my computer. Will the kernel throw the panic error on the ADB though?

But which files were you looking at over ADB? I have no permissions to do dmesg. :-S

ADB is just a debugging tool, you can get a shell and execute some commands on the phone, but you can’t access dmesg without the root privileges. I decided that I don’t want to root my phone yet, so I used adb logcat to collect logs. You can get logs with adb logcat -b all and use grep to get what you want. For example:

adb logcat -b all | grep -i wifi | grep android.hardware.wifi-service

But there are no kernel logs here, only system and apps logs.

After several weeks of testing I found that even with the static bandwidth settings and disabled Wi-Fi band steering the problem still happens too often (sometimes after 12 hours since reboot).

I tinkered more settings without any visible effect and at last disabled the 802.11ax mode (both for 2.4 and 5.0 GHz) and set “Guard Interval” from “Auto” to “Long” in the Advanced Wifi Settings. Can’t say that this completely eliminate the problem, but now I have an uptime of 109 hours on my phone and Wifi still works.