DEV Community

Cover image for Linux on the Dell XPS: Fixing AX201 Wi-Fi performance
Jonathan Bowman
Jonathan Bowman

Posted on • Updated on • Originally published at bowmanjd.com

Linux on the Dell XPS: Fixing AX201 Wi-Fi performance

I am very happy with Linux on my Dell XPS 13 9310. I use the latest version of Fedora (35 at the time of this writing, soon to be upgraded to 36).

However, the Wi-Fi connection gave me great difficulty for months before I learned that performance is much better with the power saving functionality turned off. With power saving on, I would often lose packets right and left. This was a typical ping session:

[bowmanjd@lappy386 ~]$ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=223 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=1.15 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=15.3 ms
64 bytes from 192.168.0.1: icmp_seq=6 ttl=64 time=1.56 ms
^C
--- 192.168.0.1 ping statistics ---
6 packets transmitted, 4 received, 33.3333% packet loss, time 5075ms
rtt min/avg/max/mdev = 1.147/60.182/222.714/94.010 ms
Enter fullscreen mode Exit fullscreen mode

Note the first two dropped packets. Sometimes more, sometimes less. At first, I blamed our wireless access point, yet no other client device had this problem. Finally, I booted into Windows on the XPS and noticed much better wireless performance. Clearly, this is a driver issue of some sort.

There may be a variety of solutions for this, and I suspect this will one day be fixed in the kernel, but here is how I solved it for now.

The NetworkManager solution

For Linux distros using NetworkManager, add a new configuration file to the /etc/NetworkManager/conf.d/ directory. Name it something like disable_power_save.conf with the contents:

[connection]
wifi.powersave = 2
Enter fullscreen mode Exit fullscreen mode

Elevate to root first using sudo or similar.

One command can do it all:

printf "[connection]\nwifi.powersave = 2\n" | sudo tee /etc/NetworkManager/conf.d/disable_power_save.conf
Enter fullscreen mode Exit fullscreen mode

Then restart NetworkManager with:

sudo systemctl restart NetworkManager
Enter fullscreen mode Exit fullscreen mode

Test the performance with ping, and there should be a marked improvement.

wifi.powersave config options

NetworkManager has several configurable options for wireless adapter settings, including powersave. You can read about them in the API documentation. There, we discover the following powersave options:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0) (use the globally configured value).
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1) (don't touch currently configured setting)
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2) (disable Wi-Fi power saving)
  • NM_SETTING_WIRELESS_POWERSAVE_ENABLE (3) (enable Wi-Fi power saving)

In this case, I want to disable Wi-Fi power saving, thus the value of 2 in the config file, set with

[connection]
wifi.powersave = 2
Enter fullscreen mode Exit fullscreen mode

Detecting and setting the power-save setting on the wireless card

With or without NetworkManager, the power save setting of the AX201 and other Wi-Fi cards can be read with the iw command.

First, find the name of your wireless adapter with iw dev or to get just the name:

iw dev | grep -o 'Interface.*'
Enter fullscreen mode Exit fullscreen mode

The wireless adapter likely starts with "wl". Mine is wlp0s20f3, so the following works to get the current powersave setting:

iw dev wlp0s20f3 get power_save
Enter fullscreen mode Exit fullscreen mode

If you have already made the NetworkManager config changes and restarted NetworkManager, then the result should be Power save: off.

A similar command can be used to turn power_save back on:

iw dev wlp0s20f3 set power_save on
Enter fullscreen mode Exit fullscreen mode

Awaiting other solutions...

Of course, I hope that a driver solution comes soon with new kernel releases. Likely the above solution will not be necessary long term. If you have encountered other ways to solve this problem, please feel free to use the comments!

Other resources

Top comments (2)

Collapse
 
svargasdev profile image
Sam Vargas

I'm thinking about buying an XPS 9310... Was this solved with the upgrade to Fedora 36?

Collapse
 
bowmanjd profile image
Jonathan Bowman

Such a good question! I am unsure... I decided to keep the powersave off anyway. So, it is definitely working. But whether it worked due to the upgrade, or because I disabled powersave... Let me test a bit and get back to you.