mt76 icon indicating copy to clipboard operation
mt76 copied to clipboard

mt76x2, mt76x3, mt7615: tx power with mt76 driver is lower than with mediatek driver

Open csharper2005 opened this issue 2 years ago • 13 comments

Hi everybody,

I have had many mt7621 router with different combinations of wireless chips:

  • mt7603 + mt7615n
  • mt7602 + mt7612
  • mt7603 + mt7612
  • mt7603 + mt7613
  • mt7615dn (dbdc)

Problem:

  • In all cases tx power with mt76 driver (OpenWrt) is 4-10 dBm lower than with mediatek driver (OEM firmwares, Padavan, AsusWrt). I roughly check that using WiFi Analyzer app on my phone

Example 2 routers mt7603 + mt7615. OpenWrt config - 20 dBm TX power Stock config - according to documentation router has 100 mWt tx power (also 20 dBm). Routers are in the same place. OpenWrt real TX power is lower: image

Possible root causes

  • TX power in mt76 is ok. The vendors (Xiaomi, Sercomm, Arcadyan etc) violates the maximum allowable power.
  • TX power with mt76 is not enough for different reasons (i.e. stock use file eeprom, not on Flash). We correctly use various hacks (changes country to Venezuela, change eeprom data, make own patches) to get the full power.

Do you have similar user experience? I found many similar tickets here and would like to take a closer look at this issue. Maybe someone has more accurate devices for estimating power than a phone.

@nbd168 maybe it's possible to define +delta dBm via dts or some configs? It would be safer than another hacks. @ptpt52 what do you think?

csharper2005 avatar Mar 27 '22 21:03 csharper2005

Judging from the image, safe to assume you're using a UNII-2 channel. UNII-2 is capped at 20dbi globally, but 23dbi in China and other eastern countries. Based on that, I'd say that it's the former case. You could test by setting the country in openwrt to China, setting the output power to 23 and recheck.

Or, use a unii-1 channel (like 44) on both routers, that way you can set the openwrt output to 23 legally. Unii-1 is 23dbi global and China.

I'd love to see a followup!

dekomote avatar Mar 29 '22 18:03 dekomote

I have the same experience with a MT7621 SoC with a 7612 + 7603e Wifi chips (ZBT WE3526).

OEM firmware (OpenWRT derived) with the MediaTek drivers is 4 to 10dB stronger.

I also note the OEM 7603 related code loads the 'eeprom' from a file, not the actual flash. So maybe an override is needed in DTS?

This issue is also related to what is discussed in https://github.com/openwrt/mt76/issues/633

JFtico avatar Apr 01 '22 17:04 JFtico

Or, use a unii-1 channel (like 44) on both routers, that way you can set the openwrt output to 23 legally. Unii-1 is 23dbi global and China.

Hmm... Channel 44 + driver default power in OpenWrt gives approximately the same EIRP as stock firmware.

csharper2005 avatar Apr 02 '22 08:04 csharper2005

Or, use a unii-1 channel (like 44) on both routers, that way you can set the openwrt output to 23 legally. Unii-1 is 23dbi global and China.

Hmm... Channel 44 + driver default power in OpenWrt gives approximately the same EIRP as stock firmware.

Just as I suspected. If you now set the country to China, set a Unii 2 channel and set the output to 26dbi, i think you'll see the same.

dekomote avatar Apr 02 '22 09:04 dekomote

Done some measurements.

