Ultimate USB to I2S interface

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
[ ... ]
Full-speed USB is not enough bandwidth for 4 channels at 192KHz, but 2 might be possible if the peripheral will do it, but it's close to the limit of USB FS. For 192KHz USB HS is really required, but few uCs that are reasonable to DIYers support it.

2-channel 24/192 requires 9.216 Mbps well below USB 1.1's maximum data rate of 12 Mbps.

The problem with USB 1.1 and 2-ch 24/192 lies in how the 1.1 spec is implemented. As long as the DAC is the only device on a particular USB bus, all is well. However if two (or more) devices are connected to a USB 1.1 bus, the specification calls for a hard limit to be imposed on each device of 1/2 the maximum data rate, regardless of the actual data requirement.

So, even though such things as a keyboard or mouse have very small data requirements and are configured under USB 1's Low Speed Data rate of 1.5 Mbps, connecting such a device to the bus limits the second device's data transfer rate. Thus, even though 1.5 + 9.216 = 10.716 and that is below 12 Mbps, the audio device will be throttled to below it's required data transfer rate.

One of the areas addressed with USB 2.0 is this behaviour, so that USB 2.0 is not under such a hard limit (there's a limit, but it's more than 1/2 the maximum ... I don't have the details as to what it actually is, but it's moot since it's more than 12 Mbps). However connecting a USB 1.1 device to a USB 2.0 bus can cause the bus to limit itself to USB 1.1's maxumum data transfer rate.

Not every computer has a USB bus exclusively assigned to each USB connector; it's hardly unheard of for a PC to have multiple ports (it's a salable "feature") but rather than each assigned to a USB bus exclusively (which costs money) some of them may be shared. I believe that there is usually at least one dedicated USB bus available via a USB connector, ... on a decent machine there should be at least two ... but then again when minimizing cost is paramount it's possible, I suppose, for an example out there to break that rule.

All Apple computers have a dedicated USB bus assigned to each connector, and "better" PCs probably will, but when the price goes down, all bets are off. Laptops will require multiple devices connected internally to a USB bus (camera, keyboard, mouse, bluetooth module, WiFi, card reader, etc) so the exact configuration internally can be a problem, or unknown.

Note that the problem can arise even if the audio device is limited to, say, 24/96. It is imperative that an audio device of the quality we're interested in is connected to a dedicated USB bus.

If the computer has USB 2.0 ports, there will be either one or two ECHI controllers. Each controller (not each USB port) supports 480Mbps maximum.

It is much better to have two, so that the audio device can be connected to it's own controller, and more importantly so that the internal USB ports are not impeding the external connectors available.

Intel, AMD, Broadcom and nVidia sell 2-controller southbridge chips but there are also Intel, AMD and Broadcom chips with just one, covering all USB 2.0 ports. All Sis, VIA and ULi southbridge chips have only 1 ECHI controller for all USB ports.
 
Last edited:
2-channel 24/192 requires 9.216 Mbps well below USB 1.1's maximum data rate of 12 Mbps.
I haven't pushed the practical limits before, so I'm cautiously optimistic about sustaining 9.216Mbps reliably, even over a dedicated host port, didn't mean to say that HS is an absolute requirement necessarily. Do you have experience here? USB has a fair amount of low-level protocol overhead, in addition to being half-duplex, so I'm not too sure what it's practical limits are in iso mode.

The problem with USB 1.1 and 2-ch 24/192 lies in how the 1.1 spec is implemented. As long as the DAC is the only device on a particular USB bus, all is well. However if two (or more) devices are connected to a USB 1.1 bus, the specification calls for a hard limit to be imposed on each device of 1/2 the maximum data rate, regardless of the actual data requirement.
Correct me if I'm wrong, but I think this is managed by the OS's USB stack, which will reject requests for iso bandwidth that isn't serviceable by the current state of the bus, so the user should at least get an error of some sort. Anyway, everything is USB2 these days, even if it only supports FS, so I don't think it's a real problem.

Even if the user needs to fiddle and find a free USB host port, I think that's an acceptable tradeoff for affordable and easy to implement USB audio with asynchronous clock, however it's implemented.
 
The problem with USB 1.1 and 2-ch 24/192 lies in how the 1.1 spec is implemented. As long as the DAC is the only device on a particular USB bus, all is well. However if two (or more) devices are connected to a USB 1.1 bus, the specification calls for a hard limit to be imposed on each device of 1/2 the maximum data rate, regardless of the actual data requirement.
Can you cite the section of the USB 1.1 spec where it defines this 1/2 data rate limit? Is the USB 1.1 specification even still available from the USB organization? It seems like all new devices are supposed to be USB 2.0, even if they only run at Full Speed or Low Speed. But I have found it difficult to obtain the specifications for USB 1.1 whenever I want to verify the compliance of older USB hardware. Am I just looking in the wrong places?

One of the areas addressed with USB 2.0 is this behaviour, so that USB 2.0 is not under such a hard limit (there's a limit, but it's more than 1/2 the maximum ... I don't have the details as to what it actually is, but it's moot since it's more than 12 Mbps). However connecting a USB 1.1 device to a USB 2.0 bus can cause the bus to limit itself to USB 1.1's maxumum data transfer rate.
USB-Audio should use Isochronous endpoints, which have a limit of 1024 bytes payload per frame, with 1000 frames per second. That's 8.192 Mbps maximum. A Device is allowed to have multiple Isochronous endpoints active at one time, so technically it should be possible to reach closer to the theoretical maximum of perhaps 11.856 Mbps. You cannot actually reach 12 Mbps because of the overhead of USB transactions, and I had to build a spreadsheet to find the optimum payload size to even get that close. However, it's rather moot, since every shipping operating system seems to set the limit to 1024 bytes per frame anyway, meaning that your device will not even enumerate (will not be enabled) unless you have no more than 1024 isochronous bytes per frame maximum.
 
That is a great idea and worth exploring.

Of course, if it's worth doing, it's worth doing right. Here we are playing with I2S to a large extent because the alternatives were done wrong for no good reason. Certainly we should avoid that if we intend to create something that has any chance of being adopted by careful users.
I'm glad we're potentially on the same page, here. However, I should point out that I envision something more along the lines of the types of connectors you see running between boards inside the same chassis. I am not thinking at all about the HDMI connector, F-connector, BNC, RCA or anything designed for the outside of a chassis.

I am communicating with someone who is designing a USB-Audio board with processing and DAC capabilities, and he has already decided to use a simple ribbon cable. This would probably be something common like 12-pin, 100 mil headers and cables. I convinced him to use a pin-out that is compatible with LVDS, or at a minimum will place ground between each signal if it is not balanced. Ribbon cables are (were) available with twisted pair configurations, which should be fairly robust.

I was personally considering a Hirose connector for Flat Flexible Cable. These do not offer twisted pair configurations (to my knowledge) because they are flat wires, not stranded 'round' wires. But the same balanced pin-out should work.

Something along the lines of:

01 GND (can serve as reference)
02 Master/Slave CLK Select
03 MCLK+
04 MCLK-
05 BCLK+
06 BCLK-
07 WCLK+
08 WCLK-
09 DATA+
10 DATA-

The Master/Slave Select effectively makes the MCLK bidirectional, so that a DAC board can choose to either source its local clock or slave to the I2S board. All other pins, 5-10, are outputs from the I2S board to the DAC board.

One question I have is whether people here are designing with DAC chips that require a Return data path to the main processor. If that is the case, then the connector needs a couple more pins to accommodate those chips.

Another of my proposals is to design for compatibility between LVDS and single-ended designs. Obviously, the benefits of LVDS would not be realized unless both the I2S board and the DAC board were differential, but it should still be possible to mix types as long as single-ended is acceptable for those combinations. Single-ended transmitting boards would just connect the (-) pin of any signal to ground, single-ended receivers would ignore the (-) pin and reference pin 01 for GND.

P.S. I realize the hidden irony here, because RCA was originally designed as a connector exclusively for the interior of a television chassis. Somehow, third parties because using the 'RCA' connector to add sound devices external to the television chassis. RCA was never designed to be used between separate chassis, and it is actually quite poor for that purpose, but convenience led to a nearly universal consumer standard for audio. Hopefully, people won't start running ribbon cables or FFC between their audiophile gear and create another mess. My goal is to suggest a purely internal interconnect and hope that it stays that way. An entirely different physical connector would be needed for inter-chassis connections.
 
To clarify ...

Some of my previous post was based on the USB 1.1 spec which I had studied closely. I had not dug quite as deep into USB 2.0, so some corrections are needed.

Depending on the southbridge chip used, you will have either one or two controllers (or one or two USB buses capable of 480 Mbps).

Apple computers with cameras will have one USB 2.0 controller assigned to the camera and the other assigned to the external ports (shared). All internal devices are connected to one of the two USB 1.1 ports.

Considering that a large number of computers will have a chip with just one USB 2.0 controller, we should expect all external USB 2.0 ports to be shared unless we know for sure otherwise.

Desktops with USB PCI/etc cards installed could have either one or two dedicated controllers on the card, but no more, regardless of the USB connectors supplied.
 
Can you cite the section of the USB 1.1 spec where it defines this 1/2 data rate limit? Is the USB 1.1 specification even still available from the USB organization? It seems like all new devices are supposed to be USB 2.0, even if they only run at Full Speed or Low Speed. But I have found it difficult to obtain the specifications for USB 1.1 whenever I want to verify the compliance of older USB hardware. Am I just looking in the wrong places?


USB-Audio should use Isochronous endpoints, which have a limit of 1024 bytes payload per frame, with 1000 frames per second. That's 8.192 Mbps maximum. A Device is allowed to have multiple Isochronous endpoints active at one time, so technically it should be possible to reach closer to the theoretical maximum of perhaps 11.856 Mbps. You cannot actually reach 12 Mbps because of the overhead of USB transactions, and I had to build a spreadsheet to find the optimum payload size to even get that close. However, it's rather moot, since every shipping operating system seems to set the limit to 1024 bytes per frame anyway, meaning that your device will not even enumerate (will not be enabled) unless you have no more than 1024 isochronous bytes per frame maximum.

I had the specification somewhere and read it a number of times. I seem to recall it running about 60 pages. The throttle to 1/2 speed is in the specification, but I'd have to find it first, and re-read it second, to give you a citation. It's there, though. I'm pretty sure I got it from the IEEE.

There's a download of the 1.1 available here (pdf) 2 MB
http://mprolab.teipir.gr/vivlio80X86/usb11.pdf
 
Last edited:
2-channel 24/192 requires 9.216 Mbps well below USB 1.1's maximum data rate of 12 Mbps.

The problem with USB 1.1 and 2-ch 24/192 lies in how the 1.1 spec is implemented. As long as the DAC is the only device on a particular USB bus, all is well. However if two (or more) devices are connected to a USB 1.1 bus, the specification calls for a hard limit to be imposed on each device of 1/2 the maximum data rate, regardless of the actual data requirement.

So, even though such things as a keyboard or mouse have very small data requirements and are configured under USB 1's Low Speed Data rate of 1.5 Mbps, connecting such a device to the bus limits the second device's data transfer rate. Thus, even though 1.5 + 9.216 = 10.716 and that is below 12 Mbps, the audio device will be throttled to below it's required data transfer rate.

One of the areas addressed with USB 2.0 is this behaviour, so that USB 2.0 is not under such a hard limit (there's a limit, but it's more than 1/2 the maximum ... I don't have the details as to what it actually is, but it's moot since it's more than 12 Mbps). However connecting a USB 1.1 device to a USB 2.0 bus can cause the bus to limit itself to USB 1.1's maxumum data transfer rate.

Not every computer has a USB bus exclusively assigned to each USB connector; it's hardly unheard of for a PC to have multiple ports (it's a salable "feature") but rather than each assigned to a USB bus exclusively (which costs money) some of them may be shared. I believe that there is usually at least one dedicated USB bus available via a USB connector, ... on a decent machine there should be at least two ... but then again when minimizing cost is paramount it's possible, I suppose, for an example out there to break that rule.

All Apple computers have a dedicated USB bus assigned to each connector, and "better" PCs probably will, but when the price goes down, all bets are off. Laptops will require multiple devices connected internally to a USB bus (camera, keyboard, mouse, bluetooth module, WiFi, card reader, etc) so the exact configuration internally can be a problem, or unknown.

Note that the problem can arise even if the audio device is limited to, say, 24/96. It is imperative that an audio device of the quality we're interested in is connected to a dedicated USB bus.

If the computer has USB 2.0 ports, there will be either one or two ECHI controllers. Each controller (not each USB port) supports 480Mbps maximum.

It is much better to have two, so that the audio device can be connected to it's own controller, and more importantly so that the internal USB ports are not impeding the external connectors available.

Intel, AMD, Broadcom and nVidia sell 2-controller southbridge chips but there are also Intel, AMD and Broadcom chips with just one, covering all USB 2.0 ports. All Sis, VIA and ULi southbridge chips have only 1 ECHI controller for all USB ports.
USB BUS 2.0 spec it's define High Speed, Full speed and Low Speed. For Full speed and Low Speed is backward compatible with USB BUS 1.1 Spec.
If you want to transfer 192k 24bit 2 channels data, you need transfer 1152000 bytes per second. It's means you need transfer 1152 bytes per frame. You check the USB Bus 1.1 spec page 42 and page 48. For ISO transfer per endpoint max transfer per frame is 1023. For Bulk transfer per endpoint max transfer per frame is 1216 bytes. So you is you want to transfer 192k 2 channels 24bit audio data you need use bulk transfer. But bulk transfer don't guarantee time interval. Once another control, bulk, interrupt or ISO transfer start you audio will not arrive in time.
If you reference to USB Audio Class 1.0 to design an USB Audio Device. The max sample rate should be 192K 2 channel 16 bit(768 bytes Per frame) or 96K 2 channels 24 bit(576 bytes Per frame).
 
USB BUS 2.0 spec it's define High Speed, Full speed and Low Speed. For Full speed and Low Speed is backward compatible with USB BUS 1.1 Spec.
That's basically correct, except that USB 2.0 relaxed some of the requirements from USB 1.1, which is technically compatible but different. If they had made the requirements more strict, it would not have been compatible without a lot of luck, but reducing the requirements is easy. One example of this is that the standby current for a suspended USB 1.1 Device was something like 125 µA, and nobody really achieved that. So, USB 2.0 just bumped that up to 100 mA, because everybody was pretty much doing that anyway due to lack of understanding. USB 2.0 just made it official. Note that I may not have the precise numbers (125 µA to 100 mA), but it was very close to that.
 
That's basically correct, except that USB 2.0 relaxed some of the requirements from USB 1.1, which is technically compatible but different. If they had made the requirements more strict, it would not have been compatible without a lot of luck, but reducing the requirements is easy. One example of this is that the standby current for a suspended USB 1.1 Device was something like 125 µA, and nobody really achieved that. So, USB 2.0 just bumped that up to 100 mA, because everybody was pretty much doing that anyway due to lack of understanding. USB 2.0 just made it official. Note that I may not have the precise numbers (125 µA to 100 mA), but it was very close to that.
Please reference follow URL:
USB-IF Compliance UpdatesThe USBIF request Maximun Suspend current is 2.5mA. And if you use Intel Chip you you should bellow 150uA.
As I know most spec in full speed and low speed is the same with USB 1.1. Its no deffernet. So most of USB Audio device claim they are USB 2.0 compatible.
 
I take back my example. USB 1.1 and 2.0 seem to have the same list of requirements for suspend current (500 µA for all Devices except high-power remote wakeup, which is allowed 2.5 mA, with spikes up to 100 mA or 500 mA as appropriate from the negotiated resume current maximums). In this case, the USB 2.0 spec was altered after the fact by the document you cite. I'm not sure what InterChip is, though.

The other examples that I seem to recall are probably specific to USB-Audio, which is not on the same revision schedule as the main USB specification. Part of my complaint was that they seem to have removed the USB 1.1 spec from their site, so it's hard to compare these things. Thanks to this thread, though, I now have USB 1.1 specs to compare.

In any case, reeling myself in from the distractions, your comments about USB isochronous match my understanding, so it's fairly clear that stereo 24/192 is not possible with Full Speed. But it is possible to do 5.1 surround at 24/44.1 or perhaps 24/48, and still have room for stereo 16/44.1 as well. The Emagic/Apple EMI 2|6 supported this combination, and later added stereo 24/96, but without surround.
 
I wouldn't use ribbon cable, not up to the job, terrible, zero signal integrity.
I would use a cable configuration as specified.
Differental pairs have to be treated as differential pairs, the close coupling requires maintaning through any cable interconnections or you are going to add serious impedance mismatches and bugger up the signal.
 
I wouldn't use ribbon cable, not up to the job, terrible, zero signal integrity.
I would use a cable configuration as specified.
Differental pairs have to be treated as differential pairs, the close coupling requires maintaning through any cable interconnections or you are going to add serious impedance mismatches and bugger up the signal.
Thanks for the feedback. I'm not actually in favor of ribbon, but what about twisted pair ribbon? Is that still made any more? It was once used for high-speed disk interfaces which were probably differential.

Also, how does FFC fare? Adjacent signals are not coupled very much, it would seem, but is that bad or good?

When you say "as specified," I don't know what you mean, though. There was a long list of cables and connectors suggested, but I don't know which one was "specified," per se.

I also worry that expensive and bulky connectors for I2S, with its 3 to 5 signals per link, would be too troublesome and doom the standard from the beginning. But that's just my opinion at the moment.
 
I believe...

The Ayre QB-9 uses ribbon cable internally (about 6 cm or so of it) to take I2S from the USB receiver board to the DAC/output board. The measured performance (both jitter, and resolution) of the QB-9 is very, very, good (see Stereophile.com for details). As long as we are talking about an internal board for placing inside an existing DIY DAC, and the distance can be kept short, it appears that simple ribbon cable is up to the task.
If one is planning on building a separate chassis, and going I2S from one chassis to another, then a differential I2S signal is better, and will require some special cabling. Note that making I2S differential will increase jitter a little; it would be better in general to keep the converter board internal, and the I2S run as short as possible.
 
The Ayre QB-9 uses ribbon cable internally (about 6 cm or so of it) to take I2S from the USB receiver board to the DAC/output board. The measured performance (both jitter, and resolution) of the QB-9 is very, very, good (see Stereophile.com for details). As long as we are talking about an internal board for placing inside an existing DIY DAC, and the distance can be kept short, it appears that simple ribbon cable is up to the task.
Do you happen to know the pin-out for this internal QB-9 ribbon? I would be very curious. From your description, it seems to be single-ended, not differential.
 
Nope...

I have no idea on the pin out. I have just seen the inside of the QB-9 and the ribbon cable connecting the two boards. Differential I2S has been discussed in other threads (somewhere). I believe PS Audio uses differential I2S for their external connections, but the my understanding is that this is only necessary for external connections (and some do not even use differential for that).
My understanding is that I2S is not differential natively, hence it must be converted at the transmitter and receiver ends, this conversion will only add jitter. It makes sense to me that internal I2S transmission should remain in the native mode of the receiver end (DAC chip), rather than being converted, and the wiring just kept as short as possible.
 
Ribbon cable is a cheap, is old and a better result can be had using FFC, and if you are trying to b uild the best, why not use the best solution. You can impedance matched cables and shielded cable, much better than ribbon cable, for both measurement and EMC (which has an effect in the box). I haven't seen ribbon cable used in a design for 10+ years now. And for digital signal transmission avoiding impedance mismatches is one of the critical factors...
PCB-FPC/FFC Connectors
 
Lots...

Ribbon cable is a cheap, is old and a better result can be had using FFC, and if you are trying to b uild the best, why not use the best solution. You can impedance matched cables and shielded cable, much better than ribbon cable, for both measurement and EMC (which has an effect in the box). I haven't seen ribbon cable used in a design for 10+ years now. And for digital signal transmission avoiding impedance mismatches is one of the critical factors...
PCB-FPC/FFC Connectors

Of DAC/CDPs use ribbon cable internally to connect from a digital input board/transport to the DAC/Analog output board. I have seen this used in dCS, PS Audio, Meitner, bel canto, Sim Audio, etc. Typically the connections are kept very short: ~5 cm or so. Properly implemented, ribbon cable allows for parallel tracks of precisely the same length for digtal communication, just how an engineer would lay out traces on a PCB.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.