PDA

View Full Version : Updated kernel with multiblock - write speed still 300kb/s


brian911
2007-12-06, 02:38
My understanding is after I updated the kernel with fanoush's multiblock hack, my write speed is suppose to increase significantly. However, when I WinSCP files to my 770, it's still hovering around 300kb/s. Is this a WiFi bottleneck on the Nokia 770?

By the way, I ran fanoush's speed test and according to that the multiblock hack worked.

Also, I would like to say that since I reflashed my Nokia with the WLAN bug hotfix, my Nokia hasn't rebooted once!

fanoush
2007-12-07, 18:21
YEs, wi-fi speed is quite poor. 300KB/s over scp is 'normal'. Try to turn off ssh encryption if winscp allows it or select blowfish cipher (default is 3des I think, which is slow). You can also try ftp or wget from device, it should do ~600KB/s.

Also there were some experiments (http://bugs.maemo.org/show_bug.cgi?id=2006#c30) with 'overclocking' SPI bus connecting wi-fi chip to main CPU. So far it is unstable but there is some potential.

brian911
2007-12-09, 09:34
Thank you for the info! WinSCP by default has this cipher selection list in order of preference: AES, Blowfish, 3DES, then DES.

One question though: is encryption necessary anyways since I'm connecting through wifi with WPA enabled?

My test using WinSCP and various encryption methods:
AES 310KB/s
Blowfish 345KB/s
3DES 210KB/s
DES 345KB/s

Selecting 'compression' slowed down all the transfer speeds.

technut
2007-12-09, 10:11
One question though: is encryption necessary anyways since I'm connecting through wifi with WPA enabled?WPA encryption only applies to the wireless portion of the connection. If you want it to be encrypted all the way to/from the server then WPA isn't enough on its own.

brian911
2007-12-09, 10:50
I'm only transfering files locally in my workgroup. That should be okay no?

fanoush
2007-12-09, 12:12
Well, depends on you but yes, that should be OK. ssh or scp is meant for very good security, you mostly don't need it just for transferring files. WPA is already encrypted so it is almost like on wired network. If you don't regulary use end to end encryption for all traffic on wired network you don't need it here too.

If winscp allows it (and ssh server will accept it), turn encryption off completely, you will get something like a bit safer ftp and speed should go up.

Serge
2007-12-09, 12:39
YEs, wi-fi speed is quite poor. 300KB/s over scp is 'normal'. Try to turn off ssh encryption if winscp allows it or select blowfish cipher (default is 3des I think, which is slow). You can also try ftp or wget from device, it should do ~600KB/s.

Also there were some experiments (http://bugs.maemo.org/show_bug.cgi?id=2006#c30) with 'overclocking' SPI bus connecting wi-fi chip to main CPU. So far it is unstable but there is some potential.
Well, I'm currently using 'overclocked' wlan driver with Nokia 770 (divisor set to 3, one step down from unreliable settings), openssh is configured to use 'arcfour' encryption (yes, I know it has a security flaw). Nokia 770 filesystem is mounted with sshfs (http://fuse.sourceforge.net/sshfs.html) on my desktop PC and I use it to move files to the device. It works perfectly and provides speed ~570KB/s. So I have no need for USB anymore :) Hopefully wlan speed can be improved further.

OMAP1710 should have hardware acceleration for DES/3DES. I wonder if it would be possible/realistic to patch kernel and openssh to use it?

joshin
2007-12-09, 17:03
Where can I find the "overclocked" WAN driver?

Heck, if I could combine the best kernel revision with the 24mhz mmc driver and this wlan driver, my (kid's) 770 would be about perfect. I'd want the 52mhz mmc driver since I have a better rsmmc card than he does. :)

So what's the best way to build one's own kernels for the 770? I have a gcc4.1.2 toolchain built on my linux box (for distcc when building for my NSLU2). Is that sufficient or would I need to setup scratchbox?

Serge
2007-12-11, 22:25
I can share a precompiled binary, but installing it is a bit tricky. Maybe fanoush can add two versions of cx3110x.ko to the memory corruption bugfix installer, with the option to choose between normal and highspeed version. On the other hand, I have some more patches added, one of them retries waking up wlan chip if the first attempt failed (standard driver just sets internal error flag and stops working properly if such error occurs). From the user's point of view, it looks like a sudden loss of connection while wlan indicator shows that it is still online, this problem disappears after reconnecting. Error messages in dmesg are somewhat similar to https://bugs.maemo.org/show_bug.cgi?id=329
Subjectively this problem seems to happen more often at higher McBSP bus frequency, while I also have seen it when running wlan driver at normal speed.

I never tried compiling kernel outside scratchbox. Installing scratchox would be a good idea anyway unless you are looking for extra problems/new experience :) Step by step instructions for compiling kernel and cx3110x can be found in maemo wiki.

PattiM
2007-12-13, 02:11
My understanding is after I updated the kernel with fanoush's multiblock hack, my write speed is suppose to increase significantly. However, when I WinSCP files to my 770, it's still hovering around 300kb/s. Is this a WiFi bottleneck on the Nokia 770?

By the way, I ran fanoush's speed test and according to that the multiblock hack worked.

Also, I would like to say that since I reflashed my Nokia with the WLAN bug hotfix, my Nokia hasn't rebooted once!

Hi Brian: can you give links to these two fixes (speed and WLAN)? I just started booting from mmc1 - do you know if these will work for my setup?
http://maemo.org/community/wiki/howto_easily_boot_from_mmc_card/
Thanks!
Patti

brian911
2007-12-13, 05:35
Hi Patti:

I just wrote a guide based on the link you posted, but with more explanations and hopefully easier to follow. It can be found here: http://internettablettalk.com/forums/showthread.php?t=12916

I incorporates the WLAN fix as part of the instruction. As for the kernel hack for speed increase, it works on my 2GB Kingston MMC card but I am unsure whether you can use it with other cards especially for the multiblock. Fanoush will be able to help you better.

brian911
2007-12-13, 05:39
Sorry, I think I misunderstood your post. If you have already moved your OS to your MMC without the WLAN fix already installed, then you may already have some corrupted data. Installing the fix now will stop the device from corrupting any more data, but it will not fix data that has been corrupted already. You can try installing the fix and see if your device is stable. Otherwise, I would recommend reflashing the device and follow my guide to boot off MMC again.

joshin
2007-12-13, 16:19
That would be great Serge. I should be able to integrate it into my initrd without too much problem.

Yeah, I guess I'll figure out scratchbox since everyone else is using it. Anyone build a GCC4.1 or 4.2 toolchain yet?

Thanks!
-J

I can share a precompiled binary, but installing it is a bit tricky. Maybe fanoush can add two versions of cx3110x.ko to the memory corruption bugfix installer, with the option to choose between normal and highspeed version. On the other hand, I have some more patches added, one of them retries waking up wlan chip if the first attempt failed (standard driver just sets internal error flag and stops working properly if such error occurs). From the user's point of view, it looks like a sudden loss of connection while wlan indicator shows that it is still online, this problem disappears after reconnecting. Error messages in dmesg are somewhat similar to https://bugs.maemo.org/show_bug.cgi?id=329
Subjectively this problem seems to happen more often at higher McBSP bus frequency, while I also have seen it when running wlan driver at normal speed.

I never tried compiling kernel outside scratchbox. Installing scratchox would be a good idea anyway unless you are looking for extra problems/new experience :) Step by step instructions for compiling kernel and cx3110x can be found in maemo wiki.

Serge
2007-12-13, 19:55
That would be great Serge. I should be able to integrate it into my initrd without too much problem.
Check the attached file. It works for me, but I don't know if the resulting McBSP (SPI bus which connects OMAP and WLAN chips) clock frequency is within a valid range. Use at your own risk :)

Yeah, I guess I'll figure out scratchbox since everyone else is using it. Anyone build a GCC4.1 or 4.2 toolchain yet?
You can find more toolchains for scratchbox here:
http://scratchbox.org/download/files/sbox-releases/apophis/tarball/
The following tarballs contain gcc 4.x toolchains:
scratchbox-toolchain-arm-linux-2006q1-6-1.0.4-i386.tar.gz
scratchbox-toolchain-arm-linux-2006q3-27-1.0.6-1-i386.tar.gz

Serge
2007-12-13, 20:08
OMAP1710 should have hardware acceleration for DES/3DES. I wonder if it would be possible/realistic to patch kernel and openssh to use it?

Replying to myself :) There seems to be some ongoing work related to adding support for hardware accelerated security stuff on OMAP2420: http://thread.gmane.org/gmane.linux.ports.arm.omap/6804

joshin
2007-12-19, 17:01
So far so good, thanks Serge!

Check the attached file. It works for me, but I don't know if the resulting McBSP (SPI bus which connects OMAP and WLAN chips) clock frequency is within a valid range. Use at your own risk :)

Serge
2008-02-24, 13:39
Is there anybody interested to try even faster 'overclocked' version of WLAN driver for Nokia 770? I just got it working yesterday, so it's still experimental stuff :)

JeffElkins
2008-02-24, 18:33
Posted in another thread:

===
I'm maintaining a library of ebooks on a N800 for myself and a 770 for my wife. The N800 is running OS2008 and the 770 OS2007HE. The storage cards in each are formatted ext3.

When running rsync to update the libraries, I'm seeing a major difference in speed via wireless: The N800 regularly sees transfer speeds from the central library of 600-750 kB/s. However, the 770 is markedly slower, with speeds ranging from 21 kB/s to 300 kB/s, usually staying on the low side.

Are these slow speeds to be expected with the 770?

Thanks,
Jeff
===

Serge replied and pointed me here where I grabbed the overclock wifi module. I'm sorry to say, I don't see much difference. I'm now seeing an upper cap of around 300 kB/s and lower cap of 30 kB/s.

I'm using the following script to sync:

#! /bin/bash

[ $# -eq 0 ] && { echo >&2 Missing argument, type "booksync tabletname"; exit 1; }

echo starting sync with $1

sudo rsync --verbose --progress --stats --compress --rsh=/usr/bin/ssh \
--recursive --times --perms --links --delete \
--exclude "*bak" --exclude "*~" \
/software/books/* $1:/media/mmc1/books/

Serge
2008-02-24, 19:19
Serge replied and pointed me here where I grabbed the overclock wifi module. I'm sorry to say, I don't see much difference. I'm now seeing an upper cap of around 300 kB/s and lower cap of 30 kB/s.
How did you test it? Installing wlan driver is not so easy. I have attached the latest revision of the driver (still experimental) and here is some short usage instruction:

This driver is provided 'as is' and without any warranty. While I successfully
use this driver myself on my Nokia 770, it is not known if it makes the
hardware operate out of its specifications.

================================================== =============================

More details about this driver can be found here:
https://garage.maemo.org/pipermail/cx3110x-devel/2008-February/000019.html

15mhz version is probably a safe and reliable choice.

21mhz is the highest clock frequency which seems to work on the device (with some
glitches that need workarounds), so using it may be much more risky.

================================================== ==============================

You can load optimized wlan driver and test it by doing the following:

1. copy the modified driver cx3110x-optimized-15mhz.ko somewhere to your device
2. login as root
3. run the following commands in the directory with cx3110x-optimized-15mhz.ko:

rmmod cx3110x
insmod cx3110x-optimized-15mhz.ko
chroot /mnt/initfs /usr/bin/wlan-cal

4. connect to wireless network
5. test performance/stability of your network connection

To ensure that the driver has really loaded, you can check 'dmesg' log. You should
see something like this after loading driver:
[ 64.257110] McBSP2: freq_limit=16MHz, base_freq=63MHz, div=3 (15.7MHz)
[ 64.257659] Loading 3825.arm firmware
[ 64.453460] (c)opyright 2004 Conexant

JeffElkins
2008-02-24, 20:21
How did you test it? Installing wlan driver is not so easy. I have attached the latest revision of the driver (still experimental) and here is some short usage instruction:

Thanks.

I modified my /etc/init.d/rcS script to unload cx3110x.ko then load the modified cx3110x.ko module. As I said, not much change. However, I did not run chroot /mnt/initfs /usr/bin/wlan-cal. I downloaded the new modules, added the new step for wlan-cal and retested. Result: improved! The 15mhz module performed with an upper limit of 400 kB/s while the 21Mhz version topped out at 580 kB/s.

I still get pauses during transfers every so often (~ 10 seconds) that reduce overall throughput that I don't see on the N800, but these modules definitely work.

Jeff

JeffElkins
2008-02-24, 20:30
I mentioned that I'm running the OS2007HE (SU-18_2007HACKER_4.2007.46-3_PR_F5_MR0_ARM.bin) which I believe is the most current. Do I need to reflash a fanoush kernel as well?

Serge
2008-02-24, 21:09
It is important to have a high speed kernel with multiblock write support (HE firmware images are still provided by Nokia and they do not seem to take the risk of including high speed MMC patches). Multiblock write support is very important for fast moving data to the device

Without the high speed MMC kernel, no matter how fast WLAN driver can fetch data to your device, the overall performance will be severely limited at the stage of storing data to the flash card.

JeffElkins
2008-02-24, 22:12
It is important to have a high speed kernel with multiblock write support (HE firmware images are still provided by Nokia and they do not seem to take the risk of including high speed MMC patches). Multiblock write support is very important for fast moving data to the device

Without the high speed MMC kernel, no matter how fast WLAN driver can fetch data to your device, the overall performance will be severely limited at the stage of storing data to the flash card.

OK, Is a high-speed kernel with multiblock write support available? It's not included in the latest HE firmware image?

Serge
2008-02-24, 22:33
OK, Is a high-speed kernel with multiblock write support available? It's not included in the latest HE firmware image?
Fanoush can answer this question much better than me. Anyway, you can try the latest highspeed kernel from http://fanoush.wz.cz/maemo/ (you don't have to immediately flash it instead of the current one, it is possible to just boot kernels for testing).

JeffElkins
2008-02-24, 22:38
Fanoush can answer this question much better than me. Anyway, you can try the latest highspeed kernel from http://fanoush.wz.cz/maemo/ (you don't have to immediately flash it instead of the current one, it is possible to just boot kernels for testing).

Thanks Serge!

Edit:

I flashed Fanoush's latest kernel and I'm seeing better overall throughput, but still the occasional freeze.. in one case :

"259101 100% 4.29kB/s 0:00:58 (xfer#14, to-check=2205/2383)"

However, I'm better off now that I was before.

Jeff

Serge
2008-02-25, 06:53
Some more hints to improve performance.

It probably makes sense trying to disable rsync compression. Depending on the compressibility of your data, it may be much more favorable to run without any compression at all.

Also as rsync is running over ssh in your case, faster cipher will definitely improve performance, it has been already mentioned in this thread with benchmarks posted. In order to use faster cypher, you can edit '/etc/ssh/sshd_config' on the device and append 'Ciphers blowfish-cbc' or 'Ciphers arcfour' (without quotes) line to the end of it. Rebooting the device may be needed for this change to take effect. Using 'arcfour' is the fastest method, but it is considered insecure and some ssh clients may reject connecting to your device after this change. In any case, messing with sshd config may result in nonworking ssh, so be prepared to restore this configuration file from xterm on the device itself in the worst case.

As for the further optimizations, we may consider either adding assembly optimizations to blowfish cipher, or still try find some way to use OMAP hardware acceleration for DES/3DES/AES.

fanoush
2008-02-25, 08:06
There is also 'none' cipher but maybe it is not compiled in
http://www.psc.edu/networking/projects/hpn-ssh/none.php

fanoush
2008-02-25, 08:26
OK, Is a high-speed kernel with multiblock write support available? It's not included in the latest HE firmware image?
http://fanoush.wz.cz/maemo/#sdhc is the latest
It is a hack, it can't be included in any official firmware. Even OMAP2 in N8x0 does not support high speed SD and MMC modes officially (= with TI's blessing) so those are disabled in kernels shipped by Nokia. OMAP1710 in 770 is older and maybe they also used other incompatible parts or design since they intentionally restrict 770 mmc speed to 12MHz in all 770 kernels (24Mhz would be normal, 48MHz is high speed). Or maybe 770 is fine but rs-mmc cards on market are flaky so they slowed it down to make it more compatiblle, who knows.

JeffElkins
2008-02-29, 21:41
Thanks for the tips guys!