# RTL8821AE - slow performance

## Akaihiryuu

I can only really do tests on the 2.4 GHz bands, because my phone is the only hardware I have (other than the server itself) that has 5GHz hardware.  It's working (mostly) but I'm getting timeouts and very poor performance of about 0.7mbps.  This is my hostapd.conf.  If it can be fixed with some conf changes great...if not I'm willing to consider other cards (this is a mini-pcie card and I can get replacements for around $25 so I'm not worried about that).  It's really odd, because the 0.7mbps seems like it's an artificial cap.  It only happens on download, upload goes as high as 5mbps (my max upload speed), though it is VERY jumpy with the speed going up and down constantly.

```
interface=wlan0

bridge=br0

country_code=US

logger_syslog=-1

logger_syslog_level=2

logger_stdout=-1

logger_stdout_level=2

ctrl_interface=/var/run/hostapd

ctrl_interface_group=0

ssid=x

hw_mode=g

channel=9

ieee80211d=1

accept_mac_file=/etc/hostapd/hostapd.accept

deny_mac_file=/etc/hostapd/hostapd.deny

wpa=2

wpa_passphrase=x

wpa_key_mgmt=WPA-PSK

rsn_pairwise=CCMP

ieee80211n=1

#wmm_enabled=1

own_ip_addr=x
```

----------

## khayyam

Akaihiryuu ...

as I mentioned in my post to your other thread, this sounds very much like a lack of entropy, try running a entropy daemon, there are various to choose from:

sys-apps/haveged

sys-apps/audio-entropyd

sys-apps/timer_entropyd

best ... khay

----------

## Akaihiryuu

So just install that and then test wifi again?  I don't understand how an external program like that could have anything to do with wifi speeds.

----------

## khayyam

 *Akaihiryuu wrote:*   

> So just install that and then test wifi again?  I don't understand how an external program like that could have anything to do with wifi speeds.

 

Akaihiryuu ... the data (TCP/IP) is encapsulated, that encapsulation is encrypted and for hostapd to do this it needs entropy (something which is generally is short supply). An entropy generator can use some device (such as an audio card) to generate entropy and fill up the pool, thus making sure that hostapd doesn't need to wait some nanoseconds for it to be available. The issue you report is typical of entropy exhaustion, and as you would expect when more data transfered more entropy is required. I can't say for sure this is the cause, it may very well be the driver, but the symptoms suggest this may be the case.

best ... khay

----------

## Akaihiryuu

I tried that, it didn't make any difference.  My download is always *exactly* 0.8mbps (it should be more like 50), and my upload fluctuates wildly between 3 and 5mbps (my cap).  The upload is actually ok, it's just the download, which really confuses me.  There's definitely something wrong, but it's probably the drivers.  I've looked around and seen a LOT of reports of very bad performance with this chipset with the drivers included in the kernel.  Apparently there are repositories that have better ones (at least for Ubuntu and Debian).  I've seen them mentioned but haven't been able to actually find anything.

----------

## Logicien

You have some log options you can set in hostapd.conf to read what hostapd think of what it's doing. It can help to find the cause of the slow download speed.

When I have set the channel number the first time, I had a look at the other Access Points in my network neighborhood. No one was using the channel 2. So I decide to use it to not interfere with other AP. I just come to check and I am the only one who use channel 2 unless an hiden network is  using it too. So, are you alone to use channel 9? If not, try a channel number not in use.

In my Access Point tower (HP Compaq 6000 Pro MT PC ), I have disable all sorts of power saving, in the ath9k module, in the PCIe bus and I run the processor at the performance governor. For tests at least, I think it is a good idea.

Your problem can be the rtl8821ae module and/or the wireless card itself. More than one rtl modules are not working too good. You can try to set some parameters for the rtl8821ae module. A mini-pcie is not an ideal device to serve as an Access Point. It must be in a laptop. Have you check it's capabilities with the command iw list? I suppose it support AP mode.  :Smile: 

It's not impossible that the problem have it's source on the client side !

My Access Point wireless card is a Qualcomm Atheros AR9227 Wireless Network Adapter that I use in a PCIe extension slot. I am happy with it after a couple of years now. I always get my wire Internet maximum speed on all the machines of my private wireless lan.

----------

## Akaihiryuu

Yes, it supports AP mode.  I ran an access point off of a mini-PCIe card for 4 years, but it was an ath9k card.  That one still works great...but it only support 2.4GHz and 802.11n, I'm really wanting ac performance and 5GHz.  As far as the access point, yes it is fully supported, and it works as an access point, I'm just getting a lot of dropped packets and awful performance.  Performance is sufficient for light web browsing, but attempting to copy files will constantly time out.  But yes, I've checked iw list and tinkered around with some parameters but nothing helps.

As far as running AP's, it doesn't matter whether it's a mini-PCIe card or not.  Full sized PCIe wireless cards simply have the antenna assembly built into the card, while mini PCIe cards have the antennas attached with special cords.  They work the same.

I've read several places that the 8821AE drivers are still not very good.  I'll just wait, and use an external AP for now until the drivers either get better or I get a different card.  I've always kind of wanted to have an external device that I can use as a router as a backup in an emergency though.  So this will work fine for now.

----------

## Akaihiryuu

Since I have working wifi right now via an external access point, I can tinker with this card without interrupting my network.  So I've been playing around with it.  I have noticed something unusual in the kernel logs:

rtlwifi: Firmware rtlwifi/rtl8821aefw.bin not available

That could very well be the source of my problems.  Any idea where I can find this?  I assume there will be a package for it, but I can't find anything that mentions realtek.

----------

## ct85711

well, the easy and best bet would be trying the linux-firmware package, as it generally tends to be the overall main package with all firmware

----------

