element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum USB discussions getting a bit heated
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 87 replies
  • Subscribers 710 subscribers
  • Views 16472 views
  • Users 0 members are here
Related

USB discussions getting a bit heated

e14 Contributor
e14 Contributor over 14 years ago

On the other forum, discussions of USB and networking problems have been

getting a bit heated recently, with one user, Sulge, banned yesterday by abishur

for a 1-week cooling off period.  Maybe we will see him here soon.

 

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=12097&start=177

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=24&t=14151

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=5249

 

Some of the USB issues are being blamed on Linux latency, which

doesn't sound easy to fix.

  • Sign in to reply
  • Cancel
Parents
  • morgaine
    morgaine over 14 years ago

    Reading that "USB - the Elephant in our Room" thread on the RPF forum again is really depressing.

     

    From the fanbois' typical "It works for me so your complaints make no sense", or "You shouldn't expect it to work because the Foundation makes no money", to JamesH's repeated strawman of "We would need to test EVERY SINGLE USB DEVICE", it makes you wonder what it is about the Foundation that its most vocal defence comes from those with impaired logic ability.  The correlation seems strong.

     

    There's probably some kind of thesis in psychiatry available there.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 14 years ago in reply to morgaine

    Reading that "USB - the Elephant in our Room" thread on the RPF forum again is really depressing.

    Don't read it then image  I think it's unfortunate that while there's a couple of people who seem willing to discuss solutions, Pete & dom spring to mind, most of the productive discussions are getting swamped in the noise.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • e14 Contributor
    e14 Contributor over 14 years ago in reply to morgaine

    Reading that "USB - the Elephant in our Room" thread on the RPF forum again is really depressing.

    Don't read it then image  I think it's unfortunate that while there's a couple of people who seem willing to discuss solutions, Pete & dom spring to mind, most of the productive discussions are getting swamped in the noise.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • morgaine
    morgaine over 14 years ago in reply to e14 Contributor

    selsinork wrote:

     

    Don't read it then image

     

    I haven't been following RPF for months personally, which has greatly improved my quality of life.

     

    But when one of you masochists image links to something over there then I do follow your links to understand what you're talking about.  Fortunately it doesn't happen often!

     

    I think it's unfortunate that while there's a couple of people who seem willing to discuss solutions, Pete & dom spring to mind, most of the productive discussions are getting swamped in the noise.

     

    Amid all the noise and illogic, I did notice one positive thing:  the Foundation is now admitting openly that Pi's USB is faulty, you don't need to read between the lines to infer it,  The admission is done very much through gritted teeth, and fanboi logic is of course still unable to grasp that it has been admitted, but nevertheless the existence of the problem is now official.

     

    Also, the extent of the problem is now accepted to be all Pi boards, not just a few rogue ones.  Anyone who thinks that their Pi doesn't have the problem will find that actually it does if they add a USB device or two.

     

    There seems to be a limit of 8 endpoints, and by default the Model B seems to use one for the host, one for the LAN9512 hub itself, one for Ethernet, and one for each of the LAN9512's host ports, which is 5 altogether.  Add an external hub and that adds one endpoint for a 4-port or two endpoints for a 7-port (because a 7-port is usually implemented as two 4-port hubs in cascade), which means that you can attach only one or two USB devices to a hub before the USB system dies completely on all ports.  That kills off your networking too of course.

     

    What's more, the limit of 8 endpoints doesn't mean that Pi's USB will work if you use fewer.  It just means that it won't die completely and totally if everything else is OK and if the Pi can cope with the interrupt rate.  Unfortunately there's more.

     

    In addition, and this is the killer, even if you use fewer endpoints than the maximum, USB events will get lost occasionally on all Pi boards with the current driver if you use low-speed or full-speed USB devices, because split transactions occasionally get broken by Linux interrupt response latency often being longer than 1 ms, which causes the USB event to be discarded.

     

    Linux is not a realtime operating system, so if your driver or your hardware require interrupt response within a specific time constraint, correct operation will fail periodically when the system has other work to do.  There is always other work to do in a Linux system, which is why the Pi's USB has a continuous non-zero error rate no matter how few USB endpoints you use.

     

    In engineering, the first step to finding a solution is admitting the problem, so this is progress.  But god, that first step sure is hard with RPF.

     

    Morgaine.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 14 years ago in reply to morgaine

    Anyone who thinks that their Pi doesn't have the problem will find that actually it does if they add a USB device or two.

    My Pi doesn't have a problem. Really.

    image

    lack of a USB connector probably has something to do with it image

     

    It looks like the ethernet function of the lan9512 uses three endpoints, one bulk in, one bulk out and one interrupt. With just a simple keyboard and mouse my system lists 8 active endpoints.  Oh, and hotplugging the keyboard/mouse just reset one of the newer ones. The original one doesn't have that problem.

     

    So is that 8 endpoint limit a hardware one ?  Or a crappy driver problem ?    The actual question has to be whether it's fixable in software or not and what limits that might have.

     

    If it's simply an interrupt latency problem there will be ways to help mitigate that. One possible way to help would be to up the clock speed to 1GHz as they've mentioned they want to find a way to do, it's not like that's a cure, more like a short term band-aid while other avenues are explored.

    It probably also explains why people like me who don't use a bloated deskptop distro and literally have init, two gettys, dhcpcd and sshd running really don't see the problem to the same degree - I'm simply not adding lots of extra latency running lots of irrelevant crap. I do see dropped and/or repeating keypresses now and again, so no denying there is an issue.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • morgaine
    morgaine over 14 years ago in reply to e14 Contributor

    selsinork wrote:

     

    My Pi doesn't have a problem. Really.

    <image>

    lack of a USB connector probably has something to do with it image

     

    Hahaha, nice one. image

     

    It looks like the ethernet function of the lan9512 uses three endpoints, one bulk in, one bulk out and one interrupt. With just a simple keyboard and mouse my system lists 8 active endpoints.  Oh, and hotplugging the keyboard/mouse just reset one of the newer ones. The original one doesn't have that problem.

     

    Oh dear, it's a bit worse than I gathered from that thread then, the hard limit arrives a bit sooner.

     

    So is that 8 endpoint limit a hardware one ?  Or a crappy driver problem ?    The actual question has to be whether it's fixable in software or not and what limits that might have.

     

    I gather that 8 endpoints is a hardware limit because a Foundation or Broadcom person said that they found it in the Verilog for the SoC's USB controller, IIRC.  The interrupt rate issue is completely separate from that.

     

    If it's simply an interrupt latency problem there will be ways to help mitigate that. One possible way to help would be to up the clock speed to 1GHz as they've mentioned they want to find a way to do, it's not like that's a cure, more like a short term band-aid while other avenues are explored.

    It probably also explains why people like me who don't use a bloated deskptop distro and literally have init, two gettys, dhcpcd and sshd running really don't see the problem to the same degree - I'm simply not adding lots of extra latency running lots of irrelevant crap. I do see dropped and/or repeating keypresses now and again, so no denying there is an issue.

     

    You're right to call these "bandaids", and they're poor ones because they cannot make the USB errors disappear but only reduce the rate at which they occur.  That rate cannot be made arbitrarily small on Linux without either adding realtime patches so that the housekeeping processes receive guaranteed scheduling priority, or else removing the need for realtime response in the driver.  If the SoC's crappy USB core requires that split transactions be handled in software then the second alternative is not available.

     

    Even a completely quiescent Linux system has processes that get scheduled to run occasionally, even if it's only the periodic filestore sync/update process that is scheduled by a timer.  If scheduling triggers in the middle of USB split transaction handling, the probability that the USB event will be lost is non-zero.

     

    It's just the way Linux works, and all Unixes have worked that way since the dawn of time, so Broadcom designers can hardly express surprise nor point a finger of blame at Linux.  If they genuinely are surprised then Broadcom's problems run far deeper than a broken Pi.

     

    Morgaine.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 14 years ago in reply to morgaine

    I gather that 8 endpoints is a hardware limit because a Foundation or Broadcom person said that they found it in the Verilog for the SoC's USB controller, IIRC.  The interrupt rate issue is completely separate from that.

    Eeewww... a limitation that's hard coded into silicon is going to be difficult image  It's what comes of never being designed for what it's being asked to do. 

     

    The model A with SPI ethernet is looking more and  more appealing.   However, with the pragmatic hat on for a moment, if the interrupt rate problem can be resolved it still mostly meets the design goal for a small educational device with wired ethernet, mouse & keyboard. I say mostly as there's a lot to be said for being able to save stuff to a usb key as well as the sd-card, but still, it's not completely fatal - inconvenient yes.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jamodio
    jamodio over 14 years ago in reply to morgaine

    It is going to be really hard, making USB OTG work as a "host" if you excuse my French is a "***" ...

     

    I found some documentation from Synopsys (http://www.synopsys.com/dw/ipdir.php?ds=dwc_usb_2_0_hs_otg) but didn't have time yet to even browse through it.

     

    -J

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jamodio
    jamodio over 14 years ago in reply to e14 Contributor

    The model A with SPI ethernet is looking more and  more appealing.   However, with the pragmatic hat on for a moment, if the interrupt rate problem can be resolved it still mostly meets the design goal for a small educational device with wired ethernet, mouse & keyboard. I say mostly as there's a lot to be said for being able to save stuff to a usb key as well as the sd-card, but still, it's not completely fatal - inconvenient yes.

     

    Hmmm, that would be some interesting project to try, as far as I remember there are some Linux drivers for the Microchip standalone Ethernet controllers, obviously don't expect to power the thing from the regular 3V3 power supply.

     

    I used to produce this board based on the ENC424J600

     

    http://www.ljcv.net/nic424/nic424-v1.0-800px.jpg

     

    I'll put on my to-do list of things to try in my protoboard setup... Good idea selsinork

     

    -J

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • morgaine
    morgaine over 14 years ago in reply to e14 Contributor

    selsinork + jamodio:  TCP offload and USB offload beckons, as you are both suggesting.

     

    It's certainly an engineering solution to the problem, but the trouble is, what's left of the Pi if you have to add those externally?  Just a standalone multimedia chip with SD card and low-end ARM.  It's no longer appealing for $35, and doesn't even make any sense in a networked world.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jamodio
    jamodio over 14 years ago in reply to morgaine

    Ohh no, it is just for experimenting. I'd rather put more time/money on Beagle or Panda boards, I'm waiting for the guys from Olimex that said their board should be about ready in September.

     

    If RPF does not come up with a decent solution which may require to dig deep into the design, besides being an interesting gadget to tinker with and some stuff that can be donde with model A, asuming you can hookup a keyboard and a mouse that works with an external hub, IMHO the thing is dead.

     

    -J

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 14 years ago in reply to morgaine

    It's no longer appealing for $35, and doesn't even make any sense in a networked world.

    Ok, but... Alternatives ?   With reliable, even if slow, ethernet it still works for me. If we offload anything much then the model A is obviously a better starting point.

     

    If usb can be fixed - within limits of the silicon - that's better. But as you keep saying, it needs to be reliable and 'just work'.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 14 years ago in reply to jamodio

    obviously don't expect to power the thing from the regular 3V3 power supply.

    What, no 1.8v version that I can power from the lan9512 ?  image

     

    Nice looking board..  I know it'll work - Chris Boot and Simon Arlott were using them along with sd-card on spi during their 3.5 kernel efforts.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube