Bananian

manual for BPi - R1 setup

33 16348
Yuri  
I have a BPi R1 with hdd WD Blue 1Gb, Igor's debian and kernel 3.4.106
I use the board as a router, samba server, media server (PLEX), SAT-IP server with USB DVB-S devices, and many more that ...
I completely customized the device to your instructions, thank you so much!
Everything works fine, except the transmission rate. Speed between the ports of the router (between PC computers - windows, linux) is good - 800-900 Mbps by iperf, samba 70-90 MB/s.
But the speed between any computer and Banana is very low - 150-200 Mbps and samba 8-15 MB/s
Also unsatisfactory work IPTV from my ISP (frequent distorsion). Streaming from the SAT-IP Server (RTSP protocol) is also often interrupted.
On my previous router TP-LINK 1043, these services worked perfectly.
I switched off all the extra services, but the speed did not improved
I tried the mainline core 3.19.2 - also without success.
I'm at a loss ..

Tido  
Edited by Tido at Mon Apr 6, 2015 19:22

Hi Yuri,

Great to hear from you.
I have to admit I still struggle with the combination of driver & hostapd, do you use wpa2 for authentication ?

Concerning your problem, I would read this post from tkaiser  or Samba & CPU and follow this user. I got the impression that he is really looking for network-performance.

Please keep us posted when you got the error or update the document accordingly.

Cheers
Tido

tkaiser  
Edited by tkaiser at Mon Apr 6, 2015 13:43
Yuri replied at Sat Apr 4, 2015 12:58
I have a BPi R1 with hdd WD Blue 1Gb, Igor's debian and kernel 3.4.106


Please have a look at the 'Fix gmac not working reliable on the Bananapi' thread here: http://lists.denx.de/pipermail/u-boot/2014-September/thread.html#190149

I find it a bit hard to diagnose this issue since I don't have the Lamobo R1 (BPi R1) and reports as well as test results one can find on the net are often inaccurate/misleading.

