none
isochronous communication RRS feed

  • Question

  • I have a USB bus driver that communicates between two Windows machines over wired connection. : ie. a USB mic is connected to one machine and this device is be virtually configured in another machine over TCP/IP. So the mic appears as a local USB mic in the second machine and acts as a USB mic. The device is configured ( control transfer + isochronus packets) using the normal USB communication. ie. details are fetched from the real device over TCPIP and given to the bus driver in the second machine against each request,using sockets via  a user mode app. The thing is ,on Wifi the audio is not clear and often noisy. How can we rectify this? Is this because the protocol is TCP?

    Wednesday, October 26, 2016 5:54 AM

Answers

  • There is nothing inherently wrong with using TCP/IP, what is important is the environment in which it is being used (short distance vs. long distance; congested vs uncongested network, multiple vs few hops, etc). Most of the problems have to do with lost packets and the default retransmit timers used by TCP/IP. 

    Microsoft contracted me to write the USB over TCP remoting software for their Lync phones, and it worked just fine. Microsoft remotes audio USB devices as part of RDP. For real-time performance, UDP is generally the better choice over TCP because timeliness is more important than correctness (hiss, pops, dropouts, are acceptable). As Pavel suggests, remoting the audio stream rather than the USB probably makes more sense if you're going across the internet.

     -Brian


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

    Wednesday, October 26, 2016 7:27 PM
    Moderator

All replies

  • Is Batman a transvestite? Who knows? You're going to have to characterize the nature of the problem before you - or anyone else - can even begin to form a hypothesis about what the problem may be. I'd start with the Microsoft Message Analyzer (free), which can analyze both USB and TCP/IP to determine what is going on.

     -Brian


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

    Wednesday, October 26, 2016 6:02 PM
    Moderator
  • Remoting USB audio devices is not a good idea, exactly because delays and jitter are not acceptable.

    For example, Spice uses a *local* virtual audio device, which sends captured audio (not raw USB) over their custom low-latency protocol.

    Regards,

    -- pa

    Wednesday, October 26, 2016 6:55 PM
  • There is nothing inherently wrong with using TCP/IP, what is important is the environment in which it is being used (short distance vs. long distance; congested vs uncongested network, multiple vs few hops, etc). Most of the problems have to do with lost packets and the default retransmit timers used by TCP/IP. 

    Microsoft contracted me to write the USB over TCP remoting software for their Lync phones, and it worked just fine. Microsoft remotes audio USB devices as part of RDP. For real-time performance, UDP is generally the better choice over TCP because timeliness is more important than correctness (hiss, pops, dropouts, are acceptable). As Pavel suggests, remoting the audio stream rather than the USB probably makes more sense if you're going across the internet.

     -Brian


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

    Wednesday, October 26, 2016 7:27 PM
    Moderator
  • Thanks a lot for the comments..
    Thursday, October 27, 2016 5:26 AM
  • Hi, I would like to get one more thing clarified with regard to this discussion. The TCP/IP client application has set the TCP_NODELAY flag in socket options. According to the docs setting this option can impede performance. Could this have anything to do with the issue?

    • Edited by its_me_here Wednesday, November 2, 2016 11:51 AM
    Wednesday, November 2, 2016 11:51 AM
  • Possibly. Disabling the Nagle algorithm decreases latency at the expense of increased bandwidth

     -Brian


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

    Wednesday, November 2, 2016 7:09 PM
    Moderator