Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Fallback to generic wifi firmware (rtl8192cu to rtl8xxxu)

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
maja_ldm
Posts: 12
Joined: 2013-02-22 15:19

Fallback to generic wifi firmware (rtl8192cu to rtl8xxxu)

#1 Post by maja_ldm »

I'm currently using rtl8192cu wireless firmware from the non-free package "firmware-realtek_20161130-4_all.deb" and I'm having an unusual bandwidth (speed benchmarks giving me a 250kbps download speed and a 5mps upload speed while a Windows installation on the same machine gets 25mps downloads). I also tried the newer "firmware-realtek_20180825+dfsg-1~bpo9+1_all.deb" but download speeds were even slower.

I read here (https://askubuntu.com/questions/936987/ ... in-windows) that falling back to rtl8xxxu can help with this problem and I believe I'd be better off with that as I didn't provide the proprietary firmware for the net install of Debian and the download speed was normal at that time.

I can't find the generic firmware listed in the output of 'lsmod | grep rtl' and I lose all internet connections if I blacklist the proprietary ones. The only place where I can find a download for rtl8xxxu are the linux github (https://github.com/torvalds/linux/tree/ ... k/rtl8xxxu) and a fork that includes an hard-coded reference to firmware for a different device (https://github.com/johnheenan/rtl8xxxu).

What is the correct way to obtain, install and load generic firmware from the main Linux repository? Am I supposed to just download and build the c files from the official repository?
Last edited by maja_ldm on 2019-01-05 10:24, edited 2 times in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Fallback to the generic wifi drivers (rtl8192cu to rtl8x

#2 Post by Head_on_a_Stick »

Try disabling powersaving with the standard driver first:

Code: Select all

# iw dev $interface set power_save off
Replace $interface with the actual name of the interface.

Does that help?

If that doesn't help you could try a patched version of the driver:

https://github.com/Rick-Moba/rtl8192cu
deadbang

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Fallback to the generic wifi drivers (rtl8192cu to rtl8x

#3 Post by sunrat »

You are confusing drivers with firmware, they are not the same. Drivers are kernel modules whereas firmware is tiny code loaded on the device usually at boot time.
Tell us what the device is from lsusb or lspci.
Tell us what driver is loaded;

Code: Select all

lsmod |grep rtl
The advice from Head_on_a_Stick should be helpful. I suspect you will have to build the driver from the Github link he gave.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

maja_ldm
Posts: 12
Joined: 2013-02-22 15:19

Re: Fallback to the generic wifi drivers (rtl8192cu to rtl8x

#4 Post by maja_ldm »

I tried to diable "power saving", without results. As a side note, the machine has dual boot with Windows 10, if I leave Windows in a hybernated state the download speed on Debian reaches 10mbps (against Windows's 20 mbps and Debian's 250kbps when Windows is shut off properly).

About the repackaging, I'm not really sure what do with it, is the following procedure correct?

Code: Select all

sudo dkms add ./rtl8192cu
sudo dkms install 8192cu
sudo depmod -a

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Fallback to the generic wifi drivers (rtl8192cu to rtl8x

#5 Post by bw123 »

...What is the correct way to obtain, install and load generic drivers from the main Linux repository? Am I supposed to just download and build the c files from the official repository?
The way I understand it, the correct way is to use the latest stable kernel that supports a device. Since Linus has it in git, it's probably in the kernel so you don't have to install anything except the correct kernel, and any separate firmware.

Like sunrat said, if you ID the device maybe someone will know about it or look it up for you.

The debian wiki might have it listed, but I'm tired of looking things up, and it's hard without the correct device ID.
resigned by AI ChatGPT

maja_ldm
Posts: 12
Joined: 2013-02-22 15:19

Re: Fallback to the generic wifi drivers (rtl8192cu to rtl8x

#6 Post by maja_ldm »

bw123 wrote: Like sunrat said, if you ID the device maybe someone will know about it or look it up for you.
The debian wiki might have it listed, but I'm tired of looking things up, and it's hard without the correct device ID.
The name of the device is: D-Link Corp. DWA-121 802.11n Wireless N 150 Pico Adapter [Realtek RTL8188CUS]. It is part of a series of notoriously problematic devices (https://unix.stackexchange.com/a/252215/81083) and the Debian wiki suggests to use the non-free firmware-realtek package, which is what I'm already using.
bw123 wrote: Since Linus has it in git, it's probably in the kernel so you don't have to install anything except the correct kernel, and any separate firmware.
My doubts stem from the fact that the generic firmware uploaded on torvald's github is not listed in the output of lsmod, which really makes my problem one of:
  • a) How do I use a driver that is not loaded by default by the system? (if the driver is already installed)
    b) How do I install drivers from a github? Do I use dkms? How do I use it? (if I need to compile either torvald's or a repackaging)
As a sidenote I also tried to add the following line to /etc/modprobe.d/rtl8192cu.conf but didn't get any visible result:

Code: Select all

options rtl8192cu  rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1
Last edited by maja_ldm on 2019-01-05 10:25, edited 1 time in total.

maja_ldm
Posts: 12
Joined: 2013-02-22 15:19

Re: Fallback to the generic wifi drivers (rtl8192cu to rtl8x

#7 Post by maja_ldm »

sunrat wrote: You are confusing drivers with firmware, they are not the same. Drivers are kernel modules whereas firmware is tiny code loaded on the device usually at boot time.
This explains why the device downloads at a faster speed if Windows is an an hybernated state.. I'll correct the thread. Someone on the unix stackexchange suggested that I might also look into getting the Windows supplied firmware and try to make it work with Debian, but I'm not sure hopw this would bes possible

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Fallback to the generic wifi drivers (rtl8192cu to rtl8x

#8 Post by Head_on_a_Stick »

maja_ldm wrote:How do I use a driver that is not loaded by default by the system? (if the driver is already installed)
Add the name of the kernel module to /etc/modules (or in a file under /etc/modules-load.d/) to force the driver to load.

It should be loaded automatically by udev once the device is detected though.
maja_ldm wrote:How do I install drivers from a github?

Code: Select all

git clone https://github.com/Rick-Moba/rtl8192cu
cd rtl8192cu
make -j99
# make install
deadbang

maja_ldm
Posts: 12
Joined: 2013-02-22 15:19

Re: Fallback to the generic wifi drivers (rtl8192cu to rtl8x

#9 Post by maja_ldm »

Head_on_a_Stick wrote: Add the name of the kernel module to /etc/modules (or in a file under /etc/modules-load.d/) to force the driver to load.
Explicitely loading the module worked.

I proceeded to do some benchmarking with speedtest.net using different configurations of firmware. I don't know what's going on on my computer, but after trying to use Debian with Windows hybernated (getting the same high download speeds, as expected) and then shutting off Windows and testing Debian again, the download speed under Debian is now better then on Windows (and similar to the download speed obtained on a different machine with another receiver). I don't even know if the "iw dev $interface set power_save off" rule is still in place after all this removing and reinstalling (I guess it is since it was set to the interface id).

As far as the original question went, I'll consider "add the name of the kernel module to /etc/modules" as the proper answer, with a conditional "reinstall the linux kernel" as a solution if for some reason that doesn't work.

As far this receiver is concerned, I expect it to just be unstable and unreliable and I'll switch to ethernet as soon as I can.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Fallback to the generic wifi drivers (rtl8192cu to rtl8x

#10 Post by Head_on_a_Stick »

maja_ldm wrote:I don't even know if the "iw dev $interface set power_save off" rule is still in place after all this removing and reinstalling
No, the `iw` command only lasts until the machine is rebooted, you need a udev rule to apply the command automatically on every boot.

Use this example but reverse the setting (obviously):

https://wiki.archlinux.org/index.php/Po ... interfaces
deadbang

maja_ldm
Posts: 12
Joined: 2013-02-22 15:19

Re: Fallback to generic wifi firmware (rtl8192cu to rtl8xxxu

#11 Post by maja_ldm »

I've been through several reboots now and the download speed is still how it should be. When I'll experience problems in the future I'll go back to try and tweak the firmware at that time.

Post Reply