If the aforementioned issue applies also to the Lamobo R1 (which it should since the Lamobo also uses the A20's GMAC implementation but a different PHY in form of the directly connected port of the embedded BCM53125 switch IC) then it might be necessary to either use a patched kernel 3.4 to get good throughput between SoC and switch or to use mainline kernel with appropriate u-boot that pokes these gmac clk register bits.

To test what's going on one has to understand how the two pieces of silicone interact and in which situation the problem applies and when not (eg. switch traffic between the ports of the BCM53125). Some people report that only packets sent from the Lamobo R1 to somewhere else is slow and that the other direction is ok.

Anyway. Recent u-boot versions of OpenWRT contain a patch for board/sunxi/gmac.c:
  1. +@@ -34,7 +34,7 @@ int sunxi_gmac_initialize(bd_t *bis)
  2. +          * need to set bits 10-12 GTXDC "GMAC Transmit Clock Delay Chain"
  3. +          * of the GMAC clk register to 3.
  4. +          */
  5. +-#ifdef CONFIG_TARGET_BANANAPI
  6. ++#ifdef CONFIG_SUNXI_GMAC_TX_DELAY_3
  7. +         setbits_le32(&ccm->gmac_clk_cfg, 0x3 << 10);
  8. + #endif
Copy the Code
And they add in configs/Lamobo_R1_defconfig:
  1. CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,SUNXI_GMAC_TX_DELAY_3,RGMII,MACPWR=SUNXI_GPH(23),AHCI,USB_EHCI"
Copy the Code
If these 'gmac clk register' are highly board specific then why should a setting for the Banana Pi match the situation on the Lamobo R1? As far as I understand there are two sets of relevant bits:

  • bits 5-7, "Configure GMAC receive clock delay chain"
  • bits 10-12, "Configure GMAC transmit clock delay chain"

Maybe they've to be adjusted both to avoid clock problems, maybe just tx (bits 10-12). This is something only people owning a Lamobo R1 might be able to answer with tests (if I understood correctly by completely disabling VLANs and just doing iperf in both directions between one capable machine and the router board. The other machine must be able to exceed 935 Mbits/sec against another machine otherwise results might be misleading)

Yuri  
I have to admit I still struggle with the combination of driver & hostapd, do you use wpa2 for authentication ?

I'm using driver version 4.0.2.9000 and hostapd version 0.8 from rtl drivers pack from rtl site. It's works quite stable with wpa2.

Yuri  
Anyway. Recent u-boot versions of OpenWRT contain a patch for board/sunxi/gmac.c:
Ok, I have patched my u-boot for bits 10-12.
I have not found what value should be in bits 5-7 and not patch them.
In the near future I will test and make a report.

Tido  
Yuri replied at Wed Apr 8, 2015 07:03
I'm using driver version 4.0.2.9000 and hostapd version 0.8 from rtl drivers pack from rtl site. It ...

I got mine now working as well, but at the moment with Jens Segers hostapd. Probably it will also run with others.
My tests led me to the conclusion, that hostapd must be started as late as possible.
In the 15.01 manual I wrote a new section for the hostapd, followed by boot order control.
It works with reboot. What I am still missing is the option to stop and start hostapd, if you only restart the 'networking'.

If this works nicely... after months.. I can finally start to build on the BPi-R1 my router with all functionalities I dream of

igorpec  
Edited by igorpec at Wed Apr 22, 2015 07:43

Check this hostapd, v2.5dev:

https://github.com/igorpecovnik/ ... in/hostapd25-rt.tgz

with this config:

https://github.com/igorpecovnik/ ... ostapd.realtek.conf
(it's prepared for bridge mode)

Build script:
https://github.com/igorpecovnik/hostapd
(will be packed as deb once ;)

It's latest dev version, patched for rtl871xdrv / Realtek and patched for noscan=1 option which forces HT40

I can't test at full rates since none of my client is capable but I got transfer rate just over 100Mb on my n-WLAN Nic @Notebook.

It works with reboot. What I am still missing is the option to stop and start hostapd, if you only restart the 'networking'.


Use the scripts from hostapd package - install / uninstall and copy over your own compiled version. With my image is by default as it should be: service hostapd stop / start

Tido  
Edited by Tido at Wed Apr 22, 2015 20:26
igorpec replied at Wed Apr 22, 2015 07:37
Use the scripts from hostapd package - install / uninstall and copy over your own compiled version.

With my image is by default as it should be: service hostapd stop / start



You misunderstood. start | stop | status | restart    is NOT the topic

My tests led me to the conclusion, that hostapd must be started   _as_late_as_possible.
Network  eth0  wlan
dnsmasq  (dhcp)
and at very last

hostapd

igorpec  
Tido replied at Wed Apr 22, 2015 20:24
You misunderstood. start | stop | status | restart    is NOT the topic

My tests led me to the co ...
  1. ### BEGIN INIT INFO
  2. # Provides:             hostapd
  3. # Required-Start:       $remote_fs
  4. # Required-Stop:        $remote_fs
  5. # Should-Start:         $network
  6. # Should-Stop:
  7. # Default-Start:        2 3 4 5
  8. # Default-Stop:         0 1 6
  9. # Short-Description:    Advanced IEEE 802.11 management daemon
  10. # Description:          Userspace IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP
  11. #                       Authenticator
  12. ### END INIT INFO
Copy the Code
Ahaaa. OK

Maybe just this way: change Required/Should-Start to what should be before this and update.

... if you wan't to use original scripting, otherwise start hostapd out of /etc/rc.local

Tido  
Edited by Tido at Mon Apr 27, 2015 07:54

Ahaaa. OK

Maybe just this way: change Required/Should-Start to what should be before this and upd ...[/quote]

Hi Igor,

Ahh, this forum doesn't send notification email   I didn't see you reply.
I found that changing these two lines:
# Required-Start:    $named
# Required-Stop:    $named

Does delay the start of the service, on Banania 15.01 it is now at S03, before it was S01.
I can test your suggestion as well, haven't done it by now.

Cheers

You have to log in before you can reply Login | Sign Up

Points Rules