Shoving a LOT of data out of multiple USB-serial ports

Sdílet
Vložit
  • čas přidán 23. 07. 2024
  • Optimising througput on multi-port FTDI USB-serial interfaces
  • Věda a technologie

Komentáře • 57

  • @gexwing
    @gexwing Před 8 lety +21

    Serial bus utilisation: 102%, you should patent that one :)

  • @JacGoudsmit
    @JacGoudsmit Před 8 lety +6

    Interesting research! I write software to talk through FTDI devices all the time (not by choice) so this is definitely something to keep in mind in near-realtime applications: Keep the packets at 2048 bytes or less, or you lose half of your effective bandwidth.
    Thanks for posting!

    • @mikeselectricstuff
      @mikeselectricstuff  Před 8 lety +3

      +Jac Goudsmit Bear in mind the packet sizes may be different for the non high-speed USB devices

  • @ClearInstructionsOnly
    @ClearInstructionsOnly Před 8 lety +4

    Very Clear Instruction indeed. Successfully shoved lots of data out of multiple USB port. Thank you.

    • @ClearInstructionsOnly
      @ClearInstructionsOnly Před 8 lety

      +Virulent I have done many Clear Insctruction videos so far, and can see very fast if Instructions are given clear or not:)

  • @bigclivedotcom
    @bigclivedotcom Před 8 lety +13

    I would guess that there might be a [particular laptop or motherboard configuration that might implement the USB in a more optimised manner. But that's almost like the days of the PCW bench tests where computers were tested against each other in ridiculously specific manners. RS485 is definitely a nice rugged industrial data transfer system. Quite fascinating in its own right. (Although the more technical details of the 120 ohm characteristic impedance are quite frankly not very entertaining at all.)

    • @whitcwa
      @whitcwa Před 8 lety

      +bigclivedotcom I had a problem with some VTR which used 485 remote control. One day, someone replaced one of the units and we started getting intermittent errors. It turns out that all of the VTRs had their termination switches ON and they were looped together. It worked with four switches on (30 ohms!) , but five caused problems. We turned all of them off and used an external terminator on the last one in the chain.

    • @mikeselectricstuff
      @mikeselectricstuff  Před 8 lety +5

      +Chris W That's the thing about 485 - when done right it's bombproof, but can "sort-of" work if not wired correctly. First thing to do on any 485 setup is an end-to-end resistance check for opens & wrong termination.

    • @DarkInsanePyro
      @DarkInsanePyro Před 8 lety

      +mikeselectricstuff +1 to the soft-of work part, especially on a multi-drop network! We use 485 nearly exclusively in our products at work. Sometimes though (usually user error) the network is terminated/polarity inverted/transceiver mode set incorrectly and the issue pops up in a random location on the bus. Agree with checking resistance, found the point of issue quickly that way. Fun when the data is corrupted/inverted due to one of the two lines being O/C or S/C.

  • @obiwanjacobi
    @obiwanjacobi Před 8 lety

    Excellent video, Mike. You should make more of these design vids - I love them! Thanx!

  • @kuro68000
    @kuro68000 Před 8 lety +1

    Another excellent experiment and video. Thanks.

  • @morkey74
    @morkey74 Před 8 lety +1

    like your scope. It makes test easy when you have the right equipment

  • @stevenking2980
    @stevenking2980 Před 8 lety

    Love your vids. Been subbed for two years or so, and if I may, can we have some more year down vids please sir? I would send some stuff if shipping wasn't off the scale from NC to you!
    Thanks to Mike and his electric stuff!

  • @eigenvector7035
    @eigenvector7035 Před 4 lety

    Revisiting this video after a very long time, since You said it's a driver issue, I'm curious whether there would be the same problem in a Linux/BSD environment. I'll definitely keep that in mind when dealing with these.

  • @PinguimFU
    @PinguimFU Před 8 lety

    +mikeseletricstuff some ealier usb 3.0 boards use different chipsets for the USB 3.0 and USB 2.0 ports maybe that,s a way to go around the port limits?

  • @tomvleeuwen
    @tomvleeuwen Před 8 lety +1

    Do you call the write functions in parallel threads or sequentially? I figure if you spawn one thread for each endpoint, it all goes fast again.

  • @AndrewBorrill1
    @AndrewBorrill1 Před 2 lety

    Great video as always. Looks like Easysync may have gone out of business in December 2021. A shame as their equipment is very good. Ebay may be the only source now.

  • @MichaelBeeny
    @MichaelBeeny Před 8 lety +12

    I was just wondering why you up loaded a wide screen (16 x 9 ish) video within a 4 x 3 frame? Thought it was odd, you being a tech kind of guy! interesting vid however.

    • @TheChipmunk2008
      @TheChipmunk2008 Před 8 lety +2

      +Michael Beeny 4:3 is standard, youtube seems to like 16:9 for no clear reason, so youtube's fault?

    • @TheTjopp
      @TheTjopp Před 8 lety

      +Michael Beeny Getiing video right is notoriously tricky

    • @mikeselectricstuff
      @mikeselectricstuff  Před 8 lety +2

      +Michael Beeny Just reinstalled Vegas and settings are messed up - not got around to sorting it out yet

    • @aptsys
      @aptsys Před 8 lety

      +Michael Beeny Yawn, who cares. You can see the content, so no worries.

    • @FrankSandqvist
      @FrankSandqvist Před 8 lety +3

      +TheChipmunk2008 I wouldn't say 4:3 is standard at all anymore.

  • @Kilohercas
    @Kilohercas Před 8 lety

    I am using SPI interface of FT2232H, it is very nice, and can get 30Mbps with no problem ( good thing is DMA can get 65535 space, just like maximum packet size. And it use bus quite well. For very short packets it can be 10KHz repetition rate, and for longer packets, it will shift more data. And only at small packets, bus utilization is not very efficient, but with larger packets, it is very good.
    But yes, it's for single point communication, unless you will change SPI to differential signaling or something...
    FTDI just released USB 3.0 with parallel interface i think i will give a try

  • @TheJeremy5599
    @TheJeremy5599 Před 8 lety

    i saw in a comment you use sony vegas for your video's
    what are your computers specs?

  • @keiyakins
    @keiyakins Před 8 lety +1

    Did you try using a different pair of ports? I know a lot of PCs these days actually have multiple USB controllers, so if you got one of those on each of them you'd have better results.

  • @AintBigAintClever
    @AintBigAintClever Před 8 lety

    Maybe if the USB size limit is a common issue (OS rather than motherboard, for example) then perhaps you could use a client-server setup, either with a PC hammering data across Ethernet to its clients or using Raspberry Pi, etc. as a smart "here's a big fat packet, now chop it up and bang it out to your USB ports" device.

  • @AttieGrande
    @AttieGrande Před 8 lety

    did you try a multi-threaded (/multi-process) application? I wouldn't be too surprised if your write call is blocking just that thread... It could possibly permit even better parallelism with the sub-2k packets, and would likely bring down the inter-port latency with larger packets too... unless the FTDI driver is genuinely badly implemented.

    • @AttieGrande
      @AttieGrande Před 8 lety

      or try setting the non-blocking flag!

  • @prankmypants
    @prankmypants Před 8 lety

    have you played with usb3.1? i think you can address more ports than usb2.0

  • @0MoTheG
    @0MoTheG Před 7 lety

    Please update the description to be more clear/specific.
    What is the source (PC with software?) and what is the sink (µC with RS-232)? What are you measuring where? Many things only got clear as I watched the video.
    "Shoving multiple data streams out of one USB port to UARTs" Would be more descriptive.

  • @ceecrb1
    @ceecrb1 Před 8 lety

    As rs485 is dmx, why not try ethernet to dmx node style setup? Curious rather than saying its better.

    • @stonent
      @stonent Před 8 lety +2

      +ceecrb1 10:26

    • @ceecrb1
      @ceecrb1 Před 8 lety

      +stonent yeah like an idiot I typed before watching the whole video....

  • @tHaH4x0r
    @tHaH4x0r Před 8 lety +1

    Looks to me as if an IT guy programmed that part. This is the exact same way a lot of routers handle packets larger than a particular size (i.e. just drop)

  • @GeorgeTsiros
    @GeorgeTsiros Před 8 lety

    Just so I'm sure I understood, you just want to send lots of data to multiple serial ports through *one* USB connection on the PC, right?

  • @donpalmera
    @donpalmera Před 8 lety

    I suspect the Linux drivers won't have these issues. I think for windows a libusb based driver tuned to handling multiple ports via better scheduling/multiple threads might be the way to go.

    • @dorsetengineering
      @dorsetengineering Před 8 lety

      The Linux d2xx drivers have other, un-fixable bugs... :( faulty implementation of FT_GetQueueStatus being the main culprit.

    • @donpalmera
      @donpalmera Před 8 lety

      Hugh Frater I meant the driver in the kernel.

    • @dorsetengineering
      @dorsetengineering Před 8 lety

      Ftdi_sio and usbserial modules? As you say, these are probably good as I think they are open source. Libftd2xx.so is most certainly closed and most certainly buggy.

  • @DarkInsanePyro
    @DarkInsanePyro Před 8 lety +1

    It didn't make sense he was whispering... turns out I heard him through my headphones and not speakers. Late evening. -_-'

    • @TheChipmunk2008
      @TheChipmunk2008 Před 8 lety

      +DarkInsanePyro Mike whispering makes a good evening :)

  • @goyabee3200
    @goyabee3200 Před 8 lety +9

    megabaud

    • @unlokia
      @unlokia Před 8 lety

      Who *says* that, lol.

    • @johnkapri6306
      @johnkapri6306 Před 8 lety +1

      +unlokia I do. I also say "nineteen-kay-two baud" and "nine-kay-six baud". If you have to say that often, you tend to keep things short.

  • @nplanel
    @nplanel Před 8 lety

    +mikeselectricstuff : The driver should implement scatter/gather I/O (Vectored I/O) ; It's quiet common in driver/kernel world with hardware buffer limitation. From the user point of view the driver will split the big packet in 2k chunk, and send it to the hardware. Quite easy to implement, shame on FTDI driver guys.

  • @joelholdsworth
    @joelholdsworth Před 8 lety +4

    This is why you EE guys really need to get into Linux. Often these edge cases are much better handled - or if not at least there is an opportunity to do something about it.

    • @Gooberslot
      @Gooberslot Před 8 lety +1

      +fractureforce He said on the Amp Hour that he doesn't think too highly of free software. :(

    • @ethanpoole3443
      @ethanpoole3443 Před 8 lety +1

      +Gooberslot Everyone has different experiences and needs and all the various OS fans get too hung up on which OS they think everyone should have to use/not use.
      I love Linux for servers and some development work and use it heavily for such, but it is nothing but headaches for me on the workstation front so I am not terribly fond of Linux for workstation use nor would I try to make my less than tech savvy family use Linux workstations. Plus constantly needing to emulate Windows under Linux can be a headache as I have a lot of commercial software and drivers that do not have comparably effective Linux counterparts and I have better things to do than reinvent the wheel and author all the code required to replace them. To each their own!

    • @joelholdsworth
      @joelholdsworth Před 8 lety

      +Ethan Poole Yeah - but you seem rather hung up on your non-support for Linux.
      It's only a suggestion. Mike can consider the suggestion, and look into it - or not. Of course a transition would require some changes to workflow - that's one of the costs of trying something new, and why many people dual-boot.
      I'm just saying that many people - myself included have benefited in their projects from having access to the inner workings of their OS. Which is why I'm saying it's a useful tool to have on hand.

    • @joelholdsworth
      @joelholdsworth Před 8 lety

      +Gooberslot At 7:36, he appears to be using LibreOffice Calc - so he clearly doesn't have too big a problem with it. Also it's nice to see non-Linux users gaining awareness of the need for LibreOffice over Apache OpenOffice.

  • @rfmerrill
    @rfmerrill Před 8 lety

    Wouldn't it be easier to use ethernet? USB is such a chore, and Ethernet usually gives userspace code access to basically the raw data.

    • @rfmerrill
      @rfmerrill Před 8 lety

      Yeah but they give you kind of a shakey serial interface (you can't /actually/ do full-duplex)

    • @rfmerrill
      @rfmerrill Před 8 lety

      Well I meant as an interface to the RS485, not replacing it. They make ethernetRS485 adapters already.

    • @superdau
      @superdau Před 8 lety

      +rfmerrill
      Did you read Richard's reply at all?

  • @joblessalex
    @joblessalex Před 8 lety +1

    First.