julyjim
Posts: 117
Joined: Tue Jan 31, 2017 5:04 am

USB ports bandwidth

Tue Jan 31, 2017 5:19 am

Are USB ports connected to common controller or are they separate?
I am concerned about practical USB bandwidth.
How many USB web cams ( small frame format, no HD ) can I connect / run on the entire board?

Thanks

User avatar
DougieLawson
Posts: 35347
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: USB ports bandwidth

Tue Jan 31, 2017 10:36 am

Common LAN9514 controller (which also runs the ethernet). On an A, A+ and Zero there is no USB controller, there's just a single USB port driven from the BCM2835 SoC.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

mikerr
Posts: 2768
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB ports bandwidth

Tue Jan 31, 2017 10:39 am

Note the raspberry pi camera doesn't use USB bandwidth at all - and you can use two of them on the compute module...

You can use that in addition to USB webcams.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

julyjim
Posts: 117
Joined: Tue Jan 31, 2017 5:04 am

Re: USB ports bandwidth

Tue Jan 31, 2017 1:58 pm

Thanks for reply, but that was not what I asked , sorry.

User avatar
RaTTuS
Posts: 10318
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: USB ports bandwidth

Tue Jan 31, 2017 2:08 pm

480mbps is the max for the USB port
what do your cameras output ?
what are you wanting to do with the output of the cameras
the RPI camera is much better than most usb cameras [YMMV]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22693
Joined: Sat Jul 30, 2011 7:41 pm

Re: USB ports bandwidth

Tue Jan 31, 2017 4:16 pm

All the four USB ports on the Pi B models are muxed on to a single USB port in to the SoC, so you are restricted to an overall bandwidth of about USB2 rates, which is usually about half of theoretical maximum once you take in to account overheads. Not only that but the ethernet is muxed on to the same port as well, so you need to take that in to account as well.

As someone above says, the Pi camera does not use USB and does not impact on the USB port at all.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

W. H. Heydt
Posts: 10292
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: USB ports bandwidth

Tue Jan 31, 2017 5:43 pm

jamesh wrote:All the four USB ports on the Pi B models are muxed on to a single USB port in to the SoC, so you are restricted to an overall bandwidth of about USB2 rates, which is usually about half of theoretical maximum once you take in to account overheads. Not only that but the ethernet is muxed on to the same port as well, so you need to take that in to account as well.
Depending on how you figure it, you may do a bit better than half.. My SSD read test (reading 3.2GB) using a Pi3B came in at 35MB/s. Just counting 8 bits per byte, with no added start/stop, parity, or other overhead, that would 260Mb/s. If you use the old serial line rule of thumb of 10 bits per byte transferred, it would 350Mb/s, or nearly 3/4 of theoretical maximum.

julyjim
Posts: 117
Joined: Tue Jan 31, 2017 5:04 am

Re: USB ports bandwidth

Wed Feb 01, 2017 2:00 pm

Thanks for very compressive answers , appreciate that very much.

Small , tiny side note.
I am always puzzled why people need to know the actual application . usage / reason the question is posted. I always assume they are curious, but deep down it reminds me of people who repeat the spoken question not to clarify it, but to stall for time so they can figure out the answer.

To satisfy the curiosity - I am planning to have several cameras monitoring and controlling model railroad.
Look up "green wave" concept for further clarification.

Cheers

W. H. Heydt
Posts: 10292
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: USB ports bandwidth

Wed Feb 01, 2017 2:34 pm

julyjim wrote:Thanks for very compressive answers , appreciate that very much.

Small , tiny side note.
I am always puzzled why people need to know the actual application . usage / reason the question is posted. I always assume they are curious, but deep down it reminds me of people who repeat the spoken question not to clarify it, but to stall for time so they can figure out the answer.

To satisfy the curiosity - I am planning to have several cameras monitoring and controlling model railroad.
Look up "green wave" concept for further clarification.

Cheers
Quite a bit of the "what project?" question revolves around potential alternate solutions to specific roadblocks. In your case, it appears to me that rather than worrying about how many cameras can be connected to a single Pi, you could deply as many Pis as it takes to support the number of cameras you are planning to use, possibly right down to one camera per Pi.

mikerr
Posts: 2768
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB ports bandwidth

Wed Feb 01, 2017 2:41 pm

If you want an answer to how many cameras you can use, you need to tell us the bandwidth each individual camera uses in your use case (which you haven't)

The pi has 480Mbps total. Divide that by the bitrate of your cameras (which will vary greatly depending on framesize, format and frame rate)

E.g. if you only wanted 1 frame per second,you could probably use 20+ cameras via a usb hub...
Android app - Raspi Card Imager - download and image SD cards - No PC required !

ejolson
Posts: 3034
Joined: Tue Mar 18, 2014 11:47 am

Re: USB ports bandwidth

Wed Feb 01, 2017 6:42 pm

mikerr wrote:E.g. if you only wanted 1 frame per second,you could probably use 20+ cameras via a usb hub...
According to the General Information bullet point 2 from the USB sticky thread in Troubleshooting, the hardware has a limit of 8 simultaneously active USB transactions. Since Ethernet counts for one, bandwidth considerations aside, that leaves at most 7 available for cameras.

Green wave seems to be a real-time railway traffic management policy for optimizing rail traffic through open corridors that bottleneck a network. It sounds fun but difficult to implement in a model railroad setting.

Heater
Posts: 12629
Joined: Tue Jul 17, 2012 3:02 pm

Re: USB ports bandwidth

Wed Feb 01, 2017 8:23 pm

julyjim,
I am always puzzled why people need to know the actual application . usage / reason the question is posted. I always assume they are curious, but deep down it reminds me of people who repeat the spoken question not to clarify it, but to stall for time so they can figure out the answer.
No. A moments reflection would tell you that we have no need to repeat the question or stall for time before we answer. This is an internet forum. We can answer now or after an hour or next week or perhaps not at all.

Curiosity is certainly a motivation for asking about the actual application.

But the main point is this: So many times it happens that someone pops up with a question like "Please tell me how to do X" or "I tried X and it did not work". After much time wasting toing and froing and debate we find out they never really wanted to do X at all. They thought X was a solution to what they really wanted to do and there are other better ways of doing it.

Just trying to be efficient.

User avatar
CarlRJ
Posts: 599
Joined: Thu Feb 20, 2014 4:00 am
Location: San Diego, California

Re: USB ports bandwidth

Wed Feb 01, 2017 9:05 pm

julyjim wrote:Small , tiny side note.
I am always puzzled why people need to know the actual application . usage / reason the question is posted. I always assume they are curious, but deep down it reminds me of people who repeat the spoken question not to clarify it, but to stall for time so they can figure out the answer.
It can remind you of whatever you want, but your guess is incorrect. And stalling for time in a non-realtime conversation is laughable. Everyone knows that we've all got google/stackoverflow/etc available to us at a second's notice. We could copy and paste a voluminous-but-perhaps-not-applicable-answer from somewhere in thirty seconds. So that's not the reason for asking for more information...

You are asking for help from a pool of developers and tinkerers with collectively an absolutely enormous amount of experience answering such questions, and many of us have found, over the years, that people often ask questions that are two or three steps down the path from what they really have in mind. That is, they had an original question/need in mind, and they made two or three assumptions from that, and they're now asking a question that may be going down some odd, really convoluted, possibly unworkable, path towards their goal. So, we want to answer the question as asked (if possible), but often want to know what the original goal was, if the question asked seems odd (or if we've seen a similar question raised in the past on the basis of an odd assumption), because we (collectively) may be able to suggest a much simpler solution that sidesteps the original (and possibly incorrect) assumptions. We are problem solvers. Sometimes it helps to know what the whole problem is, rather than just one small corner of it.

User avatar
RaTTuS
Posts: 10318
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: USB ports bandwidth

Thu Feb 02, 2017 7:39 am

julyjim wrote:Thanks for very compressive answers , appreciate that very much.

Small , tiny side note.
I am always puzzled why people need to know the actual application . usage / reason the question is posted. I always assume they are curious, but deep down it reminds me of people who repeat the spoken question not to clarify it, but to stall for time so they can figure out the answer.

To satisfy the curiosity - I am planning to have several cameras monitoring and controlling model railroad.
Look up "green wave" concept for further clarification.

Cheers
why usb cams ?
which usb cams
post links to them all
they often have bad resolutions or do not compress the data in any useful way YMWV on how many you can stuff onto a USB chain
give use more useful info and we can help more , faster and with better info
what are you thinking of , have you though of using the foundation camera ?
multiple RPI's ?
a PI0 + camaera + network hat may be a better option , or PI2 or Pi3
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

texy
Forum Moderator
Forum Moderator
Posts: 5156
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: USB ports bandwidth

Thu Feb 02, 2017 12:06 pm

RaTTuS wrote: a PI0 + camaera + network hat may be a better option , or PI2 or Pi3
+1 however we have no idea of budget or infrastructure. Yup we always have further questions :D
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

mikerr
Posts: 2768
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB ports bandwidth

Thu Feb 02, 2017 12:32 pm

ejolson wrote:According to the General Information bullet point 2 from the USB sticky thread in Troubleshooting, the hardware has a limit of 8 simultaneously active USB transactions. Since Ethernet counts for one, bandwidth considerations aside, that leaves at most 7 available for cameras.
Not sure on the continued accuracy of that - there's a note on this thread that says the "8 endpoints limit" is removed, and also someone successfully tested 13 devices:
viewtopic.php?f=63&t=13917

..and for grins I started a new thread with some tests:
viewtopic.php?f=63&t=173343
Android app - Raspi Card Imager - download and image SD cards - No PC required !

Return to “General discussion”