Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project: Add 8821/11au rtw88 in-kernel driver. Need testers... #133

Open
morrownr opened this issue Apr 30, 2024 · 157 comments
Open

Project: Add 8821/11au rtw88 in-kernel driver. Need testers... #133

morrownr opened this issue Apr 30, 2024 · 157 comments

Comments

@morrownr
Copy link
Owner

morrownr commented Apr 30, 2024

Greetings to anyone that reads this message.

This Issue is where we coordinate and take bug report for the new 8821a in-kernel driver.

An effort is underway to add support for the rtl8821/11au chipset to the rtw88 in-kernel driver series. The driver is available for testing at the following repo:

https://github.com/lwfinger/rtw88

Remember to first remove the out-of-kernel driver in this repo or whatever repo you may have installed. You can run the following to remove it if using this repo:

$ sudo sh remove-driver.sh

It is important to follow the instructions in the README at the repo with the new test driver. You may not be familiar with rtw88 in the kernel but even if you are, there are some necessary mods that you need to know about. The rtw88 that has this new driver is more advanced than the rtw88 in stable kernels as it follows wireless-next and is used to work on and develop new drivers.

We welcome you to test and report on this new driver. Your testing will help us get this new driver in the Linux kernel sooner and in better shape. We do have specific needs. The most immediate need is to find users that have adapters that have bluetooth support (rtl8821au chip). The current developers only have adapters that have rtl8811au chips so we need help. We also need testers with old laptps that have the rtl8821ae chip.

If you are aware of anyone who is familiar with mac80211 drivers, please invite them as more eyes on the code is a good thing. Your ideas are most welcome. We can do this.

@morrownr

Status report:

  • A possible outstanding bug has to do with idle power savings (IPS). This bug is under investigation.

  • Managed mode (client) appears to be in good shape. There some reports of slow performance on some ARM platforms, This is being investigated.

  • Monitor mode appears to be in good shape but Active Monitor mode is not supported. Monitor mode needs more testing.

  • AP mode is in good shape but AP Mode DFS channels are not supported (this common on usb wifi adapters). This is an issue that needs to be investigated but should not slow down the upstreaming of this driver.

  • P2P mode is in good shape.

  • IBSS mode has not been tested yet. Please test and report.

Overall: the driver appears to be in good shape but we need a lot of testing to take place. Please test and report your results.

@lwfinger
Copy link

lwfinger commented May 5, 2024

I get a maximum of 130 Mbps transmit and 93 RX with iperf3. LibreSpeed gets 119 down and 113 up.

@lwfinger
Copy link

lwfinger commented May 6, 2024

The master branch now contains all of dubhater's changes for the RTW8821AU and RTW8812AU, and the driver works. I have not removed any of the other branches until the code is checked a bit more, but please test everything. The speeds are still on the low side, but that will come.

@morrownr
Copy link
Owner Author

morrownr commented May 6, 2024

@lwfinger

The master branch now contains all of dubhater's changes for the RTW8821AU and RTW8812AU, and the driver works.

Thanks. I'll start testing and adding additional vid/pids for rtw8812au.

@dubhater

As you ready for rtw8812au to be tested or just rtw8821au?

@morrownr
Copy link
Owner Author

morrownr commented May 6, 2024

Initital testing of rtw88 master:

$ iperf3 -c 192.168.1.1
Connecting to host 192.168.1.1, port 5201
[  5] local 192.168.1.172 port 57430 connected to 192.168.1.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  28.6 MBytes   240 Mbits/sec    0    526 KBytes       
[  5]   1.00-2.00   sec  25.4 MBytes   213 Mbits/sec    0    526 KBytes       
[  5]   2.00-3.00   sec  25.5 MBytes   214 Mbits/sec    0    526 KBytes       
[  5]   3.00-4.00   sec  25.5 MBytes   214 Mbits/sec    0    551 KBytes       
[  5]   4.00-5.00   sec  25.7 MBytes   216 Mbits/sec    0    551 KBytes       
[  5]   5.00-6.00   sec  25.7 MBytes   216 Mbits/sec    0    551 KBytes       
[  5]   6.00-7.00   sec  26.5 MBytes   222 Mbits/sec    0    577 KBytes       
[  5]   7.00-8.00   sec  24.2 MBytes   203 Mbits/sec    0    577 KBytes       
[  5]   8.00-9.00   sec  25.5 MBytes   214 Mbits/sec    0    577 KBytes       
[  5]   9.00-10.00  sec  25.6 MBytes   215 Mbits/sec    0    577 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   258 MBytes   217 Mbits/sec    0             sender
[  5]   0.00-10.01  sec   256 MBytes   214 Mbits/sec                  receiver

iperf Done.

I ran iperf3 several times with my primary testing setup. Speed looks really good. Around 220 Mbps is about as fast as this chip can go if the out-of-kernel results over the last few years are good. The test above is on a DFS channel where there is no congestion. dmesg is clean. I'm impressed so far.

Monitor mode frame injection test:

$ sudo aireplay-ng --test wlx00c0caac47c7
[sudo] password for morrow:         
13:40:39  Trying broadcast probe requests...
13:40:39  Injection is working!
13:40:41  Found 12 APs

13:40:41  Trying directed probe requests...
13:40:41  C6:BE:59:93:4F:3B - channel: 44 - ''
13:40:43  Ping (min/avg/max): 2.473ms/9.155ms/17.771ms Power: -81.38
13:40:43  21/30:  70%

13:40:43  10:33:BF:60:FA:3B - channel: 44 - 'CoxWiFi'
13:40:43  Ping (min/avg/max): 1.548ms/5.636ms/8.924ms Power: -39.00
13:40:43  29/30:  96%

13:40:43  08:A7:C0:14:81:DA - channel: 44 - 'Wade Wifi'
13:40:47  Ping (min/avg/max): 10.801ms/17.700ms/27.914ms Power: -76.69
13:40:47  13/30:  43%

13:40:47  08:A7:C0:14:81:DF - channel: 44 - ''
13:40:51  Ping (min/avg/max): 14.111ms/22.023ms/39.249ms Power: -76.83
13:40:51  12/30:  40%

13:40:51  CC:BE:59:93:4F:3B - channel: 44 - 'SKHutch5'
13:40:52  Ping (min/avg/max): 2.017ms/6.207ms/20.025ms Power: -80.83
13:40:52  24/30:  80%

13:40:52  08:A7:C0:14:81:DD - channel: 44 - ''
13:40:57  Ping (min/avg/max): 10.314ms/21.516ms/31.877ms Power: -77.00
13:40:57  10/30:  33%

13:40:57  C2:BE:59:93:4F:3B - channel: 44 - ''
13:40:59  Ping (min/avg/max): 7.544ms/18.691ms/34.159ms Power: -79.70
13:40:59  20/30:  66%

13:40:59  10:33:BF:60:FA:3A - channel: 44 - ''
13:41:00  Ping (min/avg/max): 3.128ms/9.390ms/16.078ms Power: -38.93
13:41:00  28/30:  93%

13:41:00  10:33:BF:60:FA:3E - channel: 44 - ''
13:41:00  Ping (min/avg/max): 1.213ms/8.218ms/20.971ms Power: -38.80
13:41:00  30/30: 100%

13:41:00  08:A7:C0:14:81:DC - channel: 44 - 'CoxWiFi'
13:41:04  Ping (min/avg/max): 6.712ms/18.391ms/26.479ms Power: -77.00
13:41:04   9/30:  30%

13:41:04  08:A7:C0:14:81:DB - channel: 44 - ''
13:41:09  Ping (min/avg/max): 12.830ms/20.560ms/26.364ms Power: -77.00
13:41:09   9/30:  30%

13:41:09  10:33:BF:60:FA:3C - channel: 44 - ''
13:41:09  Ping (min/avg/max): 2.109ms/8.086ms/23.178ms Power: -38.93
13:41:09  28/30:  93%

Going in and out of monitor mode works well and things look like they should. The injection test above showed very good results. So far monitor mode looks good.

I will do more detailed test on managed and monitor mode as able this week and I plan to test AP mode and
P2P-client. So far, this driver looks good.

I plan to rework the first message in this thread to provide instructions to those who can test/report as most will not be used to the instructions for getting this driver going,

I am still looking for someone with a rtl8821au based adapter and someone with an old laptop with a rtl8821ce chip in it so we can test bluetooth.

@morrownr

Repository owner deleted a comment from dubhater May 6, 2024
Repository owner deleted a comment from dubhater May 6, 2024
Repository owner deleted a comment from dubhater May 6, 2024
Repository owner deleted a comment from lwfinger May 6, 2024
Repository owner deleted a comment from dubhater May 6, 2024
Repository owner deleted a comment from lwfinger May 6, 2024
Repository owner deleted a comment from dubhater May 6, 2024
Repository owner deleted a comment from lwfinger May 6, 2024
Repository owner deleted a comment from lwfinger May 6, 2024
@dubhater
Copy link

dubhater commented May 6, 2024

@morrownr rtw_8812au is not ready yet.

I can see some RTL8821AE on Aliexpress, both M.2 and mini PCIe.

Repository owner deleted a comment from dubhater May 6, 2024
@morrownr
Copy link
Owner Author

morrownr commented May 6, 2024

@dubhater

I can see some RTL8821AE on Aliexpress, both M.2 and mini PCIe.

Give me a chance to round up some testers that already have the chips. We can always go get one if we have to do so. This repo gets over 100 hits per day so there are a lot of users of this chip. I just need to work on getting them in here now that we have something for them to test. I'll work it.

I'm impressed with this driver so far. We'll find problems but so far it is working well. My opinion after a few years of supporting out-of-kernel drivers for both the rtl8821au and rtl8821cu is that the au is simply a more reliable chip that causes users far fewer problems.

@morrownr

@gmsanchez
Copy link

@morrownr

I have a TP-Link Archer T2U PLUS [RTL8821AU]. I removed this kernel module using $ sudo sh remove-driver.sh and installed rtw88 using the provided readme on Kubuntu 24.04

So far everything is working good. I am willing to help, but I don't have a lot of experience in this field. Are there any instructions to run the required tests? Just let me know.

