USB packet loss.


254 posts   Page 1 of 11   1, 2, 3, 4, 5 ... 11
by thexman » Thu Apr 26, 2012 8:36 pm
has anyone else noticed USB packet loss on data?

is it a Libusb issue or USB PI microcode.?

anyone else seeing problems

thanks
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by dom » Thu Apr 26, 2012 8:56 pm
Possibly related to this: https://github.com/raspberrypi/firmware/issues/9

Can you narrow it down any more? Does it only lose data when heavily loaded?
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4011
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by thexman » Thu Apr 26, 2012 9:42 pm
well Dom

i'm running 4 hubs from a 4 port hub with 16 devices plugged in, in windows it runs fine and allows me to interact with each device, also each device can interact with them selves .

when i plug the same powered hubs into the PI and run my software now converted to ARM from X86  it all goes Pete Tong i'm wondering if this is a hardware issue or software with all the USB transfer faults people are reporting my 16 devices are probably hammering the USB bus how ever the processor is running quite well not to much time spent at max.
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by bredman » Fri Apr 27, 2012 8:45 am
There is a good chance that there is a power brownout somewhere under heavy USB load.

You do not specify if all 5 of your hubs are powered.

If possible, open up your primary hub and check the voltage on its 5v rail.

The RPi seems to have problems with some USB hubs, even if they have an independent power supply.

If you are willing to sacrifice a USB cable, you could cut the 5v core from the RPi to your primary hub. This would prevent any unintended draining of current from the RPi.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by thexman » Fri Apr 27, 2012 8:14 pm
yeah all the USB hubs are powered so its not a power issue think we have narrowed it down to the USB network issue currently being discussed else where. so hope fully it will be fixed quite quickley.

thanks for peoples input.
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by rew » Sat Apr 28, 2012 12:36 pm
You have 16 devices. What kind of bandwidth do they use? Anything near 100mbps? Is there a lot of network traffic as well?
Check out our raspberry pi addons: http://www.bitwizard.nl/catalog/
User avatar
Posts: 396
Joined: Fri Aug 26, 2011 3:25 pm
by thexman » Sat Apr 28, 2012 3:29 pm
constant read write from the devices, i would have to do some maths to calculate the data flow i suppose,  i was accessing the PI Via my PC to access the USB devices the PC is connected on the 100mb lan port when i experienced the failings.

im just waiting for the Debian patch fix to be released they seam to have it fixed i read last night late.

as i have no Linux Kernel writing experience ill have to wait for someones build :)
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by yoctopuce » Mon Apr 30, 2012 4:51 pm
We too are experiencing some random packet drop.

Our USB stack use the libusb-1.0 and has been tested on multiples architecture (i386, AMD64 and ARM) with success. We are able to compile and run our stack on Raspberry Pi but we have some packet that "disappear". We get no error form the libusb nor error message into the kernel logs. Since we are controlling the USB device and the linux application we have run some test to identify the issue and we have been able to reject some potential issues:

- Too week Raspberry Pi power supply:
We have test several USB charger and a stabilised power supply. This parameter has no impact on the issue.

- The USS Device consume too many:
We have been able to reproduce this error with only our device connected (witch consume between 25 to 30 mAmp). We have test several self powered USB HUB and we still have the same problem. The USB topology do not have any influence on the issue.

- USB congestion:
our devices work in full-speed (USB 1.1 12 Mbit/s) and transmit at max 1 packet of 64 bytes each frame (64 Kb/s). We have analyse the transfer with and USB analyser and ALL packets are correctly transmitted over the wire (no bus reset, no invalid packet, the USB host ack all packet). this mean that the USB Host controller of the raspberry Pi as correctly received and ack the missing USB packet.

Our conclusion is that or the libusb or the linux kernel drop some packets and do not raise any error. I will recompile the libusb from scratch to add some debug logs to identify if it is the kernel or the lib USB wich are guilty.

Does anyone had some issue with the libusb on the Raspberry Pi?
We produce USB controllers, USB sensors as well as embedded USB hubs for DIY projects
User avatar
Posts: 19
Joined: Sat Mar 03, 2012 11:27 pm
by thexman » Sat May 05, 2012 5:21 pm
hi guys anyone able to help on this problem both me and the manufacturer are experiencing issues under Arm and Linux i would point out that windows works fine. and it doesn't appear to be the USBlib file thats causing the issue.?

Ive posted my 14 devices and 4 hubs photos to show you wont be wasting your time as i am serious about my project.

work
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by thexman » Wed May 09, 2012 7:00 pm
bump still no joy in fixing this issue. any one help out here.
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by shalo » Thu May 10, 2012 11:33 am
thexman said:


im just waiting for the Debian patch fix to be released they seam to have it fixed i read last night late.

as i have no Linux Kernel writing experience ill have to wait for someones build :)


You don't say if you have taken any further steps yet?

Have you read this thread http://www.raspberrypi.org/for.....sb-storage

Someone posted a kernel you can use on page two.
Posts: 74
Joined: Tue May 08, 2012 7:25 pm
by thexman » Thu May 10, 2012 6:31 pm
yeah sorry i tried the new Kernel made no difference to the issue we are getting

i believe the manufacturer has now sent some product to the foundation in the hope they can advise a fix for the issue. we believe its a firmware rather than software as they ran a debugger in the usblib file and no faults were reported ill email them see if i can find out the exact issue and post it here as my understanding has reached its limits.

thanks
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by yoctopuce » Wed May 16, 2012 8:38 am
Hi,

We have found a serious issue on the raspberry PI USB stack (or at last the HID USB stack). We produce USB device and have found that we often get missing packet.

We have create an specific firmware illustrate the problem. This debug protocol is very simple the Raspberry will send one packet of 64 bytes, then the device will start a burst of USB transaction. Our USB device work in full speed (USB 1.1) and follow the HID protocol. All packets have the same size (64 bytes). the first uint32_t will contain the current packet number and the second uint32_t will contain the number of packet to send. Each packet is numbered and we stop after burst of 4096 packet of on the first missing packet.

The debug program call libusb-1.0, and will look for one of our device with the debug firmware, then send one USB packet to the device to start the burst. Then we will wait for all packet and check that all packet are send. You can download the source here http://www.yoctopuce.com/tmp/debug_libusb.zip

We have test this code and firmware on many linux platform (i386 and x86_64), and on a ARM based NAS (QNAP TS-219P II). We never get any missing packet. but on the Raspberry PI we always get missing packets. We have check with a USB analyser that the missing packet is correctly sent on the wire (the packet has been correctly acked by the Raspberry PI USB host). It seems that the packet is lost by the Raspberry PI firmware.

We have run this test on both the debian and arm-linux image, we have recompile the last version libusb without success. Our customers also have reported this issue.

We are ready to send one of our device to help to reproduce this issue, or to give a remote access to our Raspberry PI (or do any thing that can help you to fix this issue). If one of the firmware developer can contact us (support@yoctopuce.com) we are ready to help.
We produce USB controllers, USB sensors as well as embedded USB hubs for DIY projects
User avatar
Posts: 19
Joined: Sat Mar 03, 2012 11:27 pm
by thexman » Wed May 16, 2012 4:28 pm
would some one from the Foundation please confirm there looking into this please.
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by abishur » Wed May 16, 2012 4:35 pm
Just out of curiosity, are you use the default kernel that comes with your distro of choice, or are you using an updated kernel off github?
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4251
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by yoctopuce » Wed May 16, 2012 4:41 pm
abishur wrote:Just out of curiosity, are you use the default kernel that comes with your distro of choice, or are you using an updated kernel off github?


We have try the two official image that are available on the download page and the latest kernel (using the Easy firmware updating tool from Hexxeh). In all case we have the same bug.
We produce USB controllers, USB sensors as well as embedded USB hubs for DIY projects
User avatar
Posts: 19
Joined: Sat Mar 03, 2012 11:27 pm
by thexman » Fri May 18, 2012 9:18 pm
Any news on this issue from rpi please still awaiting for a fix from rpi please
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by yoctopuce » Sat May 19, 2012 9:21 pm
We are in contact with Eben and are working on the issue. Following there instructions we have run the same test again with some debug/trace function of the Linux kernel activated. The result confirm that sometime on or two USB packets are not reported by the Linux USB "driver"
We produce USB controllers, USB sensors as well as embedded USB hubs for DIY projects
User avatar
Posts: 19
Joined: Sat Mar 03, 2012 11:27 pm
by jbeale » Sun May 20, 2012 12:04 am
Not that I know anything at all about this, but is an interrupt conflict possible here? Would you know if it happened? Is the packet loss apparently random or happen in any predictable way after x packets or x seconds? Any relation to other system or network activity?
User avatar
Posts: 2010
Joined: Tue Nov 22, 2011 11:51 pm
by ledow » Sun May 20, 2012 11:07 am
I think this might be the cause of a problem I'm noticing too.

I'm using an Huawei E160 3G USB modem on the RPi. PPP etc. works as I expect. But at random intervals, PPP says that the modem "hung up" (which it didn't, looking at the logs of the data) and cuts the connection.

