Terrible WiFi performance with Librem13, Librem15


#16

So I guess next step is to do some sort of RMA? I’d be happy to try to replace the WiFi card, but not happy to buy one to test it.

Is this more of a Support->Contact question than a Support->Forum one?


#17

Yes, please send an email to support.


#18

Hi,
at least I can sched some light on the question of two antenna connections.

There is a main and an aux antenna. These are used for antenna diversity:

What it basically does is it avoids an effect called fast fading. Due to reflections of the radio signal and the short wavelength even millimeters can drastically change the receive energy of a radio signal. Using two antennas the radio chip listens on both antennas and chooses the strongest of both signals - very roughly explained.

2.4GHz Wifi and 5GHz Wifi are even multiples of the frequency which means that the same antenna can and will be used for both frequencies.

Finally we have Bluetooth in the Librems too (currently not supported in PureOS because of non-free firmware). Bluetooth is also using 2.4GHz. The Bluetooth chip is on the same card as on the WiFi, actually it is a companion of the WiFi chip. Since there are now two radios using 2.4GHz they must coordinate somehow. This is done by so called Bluetooth-Wifi coexistence, not by a second antenna. The two chips have signals to notify each other about who is going to use the antenna.

So bottomline: Two antenna connectors for diversity, shared for Wifi (2.4GHz and 5GHz) and for Bluetooth.

Since the antennas are placed into the LCD assembly and the back side is aluminum they are shielded off in the backside. Turning the laptop around a little can drastically improve the reception quality.

Cheers
nicole


Desired Improvements For The Librem 15v4
Poor WiFi performance
#19

Hmm… I just checked the at9k driver and found that neither BT coexistence nor diversity are enbled by default, maybe you want to try to explicitly enable them:

rmmod ath9k
modprobe ath9k blink=0 btcoex_enable=0 bt_ant_diversity=1

In the driver there is logic that suggests that BT coex and diversity are mutually exclusive that’s why I set it to 0.

Please do not expect anything from this trick. It might very well be that the EEPROM of the card already has these settings but that the driver does not expose these settings to sysfs so we can not check them. Your mileage may vary…

You may also try to enable power saving by adding:
ps_enable=1
to the list of options, but this will only do what it says, save some power :wink: It will not have any influence on the Wifi performance.

Cheers
nicole


#20

Thanks for your suggestion. I tried some combinations, and unfortunately it made no noticeable difference.

5GHz is pretty much broken, and 2.4GHz is still easily beaten, by about 5-10x. in my testing by this puppy (that I got for like $4) in the same computer in the same place: http://imgur.com/a/62dwX
Up to 20x faster with a bigger USB wifi dongle with visible antenna and with other laptops.

Not a good long term solution though because:

  1. It doesn’t do 5GHz
  2. The other USB-A port is taken 24/7 by a Yubikey nano, so this would leave zero USB-A ports free.

#21

Yes, this is pretty strange and we are investigating this. For some reason diversity seems to be switched off regardless of the module parameters. I am currently digging through the driver source to find all possible constraints on enabling diversity - there are quite a lot, EEPROM settings, quirks for specific models etc.

I am pretty sure that this can be enhanced!
We “just” have to find how :slight_smile:

Cheers
nicole


The i.MX8 cannot be deblobbed? (NXP-signed HDMI firmware)
#22

By the way, I’m delighted to see someone with RF/EM experience/knowledge is active in Purism. I still think of how all the effort of the OpenMoko project resulted in so much less than planned due to inadequate attention to EM/RF details.


#23

To add another report:

My Librem 15 also has poor wifi performance compared with other laptops/phones in the same environment. It is very sensitive to the position of the laptop screen but I am not able to turn the screen around to the optimal point at my desk in the office.

I haven’t tried opening up the case or fiddling with drivers yet.

Like @Thomas_Habets I will probably use a USB wifi dongle for now (unless I can see any obvious problems with the cables), but I look forward to @nicole.faerber’s updates as to how we can improve performance of the built-in wifi cards.

I am happy to forgo bluetooth functionality if that would result in better wifi performance.


#25

FYi: My librem13v2 is currently in the hands of Purism for troubleshooting/repair.


#26

It would be great to know if they learn something about the problem, since I am experiencing similar issues with mine here. Opened and checked antenna cables already, loosened them up a bit, but this didn’t help. I have a hard time believing that the aluminum cover truly is shielding the antennas and the only area where they can receive properly is in the small space of the plastic hinge of the screen lid, since this would be such an obvious design flaw that someone must have noticed it earlier, right?


#27

As a brief update, I rebuilt the driver with debugging enabled and I can verify that diversity is not enabled. I just have no idea yet why. The driver is pretty big and complex and for a bunch of chips. I will need to add debugging code to find the spot where it gets decided that diversity is not going to be used and subsequently find why it is not enabled.

What seems to be pretty clear to me already is that WiFi antenna diversity and Bluetooth coexistence are mutually exclusive. As soon as BT coex is enabled then WiFi diversity gets disabled. This is driver code and I wonder why this is. Other combined modules, e.g. Intel, can do this. But since we do not support Bluetooth right now anyway it is not a real concern.

I’ll keep you posted if I find out more.

Cheers
nicole


#28

Can you also check if antenna diversity is an issue for the Librem 13v1? Does the 13v1 have two antennas internally also? If so, is antenna diversity enabled for it? My 13v1 has always had weak WiFi abilities, much weaker than my other devices.


#29

I do not have a 13v1 at hand to verify but I am pretty sure that the basic design is very similar. The 13v1 also has working Bluetooth once you install the non free firmware and Bluetooth is exclusively using the second antenna - if it is in use. So there must be two antennas inside the case. And since it is basically the same WiFi/BT NGFF module it is very likely that it suffers from the problem.

Cheers
nicole


#30

How would I diagnose if I had the problem on my Librem 13v1?

I’m running Qubes 3.2. It runs the Xen hypervisor (not sure which version). In the dom0 VM it has an old version of Fedora running a modified Linux 4.4.67. Both USB controllers (PCI devices) are assigned to the sys-usb VM running Fedora 25 (but running a modified Linux 4.4.67 which is provided to it by dom0). The Atheros AR3012 Bluetooth shows up as a USB device in sys-usb. The Atheros AR9462 (PCI device) is assigned to the sys-net VM which is running the same versions of Fedora and Linux as sys-usb. Note that the two different parts of the Wireless/Bluetooth chip are accessed via two different PCI devices which are assigned to two different VMs.

I don’t need or use Bluetooth so I hope no antenna is devoted to Bluetooth, or if one is then I hope it can be switched to supporting antenna diversity.

Help!?


#31

We did a little further analysis of possible problems. To put it up front, we still do not know how to really improve the situation, sorry.

By some hardware analysis (which involved taking apart devices etc.) we found that at least the antennas (yes, L13v2 and L15v3 do have two) are not the issue. The antennas are placed in the display hinge bar where the kill switches are located also. Replacing these with other antennas or changing their position did not improve the situation.

We also have the suspicion that the reception quality is fine but that the problem might be related rather to the sending path.

We are investing further, stay tuned!

Cheers
nicole


#32

A little further down the road at least I have the impression that the situation has improved with more recent kernel version (4.13+). Can someone else confirm this? Now I can successfully associate with 5GHz access points which did not work at all before. There is still room for improvement but it is somewhat better.

I still uphold my theory that the TX signal strength is the problem and I suspect that the ATH9k driver is very conservative on choose the TX power. I just have not yet found a way to force it to higher TX power, the driver’s algorithm will always reset it if I manually increase it…

Cheers
nicole


#33

I also have the feeling that it got better with recent updates on my machine (using Solus here) although I’m on the LTS branch (4.9.66). This aside, it is still a big problem in everyday use and oftentimes I just use a mobile internet hotspot because it is very slow or doesn’t work at all. Like someone wrote aove, quality is degrading really fast when moving away from the router, so sometimes, when I need to download or upload something, I have to walk to the room with the router :slight_smile:

I love using my Librem so much and use it very often, so proper WiFi would be a relief. I will just stay tuned and thanks for investigating this issue!

Many regards,
Christian


#34

I’m just glad to see that Purism has a person for this stuff.

Seems like the kind of topic that would usually be overlooked.

Hope it’ll be pretty well fixed and put into consideration for the next revision of Librems.


#35

Librem 13v1 — improved a lot, and it’s not just a feeling.


#36

If the wifi card is AR9462, then antenna diversity is irrelevant since AR9462 is a 2-stream card. Diversity is used only for 1-stream cards (like AR9565 etc.) and with such cards the HW will switch reception between the main and aux antennas based on various factors to improve RX performance.

BT coexistence and antenna diversity can’t be enabled at the same time - but this limitation doesn’t apply to AR9462 since diversity is not used at all with this chip.