libc0607 / rtl88x2eu-20230815

Linux Driver for WiFi Adapters that are based on the RTL8812EU and RTL8822EU Chipsets with packet injection patch- v5.15.0.1
29 stars 17 forks source link

Injection instability on 40MHz channels #7

Open svpcom opened 1 month ago

svpcom commented 1 month ago

When I try to inject 4 mbit/s stream MCS1 using 40 MHz channel then card became periodically stall injection which leads to massive packet dropoff on RX side. The same injection on 20 MHz channel or using 8812au card @40MHz works fine. Receiving the same stream (generated by 8812au card) works without problem, so it seems this is TX-only issue

snokvist commented 1 month ago

I have the same issue, tried a multitude of settings with the same results.

libc0607 commented 1 month ago

Do you have any clue on why that happened? I can't 100% reproduce that, but it does happen sometimes...

I tended to conclude that it was some interference (as in a wider band there's a higher chance), but that could be wrong and it's a bug somewhere...?

svpcom commented 1 month ago

@libc0607 This only happened when sufficient amount of traffic exists. I.e. if I'll transmit separate packets it will not happened. I have no idea how to debug it - only to compare some pieces of code with 8812au driver (it doesn't have such problem)

svpcom commented 1 month ago

test video pipeline to reproduce:

gst-launch-1.0 videotestsrc is-live=true ! 'video/x-raw,format=I420,width=1920,height=1080,framerate=30/1' ! clockoverlay halignment=right valignment=top text=src ! x264enc tune=zerolatency bitrate=4000 intra-refresh=true ! rtph264pay aggregate-mode=zero-latency mtu=1400 config-interval=1 ! udpsink host=127.0.0.1 port=5602 sync=false

test hw setup: x86 laptop with 8812eu (wlan1) and 8812au (wlan2) wifibroadcast.cfg

[common]
wifi_channel = 149
wifi_txpower = {'wlan1': 100, 'wlan2': -100}

[base]
bandwidth = 40
mcs_index = 1
use_qdisc = True

wfb-ng config:

  1. wfb-server --profiles drone --wlan wlan1
  2. wfb-server --profiles gs --wlan wlan2

modprobe config

# blacklist stock module
blacklist 88XXau
blacklist 8812au
options cfg80211 ieee80211_regdom=RU
options 88XXau_wfb rtw_tx_pwr_idx_override=1
options 8812eu rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0
libc0607 commented 2 weeks ago

Still can't reproduce. So don't know what's going on :( Tried the above with 2 8812eu several times, with enough traffic...

I haven't touched anything about 40MHz yet, could that be some bug by Realtek?

svpcom commented 2 weeks ago

@libc0607 I'm unable to reproduce it exactly, but when I run python3 -m wfb_ng.latency_test 5602 5600 1500 2000 over wfb-ng standard video link channel with 40Mhz bw (mcs1, fec 8/12, bw 40) then if 8812au tx and 8812eu rx I get stable 13 mbit/s bitrate with latency < 5ms. If 8812eu tx and 8812au rx then latency can be very worse and bitrate with < 5ms latency will be from: 3 mbit/s to 12 mbit/s during several consequent runs. No such problem with dual 8812au cards or with 8812eu cards at 20MHz bw.

svpcom commented 2 weeks ago

@libc0607 how to reproduce:

  1. connect 8812au as wlan1 and 8812eu as wlan2 to PC
  2. Add to /etc/wifibroadcast.cfg
    
    [common]
    wifi_txpower = {'wlan1': -100, 'wlan2': 100}  # set min power to both cards
    wifi_channel = 161

[base] force_vht = False bandwidth = 40 mcs_index = 1 use_qdisc = True

3. Run `sudo wfb-server --profiles drone --wlans wlan2`  # 8812eu will tx
4. Run `sudo wfb-server --profiles gs --wlans wlan1` # 8812au will rx
5. Run `sudo wfb-test-latency 5602 5600 1500 2000`   # start test with initial pkt rate 2000 pkt/s with 1500 bytes packets

Also it is interesting that even with 20MHz channel eu -> au produce max 6.8 mbit/s and au -> eu 7.4 mbit/s

svpcom commented 2 weeks ago

P.S. All bitrate are with 8/12 FEC overhead - raw bitrates will be 1.5x faster

svpcom commented 2 weeks ago

8812au card(s) in test above are alfa awus036ach connected to usb3 ports. There were tests:

  1. au -> au
  2. au -> eu
  3. eu -> au
libc0607 commented 2 days ago

I've tested 40MHz on 8812au, 8812cu, 8812eu, and 8733bu respectively, only 8812au and 8733bu seem to be performing good...

Considering that these drivers are all just filling 40MHz to TXDESC (especially 8812cu/eu/8733bu, their drivers are really similar, just string replacements), and not touching anything else related to 40mhz, I'd like to say the difference is in firmware/hardware...

waterfall plot: 8812au, seems pretty good: 9b3daf0e738bbc0f07ba16d8a4320a7

8733bu, good too: 7b05485915ee19cb137c527941ae709

8812eu, with occasionally stuck: 92506a318b1fa163d5d855ad8cb8b88

8812cu, barely usable: 7f0a692953203456b2a8f379d06efb5

(Why does realtek make tons of chip designs, but all of them have different bugs and none of them is perfect...

svpcom commented 2 days ago

@libc0607 Is it a test mode (when it internally transmit continuous signal) or you try to feed max possible packet rate?

libc0607 commented 1 day ago

@libc0607 Is it a test mode (when it internally transmit continuous signal) or you try to feed max possible packet rate?

filled wfb_tx with random data to the maximum rate. haven't tested the internal mode yet

libc0607 commented 3 hours ago

Found the 8812cu MP toolkit, and tried 40MHz "Packet TX" mode
the spectrum seems solid, and the packet can be received & decoded

image

So the good news is at least jaguar3 hardware can work with 40MHz injection. Gonna find out what's happening