Dual USB audio sources i2s

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
wizzo
Newbie
Posts: 1
Joined: Fri Sep 25, 2015 1:55 am

Dual USB audio sources i2s

Post by wizzo »

Hello all,


I have a project im trying to accomplish. I am new user and are learing about i2s, although Im a novice, I have lots of experience with audio design and serial communication protocols.

My question is, Im still unclear on the features that i2s has as a protocol. My goal is to have an audio interface with two USB inputs. These inputs will be connected to 2 different computers.


Those 2x USB-i2s adapter will feed a DAC/DSP with 4x4 inputs/outputs available for i2s.

The way i understand i2s is a bus protocol with 3 wires, 2 for clock and 2 for multiplex data....


In theory I can take the clock signals (master would be DAC/DSP) and sync both USB-i2s cards and then feed audio that I can output through my main stereo pair... simple right?


I realize there might be a few pieces im missing but my goal is simple i want a dual USB interface that can handle 2 digital audio signals that can be fed into a DSP/DAC input these would then be routed to an analog output for play back...


I appreciate anyones help guidance and time...
Attachments
CUSTOM INTERFACE.pdf
(22.68 KiB) Downloaded 443 times
CUSTOM INTERFACE.pdf
(22.68 KiB) Downloaded 443 times


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

I removed your second (duplicate) topic.
User avatar
tuck1s
Active Member
Posts: 32
Joined: Thu Sep 25, 2014 1:19 am

Post by tuck1s »

Hi, I2S and USB are very different protocols. I2S is (as you say) a simple serial protocol with a bit clock, a word clock (sometimes called LRCLK because it's used to indicate Left / Right channel assignments in pure stereo situations) and a data line. Many DACs can accept I2S directly - diyaudio.com is a good source of information on the design choices available there.

USB is a multi-purpose protocol. I have not delved into it deeply, but the data formatting, framing etc are I believe very different. There are existing libraries for XMOS devices to support USB-to-I2S bridging - in fact there's a simple "reference headphone DAC" design that is definitely worth a look.

Xmos can support USB protocol natively but for high speed use, a separate PHY chip is often used.

What is very unusual about your request, is to have the system slaved to TWO USB ports. Why is that? USB is fast enough to carry multi-channel audio over a single port.
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

This is certainly feasible. I'm guessing that the goal of this is to allow two different audio sources on two different hosts to play through the same audio device?

This does make sense and the fact that the USB Audio ref design uses asynch mode (master clock local to audio device) means that this concept should work.

The main challenge here is instantiating 2x USB devices. I assume a single chip is desirable. Our XU224/232 devices have 2x USB PHYs included although you could potentially use an L16 with 2 x external ULPI PHYs.

However, the IP today assumes a single instance, so some work needs to be done to make those rentrant , i.e. allow two to be instantiated in the same system.

There has been some internal skunkworxy work to prove this is possible, but no product development yet.

Because it represents a fair chunk of work, there are two options. 1) Work with XMOS to help us prioritise the development of dual USB IP (will need commercial justification of course) or 2) have a go yourself.

1) is best approached via your regional sales/FAE contact and 2) can be done with some pointers here, but is certainly several weeks work..
dweeb4
Active Member
Posts: 52
Joined: Mon Jan 19, 2015 12:47 pm

Post by dweeb4 »

I'm interested in this concept but for a somewhat different reason than the o/p - I want to read in high-speed USB signal using a USB transceiver over ULPI into an XMOS chip & I want to output this USB high-speed signal via ulpi to a different USB transceiver.

I see the XU224 datasheet states that the USB phy should not be enabled on both tiles. From what you say, I take it that this is a software limitation rather than hardware? Would that be correct? Are there any hardware limitations that prevent handling two high-speed (480Mbps) USB signals in XMOS chips? I've read that ulpi in XMOS is hardware assisted.

Can you say what the thinking is behind having 2 ULPI interfaces in some XMOS chips but only being able to use one?
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

The XU224 datasheet is perhaps a bit misleading here. The statement is true for two tiles on a node - one one set of USB HW exists per node. The XU224 actually has two nodes, one containing one tile and the other two. So yes it does have 2x USB PHYs and consequently hardware-wise, it meets the requirement.

There is some HW assistance inside - however in the XU… family it’s all hidden inside. All you see is D+ and D- come out.

The remaining issue is the driver that will support two instances of USB Device, due to globals in the library. It has been done experimentally and works (basic implementation by re-naming stuff), but is not officially supported yet. Do you have an XMOS commercial contact to discuss this with?
dweeb4
Active Member
Posts: 52
Joined: Mon Jan 19, 2015 12:47 pm

Post by dweeb4 »

infiniteimprobability wrote:The XU224 datasheet is perhaps a bit misleading here. The statement is true for two tiles on a node - one one set of USB HW exists per node. The XU224 actually has two nodes, one containing one tile and the other two. So yes it does have 2x USB PHYs and consequently hardware-wise, it meets the requirement.

There is some HW assistance inside - however in the XU… family it’s all hidden inside. All you see is D+ and D- come out.

The remaining issue is the driver that will support two instances of USB Device, due to globals in the library. It has been done experimentally and works (basic implementation by re-naming stuff), but is not officially supported yet. Do you have an XMOS commercial contact to discuss this with?
Excellent - thanks for the answer.
No, I don't have an XMOS commercial contact to discuss with - how do I go about establishing this?
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

Hi - Commercial contacts can be found here:

https://www.xmos.com/contact/distributors
dweeb4
Active Member
Posts: 52
Joined: Mon Jan 19, 2015 12:47 pm

Post by dweeb4 »

Thanks!
asjwood
Newbie
Posts: 1
Joined: Tue Aug 11, 2020 3:27 pm

Post by asjwood »

We're in the process of creating a new design based on the XU224. We'd like to enable both USB PHYs so we can support synchronous input and output at different sample rates (in the same family) for example 96k in and 48k out.

Initially after reading this thread, I was hopeful that I might be able to modify the USB audio reference code to accomplish this.

However, as far as I can tell, lib_xud has been compiled with the assumption that there is a single usb_tile and so having tileref usb_tile[2] in the .xn causes the following linker errors

Code: Select all

: Error: Type of symbol `usb_tile’ has mismatch with previous definition:
found: `tileref usb_tile[2]’ in file `’
previous: `tileref usb_tile’ in file `../libsrc/XUD_Manager.xc’
: Error: Type of symbol `usb_tile’ has mismatch with previous definition:
found: `tileref usb_tile[2]’ in file `’
previous: `tileref usb_tile’ in file `../libsrc/XUD_SetDevAddr.xc’
: Error: Type of symbol `usb_tile’ has mismatch with previous definition:
found: `tileref usb_tile[2]’ in file `’
previous: `tileref usb_tile’ in file `../libsrc/XUD_PowerSig.xc’
: Error: Type of symbol `usb_tile’ has mismatch with previous definition:
found: `tileref usb_tile[2]’ in file `’
previous: `tileref usb_tile’ in file `../libsrc/XUD_DeviceAttach.xc’
: Error: Type of symbol `usb_tile’ has mismatch with previous definition:
found: `tileref usb_tile[2]’ in file `’
previous: `tileref usb_tile’ in file `../libsrc/XUD_TestMode.xc’

I raised a support ticket with XMOS hoping they might be able to send me an alternative version of lib_xud (as this thread hints that this code does exist...) or at least tell me if the newer lib_usb doesn't have this limitation.

Can anyone here help?
Post Reply