Wifi Speed problems with Realtek RTL8723BE #104

Closed
BharatKalluri opened this Issue Mar 21, 2016 · 13 comments

Comments

Projects
None yet
3 participants

Hi @lwfinger ,

I have recently installed Ubuntu on my Lenovo g50 45. I have been having a weird problem since the beginning. I am a beginner in Linux so please bear with me :-)

I usually have a download speed of 120-160 kbps on any machine connected to the wifi router. After installing Ubuntu on the system The speed will hit a maximum of 60-65 kbps and continue at that speed. It does not go beyond!

I am using the "rock.new_btcoex" branch, with parameters
options rtl8723be ips=N ant_sel=2 msi=1
in the file /etc/modprobe.d/50-rtl8723be.conf.

I have tried both ant_sel=1 and ant_sel=2 and both of them dont seem to make any difference.

Also Tried Both msi values(0 and 1) but no luck.

I would happily Repeat any steps you ask me to( could even give you ssh access if needed ), I just need this problem solved as this is the only laptop of my house :-(

At first I thought there was packet loss (Don't know if packet loss actually results in speed loss). I tried downloading files with different distances but it changed nothing(Even when the router is beside the laptop!).

The ping also says

PING google.com (216.58.220.14) 56(84) bytes of data.
64 bytes from bom05s05-in-f14.1e100.net (216.58.220.14): icmp_seq=4 ttl=56 time=52.8 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 52.898/60.373/82.711/12.899 ms

So there is no packet loss.

for more info These are come commands I executed(if you need any reference)

#for f in /sys/module/rtl8723be/parameters/*; do echo -n "$f: " ; cat "$f" ; done
/sys/module/rtl8723be/parameters/ant_sel: 2
/sys/module/rtl8723be/parameters/debug: 1
/sys/module/rtl8723be/parameters/disable_watchdog: N
/sys/module/rtl8723be/parameters/fwlps: N
/sys/module/rtl8723be/parameters/ips: N
/sys/module/rtl8723be/parameters/msi: Y
/sys/module/rtl8723be/parameters/swenc: N
/sys/module/rtl8723be/parameters/swlps: N

lf I do lspci I get

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1566
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Mullins [Radeon R4/R5 Graphics] (rev 05)
00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Kabini HDMI/DP Audio
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 156b
00:02.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1
00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1
00:08.0 Encryption controller: Advanced Micro Devices, Inc. [AMD] Device 1537
00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 11)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 39)
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 39)
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 42)
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 02)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11)
00:14.7 SD Host controller: Advanced Micro Devices, Inc. [AMD] FCH SD Flash Controller (rev 01)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1580
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1581
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1582
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1583
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1584
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1585
01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10)

if I do modinfo rtl8723be I get

filename:       /lib/modules/4.2.0-34-generic/kernel/drivers/net/wireless/rtlwifi/rtl8723be/rtl8723be.ko
firmware:       rtlwifi/rtl8723befw.bin
description:    Realtek 8723BE 802.11n PCI wireless
license:        GPL
author:         Realtek WlanFAE <wlanfae@realtek.com>
author:         PageHe  <page_he@realsil.com.cn>
srcversion:     2DA37D00E0E770F2130B511
alias:          pci:v000010ECd0000B723sv*sd*bc*sc*i*
depends:        rtl_pci,rtlwifi,btcoexist,mac80211
vermagic:       4.2.0-34-generic SMP mod_unload modversions 
parm:           swlps:bool
parm:           swenc:using hardware crypto (default 0 [hardware])
 (bool)
parm:           ips:using no link power save (default 1 is open)
 (bool)
parm:           fwlps:using linked fw control power save (default 1 is open)
 (bool)
parm:           msi:Set to 1 to use MSI interrupts mode (default 0)
 (bool)
parm:           debug:Set debug level (0-5) (default 0) (int)
parm:           disable_watchdog:Set to 1 to disable the watchdog (default 0)
 (bool)
parm:           ant_sel:Set to 1 or 2 to force antenna number (default 0)
 (int)

If you need more info just ask and I will try to reply as soon as possibe.

Owner

lwfinger commented Mar 22, 2016