Two Xiaomi AX3200 routers.

  1. OpenWrt SNAPSHOT r19309 with included mt76 driver.
  2. OpenWrt SNAPSHOT r19309 with MTK driver (https://forum.openwrt.org/t/adding-openwrt-support-for-xiaomi-redmi-router-ax6s-xiaomi-router-ax3200/111085/336).

MTK wifi settings are default (maximum power). mt76 power varys.

Signal measured through 3 brick walls. Channel width - 80 MHz. Scan interval - 5 seconds.

Channel 36, mt76 power 20 dBm
Channel 36, mt76 power 23 dBm
Channel 36, mt76 power 27 dBm
Channel 52, mt76 power 20 dBm
Channel 52, mt76 power 23 dBm
Channel 52, mt76 power 27 dBm
Channel 149, mt76 power 20 dBm
Channel 149, mt76 power 23 dBm
Channel 149, mt76 power 27 dBm

levshutov avatar Apr 03 '22 13:04 levshutov

I am also experiencing this problem in mt7915. so I am using a workaround by modifying wireless-regdb.

mog422 avatar Apr 12 '22 02:04 mog422

Can you specify your workaround?

tkso1997 avatar Apr 12 '22 08:04 tkso1997

Done some measurements.

Two Xiaomi AX3200 routers.

  1. OpenWrt SNAPSHOT r19309 with included mt76 driver.
  2. OpenWrt SNAPSHOT r19309 with MTK driver (https://forum.openwrt.org/t/adding-openwrt-support-for-xiaomi-redmi-router-ax6s-xiaomi-router-ax3200/111085/336).

MTK wifi settings are default (maximum power). mt76 power varys.

Signal measured through 3 brick walls. Channel width - 80 MHz. Scan interval - 5 seconds.

Channel 36, mt76 power 20 dBm Channel 36, mt76 power 23 dBm Channel 36, mt76 power 27 dBm Channel 52, mt76 power 20 dBm Channel 52, mt76 power 23 dBm Channel 52, mt76 power 27 dBm Channel 149, mt76 power 20 dBm Channel 149, mt76 power 23 dBm Channel 149, mt76 power 27 dBm

can you try to turn off sku like this and make another test?

https://github.com/MeIsReallyBa/mt76/commit/e73be47c93b800e1c0a24ce5a044526754d31a4c

MeIsReallyBa avatar Apr 15 '22 10:04 MeIsReallyBa

can you try to turn off sku like this and make another test?

MeIsReallyBa@e73be47

No difference compared with previous results

levshutov avatar Apr 15 '22 18:04 levshutov

Did you try PA as country? normally it should be possible to set 30dbi if hardware is able to, if yes you can patch a wireless-regdb

phil2sat avatar Apr 20 '22 14:04 phil2sat

Did you try PA as country? normally it should be possible to set 30dbi if hardware is able to, if yes you can patch a wireless-regdb

PA gives me 27dBm max. mt76 27dBm signal is lower than mtk default.

levshutov avatar Apr 20 '22 16:04 levshutov

So then youre not capped by the regdb, its either the chipset does max 27dbm or some antenna gain like 3dbi you could ty: "iw phy "$phy" set antenna_gain 0" to get to 30dbi or it could be that some calibration data or even coext settings are different for your device, im no dev but i dived a little bit trough the eeprom.c and what i saw was that the coext settings wasnt implemented fully (as far as my knowledge can say)

in this case there only the devs can help

phil2sat avatar Apr 21 '22 05:04 phil2sat

Done some measurements. Two Xiaomi AX3200 routers.

  1. OpenWrt SNAPSHOT r19309 with included mt76 driver.
  2. OpenWrt SNAPSHOT r19309 with MTK driver (https://forum.openwrt.org/t/adding-openwrt-support-for-xiaomi-redmi-router-ax6s-xiaomi-router-ax3200/111085/336).

MTK wifi settings are default (maximum power). mt76 power varys. Signal measured through 3 brick walls. Channel width - 80 MHz. Scan interval - 5 seconds. Channel 36, mt76 power 20 dBm Channel 36, mt76 power 23 dBm Channel 36, mt76 power 27 dBm Channel 52, mt76 power 20 dBm Channel 52, mt76 power 23 dBm Channel 52, mt76 power 27 dBm Channel 149, mt76 power 20 dBm Channel 149, mt76 power 23 dBm Channel 149, mt76 power 27 dBm

can you try to turn off sku like this and make another test?

MeIsReallyBa@e73be47

Interesting results, thanks for sharing.

One question: did you use 802.11ax or 802.11ac in your tests?

I'm asking this because I also have two AX6S and one AX3200 (same device), and while testing 802.11ax performance through a brick wall I've noticed that the 802.11ax performance is worse than 802.11ac (it happens with multiple ax devices, but with an iPhone 13 the problem is even worse). See more details of my test in the forum here.

My hypothesis is that mt76 drivers may not be enabling beamforming in 802.11ax that could explain the instability of the signal strength in your tests if you used 802.11ax. If so, you may want to repeat your tests with 802.11ac to compare the results.

dmsza avatar May 17 '22 15:05 dmsza

Looking at MediaTek's GPL code, the EEPROM size on the MT7663 is 1536 (0x600). I made the change in the MT76 driver and noticed an average 5dbm increase in signal strength.

My config:

config wifi-device 'radio1' option type 'mac80211' option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0' option channel '149' option band '5g' option htmode 'VHT80' option disabled '0' option country 'BR' option noscan '1' `

I've tested on my TP-Link Archer C6 v3. Not sure if work on other devices.

patch.txt

rodsmar avatar Nov 01 '22 17:11 rodsmar

My hypothesis is that mt76 drivers may not be enabling beamforming in 802.11ax that could explain the instability of the signal strength in your tests if you used 802.11ax. If so, you may want to repeat your tests with 802.11ac to compare the results.

I have a MT7621-equipped router (DIR-2640) that does not support 802.11ax. It does not appear beamforming is enabled:

# grep vht_capab /var/run/hostapd*.conf
/var/run/hostapd-phy1.conf:vht_capab=[RXLDPC][SHORT-GI-80][SHORT-GI-160][TX-STBC-2BY1][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN][RX-STBC-1][VHT160-80PLUS80][MAX-A-MPDU-LEN-EXP7]

Capturing beacon frames confirm it's not advertising support for beamforming.

jamesmcguirepro avatar Nov 06 '22 22:11 jamesmcguirepro

My hypothesis is that mt76 drivers may not be enabling beamforming in 802.11ax that could explain the instability of the signal strength in your tests if you used 802.11ax. If so, you may want to repeat your tests with 802.11ac to compare the results.

I have a MT7621-equipped router (DIR-2640) that does not support 802.11ax. It does not appear beamforming is enabled:


# grep vht_capab /var/run/hostapd*.conf

/var/run/hostapd-phy1.conf:vht_capab=[RXLDPC][SHORT-GI-80][SHORT-GI-160][TX-STBC-2BY1][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN][RX-STBC-1][VHT160-80PLUS80][MAX-A-MPDU-LEN-EXP7]

Capturing beacon frames confirm it's not advertising support for beamforming.

Seems to be enabled on MT7622, a RT3200

var/run/hostapd-wl1.conf:vht_capab=[RXLDPC][SHORT-GI-80][SHORT-GI-160][TX-STBC-2BY1][SU-BEAMFORMER][SU-BEAMFORMEE][MU-BEAMFORMER][MU-BEAMFORMEE][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN][RX-STBC-1][SOUNDING-DIMENSION-4][BF-ANTENNA-4][VHT160-80PLUS80][MAX-MPDU-7991][MAX-A-MPDU-LEN-EXP7]

Anteus avatar Nov 07 '22 07:11 Anteus

Looking at MediaTek's GPL code, the EEPROM size on the MT7663 is 1536 (0x600). I made the change in the MT76 driver and noticed an average 5dbm increase in signal strength.

My config:

config wifi-device 'radio1' option type 'mac80211' option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0' option channel '149' option band '5g' option htmode 'VHT80' option disabled '0' option country 'BR' option noscan '1' `

I've tested on my TP-Link Archer C6 v3. Not sure if work on other devices.

patch.txt

Sounds great, maybe you could create pull request with this diff?

EugeneKey avatar Nov 07 '22 21:11 EugeneKey

Looking at MediaTek's GPL code, the EEPROM size on the MT7663 is 1536 (0x600). I made the change in the MT76 driver and noticed an average 5dbm increase in signal strength.

My config:

config wifi-device 'radio1' option type 'mac80211' option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0' option channel '149' option band '5g' option htmode 'VHT80' option disabled '0' option country 'BR' option noscan '1' `

I've tested on my TP-Link Archer C6 v3. Not sure if work on other devices.

patch.txt

ping @nbd168 what do you think about this

ptpt52 avatar Nov 07 '22 21:11 ptpt52

Looking at MediaTek's GPL code, the EEPROM size on the MT7663 is 1536 (0x600). I made the change in the MT76 driver and noticed an average 5dbm increase in signal strength. My config: config wifi-device 'radio1' option type 'mac80211' option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0' option channel '149' option band '5g' option htmode 'VHT80' option disabled '0' option country 'BR' option noscan '1' ` I've tested on my TP-Link Archer C6 v3. Not sure if work on other devices. patch.txt

Sounds great, maybe you could create pull request with this diff?

Yes. But I need testers to see if there are improvements in all equipment that uses the MT7663/MT7613 chip.

rodsmar avatar Nov 07 '22 21:11 rodsmar

Yes. But I need testers to see if there are improvements in all equipment that uses the MT7663/MT7613 chip.

I use Xiaomi AX3200 (MT7622/MT7615) Could there be similar changes for this chip? How to find out the EEPROM size for MT7622?

EugeneKey avatar Nov 08 '22 08:11 EugeneKey

Is the EEPROM_SIZE for the mt7615 1024 or 1536 (same as mt7663)?

thelinuxdude avatar Nov 10 '22 04:11 thelinuxdude

If you have a MT7613/MT7663 based device, please test latest OpenWrt master. I've increased the EEPROM size without affecting MT7615

nbd168 avatar Nov 11 '22 19:11 nbd168

@nbd168 MT7615 eeprom can be even bigger (0x2600 bytes). This device. Upd. And this too.

csharper2005 avatar Nov 11 '22 20:11 csharper2005

@nbd168 MT7615 eeprom can be even bigger (0x2600 bytes). This device. Upd. And this too.

Hey, you may look at GPL code for your device. It's out of my knowledge, but MT7615 EEPROM has iPAiLNA, iPAeLNA, ePAiLNA and ePAeLNA.

Looking at mt7615d GPL code, the ePAiLNA, and ePAeLNA has three files with 1200 bytes each, and the other has three files with 1024 bytes each

Maybe the stock rom assembled all EEPROM binaries in a single file.

rodsmar avatar Nov 11 '22 21:11 rodsmar

If you have a MT7613/MT7663 based device, please test latest OpenWrt master. I've increased the EEPROM size without affecting MT7615

Apparently everything is fine!

rodsmar avatar Nov 15 '22 22:11 rodsmar

Can #575 be related to this?

sinancetinkaya avatar Nov 16 '22 11:11 sinancetinkaya

I noticed that mt7663 tx power is really good with the current SNAPSHOT. Very nice and very closer to stock. Thanks, @nbd168!

Also noticed that speed approximately the same with 40 and 80 MHz width. 40 MHz (obstacles and walls): image

80 Mhz (obstacles and walls): image

So 40 MHz might be even better. Can anyone else confirm this observations for 7612, 7615?

csharper2005 avatar Dec 18 '22 16:12 csharper2005

7603, 20 MHz, obstacles and walls: image

7603, 40 MHz, obstacles and walls: image

csharper2005 avatar Dec 18 '22 17:12 csharper2005

@csharper2005 Sorry, I accidentally removed my post. Is it the latest snapshot?

sinancetinkaya avatar Dec 18 '22 20:12 sinancetinkaya

@sinancetinkaya, I've made a table:

Model SNAPSHOT Driver (mt76) 7602 7603 7612 7613 7615 7615dbdc 2g, 20 MHz 2g, 40 MHz 5g, 40 MHz 5g, 80 MHz Test conditions
Beeline SmartBox GIGA r21523-4609228432 2022-12-09   x   x     88 / 53 60 / 87 144 / 140 110 / 168 Walls, Intel(R) Wireless-AC 9560
Etisalat S3 r21549-963c77158c 2022-12-09   x     x   63 / 7 49 / 8 182 / 228 303 / 326 Walls, Intel(R) Wireless-AC 9560

csharper2005 avatar Dec 19 '22 15:12 csharper2005