How to use synchronous endpoint of USB audio device?

4

2

I want to play the same sound over several USB audio devices in sync. Last time I tried something like this was about 2001 and it was successful -- and the pair of Griffin iMics I used back then still work in that usage, but I want more channels now.

I'm having trouble getting this to work with more recent USB Audio devices. I have some devices with C-Media chips, which creates a lot of crackles and pops and drift out of sync relative to the iMics; another device with a TI chip doesn't crackle but still drifts out of sync.

According to my understanding of how USB audio works, the sync problems would be consistent with the iMics using Synchronous clocking and the others using Asynchronous clock.

Now, when I do lsusb -v I see that each of my devices exposes multiple endpoints, some Synchronous, some Asynchronous, and some Adaptive. So I need some way to instruct the audio driver to use the synchronous endpoint. That's where I'm stuck.

  • How can I tell which endpoints are being used? lsof reports a /dev/snd/pcmXXXXX are in use, but I'm not sure whether that corresponds to any particular endpoint. I can see information about endpoints in /sys/bus/usb but I don't know how to tell of any of the endpoints are active.
  • How can I change which endpoint is used, by configuring ALSA or some other library? I've tried looking through the ALSA sources but haven't found any parts that tell how it selects which endpoint to use.

crowding

Posted 2014-06-10T06:19:22.207

Reputation: 436

Answers

4

The USB specification defines three synchronization modes for isochronous endpoints: synchronous, asynchronous, and adaptive.

Nobody uses synchronous. For playback endpoints, adapative means that the device runs at exactly the speed at which the PC decides to sends data; asynchronous means that the device tells the PC how fast it should send data (this is done through a second endpoint in the other direction).

An asynchronous device typically has three isochronous endpoints: one asynchronous output endpoint for playback samples, one input endpoint for playback frequency feedback data, and one asynchronous input endpoint for capture samples. It might also have interrupt and bulk endpoints for mixer control, MIDI, and vendor-specific stuff.

The USB audio driver prefers an adaptive endpoint over an asynchronous endpoint, if possible. (But I don't know of any current device that actually has different endpoint types for the same output; the C-Media CM66xx chips certainly don't.)

So if you want to run multiple devices at the same speed, you cannot affect anything with software configuration; you must use devices that you know support adaptive mode.

CL.

Posted 2014-06-10T06:19:22.207

Reputation: 1 351

You say "Nobody uses synchronous", but I've seen synchronous USB audio in devices by Shure, Apogee, Logitech, Blue, Fender, MXL, and Turtle Beach. Apple's Made for iPod guidelines actually recommend it, especially for input-only or output-only devices. – endolith – 2017-05-08T20:10:08.043

Thanks, that makes more sense. On closer inspection the iMic was defining adaptive outputs and async inputs, and I wan't noticing which was in and out. However, I'm a little surprised that the iMic and the TI chip, both adaptive, would go out of sync with each other. – crowding – 2014-06-12T06:03:36.087

Were they connected to the same bus? – CL. – 2014-06-12T06:41:03.077

Yes, both through the same hub. – crowding – 2014-06-12T06:59:49.830