Some general points:

  1. You only ever need to change msi if your device fails to ever get interrupts. If you are getting anything, leave it alone.
  2. If you get the same results for ant_sel=2 as you do for ant_sel=1, then you do not have the antenna selection problem. As a check, run the "sudo iw dev wlan0 scan | grep signal" command with the various settings. If you only see signal values of -70 dBm or lower, you have the problem. If you see values near -40 dBm, you do not have that problem.
  3. There is no longer any need to run the rock.new_btcoex branch. That is particularly true if you do not need the ant_sel option. In fact, that branch has a lot of code that I have never tested. For all I know, it may be slowing your throughput.
  4. For checking for lost packets, pinging your router is a lot more effective than checking an outside address. For testing throughput, I use netperf, but that requires a local server. Another option is to use speedtest.net. With my wired connection, my speeds are 58/6 Mbps (download/upload). Using the rtl8723be driver from kernel 5.0, I get 46/3. That is with both antennas connected.

Hi @lwfinger ,

OK, So I did a clean install of drivers, nothing in the config files and without specifying anything in the ant_sel parameters if I do

sudo iw dev wlp1s0 scan | grep signal

I get

signal: -8.00 dBm

and when I checked the ping with the router it says

0% packet loss

and now, this is where things get interesting,

When I do a speed test on the Computer it says download to be 0.68/1.21 and when I do a speed test on my android it says 1.2/1.2. I tried the test several times and the same result pops up(the download speed on Ubuntu will be half the original download speed of the network). That is The problem,

Why are the download speeds exactly half?

You were saying "Both antennas connected". Is my computer using only one antenna? if so how do I connect both antennas?

Or is there any other issue?

Owner

lwfinger commented Mar 22, 2016

The RTL8723BE mini-PCIe card has two antenna connectors. As you get a strength of -8 dBm with no module parameters, your device either has antennae attached to both connectors, or you have only one attached, but the EEPROM is correctly encoded. The HP computers with a problem definitely have only one antenna and their EEPROM incorrectly specifies which connector is used.

I do not know why the rate is 1/2 that of the Android. To get a strength of -8 dBm, you must be very close to the AP. I am about 2m from mine, and the strongest I see is -38 dBm, which is many orders of magnitude lower. (dBm is a logarithmic scale) If you can move about 1m further away, what happens? It is possible that you are saturating the input circuits.

@lwfinger, is it possible to reattach antenna to another connector physically? In this case is card going to work properly on native kernel driver?

Owner

lwfinger commented Mar 22, 2016

From what I can tell, your card works OK with the in-kernel version of the driver. If that is not the case, I have misunderstood.

No, I currently use your driver, but i wonder if it's possible to switch to the kernel driver by reattaching antenna to another card connector (HP laptop)

Owner

lwfinger commented Mar 22, 2016

You first need to show me that changing ant_sel makes a difference in the signal strengths. If not, then the in-kernel driver will work.

@lwfinger actually My wifi router is exactly beside my laptop, and even moving it away does not help.

@lwfinger How can I show the change ant_sel produces? and just so you know, I tried both parameters , Both parameters produced no difference in download speeds. The same 60kbps and around whereas I get 120-130kbps on every other device on the wifi. Will upgrading The kernel help?

Owner

lwfinger commented Mar 22, 2016

The difference is in signal strength. If you have a single antenna connected to the wrong location, the strength will be -70 dBm or lower. If you have either a single antenna connected correctly, or if you have two antennas, the signal will be your -8 dBm.

Load the driver with ant_sel=0 and use the iw command to get signal strength. Then repeat with ant_sel=1 amd finally with ant_sel=2.

One word. All these drivers are equally "mine". There is basically only a single driver written by Realtek and reworked by me to meet kernel requirements. Only the rock.new_btcoex branch has other than cosmetic differences, and that is in the BT coexistence code. Unfortunately, Realtek uses some techniques in that code that will never be acceptable in the kernel, thus that will remain an isolated branch.

@lwfinger

Signal strength without any parameters:

Signal level=-30 dBm

Signal strength with ant_sel=1

Signal level=-20 dBm

Signal strength with ant_sel=2

Signal level=-20 dBm

Signal strength with ant_sel=0

Signal level=-20dBm

So all produce the same result except with no parameters.
The signal strength changed from 6 because the router is far as you said it might cause input saturation.

Owner

lwfinger commented Mar 22, 2016

Setting ant_sel=0 is exactly the same as no parameters. As I said earlier, you do not have the antenna select problem. As to why your system is slow, that will depend on the setup of your AP, and that I cannot control. Under some conditions, the driver/AP combination can be a lot faster.

Owner

lwfinger commented Dec 2, 2016

A completely new version of the drivers has just been pushed. It fixes a lot of things. As a result, I am closing all open issues. If you get a new one, please create a new issue.

Note: The new driver fixes the problems with power save. It is recommended that you clear all ips, swlps, and fwlps options.

@lwfinger lwfinger closed this Dec 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment