linux-surface / surface-pro-x

Tracking and meta repository for Surface Pro X support.
76 stars 6 forks source link

Wi-Fi Speed is severely limited (~31 Mbps) #45

Open denysvitali opened 10 months ago

denysvitali commented 10 months ago

It seems like, no matter what I try, the Wi-Fi speed of my 5GHz + 2.4 GHz networks is limited to ~ 31 Mbps (as reported by fast.com). For comparison, my Google Pixel 7 reaches ~860Mbps at the same location and connected to the same network.

NetworkManager reports the link to be equal to 6 Mb/s: image

[  606.541461] ath10k_snoc 18800000.wifi: chan info: invalid frequency 0 (idx 41 out of bounds)
[  607.433258] ath10k_snoc 18800000.wifi: chan info: invalid frequency 0 (idx 41 out of bounds)
[  607.588867] ath10k_snoc 18800000.wifi: chan info: invalid frequency 0 (idx 41 out of bounds)
[  607.770395] ath10k_snoc 18800000.wifi: chan info: invalid frequency 0 (idx 41 out of bounds)
[  608.210963] ath10k_snoc 18800000.wifi: chan info: invalid frequency 0 (idx 41 out of bounds)
[  608.366546] ath10k_snoc 18800000.wifi: chan info: invalid frequency 0 (idx 41 out of bounds)
[  610.374137] ath10k_snoc 18800000.wifi: chan info: invalid frequency 0 (idx 41 out of bounds)
[  614.203116] ath10k_snoc 18800000.wifi: chan info: invalid frequency 0 (idx 41 out of bounds)
[  626.211827] ath10k_snoc 18800000.wifi: chan info: invalid frequency 0 (idx 41 out of bounds)

My regulatory domain seems to be OK (switching between DE and CH depending on which router I'm connecting to):

[  146.589350] wlan0: authenticate with c0:00:00:00:00:00
[  146.589378] wlan0: 80 MHz not supported, disabling VHT
[  287.324318] wlan0: capabilities/regulatory prevented using AP HT/VHT configuration, downgraded
// ...
[  591.084938] remoteproc remoteproc0: powering up 4080000.remoteproc
[  591.121721] remoteproc remoteproc0: Booting fw image qcom/msft/surface/pro-x-sq2/qcmpss8180.mbn, size 75470832
[  591.564064] remoteproc remoteproc0: remote processor 4080000.remoteproc is now up
[  605.898774] ath10k_snoc 18800000.wifi: wcn3990 hw1.0 target 0x00000008 chip_id 0x00000000 sub 0000:0000
[  605.898783] ath10k_snoc 18800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 0 testmode 0
[  605.898785] ath10k_snoc 18800000.wifi: firmware ver  api 5 features wowlan,mgmt-tx-by-reference,non-bmi crc32 b3d4b790
[  605.923623] ath10k_snoc 18800000.wifi: htt-ver 3.96 wmi-op 4 htt-op 3 cal file max-sta 32 raw 0 hwcrypto 1
[  606.213945] ath10k_snoc 18800000.wifi: invalid MAC address; choosing random
[  606.213956] ath: EEPROM regdomain: 0x406c
[  606.213957] ath: EEPROM indicates we should expect a direct regpair map
[  606.213960] ath: Country alpha2 being used: 00
[  606.213961] ath: Regpair used: 0x6c
[  606.214117] ath: EEPROM regdomain: 0x8114
[  606.214118] ath: EEPROM indicates we should expect a country code
[  606.214119] ath: doing EEPROM country->regdmn map search
[  606.214120] ath: country maps to regdmn code: 0x37
[  606.214121] ath: Country alpha2 being used: DE
[  606.214122] ath: Regpair used: 0x37
[  606.214122] ath: regdomain 0x8114 dynamically updated by country element

My /var/lib/rmtfs looks like following:

$ sha256sum modem_fs*
bdce9d9d4a5a808368eda0a1ad2f3bf4da9c04663442fcc721a8e6b5bdaa2b98  modem_fs1
afb42b49efcb52092c7dc031189ba74f13d92922fd10fad3c64df77e793d08c5  modem_fs2
5647f05ec18958947d32874eeb788fa396a05d0bab7c1b71f112ceb7e9b31eee  modem_fsc
5647f05ec18958947d32874eeb788fa396a05d0bab7c1b71f112ceb7e9b31eee  modem_fsg

but the same behaviour happens w/ modem_fs1 and modem_fs2 zeroed.

Does anyone have any clue on what's happening here?

denysvitali commented 4 months ago

I still think there is something wrong with the EEPROM / firmware. I noticed that the MAC Address is always random - and this is because the mac_addr field is zeroed. My assumption here is that the firmware can't read the EEPROM (why?) and thus both things fail.

@qzed have you had time to look into this?

denysvitali commented 4 months ago

Following a similar approach to https://github.com/twisteroidambassador/arch-linux-ath-user-regd/issues/1 (especially @PaulGrandperrin 's / OpenWRT patch), I was able to get ~100Mbps over Wi-Fi.

Unfortunately this is nowhere close to the 700+ Mbps I can reach with other devices.

My patch changed the regdomain from being the most restrictive (since the EEPROM tells the driver to use that) to a regdomain that also allows 5GHz.

Despite all of this, the driver says that it doesn't have the capabilities to use the 160 MHz band (Wi-Fi 6) and thus I'm stuck at ~100Mbps.

Something is still strange though: that 100 Mbps is the peak that I've been able to reach after many tests and reboots - it looks like there might be something else going on that might limit the Wi-Fi speed as the average is usually 50 Mbps.

qzed commented 4 months ago

Sorry, haven't had any time to look into this. But your observations regarding the regdomain match my experience with it refusing to connect to certain bands that aren't available in all regions.