@morrownr
Copy link
Owner Author

morrownr commented May 8, 2024

Hi @gmsanchez

Thanks for testing.

Are there any instructions to run the required tests?

Do you have any experience using any modes in addition to managed (client) mode?

Please document your distro and version here and post the results of the following:

$ uname -r
$ gcc --version

Do you know of a way to test your speed? If so, do it.

Post the results of:

$ sudo dmesg | grep rtw

Since you have an adapter with the version of the chip that has bluetooth support, can you verify that bluetooth is working correctly?

Post the results of:

$ lsusb

If your adapter has an LED, does it blink?

Lastly, just use it. See if anything goes wrong over the next few days. Keep us posted.

You may also get questions from @dubhater and @lwfinger .

@morrownr

@gmsanchez
Copy link

gmsanchez commented May 8, 2024

Do you know of a way to test your speed? If so, do it.

I don't know how to test my speed.

Since you have an adapter with the version of the chip that has bluetooth support, can you verify that bluetooth is working correctly?

I don't have any bluetooth device on my system.

If your adapter has an LED, does it blink?

I'll move the adapter to the front and check the LED status.

In the meantime, the requested output of the commands is below:

$ uname -r
6.8.0-31-generic
$ gcc --version
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ sudo dmesg | grep rtw
[    3.848959] rtw_core: loading out-of-tree module taints kernel.
[    3.848966] rtw_core: module verification failed: signature and/or required key missing - tainting kernel
[    3.874055] rtw_8821au 3-1:1.0: Firmware version 42.4.0, H2C version 0
[    3.915832] usbcore: registered new interface driver rtw_8821au
[    3.919055] rtw_8821au 3-1:1.0 wlx6c5ab0d0395d: renamed from wlan0
[    6.110598] rtw_8821au 3-1:1.0: MAC has not been powered on yet
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 05e3:0606 Genesys Logic, Inc. USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 002 Device 004: ID 046d:c077 Logitech, Inc. Mouse
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 2357:0120 TP-Link Archer T2U PLUS [RTL8821AU]
Bus 003 Device 003: ID 046d:08e4 Logitech, Inc. C505e HD Webcam
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

@morrownr
Copy link
Owner Author

morrownr commented May 8, 2024

@dubhater

rtw88 master - rtw_8821au

I am seeing the below during compilation. This is with Debian 12 and kernels 6.1 LTS and 6.6 LTS plus gcc 12.2. This not fatal but...

  CC [M]  /home/morrow/src/rtw88/rtw8821a.o
  CC [M]  /home/morrow/src/rtw88/rtw8821a_table.o
In file included from /usr/src/linux-headers-6.1.0-21-common/include/linux/kernel.h:26,
                 from /usr/src/linux-headers-6.1.0-21-common/arch/x86/include/asm/percpu.h:27,
                 from /usr/src/linux-headers-6.1.0-21-common/arch/x86/include/asm/current.h:6,
                 from /usr/src/linux-headers-6.1.0-21-common/include/linux/sched.h:12,
                 from /usr/src/linux-headers-6.1.0-21-common/include/linux/delay.h:23,
                 from /usr/src/linux-headers-6.1.0-21-common/include/linux/usb.h:15,
                 from /home/morrow/src/rtw88/rtw8821a.c:5:
