Skip to content

Commit f5c6e4b

Browse files
authored
refactor: single pkexec prompt, optional Bluetooth extra, richer status in mt7925-tune.py (#154)
Follow-up on the `mt7925-tune.sh` → `mt7925-tune.py` rewrite, addressing feedback from actually running it: too many polkit password prompts, Bluetooth being framed as a "fix" when it's really a trade-off, and `status` not showing enough about what hardware/driver/firmware is actually in play. ## Type of change - [x] `refactor`: restructuring without content changes - [ ] `feat`: new page or feature - [ ] `fix`: bug fix (broken link, incorrect command, layout issue) - [ ] `content`: update or improve existing content - [ ] `docs`: changes to CONTRIBUTING, README, or meta documentation - [ ] `chore`: maintenance (dependencies, config, CI/CD) - [ ] `style`: formatting, whitespace, typos - [ ] `revert`: reverting a previous commit ## Checklist - [x] PR title follows the commit convention - [x] Both EN and NL versions updated - [x] Media is in AVIF format (not PNG/JPG) — N/A, no media touched - [x] No broken image references — N/A, no media touched - [x] Tested locally: compiles
1 parent 1fd0a56 commit f5c6e4b

3 files changed

Lines changed: 254 additions & 105 deletions

File tree

src/content/docs/networking/mt7925-wifi-performance.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ next: docs/virtualization/vm-setup
77

88
The G16 GA605WV ships a MediaTek Wi-Fi 7 MT7925 card. Dropped connections, sluggish mesh roaming, or download speeds well below what the connection should give: this page covers all three.
99

10-
This is a script that applies four fixes at once (NetworkManager power saving, PCIe ASPM, Bluetooth, and a wireless-stack queue limit), each with a real effect measured on this hardware. It needs Python 3.14+ (standard library only) and `pkexec` for the privileged steps.
10+
This is a script that applies three fixes at once (NetworkManager power saving, PCIe ASPM, and a wireless-stack queue limit), each with a real effect measured on this hardware, plus an optional extra (Bluetooth off) you can opt into. It needs Python 3.14+ (standard library only) and `pkexec` for the privileged steps -- one password prompt per command, covering every privileged step in that command, not one prompt per step.
1111

1212
{{< callout type="info" >}}
1313
**Verified on this hardware.** Tested with `iperf3` against a local server on a 2.5GbE UniFi network. Stock: ~300 Mbit/s. Tuned: 500-608 Mbit/s, usually 560+. Your numbers will vary with AP, signal strength, and kernel version, but the fixes themselves are confirmed, not theoretical.
@@ -23,7 +23,7 @@ Test conditions, since they affect the numbers: a UniFi U7 Pro access point, in
2323

2424
```bash
2525
curl -LO https://zephyrus-linux.thectic.nl/scripts/mt7925-tune.py
26-
echo "c8887ca1d426df7ae55c94fd05ba9cc133566bed2feca434170f3817d6b5e69f mt7925-tune.py" | sha256sum -c
26+
echo "1da15474e447e1fe98872072768dd5f148c0a632ae39f78fc5b5b8ae3fa1e534 mt7925-tune.py" | sha256sum -c
2727
```
2828

2929
### Apply
@@ -32,20 +32,29 @@ echo "c8887ca1d426df7ae55c94fd05ba9cc133566bed2feca434170f3817d6b5e69f mt7925-t
3232
python3 mt7925-tune.py enable
3333
```
3434

35-
Reboot afterward. One of the four fixes (PCIe ASPM) is a kernel module parameter, only read at module load time.
35+
Reboot afterward. One of the three fixes (PCIe ASPM) is a kernel module parameter, only read at module load time.
36+
37+
Want the optional Bluetooth-off extra too (see the table below)?
38+
39+
```bash
40+
python3 mt7925-tune.py enable --bluetooth-off
41+
```
3642

3743
{{% /steps %}}
3844

39-
Source: [mt7925-tune.py](/scripts/mt7925-tune.py). SHA-256 `c8887ca1d426df7ae55c94fd05ba9cc133566bed2feca434170f3817d6b5e69f`.
45+
Source: [mt7925-tune.py](/scripts/mt7925-tune.py). SHA-256 `1da15474e447e1fe98872072768dd5f148c0a632ae39f78fc5b5b8ae3fa1e534`.
4046

41-
| Fix | What it does |
47+
| Fix (applied by `enable`) | What it does |
4248
|---|---|
4349
| Disable NetworkManager's Wi-Fi power saving | The most common cause of drops and slow mesh roaming |
4450
| Disable PCIe ASPM for the card | The PCIe link's own power state, not the radio. The main throughput fix |
45-
| Bluetooth off | The MT7925 is a combo Wi-Fi+Bluetooth chip sharing the same silicon and antenna paths. Removes a source of variance |
4651
| Raise the AQL Best Effort queue limit | `mac80211` caps how much data can be queued per traffic class to keep latency low under contention. The stock limit favors fairness over saturating a single stream. Trade-off: less headroom for latency-sensitive traffic (calls, gaming) sharing the radio under load |
4752

48-
`python3 mt7925-tune.py status` shows exactly what's active right now and what still needs a reboot. `python3 mt7925-tune.py disable` reverts everything.
53+
| Optional extra (`--bluetooth-off`, not applied by default) | What it does |
54+
|---|---|
55+
| Bluetooth off | The MT7925 is a combo Wi-Fi+Bluetooth chip sharing the same silicon and antenna paths. Removes a source of variance, at the cost of Bluetooth. Not one of the measured fixes above, so it's your call, not the script's |
56+
57+
`python3 mt7925-tune.py status` shows exactly what's active right now, what still needs a reboot, and the detected hardware and driver/firmware version. `python3 mt7925-tune.py disable` reverts everything, Bluetooth included.
4958

5059
{{< callout type="info" >}}
5160
**Left out on purpose:** `disable_eht=1` shows up in some third-party guides, but only exists in out-of-tree patch sets, not the mainline driver this G16 runs. CPU governor and power-profile changes also helped in testing, but that's a system-wide trade-off, not a Wi-Fi-specific one, so the script doesn't touch them. Older guides also mention pinning the driver's own `power_save` module parameter; on this G16's kernel (7.2.4) that parameter no longer exists (`dmesg` shows `mt7925e: unknown parameter 'power_save' ignored`), so the script skips it too.
@@ -57,7 +66,7 @@ Source: [mt7925-tune.py](/scripts/mt7925-tune.py). SHA-256 `c8887ca1d426df7ae55c
5766
|---|---|
5867
| Stock | ~300 Mbit/s |
5968
| ASPM disabled + NM powersave off only | 410-450 Mbit/s |
60-
| Everything (script `enable`) | 500-608 Mbit/s, usually 560+ |
69+
| Everything, including the optional Bluetooth-off extra (`enable --bluetooth-off`) | 500-608 Mbit/s, usually 560+ |
6170

6271
For reference, a phone (Samsung Galaxy S24 Ultra) on the same AP measured 439-811 Mbit/s across several runs, average around 545 Mbit/s, so the tuned G16 is now in the same range as a modern phone's Wi-Fi radio here. On a stronger/closer AP the same phone hit 1.24 Gbit/s, well above what the MT7925's 160MHz ceiling can ever reach regardless of signal quality (see [hardware ceiling](#the-hardware-ceiling) below).
6372

@@ -108,6 +117,8 @@ Qualcomm's current Wi-Fi 7 card (QCNCM865/FastConnect 7800) isn't better either:
108117

109118
{{% details title="Checking your driver and firmware version" closed="true" %}}
110119

120+
`python3 mt7925-tune.py status` shows all of this automatically (kernel/driver version, the firmware version and build time from `dmesg`, and the `linux-firmware-mediatek` package version on Arch-based distros). To check by hand instead:
121+
111122
```bash
112123
uname -r # kernel = driver version, ships in-tree
113124
sudo dmesg | grep -i "mt7925e.*Firmware\|mt7925e.*HW/SW" # firmware version
@@ -118,7 +129,7 @@ pacman -Qi linux-firmware-mediatek | grep Version # firmware pa
118129

119130
{{% details title="Where to follow active development" closed="true" %}}
120131

121-
The chip is still actively worked on; patches landed as recently as this week during testing for this page.
132+
The chip is still actively worked on; patches landed as recently as this week during testing for this page. `python3 mt7925-tune.py status` prints these same links, so you don't have to remember them.
122133

123134
- [lore.kernel.org/linux-wireless](https://lore.kernel.org/linux-wireless/): the official patch mailing list. Search "mt7925".
124135
- [ratatoskr.run](https://ratatoskr.run/): a more readable web archive of the same mailing lists.

src/content/docs/networking/mt7925-wifi-performance.nl.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ next: docs/virtualization/vm-setup
77

88
De G16 GA605WV heeft een MediaTek Wi-Fi 7 MT7925-kaart. Wegvallende verbindingen, traag roamen tussen mesh-nodes, of downloadsnelheden ruim onder wat de verbinding zou moeten geven: deze pagina behandelt alle drie.
99

10-
Dit is een script dat vier fixes tegelijk toepast (NetworkManager-powersave, PCIe ASPM, Bluetooth en een wireless-stack-queuelimiet), elk met een echt effect gemeten op deze hardware. Het heeft Python 3.14+ nodig (alleen standaardbibliotheek) en `pkexec` voor de bevoegde stappen.
10+
Dit is een script dat drie fixes tegelijk toepast (NetworkManager-powersave, PCIe ASPM en een wireless-stack-queuelimiet), elk met een echt effect gemeten op deze hardware, plus een optionele extra (Bluetooth uit) die je zelf kunt aanzetten. Het heeft Python 3.14+ nodig (alleen standaardbibliotheek) en `pkexec` voor de bevoegde stappen -- één wachtwoordprompt per commando, die alle bevoegde stappen in dat commando dekt, niet één prompt per stap.
1111

1212
{{< callout type="info" >}}
1313
**Geverifieerd op deze hardware.** Getest met `iperf3` tegen een lokale server op een 2,5GbE-netwerk met UniFi. Stock: ~300 Mbit/s. Getuned: 500-608 Mbit/s, meestal 560+. Jouw cijfers variëren met AP, signaalsterkte en kernelversie, maar de fixes zelf zijn bevestigd, niet theoretisch.
@@ -23,7 +23,7 @@ Testomstandigheden, want die beïnvloeden de cijfers: een UniFi U7 Pro access po
2323

2424
```bash
2525
curl -LO https://zephyrus-linux.thectic.nl/scripts/mt7925-tune.py
26-
echo "c8887ca1d426df7ae55c94fd05ba9cc133566bed2feca434170f3817d6b5e69f mt7925-tune.py" | sha256sum -c
26+
echo "1da15474e447e1fe98872072768dd5f148c0a632ae39f78fc5b5b8ae3fa1e534 mt7925-tune.py" | sha256sum -c
2727
```
2828

2929
### Toepassen
@@ -32,20 +32,29 @@ echo "c8887ca1d426df7ae55c94fd05ba9cc133566bed2feca434170f3817d6b5e69f mt7925-t
3232
python3 mt7925-tune.py enable
3333
```
3434

35-
Herstart daarna. Eén van de vier fixes (PCIe ASPM) is een kernel-moduleparameter, alleen gelezen bij het laden van de module.
35+
Herstart daarna. Eén van de drie fixes (PCIe ASPM) is een kernel-moduleparameter, alleen gelezen bij het laden van de module.
36+
37+
Wil je ook de optionele Bluetooth-uit-extra (zie tabel hieronder)?
38+
39+
```bash
40+
python3 mt7925-tune.py enable --bluetooth-off
41+
```
3642

3743
{{% /steps %}}
3844

39-
Bron: [mt7925-tune.py](/scripts/mt7925-tune.py). SHA-256 `c8887ca1d426df7ae55c94fd05ba9cc133566bed2feca434170f3817d6b5e69f`.
45+
Bron: [mt7925-tune.py](/scripts/mt7925-tune.py). SHA-256 `1da15474e447e1fe98872072768dd5f148c0a632ae39f78fc5b5b8ae3fa1e534`.
4046

41-
| Fix | Wat het doet |
47+
| Fix (toegepast door `enable`) | Wat het doet |
4248
|---|---|
4349
| NetworkManager's wifi-powersave uitzetten | De meest voorkomende oorzaak van drops en traag roamen op mesh-netwerken |
4450
| PCIe ASPM voor de kaart uitzetten | De energiestatus van de PCIe-link zelf, niet de radio. De belangrijkste doorvoerfix |
45-
| Bluetooth uit | De MT7925 is een combo Wi-Fi+Bluetooth-chip die dezelfde silicon en antennepaden deelt. Haalt een bron van variatie weg |
4651
| AQL Best Effort-limiet verhogen | `mac80211` begrenst hoeveel data per verkeersklasse in de wachtrij mag staan om latency laag te houden onder congestie. De standaardlimiet kiest voor eerlijkheid boven het verzadigen van één stream. Trade-off: minder marge voor latency-gevoelig verkeer (calls, gaming) dat de radio deelt onder belasting |
4752

48-
`python3 mt7925-tune.py status` laat precies zien wat nu actief is en wat nog een herstart nodig heeft. `python3 mt7925-tune.py disable` maakt alles ongedaan.
53+
| Optionele extra (`--bluetooth-off`, niet standaard toegepast) | Wat het doet |
54+
|---|---|
55+
| Bluetooth uit | De MT7925 is een combo Wi-Fi+Bluetooth-chip die dezelfde silicon en antennepaden deelt. Haalt een bron van variatie weg, ten koste van Bluetooth. Geen van de gemeten fixes hierboven, dus jouw keuze, niet die van het script |
56+
57+
`python3 mt7925-tune.py status` laat precies zien wat nu actief is, wat nog een herstart nodig heeft, en welke hardware en driver/firmwareversie gedetecteerd zijn. `python3 mt7925-tune.py disable` maakt alles ongedaan, Bluetooth inbegrepen.
4958

5059
{{< callout type="info" >}}
5160
**Bewust weggelaten:** `disable_eht=1` duikt op in sommige externe gidsen, maar bestaat alleen in out-of-tree patchsets, niet in de mainline-driver die deze G16 draait. CPU-governor- en power-profile-wijzigingen hielpen ook in tests, maar dat is een systeembrede afweging, geen wifi-specifieke, dus het script raakt ze niet aan. Oudere gidsen noemen ook het vastzetten van de `power_save`-moduleparameter van de driver zelf; op de kernel van deze G16 (7.2.4) bestaat die parameter niet meer (`dmesg` toont `mt7925e: unknown parameter 'power_save' ignored`), dus het script slaat die ook over.
@@ -57,7 +66,7 @@ Bron: [mt7925-tune.py](/scripts/mt7925-tune.py). SHA-256 `c8887ca1d426df7ae55c94
5766
|---|---|
5867
| Stock | ~300 Mbit/s |
5968
| Alleen ASPM uit + NM-powersave uit | 410-450 Mbit/s |
60-
| Alles (script `enable`) | 500-608 Mbit/s, meestal 560+ |
69+
| Alles, inclusief de optionele Bluetooth-uit-extra (`enable --bluetooth-off`) | 500-608 Mbit/s, meestal 560+ |
6170

6271
Ter referentie: een telefoon (Samsung Galaxy S24 Ultra) op dezelfde AP mat 439-811 Mbit/s over meerdere runs, gemiddeld rond de 545 Mbit/s, dus de getunede G16 zit nu in hetzelfde bereik als de wifi-radio van een moderne telefoon hier. Op een sterkere/dichterbije AP haalde diezelfde telefoon 1,24 Gbit/s, ruim boven wat het 160MHz-plafond van de MT7925 ooit kan bereiken, ongeacht signaalkwaliteit (zie [hardware-plafond](#het-hardware-plafond) hieronder).
6372

@@ -108,6 +117,8 @@ Qualcomm's huidige Wi-Fi 7-kaart (QCNCM865/FastConnect 7800) is ook niet beter:
108117

109118
{{% details title="Je driver- en firmwareversie checken" closed="true" %}}
110119

120+
`python3 mt7925-tune.py status` laat dit allemaal automatisch zien (kernel/driverversie, de firmwareversie en bouwdatum uit `dmesg`, en de `linux-firmware-mediatek`-packageversie op Arch-gebaseerde distro's). Handmatig checken kan ook:
121+
111122
```bash
112123
uname -r # kernel = driverversie, zit in-tree
113124
sudo dmesg | grep -i "mt7925e.*Firmware\|mt7925e.*HW/SW" # firmwareversie
@@ -118,7 +129,7 @@ pacman -Qi linux-firmware-mediatek | grep Version # firmware-pa
118129

119130
{{% details title="Waar je actieve ontwikkeling volgt" closed="true" %}}
120131

121-
Er wordt nog steeds actief aan deze chip gewerkt; er landden patches nog deze week tijdens het testen voor deze pagina.
132+
Er wordt nog steeds actief aan deze chip gewerkt; er landden patches nog deze week tijdens het testen voor deze pagina. `python3 mt7925-tune.py status` toont dezelfde links, zodat je ze niet hoeft te onthouden.
122133

123134
- [lore.kernel.org/linux-wireless](https://lore.kernel.org/linux-wireless/): de officiële patch-mailinglist. Zoek op "mt7925".
124135
- [ratatoskr.run](https://ratatoskr.run/): een beter leesbaar webarchief van dezelfde mailinglists.

0 commit comments

Comments
 (0)