Low latency (<10ms) buffers for USB audio drivers in Windows 10? - winapi

I've been working on some WinAPI code to try to get audio latency as low as possible in Windows 10 natively. I eventually found this documentation which indicates the WASAPI in Windows is the lowest level you can get to, and there are even some improvements in Windows 10 to make the latency even lower. Most notably, support for <10ms audio buffer sizes with newer drivers.
I used the WASAPI but the latency still isn't quite low enough. I'm measuring about 80ms round trip using USB microphone and audio devices. I tested the new drivers mentioned and successfully got lower latency and smaller buffer sizes, but the only drivers mentioned seem to be the "High Definition Audio Device" driver, which I traced to hdaudio.sys. However, typical USB audio devices seem to use "USB Audio Device" drivers, implemented in usbaudio.sys instead I believe, which isn't allowing smaller buffer sizes.
It seems like the changes to allow smaller buffer sizes are relatively minor, but for some reason the stock HD Audio drivers contain these updates but the stock USB Audio drivers do not. What is happening here? Do these updated USB Audio drivers even exist in Windows?

For those looking to operate generic USB audio hardware on Windows at low latency, the KoordASIO driver provides a convenient ASIO-WASAPI bridge, enables either WASAPI Shared or Exclusive mode, and configurable buffer size.
https://github.com/koord-live/KoordASIO

Related

Identify Windows USB Sounddevice by physical USB port connection

When I connect several USB audio devices using the default drivers I usually end up with some kind of friendly device description like "nn- USB Audio codec" or something else, so I have currently no unique property which refers to a specific hardware the e.g. manufacturer ID. I would like to ensure that in case of re-enumerating or replugging the hardware to a different port that my software will automatically identify the changed windows audio device which maps to this hardware. I there a possibility to gather further windows audio device information which can be used to determine the physical hardware ?
Maybe a little clarification is needed:
I have two or more USB audio devices, not necessarily same product or manufacturer. The audio connections have different purposes, so I want to ensure that I my software uses constantly the same physical audio devices for different tasks. This sometimes fails when a re-enumeration occurs ( sometimes without changing the physical USB port connections, it's a windows thing...)
Ideally I would distinguish them by an individual serial number, which usually is only available with storage devices. But what I can retrieve is the "physical" USB topology when I'm looking at the device with a tool such as USBDeview from Nir Sofer. There I have a property like "Hub 3, Port1". If I could map this to a sound device I get from audio audio api like "nn- USB Audio codec" as seen in the sound control panel I would be perfectly happy.
Edit2:
May be this[1] post helps here, but I still have to figure out how to get a USB Port <-> Windwos Sounddevice mapping.
[1]: Can the physical USB port be identified programatically for a device in Windows? "

Initial protocol between Webcam and driver

Is video data that comes from Webcam to low level USB driver already encoded?
What does the low level webcam driver actually do? What is its main and only minimum mission?
Where can I read the principles or the protocol between the webcam hardware and standard Windows driver?
Ok, based on 5 webcams, that have bought to understand the difference between them, I can make some conclusions.
> Is video data that comes from Webcam to low level USB driver already encoded?

How can I open an exclusive audio output in Windows XP?

I want to use the system's mic in/speaker out jacks to measure and fix voltage drops, but I cannot do this reliably without ensuring that my program has exclusive control of the audio. Is this possible in Windows XP? I have read about various API's that are available (WaveOut, Mixer) but have not found any information on taking exclusive control of an audio device before Windows Vista or 7.
Apparently the WDM kernel streaming API could possibly take exclusive control of the sound card, but this is undefined behavior. I might be able to work around by disabling the sound card by default in system settings, but this is less than an ideal solution (because it would still be possible for other applications to use the sound card).

Reading audio from a usb synth

I would like to experiment with real time audio and was wondering what options are there for accessing audio via a usb port?
I would like to get data from this hardware in an audio stream.
Is this sort of thing best handled by audio frameworks or should the data be fetched using IOKit and passed to e.g. an audio component using a framework?
Also, how is this access effected if e.g. A DAW is accessing the audio from the port? Is dual access handled by the OS?
The specs page for that hardware (Moog Minitaur) doesn't claim that it can transmit audio over USB, only that it has USB MIDI- essentially it has a built in MIDI interface.
If you wanted to get audio from it into your computer you would have to connect it to your computer's line or mic input, or an external soundcard - which may itself connect via USB. One way to handle audio in OSX would be Core Audio. You shouldn't need to write any drivers or anything to deal with the low-level I/O with the soundcard, as the soundcard should come with a driver if there isn't one already in the OS.

How do I share/mix sound output across the network on Windows?

I'm looking to replace a hardware mixer with software, to increase the flexibility of our system and reduce hardware complexity
We have 4-8 server-class PCs (Windows 7) connected in a local LAN via gigabit Ethernet.
Each PC has a USB sound card which is connected to an 8-input mixer.
The output from the mixer is sent to speakers in a few places.
What I'd like is change is:
route the sound over the network instead
each computer should can thus listen to all others and output it's own "mix"
less cables
If possible, support for really cheap hardware (i.e. raspberry pi or something)
There is no hard requirement on latency and such. Up to 100 ms is acceptable (i.e. way higher than your average quake ping...).
While I prefer open source, I'm also open to redistributable commercial solutions, for this to be economically viable, the license costs can't exceed 30-40 €/server. (Preferrably less..)
Grateful for all help!
(Please also share you experiences if possible, not just post links..)
Related question:
https://stackoverflow.com/questions/4297102/how-to-create-a-virtual-sound-card-on-windows <- doesn't seem to interconnect over network

Resources