/home/morrow/src/rtw88/rtw8821a.c: In function ‘rtw8821a_tx_power_training’:
/usr/src/linux-headers-6.1.0-21-common/include/linux/minmax.h:20:35: warning: comparison of distinct pointer types lacks a cast
   20 |         (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
      |                                   ^~
/usr/src/linux-headers-6.1.0-21-common/include/linux/minmax.h:26:18: note: in expansion of macro ‘__typecheck’
   26 |                 (__typecheck(x, y) && __no_side_effects(x, y))
      |                  ^~~~~~~~~~~
/usr/src/linux-headers-6.1.0-21-common/include/linux/minmax.h:36:31: note: in expansion of macro ‘__safe_cmp’
   36 |         __builtin_choose_expr(__safe_cmp(x, y), \
      |                               ^~~~~~~~~~
/usr/src/linux-headers-6.1.0-21-common/include/linux/minmax.h:52:25: note: in expansion of macro ‘__careful_cmp’
   52 | #define max(x, y)       __careful_cmp(x, y, >)
      |                         ^~~~~~~~~~~~~
/home/morrow/src/rtw88/rtw8821a.c:2481:31: note: in expansion of macro ‘max’
 2481 |                 write_data |= max(power_level, 2) << (i * 8);
      |                               ^~~

@lwfinger
Copy link

lwfinger commented May 8, 2024

The problem is that the code used max(a,b), whereas it should have been max_t(u32,a,b). It now compiles cleanly on openSUSE Tumbleweed and Debian 12.

@morrownr
Copy link
Owner Author

morrownr commented May 9, 2024

@gmsanchez

I don't know how to test my speed.

You can give the following site a try for basic speed testing:

https://testmy.net/

Most of us use iperf3 on our local lans for speed testing. Do you have a RasPi on your local lan or a wifi router that runs OpenWRT?

I don't have any bluetooth device on my system.

It looked like you might have a version of the chipset that includes bluetooth support so I was looking to see if the bluetooth in your adapter was working. Maybe you have a chip that is wifi only.

[ 6.110598] rtw_8821au 3-1:1.0: MAC has not been powered on yet

Let me think out loud here for a moment. I am trying to sort out why the above line is needed. What is it doing for us?

Thanks for the info and we'll be waiting for additional reports.

@morrownr

@morrownr
Copy link
Owner Author

morrownr commented May 9, 2024

@lwfinger

The problem is that the code used max(a,b), whereas it should have been max_t(u32,a,b). It now compiles cleanly on openSUSE Tumbleweed and Debian 12.

Awesome! Clean compile here.

FYI: I'll be moving to AP mode testing soon. So far, managed and monitor modes look really good but my AP mode testing will take me to another distro and ARM64.

@morrownr
Copy link
Owner Author

morrownr commented May 9, 2024

@dubhater @lwfinger

Here is a very minor nitpick:

Screenshot from 2024-05-09 14-58-12

When I run iperf3, I am seeing drop (in the statistics box) increase regularly. With other wireless devices I am more used to it not increasing or occasionally incrementing but not as regularly as I am seeing here. Do we have a buffer set slightly smaller than it needs to be?

Like I said, nitpick. I am having a difficult time finding any problems with managed and monitor modes.

I am off to test AP mode.

@morrownr

@lwfinger
Copy link

Do you see any WARNINGS in your logs like this "WARNING: CPU: 3 PID: 36 at net/mac80211/rx.c"? Your CPU and PID will be different. That may be the source of your drops.

I have a patch to silence the WARNINGS, but the drops are not fixed as the packets are malformed.

What is the utility that produced the screenshot? I am not familiar with anything like it.

@5kft
Copy link
Contributor

5kft commented May 10, 2024

@morrownr I'm using a Debian-based custom arm64/armhf distribution, and as such I can't build the rtw88 driver via @lwfinger's process (I didn't bother to try to address this further). Instead, I simply removed the original mainline (6.9-rc7) rtw88 driver source and replaced it completely with @lwfinger's version from his github.

Now, when building this new version of rtw88 I am getting errors relating to the PCI driver module support or something (see errors below). My kernel configuration does not enable CONFIG_PCI, just in case this might be related. I haven't debugged the new in-kernel rtw88 build process any further. I'm pointing this out just in case there is an oversight in this new rtw88 code for non-CONFIG_PCI and/or ARM builds (or something).

As a comparison, the mainline 6.9-rc7 rtw88 driver builds completely fine - without any errors - so there does appear to be a regression in this new version of the driver source.

In my kernel config I am only enabling the the 8821CU module, so it is kind of odd that the build is erroring out for driver sources that aren't even enabled:

CONFIG_RTW88=m
CONFIG_RTW88_CORE=m
CONFIG_RTW88_USB=m
CONFIG_RTW88_8821C=m
# CONFIG_RTW88_8822BS is not set
# CONFIG_RTW88_8822BU is not set
# CONFIG_RTW88_8822CS is not set
# CONFIG_RTW88_8822CU is not set
# CONFIG_RTW88_8723DS is not set
# CONFIG_RTW88_8723DU is not set
# CONFIG_RTW88_8821CS is not set
CONFIG_RTW88_8821CU=m
# CONFIG_RTW88_DEBUG is not set
# CONFIG_RTW88_DEBUGFS is not set

Build errors:

drivers/net/wireless/realtek/rtw88/rtw8822be.c:27:1: warning: data definition has no type or storage class
   27 | module_pci_driver(rtw_8822be_driver);
      | ^~~~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtw88/rtw8822be.c:27:1: error: type defaults to ‘int’ in declaration of ‘module_pci_driver’ [-Werror=implicit-int]
drivers/net/wireless/realtek/rtw88/rtw8822be.c:27:1: warning: parameter names (without types) in function declaration
drivers/net/wireless/realtek/rtw88/rtw8822be.c:19:26: warning: ‘rtw_8822be_driver’ defined but not used [-Wunused-variable]
   19 | static struct pci_driver rtw_8822be_driver = {
      |                          ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[7]: *** [scripts/Makefile.build:244: drivers/net/wireless/realtek/rtw88/rtw8822be.o] Error 1
make[7]: *** Waiting for unfinished jobs....
drivers/net/wireless/realtek/rtw88/rtw8822ce.c:31:1: warning: data definition has no type or storage class
   31 | module_pci_driver(rtw_8822ce_driver);
      | ^~~~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtw88/rtw8822ce.c:31:1: error: type defaults to ‘int’ in declaration of ‘module_pci_driver’ [-Werror=implicit-int]
drivers/net/wireless/realtek/rtw88/rtw8822ce.c:31:1: warning: parameter names (without types) in function declaration
drivers/net/wireless/realtek/rtw88/rtw8822ce.c:23:26: warning: ‘rtw_8822ce_driver’ defined but not used [-Wunused-variable]
   23 | static struct pci_driver rtw_8822ce_driver = {
      |                          ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[7]: *** [scripts/Makefile.build:244: drivers/net/wireless/realtek/rtw88/rtw8822ce.o] Error 1
make[6]: *** [scripts/Makefile.build:485: drivers/net/wireless/realtek/rtw88] Error 2
make[5]: *** [scripts/Makefile.build:485: drivers/net/wireless/realtek] Error 2
make[4]: *** [scripts/Makefile.build:485: drivers/net/wireless] Error 2
make[3]: *** [scripts/Makefile.build:485: drivers/net] Error 2
make[2]: *** [scripts/Makefile.build:485: drivers] Error 2

@ma8ma
Copy link

ma8ma commented Jun 13, 2024

@morrownr

On the same installation, when you use gnone, everything works and when you use KDE, it does not. Is this a fair assessment of the situation?

My environment for testing has been updated from Kubuntu 23.10 to 24.04. I have been using GNOME instead of KDE both before and after the update. After confirming that the adapter was working in the GNOME session, I switched to the KDE session and started experiencing connection failures. From that point onwards, even after rebooting the machine and logging back into GNOME, the connection fails.

I was able to connect successfully in both GNOME and KDE sessions after installing and rebooting with commit 530df1a4 (Revert "Allow 8821au, 8812au to enter IPS") from the master branch. However, the connection fails without this fix.

I apologize for the change in the situation since my previous report and any inconvenience caused.

@ZerBea
Copy link

ZerBea commented Jun 13, 2024

@Jake-Grafton
I feel sorry about that epical fault. ;-)
Looks like my multitasking ability is now gone since I've reached an age of 70 years.
Looks like it was a way too much (for my old brain), logged in here, logged in at bugzilla, compiling the git Linux kernel and testing 8811au while answering an issue report.

But joking aside. While writing this, I'm compiling 6.10-rc3 with an applied patch (which should fix monitor mode):
https://lore.kernel.org/all/7869b9b29b6796c95fd5af649e4bd6696e56dcaf.camel@sipsolutions.net/

Regards
Mike

@ZerBea
Copy link

ZerBea commented Jun 13, 2024

Some good news. The kernel bug has been fixed!
https://bugzilla.kernel.org/show_bug.cgi?id=218884#c19

Regards
Mike

@morrownr
Copy link
Owner Author

@ZerBea

Some good news. The kernel bug has been fixed!

That is good news. Thanks for being persistent in your reporting.

@morrownr
Copy link
Owner Author

@ma8ma

I apologize for the change in the situation since my previous report and any inconvenience caused.

Please don't apologize. I am conducting an investigation. A question that has to be answered is whether it is a problem in the driver with all distros, with some distros or if it is not a problem in the driver but rather a problem in a distro. I'm digging pretty hard since I have not been able to duplicate the problem on Debian 12 (kernel 6.6) and Ubuntu 24.02 (kernel 6.8). I'm attempting to install Kubuntu 24.04 but I keep into problems. I will eventually make it happen.

I was able to connect successfully in both GNOME and KDE sessions after installing and rebooting with commit 530df1a4 (Revert "Allow 8821au, 8812au to enter IPS") from the master branch. However, the connection fails without this fix.

I'm not going to refer to "Allow 8821au, 8812au to enter IPS" as a fix because what it does is turn off IPS, which we want. The reason you saw me to recommend to @dubhater to turn IPS back on is because I am the only one right now trying to track this down and we need to know if others are seeing a problem. We can tell you which 3 lines to comment out so that you can continue, if necessary.

My environment for testing has been updated from Kubuntu 23.10 to 24.04.

I understand. From a bug investigators perspective, that complicates things. While Ubuntu and the flavors do a good job of upgrading from version to version, that is still an extremely complicated thing to do and some little detail could have gone haywire. It is a situation is nearly impossible for me to reproduce. I hate to ask but could you backup your important files and do a format c: type of clean Kubuntu 24.04 installation?

Cheers

@ma8ma
Copy link

ma8ma commented Jun 14, 2024

Hi @morrownr ,

I'm not going to refer to "Allow 8821au, 8812au to enter IPS" as a fix because what it does is turn off IPS, which we want. The reason you saw me to recommend to @dubhater to turn IPS back on is because I am the only one right now trying to track this down and we need to know if others are seeing a problem. We can tell you which 3 lines to comment out so that you can continue, if necessary.

Thank you for the clarification. I understand that turning off IPS is a temporary measure to address the issue.

I understand. From a bug investigators perspective, that complicates things. While Ubuntu and the flavors do a good job of upgrading from version to version, that is still an extremely complicated thing to do and some little detail could have gone haywire. It is a situation is nearly impossible for me to reproduce. I hate to ask but could you backup your important files and do a format c: type of clean Kubuntu 24.04 installation?

Thank you for your understanding. I'm happy to try a clean installation of Kubuntu 24.04, as you suggested.

However, it might take me a month or even two to get that done. Downloading the large ISO file and installing the toolchain require a stable network connection, preferably wired. My machine is located quite far from the router, so I need to get a longer LAN cable and set everything up.

Also, reinstalling the OS and all necessary software takes time and effort, and I want to make sure I can allocate enough time for it without rushing. I hope you understand.

I'll keep you updated on my progress.

Best regards,

@morrownr
Copy link
Owner Author

@ma8ma

reinstalling the OS and all necessary software takes time and effort...

Yes, I understand this. How about you not worry about installing new for now.

I won't go into detail (it is actually kind of funny) but getting a clean installation of Kubuntu has proven to be a challenge here this week. What I finally did was install kubuntu-desktop on my clean Ubuntu installation. So far I have not been able to duplicate the problem while using the KDE desktop. It is proving to be an allusive problem. I think it is time to turn IPS back on so as to get wider testing.

Thanks for your testing and hope you can continue as you are able.

@kimocoder
Copy link

Im a bit busy with life atm, but remember that Neojou (Senior Realtek developer) left me this;

https://github.com/kimocoder/rtw88-usb

@dubhater
Copy link

@morrownr I turned on IPS again.

I will let y'all know when the code is ready for an audit. Don't look at the IQ calibration yet. :)

Untangling 8821au from 8812au is more work. I'm not too keen on it.

Upstreaming the firmware is easy. You make a patch for the linux-firmware repository and email it to Ping-Ke, who will add signed-off-by and forward it to the linux-firmware mailing list.

I've been working on the Bluetooth coexistence. I'll move on to the RTL8812AU soon.

@morrownr
Copy link
Owner Author

@dubhater

I turned on IPS again.

Thanks. I think that is the best way forward with this issue.

I will let y'all know when the code is ready for an audit. Don't look at the IQ calibration yet. :)

