Ath9k wifi suddenly slows down

I have the following device in my computer:

  Device-2: Qualcomm Atheros AR93xx Wireless Network Adapter driver: ath9k 
  v: kernel port: d000 bus ID: 06:00.0 chip ID: 168c:0030 
  IF: wlp6s0 state: up mac: <filter> 

When I boot in, it works well and has reasonable speed. Here’s a typical output from iwconfig (I edited out some sensitive values):

wlp6s0    IEEE 802.11  ESSID:"<filter>"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: XX:XX:XX:XX:XX:XX   
          Bit Rate=130 Mb/s   Tx-Power=16 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=63/70  Signal level=-47 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:371   Missed beacon:0

However, after a while (a few minutes) something happens and the speed drops dramatically, the upload speed gets stuck around 0.2 MBps, and “Tx excessive retries” start to accumulate:

wlp6s0    IEEE 802.11  ESSID:"<filter>"  
          Mode:Managed  Frequency:5.2 GHz  Access Point: XX:XX:XX:XX:XX:XX   
          Bit Rate=108 Mb/s   Tx-Power=18 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=53/70  Signal level=-57 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:45909  Invalid misc:258   Missed beacon:0

I’m confused because the Tx-Power did not decrease, in fact it somehow increased, so I would have assumed that it should have become even more reliable. I played around with setting it manually, trying both sudo iw dev 'wlp6s0' set txpower fixed 2300 and sudo iwconfig wlp6s0 txpower 23 with various numbers, but they had little effect. The only thing that seems to work is bringing the interface down with sudo ifconfig wlp6s0 down, setting the power (not sure if this is actually necessary), and then bringing it up again. That fixes the issue for a while until it drops again.

I tired the nohwcrypt=1 option but it did not help, and neither did disabling tlp. Any ideas what to check next?

Welcome here, @alyssap :wave:

As starting point I would recommend you to study this Arch wiki article:
Network configuration/Wireless - ArchWiki

Here is a similar case described, maybe the solutions fits in your case as well:
Slow WiFi in Arch but Fast in Windows / Networking, Server, and Protection / Arch Linux Forums

Hi Wollie,

I came across both while trying to resolve the issue but they did not help. Here are my regulatory settings:

country HU: DFS-ETSI
	(2400 - 2483 @ 40), (N/A, 20), (N/A)
	(5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
	(5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
	(5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
	(5725 - 5875 @ 80), (N/A, 13), (N/A)
	(57000 - 66000 @ 2160), (N/A, 40), (N/A)

country BB: DFS-FCC
	(2402 - 2482 @ 40), (N/A, 20), (N/A)
	(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
	(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
	(5735 - 5835 @ 80), (N/A, 30), (N/A)

They agree in the range where I am connecting (channel 40). Unfortunately the country for phy#0 is baked into the EEPROM and I cannot change that. Moreover, they both allow 23 dBm while iwconfig reports 16 dBm in the working case and 18 dBm in the non-working. Do you think phy#0 having a wrong country code could be the source of the issue?

Oh, I just noticed that they are in different bands in the two states, how embarrassing. I pinned it to the working one (B/G 2.4 GHz) and will update tomorrow if that fixes the issue. No idea why it doesn’t like A (5 GHz) though.

Things seems to be stable now. The issue was that for some reason my ISP issued router broadcasts both in the 2.4GHz and 5GHz bands under the same name, and Network Manager would switch between the two freely. However, the 5GHz band does not seem to work well with my computer. To fix it I simply specified in Network Manager that the connection shall always be 2.4GHz.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.