Via minicom, AT commands never have a problem and the device works perfectly (in the same physical position) on a laptop with the same PPP / chatscript setup and NEVER hangs up. Literally the only thing different is the USB port that the other end of the cable plugs into (the modem + the cable it's connected to do not move one bit when swapping between the RPi and another Linux device). The signal quality at all times is top-notch and I've never experienced any problems with this modem before.

It seems to be more common the more I "stress" the USB connection, e.g. under GPRS mode, it hardly happens at all and I can ping google and download at a blazing speed (!) all day long, in 3G mode it connects fine every time, pings fine and consistently but if I try to do "traffic" (i.e. even a simple download of Google's homepage), it will usually succeed but almost always ends up triggering a disconnect during or soon after (presumably because the USB connection is losing packets as described).

I have so far eliminated account issues (it's a PAYG 3G stick and I'm paid up for today and it always works fine whenever I switch back to a normal laptop), PPP settings (identical config on both computers), IP issues (same IP given each time, with same DNS etc.), power issues, there are no intermediate hubs to cause a problem, there are no other processes running or trying to open the serial port (had gammu loaded once but uninstalled it while troubleshooting - and gammu had no problems sitting on the device all day issuing AT commands to check for new SMS, etc.), nothing else running, very idle machine (everything described done from the CLI, not the GUI), etc.

Power supply is fine (the one supplied by RS! But have also tried 2A adaptor that provides stable 5v by multimeter on TP1&2 and same problem). I took to using a small (6 inch) USB extension lead because I thought the problem might be related to the proximity of the USB ports (my keyboard port was leant on by the 3G modem when inserted next to each other), but having that extension has made no difference to either the RPi or the other laptop connection either, but has at least allowed me to "fix" the 3G modem and its connector so I can eliminate signal variability as much as possible.

I've set up hundreds of Linux PPP and modem connections in the past for everything from 9600 modem-to-modem, Hylafax servers with multiple lines, 56k modems for Internet sharing (from a custom single-floppy Linux), PPPoA/PPPoE, 3G modems, SMS daemons, etc. and I can't see a problem that I can narrow down to software or anything except the RPi USB connection at all.

Bloody shame because reliable SMS communication and the ability to report back over a 3G connection at will figure quite highly on the list of requirements for my first big RPi test project. Just trying to get on Google gives you (barely) the front page before it just dies and PPP kills the connection and tries to redial.
User avatar
Posts: 36
Joined: Thu Feb 02, 2012 12:55 pm
by thexman » Mon May 28, 2012 8:11 pm
have the foundation or Eben / RPI found a solution to this issue yet please need an update thanks
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by thexman » Mon Jun 04, 2012 3:44 pm
Bump any fix for this issue from the raspberry Pi foundation been waiting now over a month for an official fix seams the rpi people don't either wish to admit there's a fault or post a fix or work around for the board or firmware which ever is at fault here let's hope for an update soon please
one armed controls engineer, my grammar is bad but lets face it most keyboards don't suit a one armed man
Posts: 259
Joined: Sat Apr 07, 2012 2:18 pm
by abishur » Mon Jun 04, 2012 6:09 pm
thexman wrote:Bump any fix for this issue from the raspberry Pi foundation been waiting now over a month for an official fix seams the rpi people don't either wish to admit there's a fault or post a fix or work around for the board or firmware which ever is at fault here let's hope for an update soon please


Alternate theory? They're busy people and issues like this are more of a community led fix as is the nature with linux.
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4251
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by snaipperi » Mon Jun 04, 2012 6:43 pm
abishur wrote:Alternate theory? They're busy people and issues like this are more of a community led fix as is the nature with linux.

If the community knew how to fix it, somebody would be working on it already.. community, any news?
Posts: 16
Joined: Fri Dec 02, 2011 10:37 am
by youngsyt » Tue Jun 05, 2012 9:16 am
Hi

Please have a look at my post in this thread : usb? power? hub? wifi?

I now have my TP-Link wireless adapter working and associated with my access point but only if I do not have my keyboard plugged in. The Pi is powered from the Belkin Hub and all USB peripherals are plugged into the Belkin Hub as well. If I plug the keyboard into another port on the Belkin Hub or into the second USB port on the Pi then the TP-Link 722 is not recognised properly and Dmesg shows an error 22.

Could this be due to the fact that the keyboard is a low speed device and is causing problems for the higher speed devices connected. I've seen this behaviour on another non-branded powered hub but have not gone back to check.

Regards

Terry
Posts: 7
Joined: Sun Jun 03, 2012 1:46 pm