When you are ready, it might help if you list the files that have been added and modified for 8821a support so we are on the same sheet of music. I don't have a black belt in wireless coding but can find some things. Maybe @kimocoder could find a little time around the time you ask. I like to have others going over my work as it can be hard to see your own issues.

Untangling 8821au from 8812au is more work. I'm not too keen on it.

I get that and I was not actually pushing for a full separation at this time. I was really more looking to see if you could get things in configuration where 8821a could be upstreamed without 8812a so that 8821a could start working its way through review while we mostly switch over to working 8812au. I'm sure some 8812a code could be left in for now... or at least warn Ping-Ke that 8812a is coming soon so that he understands what the plan is. You caught me once already when I modified a link in the file that I was working on that includes the vid/pids for 8812au. I was unaware of your plan but it became obvious when I broke the driver. :-)

Upstreaming the firmware is easy. You make a patch for the linux-firmware repository and email it to Ping-Ke, who will add signed-off-by and forward it to the linux-firmware mailing list.

I'll add this to my to-do list. I just happened to think that I don't remember the location of the firmware in the vendor driver. Point me in the right direction if you don't mind.

I've been working on the Bluetooth coexistence.

How is that going? And that reminds me that we still have not found anyone using the 8821ae driver. I think you said you saw where a 8821ae card is available that would work in something you have. Do we need to need at a donation drive to fund that? ... or should ae support be removed due to apparent lack of interest?

