Realtek RTL8188EUS Wifi Adapter on Rock64 not detected

  • I have a rock64 box with Libreelec 11.0.1.

    I plugged in an usb Wifi adapter

    Bus 004 Device 002: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter

    but it seems that libreelec on the Rock64 device does not recognize the stick:

    rock64:~ # iw list

    rock64:~ #

    Complete dmesg output:

    http://ix.io/4sBb


    The module seems from staging, but since I got it from pine64, I was expecting that it has at least basic Linux support:

    [ 8.281405] r8188eu: module is from the staging directory, the quality is unknown, you have been warned.

    And it is loaded, output of lsmod

    http://ix.io/4sBd

    The USB wifi adapter connects flawless on a Debian stable system on x86. I see there that firmware gets loaded:

    [428204.016092] r8188eu 1-8:1.0: firmware: direct-loading firmware rtlwifi/rtl8188eufw.bin

    I copied the FW from the Debian system to the rock64 box with libreelec 11.0.1

    rd@h370:/lib/firmware$ scp -r rtlwifi root@rock64-wlan:/storage/.config/firmware


    but this did not change anything.

    Does anybody have a suggestion what might have gone wrong?

    Thanks

    Rainer

  • "lsusb" reports whatever is connected to the bus, it has zero meaning for the device being probed and working. The staging driver is enabled with `"CONFIG_R8188EU=m" in the RK3328 kernel config and it appears to result in the module loading (as you found) but then nothing. I would expect to see the firmware loading and such. Are Debian using the staging driver or the vendor driver? (the module might be the same name but could would be completely different). Are Debian using any patches?

  • On the Debian system FW gets indeed loaded, therefore I copied it to the libreelec system. The license of the driver is GPL on the Debian system, so I assume it is not a vendor driver (which in addition would be very surprising for me, if Debian would ship vendor drivers in its main repo).

    Output of modinfo r8188eu on the Debian system

    debian Pastezone

    In there it is reported that the driver in Debian is also from staging:

    staging: Y

    Sources of this kernel can be found here:

    Folder: 5.10.162-1 | Debian Sources

    Sources of the driver in there

    Folder: rtlwifi | Debian Sources

    Kernel config here:

    https://bokomoko.de/~rd/Debian/config-5.10.0-21-amd64

    I will update that system in the next days to Debian testing, which will come with Kernel 6.1 as well. But I would expect that wifi USB adapter still works flawless there.

    Edited once, last by rdorsch (April 4, 2023 at 6:39 PM).

  • This is modinfo from the Linux 6.2 staging driver: http://ix.io/4sGP .. so Debian is using the older vendor driver (which is GPL code, but not upstream code). There is probably a way to put the driver into debug to get more info from it.

  • Interesting, do I get that right that there are two drivers in staging for this USB adapter? A working one from Realtek and a non-working one from Jes Sorensen <[email protected]> ?

    Debian testing (bookworm, upcoming Debian 12) ships a working driver with kernel 6.1:

  • Interesting, do I get that right that there are two drivers in staging for this USB adapter? A working one from Realtek and a non-working one from Jes Sorensen?

    Not correct. Debian is building with the older vendor driver, the staging driver is not enabled in their kernel. LE is building without the vendor driver, and with the staging driver enabled. However, staging = experimental drivers that are still in actively development and/or not feature complete enough to exit staging and be included in the main kernel tree. So the staging driver could be 95% complete or .. 55% with lots still to work on (and I have no idea which).

    I'd expect Debian to have a policy of only enabling finished drivers (makes sense for a large distro) and you wouldn't enable both as that will cause conflicts. LE is happy to enable the staging driver(s) as we aren't including the vendor ones (on principle; they break often) so there is no change of conflict .. and if it happens to work that's great.

  • That's more complex than I thought or I don't know enough to understand it:

    • Both drivers are under the GPL.
    • The Debian driver has these items in modinfo
      • version: v4.1.4_6773.20130222 (entry is missing in kernel 6.1)
      • author: Realtek Semiconductor Corp.
      • description: Realtek Wireless Lan Driver
      • license: GPL
      • staging: Y
      • retpoline: Y
      • intree: Y
      • name: r8188eu
    • The libreelec driver has these items in modinfo
      • license: GPL
      • description: RTL8XXXu USB mac80211 Wireless LAN Driver
      • author: Jes Sorensen <[email protected]>
      • intree: Y
      • name: rtl8xxxu

    What I don't understand:

    • Both drivers are GPL, why are there two drivers and what is the benefit of the rtl8xxxu driver?
    • According to modinfo and the Debian kernel package, the Debian module is from staging:
      rd@h370:/lib/modules/5.10.0-21-amd64$ find -name r8188eu.ko

      ./kernel/drivers/staging/rtl8188eu/r8188eu.ko
      rd@h370:/lib/modules/5.10.0-21-amd64$ dpkg -S /lib/modules/5.10.0-21-amd64/kernel/drivers/staging/rtl8188eu/r8188eu.ko
      linux-image-5.10.0-21-amd64: /lib/modules/5.10.0-21-amd64/kernel/drivers/staging/rtl8188eu/r8188eu.ko
      rd@h370:/lib/modules/5.10.0-21-amd64$

      This rather seems to be that Debian is enabling staging whereas libreelec has just the intree module, correct?
  • On the negative: Realtek maintains a driver fork for each chipset variant they shipped despite the differences between variants in the same family often being very minor, and they breed new variants like rabbits so there are probably 30+ drivers in circulation. Realtek only releases their drivers to their paying-for-support customers (end-users are not their customers) so end-users have to rely on board/device vendors sharing them; over time things generally leak to GitHub but it results in 500+ repos with slightly different versions of the same "posted once and never updated again" driver being available to confuse people. There is a large amount of common boilerplate/duplicated code in each vendor driver, and while the vendor drivers generally work okay the overall code quality is low as the drivers have never been subjected to any serious peer review during development. Frequent minor changes to upstream kernel frameworks frequently result in all the drivers breaking and needing to be patched so the drivers are a pain in the arse to maintain over time. The fact the drivers are released with a GPL license is good, but that's about the only good thing to report. Distro maintainers loathe these drivers.

    On the positive: Realtek have finally embraced upstreaming their drivers and are now contributing-to and maintaining a single driver per chip family. However their primary interest is in PCI/USB drivers and the SDIO ones are often forgotten, and this is a relatively recent development so they are only investing time/effort into the latest chipsets that nobody is really using yet, not the older chipsets that are endemic. They do comment on patches for older chipsets/drivers when asked, but community developers are the primary source of development for the older chipsets. So future support looks better, but support for everything shipped in the last decade is still a bit sucky.

    I'm not sure why the Realtek driver is flagged as staging in Debian (something for Debian maintainers to explain) but I am 100% confident this is the legacy Realtek vendor driver and not the upstream kernel staging driver.

  • Just stumbled across this thread after upgrading LibreELEC from 10.0.4 to 11.0.1 on my Raspberry Pi 2. After the upgrade my wifi was gone

    Code
    LibreELEC:~ # lsusb
    Bus 001 Device 006: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter

    chewitt Just noticed that your link (http://ix.io/4sGP) doesn't contain an alias for above mentioned wifi adapter. Could you maybe have a look why it seems to have vanished from 10.0.4 to 11.x?

    Thanks in advance and kind regards :)

  • Alright, got it working by building latest master (commit d43e1a4d9222a949a346f23779c547f7e1208c43) of LibreELEC with following patch in order to get kernel 6.4.0-rc4 which provides working wifi out of the box

  • m68k yeah I'm running a self-built version of LE12 with a newer kernel. Actually haven't tried doing a custom build of LE11 with kernel 6.4.x

    Anyways it looks like kernel 6.4.x is the actual solution to get wifi working again because it comes with proper WiFi drivers for RTL8188EUS.