pgj / freebsd-wifibox

wifibox: Use Linux to drive your wireless card on FreeBSD
BSD 2-Clause "Simplified" License
171 stars 12 forks source link

Packet Loss with RTL8723DE #61

Open venoom27 opened 1 year ago

venoom27 commented 1 year ago

Description

I installed both the stable version then tried the dev port LTS version and I am keep getting packet loss to the point that it almost is impossible to use.

wifibox:~# ping www.google.com
PING www.google.com (142.251.16.104): 56 data bytes
64 bytes from 142.251.16.104: seq=0 ttl=103 time=20.266 ms
64 bytes from 142.251.16.104: seq=1 ttl=103 time=19.769 ms
64 bytes from 142.251.16.104: seq=2 ttl=103 time=18.544 ms
64 bytes from 142.251.16.104: seq=3 ttl=103 time=20.402 ms
64 bytes from 142.251.16.104: seq=4 ttl=103 time=20.658 ms
64 bytes from 142.251.16.104: seq=5 ttl=103 time=101.747 ms
64 bytes from 142.251.16.104: seq=6 ttl=103 time=19.701 ms
64 bytes from 142.251.16.104: seq=7 ttl=103 time=18.706 ms
64 bytes from 142.251.16.104: seq=33 ttl=103 time=495.874 ms
64 bytes from 142.251.16.104: seq=34 ttl=103 time=72.070 ms
64 bytes from 142.251.16.104: seq=35 ttl=103 time=19.509 ms
^C
--- www.google.com ping statistics ---
36 packets transmitted, 11 packets received, 69% packet loss
round-trip min/avg/max = 18.544/75.204/495.874 ms

Host operating system

Output of `uname -a`.
FreeBSD 13.2-RELEASE-p2 GENERIC amd64

Wireless NIC

Relevant output of `pciconf -lv`.
ppt0@pci0:2:0:0:        class=0x028000 rev=0x00 hdr=0x00 vendor=0x10ec device=0xd723 subvendor=0x103c subdevice=0x8319
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8723DE 802.11b/g/n PCIe Adapter'
    class      = network

Wifibox version

Output of `wifibox version`.  Note that only the latest version is supported.
wifibox version 0.11.0

Disk image type and version

The kind of VM image in use, e.g. Wifibox/Alpine, and its version. wifibox-alpine-20230810

config options selected

FW_RTW88
FW_RT89
FW_RTLWIFI
KERN_LTS
COMP_XZ
UDS_PASSTHRU
APP_WPA_SUPPLICANT

Wifibox-core-0.11.0

RECOVER_RESTART_VMM

Changes to the default configuration files

Include relevant sections from all the configuration files that contain local changes and may help to reproduce the problem.

All default setting but for setting pci passthru=2/0/0

/etc/rc.conf

devmatch_enable="YES"
devmatch_blacklist="if_rtw88"
wifibox_enable="YES"
ifconfig_wifibox0="SYNCDHCP"
background_dhclient_wifibox0="YES"
defaultroute_delay="0"

Logs

Please copy and paste any relevant log output from the following sources:

- /var/log/wifibox.log (with DEBUG logging verbosity)

- /var/run/wifibox/appliance/log/dmesg

[    0.722230] Run /sbin/init as init process
[    0.722939]   with arguments:
[    0.722939]     /sbin/init
[    0.722940]   with environment:
[    0.722941]     HOME=/
[    0.722942]     TERM=linux
[    0.722943]     BOOT_IMAGE=(host)/usr/local/share/wifibox/vmlinuz
[    0.722943]     modules=squashfs
[    0.990007] rtw_8723de 0000:00:06.0: can't derive routing for PCI INT A
[    0.990010] rtw_8723de 0000:00:06.0: PCI INT A: no GSI
[    1.001004] rtw_8723de 0000:00:06.0: Firmware version 48.0.0, H2C version 0

- /var/run/wifibox/appliance/log/messages

Aug 17 21:32:50 wifibox syslog.info syslogd started: BusyBox v1.36.1
Aug 17 21:32:50 wifibox daemon.info supervise-daemon[767]: Supervisor command line: supervise-daemon wpa_supplicant --start --respawn-delay 2 --respawn-max 5 --respawn-period 1800 /sbin/wpa_supplicant -- -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf 
Aug 17 21:32:50 wifibox daemon.info supervise-daemon[771]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf 
Aug 17 21:32:56 wifibox daemon.info supervise-daemon[929]: Supervisor command line: supervise-daemon uds_passthru --start --respawn-delay 2 --respawn-max 5 --respawn-period 1800 /sbin/uds_passthru -- 
Aug 17 21:32:56 wifibox daemon.info supervise-daemon[933]: Child command line: /sbin/uds_passthru 
Aug 17 21:32:56 wifibox daemon.info : starting pid 936, tty '': '/sbin/openrc default'
Aug 17 21:32:56 wifibox daemon.debug uds_passthru[933]: Configuration: network=10.0.0.1:255.255.255.0, sockets=[path=/var/run/wpa_supplicant/wlan0,user=root,group=0,mode=770,port=1200 path=/var/run/wpa_supplicant/p2p-dev-wlan0,user=root,group=0,mode=770,port=1201]
Aug 17 21:32:56 wifibox daemon.warn uds_passthru[933]: /var/run/wpa_supplicant/wlan0 is not available, skipping.
Aug 17 21:32:56 wifibox daemon.warn uds_passthru[933]: /var/run/wpa_supplicant/p2p-dev-wlan0 is not available, skipping.
Aug 17 21:32:56 wifibox daemon.info uds_passthru[933]: Waiting for PID 943 to stop.
Aug 17 21:32:56 wifibox cron.info crond[988]: crond (busybox 1.36.1) started, log level 8
Aug 17 21:32:56 wifibox daemon.info udhcpd[1042]: started, v1.36.1
Aug 17 21:32:56 wifibox daemon.err udhcpd[1042]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Aug 17 21:32:56 wifibox daemon.info : starting pid 1049, tty '/dev/ttyS0': '/sbin/getty -L ttyS0 115200 vt100'
Aug 17 21:33:02 wifibox daemon.info udhcpd[1042]: sending OFFER to 10.0.0.2
Aug 17 21:33:05 wifibox daemon.info udhcpd[1042]: sending ACK to 10.0.0.2
Aug 17 21:33:58 wifibox auth.info login[1049]: root login on 'ttyS0'
Aug 17 21:45:00 wifibox cron.info crond[988]: USER root pid 1064 cmd run-parts /etc/periodic/15min

Additional context

Add any other context about the problem here that might help the investigation.

I am able to use the same hardware on Arch Linux when I dual boot with no drop out issues. I have also had the same kind of issues with a Macbook pro that I already been working through with support on. https://github.com/pgj/freebsd-wifibox/issues/38

Have you tried to turn it on and off?

pgj commented 1 year ago

Hi, thanks for the report! I think the FW_RTW89 option is not needed: this driver can only work with Realtek 8852AE, 8851BE, 8852BE, and 8852CE. Ideally, it should not be loaded but it is worth to check. At the same time, I noticed you had to blacklist the if_rtw88 (FreeBSD) driver from the host -- there is a slight chance that there is interference still and it is worth to check if that is not loaded either. However, based on its man page, it cannot handle this specific model.

What does lsmod say on wifibox console (inside the guest)?

pgj commented 1 year ago

Hrm, looks like Arch Linux has a specific rtw88 driver (a sibling of rtw89) and does not use the one shipped with the vanilla kernel. Realtek's own drivers is known to be unreliable and of low performance. I will port this package and get back with the wifibox-alpine version that you can test.

pgj commented 1 year ago

I have added the rtw88 driver for wifibox-alpine that could be enabled by the FW_RTW88 configuration option. This is version 20230820 that can be found in the dev branch of the pgj/freebsd-wifibox-port repository.

venoom27 commented 1 year ago

I installed wifibox-alpine-20230820 with UDS_PASSTHRU, RW_RTW88, KERN_LTS. COMP_XZ, and APP_WPA_SUPPLICANT selected. I am still getting packet lost.

wifibox:~# ping www.google.com
PING www.google.com (172.253.62.103): 56 data bytes
64 bytes from 172.253.62.103: seq=0 ttl=104 time=19.925 ms
64 bytes from 172.253.62.103: seq=1 ttl=104 time=21.201 ms
64 bytes from 172.253.62.103: seq=2 ttl=104 time=182.102 ms
64 bytes from 172.253.62.103: seq=23 ttl=104 time=771.687 ms
64 bytes from 172.253.62.103: seq=24 ttl=104 time=92.161 ms
64 bytes from 172.253.62.103: seq=25 ttl=104 time=16.242 ms
64 bytes from 172.253.62.103: seq=26 ttl=104 time=15.035 ms
64 bytes from 172.253.62.103: seq=27 ttl=104 time=23.029 ms
64 bytes from 172.253.62.103: seq=28 ttl=104 time=53.374 ms
64 bytes from 172.253.62.103: seq=29 ttl=104 time=65.433 ms
64 bytes from 172.253.62.103: seq=30 ttl=104 time=23.593 ms
64 bytes from 172.253.62.103: seq=31 ttl=104 time=32.064 ms
64 bytes from 172.253.62.103: seq=32 ttl=104 time=30.643 ms
64 bytes from 172.253.62.103: seq=33 ttl=104 time=182.652 ms
64 bytes from 172.253.62.103: seq=34 ttl=104 time=50.970 ms
64 bytes from 172.253.62.103: seq=35 ttl=104 time=14.300 ms
64 bytes from 172.253.62.103: seq=36 ttl=104 time=15.080 ms
64 bytes from 172.253.62.103: seq=37 ttl=104 time=14.693 ms
64 bytes from 172.253.62.103: seq=38 ttl=104 time=15.888 ms
64 bytes from 172.253.62.103: seq=39 ttl=104 time=128.183 ms
^C
--- www.google.com ping statistics ---
40 packets transmitted, 20 packets received, 50% packet loss
round-trip min/avg/max = 14.300/88.412/771.687 ms
pgj commented 1 year ago

That is sad. Could you please include the uname -a output from the guest? But it looks like we will need to get through the "vanilla Arch Linux as a guest" experiment (as it was sketched in #58) to make it sure that the problem is not due to the underlying virtualization and the host OS.