@dubhater
Copy link

The firmware is already here: https://github.com/lwfinger/rtw88/blob/master/rtw8812a_fw.bin

The bluetooth coexistence in the 2.4 GHz band is disappointing. The official driver can do 3/5 Mbps while using the bluetooth headphones. rtw88 is just a little better. I can't watch a 1080p Youtube video like this.

I'm not 100% sure, but I'm optimistic that my laptop's BIOS would accept other wifi cards. Maybe later...

@kimocoder
Copy link

And be aware that Neojou (Senior Realtek engineer) left rtw88-usb behind, before he changed work 👍

I'll get more time soon, too much work on my private still 🤌

Here; https://github.com/kimocoder/rtw88-usb

@souperk
Copy link

souperk commented Jun 20, 2024

Not sure if you are still looking for testers, but I got an RTL8821AU adapter.

$ lsusb
TP-Link Archer T2U PLUS [RTL8821AU]
$ uname -r 
6.9.4-200.fc40.x86_64

I have had issues with aircrack repo since upgrading to kernel 6.8.10, after installing the rtw88 driver I haven't noticed any issues.

git clone https://github.com/lwfinger/rtw88.git
cd rtw88
make
sudo make install
sudo reboot
$ sudo dmesg | grep rtw
[   19.530755] rtw_core: loading out-of-tree module taints kernel.
[   19.530759] rtw_core: module verification failed: signature and/or required key missing - tainting kernel
[   19.585413] rtw_8821au 3-1:1.0: Firmware version 42.4.0, H2C version 0
[   19.849693] usbcore: registered new interface driver rtw_8821au
[   19.878718] rtw_8821au 3-1:1.0 wlp45s0f3u1: renamed from wlan0
[   29.383046] rtw_8821au 3-1:1.0: MAC has not been powered on yet
[   31.938425] rtw_8821au 3-1:1.0: rtw8821a_power_off: bailing because RTW_FLAG_POWERON
[   31.939328] rtw_8821au 3-1:1.0: MAC has not been powered on yet
[   34.532932] rtw_8821au 3-1:1.0: MAC has not been powered on yet
[   40.549185] rtw_8821au 3-1:1.0: rtw8821a_power_off: bailing because RTW_FLAG_POWERON
[   40.549812] rtw_8821au 3-1:1.0: MAC has not been powered on yet
[   43.081316] rtw_8821au 3-1:1.0: MAC has not been powered on yet

