Fallback to generic wifi firmware (rtl8192cu to rtl8xxxu)

New to Debian (Or Linux in general)? Ask your questions here!

Fallback to generic wifi firmware (rtl8192cu to rtl8xxxu)

Postby maja_ldm » 2019-01-01 22:55

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.
maja_ldm
 
Posts: 12
Joined: 2013-02-22 15:19

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

Postby Head_on_a_Stick » 2019-01-02 09:39

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
User avatar
Head_on_a_Stick
 
Posts: 10377
Joined: 2014-06-01 17:46
Location: /dev/chair

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

Postby sunrat » 2019-01-02 22:26

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!
User avatar
sunrat
 
Posts: 2796
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

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

Postby maja_ldm » 2019-01-05 03:21

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
maja_ldm
 
Posts: 12
Joined: 2013-02-22 15:19

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

Postby bw123 » 2019-01-05 05:34

...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.
User avatar
bw123
 
Posts: 3787
Joined: 2011-05-09 06:02

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

Postby maja_ldm » 2019-01-05 10:13

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

Postby maja_ldm » 2019-01-05 10:19

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
maja_ldm
 
Posts: 12
Joined: 2013-02-22 15:19

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

Postby Head_on_a_Stick » 2019-01-05 10:23

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
User avatar
Head_on_a_Stick
 
Posts: 10377
Joined: 2014-06-01 17:46
Location: /dev/chair

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

Postby maja_ldm » 2019-01-05 13:33

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.
maja_ldm
 
Posts: 12
Joined: 2013-02-22 15:19

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

Postby Head_on_a_Stick » 2019-01-05 13:37

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
User avatar
Head_on_a_Stick
 
Posts: 10377
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Fallback to generic wifi firmware (rtl8192cu to rtl8xxxu

Postby maja_ldm » 2019-01-06 01:00

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.
maja_ldm
 
Posts: 12
Joined: 2013-02-22 15:19


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable