none
Connecting multiple devices to USB3.0 port RRS feed

  • Question

  • Hi,

     I am trying to connect 24 camera's to a windows 7 desktop that I have. I have the following configuration.

    Operating System: Win7 Ultimate

    USB Clients: 8Megapixel camera.

     I am using the Directshow library and accessing the clients using a application developed in C#. Now for testing, I have connected a single camera and everything works fine.

    However, I need a way to determine during the development phase now whether the default drivers on my machine will be able to work fine if I have 24 of these devices connected in a daisy chain fashion , without actually buying all 24 and connecting them to see(that would be the easiest way and I will do it at a later date, however, I am not sure if I will be using the same module due  to some other factors, so do not want to invest into that)

    I read some details about USB enumeration process and that how each connected client tells the host what bandwidth it will need. Now do I am trying to determine if there would be an easy way to access the client side of firmware so when it talks it can settle at a lower bandwidth initially. As I read in one of the blogs from msdn.

    Bandwidth issue is one of the aspects involved I feel based on my limited experience, any other suggestions, pitfalls pointed out will be highly appreciated.

    Any other clarifications/questions, I would be happy to answer.

    Best Regards,

    cnanda


    • Edited by cnanda Tuesday, February 25, 2014 11:19 PM spell check
    Tuesday, February 25, 2014 11:18 PM

Answers

  • This is not a simple problem.

    Will all the cameras be streaming at the same time? If so, then I suspect that you'll need ALL of your devices (including hubs) to be USB 3.1 to even have the slightest chance of this working, but it still depends upon how much streaming bandwidth (resolution * frame_size * frame_rate) will be consumed by each camera.

    You need to have a very good understanding of the bandwidth of your devices and the bandwidth capabilities of your topology (putting all the cameras on the same host USB port is not likely to work; most hosts today have 4 or 8 USB ports, so spreading the cameras across them may work, but then you need to worry about bandwidth from the host controller(s) to system memory, and then how much system memory you'll need, and so on). Most cameras have multiple selectable configurations that consist of different resolutions and bandwidths, which are selectable by the host.

    To start with, you need to learn a lot more about USB devices and hubs and the specific camera that you're considering using. Use the USBView tool (part of the WDK) to learn about what configurations your camera supports, and read the manufacturer's documentation cover-to-cover. Look at the camera class driver (or the manufacturer's driver) and learn how to use it. Then look at your motherboard's I/O chipset and read the datasheet to determine how much bandwidth it can handle, then do the same thing with your motherboard's memory controller and memory.

    Assuming you get all these streams into your system, what are you going to do with them? You're unlikely to be able to stream 24 cameras worth of data to disk without jumping through a lot of hoops - assuming the disk I/O path has enough bandwidth.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting.

    Wednesday, February 26, 2014 1:50 AM
    Moderator

All replies

  • This is not a simple problem.

    Will all the cameras be streaming at the same time? If so, then I suspect that you'll need ALL of your devices (including hubs) to be USB 3.1 to even have the slightest chance of this working, but it still depends upon how much streaming bandwidth (resolution * frame_size * frame_rate) will be consumed by each camera.

    You need to have a very good understanding of the bandwidth of your devices and the bandwidth capabilities of your topology (putting all the cameras on the same host USB port is not likely to work; most hosts today have 4 or 8 USB ports, so spreading the cameras across them may work, but then you need to worry about bandwidth from the host controller(s) to system memory, and then how much system memory you'll need, and so on). Most cameras have multiple selectable configurations that consist of different resolutions and bandwidths, which are selectable by the host.

    To start with, you need to learn a lot more about USB devices and hubs and the specific camera that you're considering using. Use the USBView tool (part of the WDK) to learn about what configurations your camera supports, and read the manufacturer's documentation cover-to-cover. Look at the camera class driver (or the manufacturer's driver) and learn how to use it. Then look at your motherboard's I/O chipset and read the datasheet to determine how much bandwidth it can handle, then do the same thing with your motherboard's memory controller and memory.

    Assuming you get all these streams into your system, what are you going to do with them? You're unlikely to be able to stream 24 cameras worth of data to disk without jumping through a lot of hoops - assuming the disk I/O path has enough bandwidth.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting.

    Wednesday, February 26, 2014 1:50 AM
    Moderator
  • I already said that, in 1/10 the space


    The original poster clearly is a beginner and needs to be shown how to solve the problem. You provided some conclusions but not how to solve the problem, or how to determine whether the problem is solvable. The purpose of this forum is to help people solve their problems.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting.

    Wednesday, February 26, 2014 2:27 AM
    Moderator
  • Hi ,

    I feel I need to share a few more details.

    1. I would not be streaming from all 24 camera's at the same time, but only one. The camera that  will be active will be streaming in the video and capturing and saving the picture on to the disk. I will run some visual analytics on these images later on.

    2. I want to keep the resolution at 8MP for now.

    3. I intend to loop through each camera between intervals of several seconds(user defined), in a daisy chained fashion.

    4. The only way I could imagine doing that is through a hub connected to each port. So , actually had another question regarding the number of hubs that can be connected to a port.I tried connecting two of them to a single port (in a daisy chained manner )from a vendor , and got "maximum hubs connected to a port exceeded error". It could be something to do with the fact that each hub has 9 ports and has 3 controllers for the 9 ports. But would be good to know the limitation windows has on the number of hubs connected, either to one port or to multiple ports.

    5. So what I want is that all the devices be enumerated and remain connected at all times , maybe not at the maximum possible bandwidth but at a lower bandwidth and then when it is necessary, I could change the streaming bandwidth during the "run" mode when it is looping through the different camera's.

    and so the easy answer I want to get to is that, is it possible to do all this through the default windows driver that get instantiated when I connect the camera's? or do I need to dive in to a custom driver development.

    USBView tool would be a good point to  start looking into for a start.

    5. The reason I am trying to connect all of them to a single hub is due to the geometric placement of the camera's , to try and  limit the cable length to a minimum(16ft is what I anticipate now ). I tried connecting a 5 meter cable and got a connection error from the application that I have. Although USB repeaters should be able to support greater lengths. USBview tool from WDK is definitely a good point to start at.

    6. The USB hubs are powered separately so that is not an issue.

    7. Also what would be a good resource to look at understand how the directshow interacts  with the camera driver class.

    For me to do :

    1. read through the USB 3.0 specifications , I am doing that now.

    2. Will look at camera's class driver and try and understand how it is handled by windows.

    and once again many thanks for your comments, I will discuss this further with my peers and look through some of the resources pointed out.

    Best Regards,

    Chinmay


    • Edited by cnanda Wednesday, February 26, 2014 3:38 PM clarification
    Wednesday, February 26, 2014 2:02 PM
  • 4. Were they self-powered hubs? If not, you likely ran into power issues. You REALLY need to read up on USB or you're not going to get very far in this project. I'd recommend the book from MindShare.

    5. They can all be connected at the same time, especially if you're only streaming from one at a time. Using daisy chained hubs will allow you to get around some of your cabling limitations.

    7. DirectShow and the USB video camera class drivers are well documented on MSDN

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting.

    Wednesday, February 26, 2014 11:01 PM
    Moderator
  • Hi Brian,

    Yes they are all self powered hubs.

    Thanks for the pointers on the book and the resource, will try and have a look at those. 

    Could you also share your experience about the maximum allowable hubs that can be connected ? Or any recommendation on a particular hub that you have used ?. As that is another issue which I am running into. When trying to  connect the second hub I get "maximum hub capacity reached" error.

    -Chinmay

    Wednesday, February 26, 2014 11:55 PM
  • You'll see that error if you cascade 6 or more hubs (the USB 1.1/2.0 spec only allows 5 hubs; I don't remember if USB 3.x is the same). I don't know why you would see it with just two, unless the hub you're plugging into is already 4 deep. Go into USBview, and count the hubs between the system port and your hub.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting.

    Thursday, February 27, 2014 12:40 AM
    Moderator
  • Hi,

    Many thanks for the inputs, I have started fiddling with the USB View tool. The hub that I found has 3 controllers for the 9 ports, this shows up as 3 hubs when I connect them to the PC.That is the way this manufacturer has it(opened up the box to see it ).

    If 5 is the maximum limit  though then I guess will have to look for a different hub altogether, or think something differently.

    Thanks once again.

    -Chinmay

    Thursday, February 27, 2014 2:10 PM