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

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

Closed
csharper2005 opened this issue Mar 27, 2022 · 32 comments

Comments

@csharper2005
Copy link

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?

@dekomote
Copy link

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!

@JFtico
Copy link

JFtico commented Apr 1, 2022

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 #633

@csharper2005
Copy link
Author

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.

@dekomote
Copy link

dekomote commented Apr 2, 2022

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.

@levshutov
Copy link

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

@mog422
Copy link

mog422 commented Apr 12, 2022

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

@tkso1997
Copy link

Can you specify your workaround?

@MeIsReallyBa
Copy link

MeIsReallyBa commented Apr 15, 2022

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

@levshutov
Copy link

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

MeIsReallyBa@e73be47

No difference compared with previous results

@phil2sat
Copy link

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

@levshutov
Copy link

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.

@phil2sat
Copy link

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

@dmsza
Copy link

dmsza commented May 17, 2022

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.

@rodsmar
Copy link

rodsmar commented Nov 1, 2022

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

@jamesmcguirepro
Copy link

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.

@Anteus
Copy link

Anteus commented Nov 7, 2022

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]

@EugeneKey
Copy link

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?

@ptpt52
Copy link

ptpt52 commented Nov 7, 2022

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

@rodsmar
Copy link

rodsmar commented Nov 7, 2022

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.

@EugeneKey
Copy link

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?

@thelinuxdude
Copy link

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

@nbd168
Copy link
Member

nbd168 commented Nov 11, 2022

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

@csharper2005
Copy link
Author

csharper2005 commented Nov 11, 2022

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

@rodsmar
Copy link

rodsmar commented Nov 11, 2022

@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
Copy link

rodsmar commented Nov 15, 2022

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!

@sinancetinkaya
Copy link

Can #575 be related to this?

@csharper2005
Copy link
Author

csharper2005 commented Dec 18, 2022

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
Copy link
Author

csharper2005 commented Dec 18, 2022

7603, 20 MHz, obstacles and walls:
image

7603, 40 MHz, obstacles and walls:
image

@sinancetinkaya
Copy link

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

@csharper2005
Copy link
Author

@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

@sinancetinkaya
Copy link

sinancetinkaya commented Dec 19, 2022

I have UniElec u7621-06 16M with mini-PCIe cards: MT7602E, MT7612E 10 dbi antennas attached
These cards suppose to have excellent signal strength but my old cheap ISP provided modem's internal wifi has better signal/performance

@csharper2005
Copy link
Author

Guys, I tested 7602, 7603, 7612, 7615 myself and didn't find any problems with TX power with current SNAPSHOT. So I decided to close to issue.

The finding with strange speed on 7613 and 40MHz / 80 MHz channel width should be investigated separately.

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