I have searched for a way to convert an I2S stream to USB audio and have only managed to find USB to I2S, not I2S to USB. Please advise me as to how this is possible.

  • \$\begingroup\$ A DSP with I2S and USB interfaces would be a general answer to your general question. \$\endgroup\$ – Eugene Sh. Apr 2 at 19:16
  • \$\begingroup\$ A DSP such as?? \$\endgroup\$ – James Conway Apr 2 at 19:17
  • 1
    \$\begingroup\$ Without researching the details, a guess as to a key problem may be clocking (presumably the I2S source is providing a clock, not accepting one, though that would be possible). Likely you can find what you want, at least in the form of a toslink type optical S/PDIF input on professional audio gear. But it may be better to see if there isn't a better path to solving your actual problem. What are you really trying to do? \$\endgroup\$ – Chris Stratton Apr 2 at 19:27
  • \$\begingroup\$ I take analog inputs into a PCM3168 (ti.com/lit/ds/symlink/pcm3168a.pdf) and take an output of I2S which I want to be converted to digital USB audio. \$\endgroup\$ – James Conway Apr 2 at 19:30
  • \$\begingroup\$ You can do this with most microcontrollers with a USB peripheral and I2S peripheral, the USB audio spec is freely available and quite straightforward \$\endgroup\$ – Colin Apr 2 at 20:40

I have searched for a way to convert an I2S stream to USB audio ...is it possible?

I think you are thoroughly confused at the difference between a control channel/device driver, a data format and an interface.

USB Audio as a spec does NOT specify the data format. It is a USB based control system for Audio output and input. See the USB Audio 3.0 spec here, and read Audio30.pdf within the zip file.

This will explain that USB Audio can 'control' endpoints that consume either analog or digital data.

Read further into Frmts30.pdf and you'll find that you could transport PCM (I2S uses PCM audio format) over the data channel and consume/convert in an endpoint of your design ….all controlled by USB Audio.

I2S is the interface definition for clocking PCM data from one chip to another. NXP have not maintained a spec in many years, but many others keep updating it, this definition from Cypress does a good job.

So there is NO conversion for I2S to USB Audio since I2S is a data format and USB Audio is a control system. You could extract the PCM audio data from an I2S stream (but there are chips for that), and I'd bet you already have the data stream in a PCM format somewhere in your system.

  • \$\begingroup\$ could you give an example of these usb audio control chips? \$\endgroup\$ – James Conway Apr 3 at 6:20
  • \$\begingroup\$ Almost invariably they will be an MCU with inbuilt USB interface. \$\endgroup\$ – Jack Creasey Apr 3 at 15:11
  • \$\begingroup\$ Does it have to be an MCU? \$\endgroup\$ – James Conway Apr 3 at 19:31
  • \$\begingroup\$ If it's to meet any significant number of USB Audio functions, then yes. \$\endgroup\$ – Jack Creasey Apr 3 at 21:56
  • \$\begingroup\$ could it not somehow be done with an arduino \$\endgroup\$ – James Conway Apr 4 at 15:49

I take analog inputs into a PCM3168 (ti.com/lit/ds/symlink/pcm3168a.pdf) and take an output of I2S which I want to be converted to digital USB audio

Ideally into a Type A socket on a computer

Now it is clear that the question exposes substantial gap in understanding of USB system architecture and related economy of development.

The audio I2S streams can not just be "sent" to "USB audio", they are just raw digital data formats for audio codecs. Which means that audio signals gets digitized (with high accuracy/resolution) and are converted into I2S digital serial format.

On the other end, the "USB audio" is a very detailed specification for the specific class of USB devices to handle audio streams. The Audio Class has to be implemented in a MCU that handles the I2S streams from PCM3168 "Audio Codec", and bridges these streams into USB-defined format. The transport interface is bi-directional, audio USB can output sound and read microphone (or line) inputs.

Technically you can implement any USB interface to bridge the I2S streams with USB streams, but you will be facing enormous development time for your PC drivers. But if you manage to implement all elements of Audio Class Device, implement all USB descriptors and endpoints correctly, and obey all the requirements for data buffering and throttling and clock synchronization, you will immensely benefit form existence of Windows and Linux/Unix/Android audio device drivers. To get a sense of what the USB audio implementation means, this SiLabs appnote might be useful. You also might want to familiarize yourself with the 130-page actual specification.

Overall, it would probably take 3-4 engineering man-years to implement the idea of taking PCM3168 to some MCU (or DSP) and implement audio class USB device.

Alternatively people are using standard USB dongles for input (recording) and output (headpones or line-out) of simple stereo signals, where all the above is already implemented and integrated into a single IC, so the street prices for these dongles are $1 - $15.

enter image description here

If you need more sophisticated audio I/O with extra quality, HiFi and low 130 dB noise level, something like Creative Labs Soundblaster will start from about $150.

Still it would be difficult to beat these prices facing 3-4 years of learning and development.

  • \$\begingroup\$ Beware those cheap dongles have only mono in even though they are stereo out. Granted, that may be enough for the unclearly stated orginal need motivating this question. \$\endgroup\$ – Chris Stratton Apr 3 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.