Happy to help any way I can, just give me ping. Thanks for the great driver 🙏

@morrownr
Copy link
Owner Author

morrownr commented Jun 20, 2024

Hi @souperk

Not sure if you are still looking for testers...

We need testers for this project now and hopefully also for future projects so if you have adapters based on the 8812au or 8814au, hopefully we will be testing those drivers at some point this year.

I have had issues with aircrack repo since upgrading to kernel 6.8.10...

Starting at some point with kernel 6.8, there are some things that are broken in the wireless stack regarding monitor mode. @ZerBea probably has the latest status on that.

[   19.530755] rtw_core: loading out-of-tree module taints kernel.
[   19.530759] rtw_core: module verification failed: signature and/or required key missing - tainting kernel

Those will go away once the driver is in the mainline kernel.

[   19.585413] rtw_8821au 3-1:1.0: Firmware version 42.4.0, H2C version 0
[   19.849693] usbcore: registered new interface driver rtw_8821au
[   19.878718] rtw_8821au 3-1:1.0 wlp45s0f3u1: renamed from wlan0

These are operations normal.

[   29.383046] rtw_8821au 3-1:1.0: MAC has not been powered on yet

I'm still pondering what this line is doing for us. Seems to not be any help. It would be helpful if it was telling us why something is wrong but we see it when things appear to be working well.

[   31.938425] rtw_8821au 3-1:1.0: rtw8821a_power_off: bailing because RTW_FLAG_POWERON

This is a new one for me. That begs the question: if everything is working, why are we seeing this?

If you are able to test IBSS, that would be great. We've had reports on all supported with the exception of IBSS. Of course, maybe we should consider shutting down IBSS as it does not appear to have any users these days.

Thanks for testing and reporting.

@morrownr

@morrownr
Copy link
Owner Author

morrownr commented Jun 20, 2024

@dubhater

The firmware is already here...

Yes, I was thinking of checking to make sure the one we have in rtw88 is the version in the latest 8812au repo but I seem to remember @lwfinger extracting it from there so we should be good except for getting it to Ping-Ke. I'll work on that.

The bluetooth coexistence in the 2.4 GHz band is disappointing.

You are trying to watch 1080p streaming videos with it? I can't say that this has come up in my world but that seems like a stretch for bluetooth technology. It is a little frequency hopping technology that runs around the 2.4 GHz band. I would not expect much bandwidth but then I have never pushed it or really, for that matter, have never used bluetooth that much. Have you done better with later versions of bluetooth?

I'm not 100% sure, but I'm optimistic that my laptop's BIOS would accept other wifi cards. Maybe later...

I've been doing some looking around to see what I can find regarding 2 issue we face. The results:

Should we support 8821ae? My answer at this point is no. Why? I'm not finding any strong evidence that the 8821ae was ever used much. Intel truly dominated wireless cards during the prime time that laptop makers would have been including the little cards in laptops so very small market share is probably all there would have been. When people retire laptops, they don't generally open them up and take the wireless card to save for future use and most laptops that would have had a 8821ae chip are probably retired by now. The cards might, or probably would not be something that would work in modern slots anyway. I say any effort to support 8821ae is a waste of time. I propose cleaning out any source and files supporting 8821ae and drop the support. It won't be missed.

Should we support IBSS? My answer at this point is no. I've had Realtek out-of-kernel drivers here at this site for several years and I can count how many times it has come up on 2 fingers. There does not appear to be any interest in it. In fact, Mediatek's WiFi 6 and 7 in-kernel usb drivers do not support it and I have seen exactly zero users asking for it. So, same as above, my recommendation is to turn off the capability and clean out any code that is specific to this chip.

I don't bring my ego to this forum so please, tell me what is wrong with the above recommendations if you disagree. I am looking at this and other things with an eye toward being as efficient as possible with the resources we have available. There is also the issue of future supportability for both issues.

@morrownr

@ZerBea
Copy link

ZerBea commented Jun 20, 2024

@morrownr , starting with kernel 6.9.5 mac80211 has been fixed an I closed the report:
https://bugzilla.kernel.org/show_bug.cgi?id=218884#c20

@dubhater
Copy link

@morrownr rtw8812a_fw.bin came from your 8812au-20210820.

I don't know if it's because of the newer bluetooth standard (5.0 versus 4.0) or because they put more effort into the driver, but the internal RTL8822CE works much better than RTL8821AU when I use the bluetooth headphones.

I agree about RTL8821AE. It's already supported by rtlwifi, so we don't need to put effort into accommodating it in rtw88.

As for IBSS mode, it probably works if AP mode works. I say we leave it alone because removing it is an extra patch to send upstream. All the logic is in the common parts of rtw88.

@morrownr
Copy link
Owner Author

As for IBSS mode, it probably works if AP mode works. I say we leave it alone because removing it is an extra patch to send upstream. All the logic is in the common parts of rtw88.

AP mode is working very well. I gave it an extended test and could find nothing other than lack of DFS support but that is the norm with usb adapters so I'll mark IBSS off my list of things to worry about.

I agree about RTL8821AE. It's already supported by rtlwifi, so we don't need to put effort into accommodating it in rtw88.

That means rtw8821ae.c should be deleted and maybe some cleanup work, right?

I don't know if it's because of the newer bluetooth standard (5.0 versus 4.0) or because they put more effort into the driver, but the internal RTL8822CE works much better than RTL8821AU when I use the bluetooth headphones.

Maybe someone with more experience with bluetooth will come along and shine some light on this.

rtw8812a_fw.bin came from your 8812au-20210820

Okay, good.

Is there anything that you want me working on?

@bugaevc
Copy link

bugaevc commented Jun 22, 2024

Hi there, I just bought myself a TP-Link Archer T2U PLUS [RTL8821AU] (as lsusb reports it). Running Fedora Linux 40, 6.9.5-200.fc40.x86_64, gcc version 14.1.1 20240607 (Red Hat 14.1.1-5) (GCC).

Built https://github.com/lwfinger/rtw88 (it built cleanly with no warnings), the compilation flags were apparently:

GNU C11 14.1.1 20240607 (Red Hat 14.1.1-5) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -mindirect-branch=thunk-extern -mindirect-branch-register -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -mharden-sls=all -mrecord-mcount -mfentry -march=x86-64 -g -O2 -O2 -std=gnu11 -p -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -fcf-protection=branch -falign-jumps=1 -falign-loops=1 -fno-asynchronous-unwind-tables -fno-jump-tables -fpatchable-function-entry=16,16 -fno-delete-null-pointer-checks -fno-allow-store-data-races -fstack-protector-strong -ftrivial-auto-var-init=zero -fno-stack-clash-protection -fmin-function-alignment=16 -fstrict-flex-arrays=3 -fno-strict-overflow -fstack-check=no -fconserve-stack -fsanitize=bounds-strict -fsanitize=shift

After modprobeing, it picked up the Wi-Fi adapter, and I was able to connect to a Wi-Fi 5 (no idea what "Wi-Fi 5" is or does) network.

Seeing this in the logs:

NetworkManager[891]: <info>  [1719049225.2065] device (wlp0s26u1u3): set-hw-addr: set-cloned MAC address to B6:06:AD:B0:00:DB (stable-ssid)
kernel: rtw_8821au 2-1.3:1.0: rtw8821a_power_off: bailing because RTW_FLAG_POWERON
kernel: rtw_8821au 2-1.3:1.0: MAC has not been powered on yet

I'm not seeing anything bluetooth-related appear, but perhaps I don't know where to look for it.

Please let me know what sort of tests / checks / benchmarks I can run that would be useful to you.

@morrownr
Copy link
Owner Author

Hi @bugaevc

I'm not seeing anything bluetooth-related appear, but perhaps I don't know where to look for it.

I just took a stroll by TP-Link's site to read what they say about the TP-Link Archer T2U PLUS. There was no mention of bluetooth capability. I also did some quick and dirty searching and I think this adapter is wifi only which means it is actually using the RTL8811AU chip. This driver works for both chips.

Please let me know what sort of tests / checks / benchmarks I can run that would be useful...

Mostly just use it and see if anything undesirable comes up. If you want to do something that may take some of your time, we could certainly use a test report on IBSS mode. Thanks for testing.

@dubhater

I curious as to your thoughts on the below lines in the log:

kernel: rtw_8821au 2-1.3:1.0: rtw8821a_power_off: bailing because RTW_FLAG_POWERON
kernel: rtw_8821au 2-1.3:1.0: MAC has not been powered on yet

@dubhater
Copy link

I pushed some more stuff:

  • Bluetooth coexistence for RTL8821AU.
  • RTL8812AU is ready for testing. It still can't do AP mode or power saving.
  • USB 3 support. Please test with RTL8822CU, RTL8822BU, RTL8812AU, both in USB 3 ports and USB 2 ports. Even USB 1.x if you have them.

@morrownr
Copy link
Owner Author

@dubhater

Thank you so much for your hard work.

RTL8812AU is ready for testing. It still can't do AP mode or power saving.

I will create a new Project issue in the 8812au repo so as to gain testers and keep 8812au stuff in one place:

Title: Project: Add 8812au rtw88 in-kernel driver. Need testers...

Should I also add a Project issue to the 88x2bu repo so as to attract testers that have the 8822/12bu?

@dubhater
Copy link

I curious as to your thoughts on the below lines in the log:

kernel: rtw_8821au 2-1.3:1.0: rtw8821a_power_off: bailing because RTW_FLAG_POWERON
kernel: rtw_8821au 2-1.3:1.0: MAC has not been powered on yet

I'm not sure. Maybe rtw8821a_power_off is being called twice in a row somehow? I added some debugging messages which may help us understand what is going on. Anyone who saw "bailing because RTW_FLAG_POWERON" should load rtw_core with the parameter "debug_mask=0x80000000" to enable the new messages.

Should I also add a Project issue to the 88x2bu repo so as to attract testers that have the 8822/12bu?

Yes, it would be good to have more people test the USB 3 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests