USB/I2S bridges (stream of conciousness)

Discussion in 'Digital: DACs, USB converters, decrapifiers' started by ultrabike, Aug 16, 2018.

  1. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    This may belong to Random Thoughts, depending on how things develop. So here it goes...

    Besides looking at audio interface options recently (think Pete Millet), I was also looking at available options for USB/I2S bridges.

    In all honesty, I paid way more attention to amplifiers and DACs than I did to interfaces in the past. I was well aware of interfaces, and that they were somewhat problematic. But I never really dived very deep into it.

    For example, in the past, I knew NwAvGuy gave the ghost kind of right after the ODAC and in fact, did not produce a DIY DAC solution. Instead he associated himself with Yoyodyne and came up with an SMT fully integrated module with entry level performance for $100. This after criticizing some amp designs that used small SMT devices because they were not DIY friendly. I don't necessarily blame him. To some extent it seemed that the problem was not just the available selection of DAC ICs, but the USB/I2S bridge options available themselves.

    I also knew that many DIY designs are sampling rate limited to 44.4/48 kHz because most major device manufacturers do not offer non-NDA/COTS higher sampling rate usb bridges. In fact, I think that from Cirrus Logic, Analog Devices, AKM, and TI (all major DAC/AMP device providers), only TI has entry level USB/I2S bridge solutions in their portfolio. Though it seems AD is getting interested in this market.

    Instead, in this segment, we have XMOS, CMedia, and SaviAudio (there is another one, but I forgot their name). The solutions are not DIY friendly due to NDAs, IC packaging, multiple F/W configurations, and so on.

    I did look into the higher end TI solutions such as the TMS320C5x family (offer USB and I2S support). Though I haven't yet used the C5x family, I'm very familiar with the TMS320 DSPs, and have done quite a bit with them (the whole 9 yards particularly the old C3x and C6x families - I know very wll the C6x families can do USB to and from I2S with their eyes closed, but they are way overkill for that). Yesterday I took a quick glance at the C5x's EVMs schematics and Demo/Test code provided. This is are my comments on them:
    1. TMDX5505EZDSP (C5505 eZdsp USB Stick Development Tool): Stay away from this kit. It looks like it's got everything, but believe it or not the USB is only connected to the embedded JTAG IC for development and debugging. It is not connected to the DSP's USB interface, so sound is going to come out of the CODEC by hardcoding sound into the memory of the DSP. In other words, not really a HW or SW reference design for a bridge from what I can tell. I barely see the point of it's existence, other than checking that the DSP talks to the CODEC through I2S and powers on.
    2. TMDX5535EZDSP (C5535/C5545 eZdsp USB Stick Development Kit): Well, the USB is now connected. But guess what? The Spectrum Digital's website has no USB code test for it (reference SW).
    3. TMDXEVM5515 (TMS320C5515 DSP Evaluation Module): Much better. Like they said in their website, it offers a reference design for more realistic memory options (like Flash). But more importantly, they connected the USB interface on this one and they do offer code references for both USB and I2S libraries. It is probably doable, but not necessary stupid-simple.
    So of all these, one could come up with a reasonable bridge reference design and FW with the TMDXEVM5515. Maybe one could use the sample code of the 5515 EVM with the 5535 EzDSP platform for simple stuff. But again, I don't see it as a slam dunk. There is obviously a bit of elbow grease to be done here.

    There may be some stuff out there that may be in the works from TI along the lines with actual SOC being developed (maybe BeagleBone Black w companion daughter card), but I don't think they are ready for prime time.

    So all of this seems to boil down to (as far as what is readily available if you want to play around with stuff):
    1. MiniDSP streamer: XMOS bidirectional USB/I2S interface for full PCM rate support (or almost full) for $100 and no DSD.
    2. ChiFi Stuff w a mixture of random XMOS, CMedia and SaviAudio stuff which is mainly unidirectional only (or actually only), but with DSD (if you get the appropriate part from CMedia and SaviAudio that is).
    3. 48 kHz max rate constrained stuff from several vendors, including TI. Obviously forget about DSD, and likely no support for ADC.
    IMO, after so many years, this is truly a sad state of affairs.

    Feel free to discuss and contribute. We all learn good stuff that way.

    BTW, I did see that the widely used CM6631A has DSD erectile dysfunction. But the not-so widely used CM6632A is not. Neither is the SA9227. There is a big eBay beans spill of SA9227 + PCM5102A for like $28. The SA9227 is bidirectional, but I think most of them are F/W crippled to USB->I2S only. There are also reports that it gets hot because the cheap implementations (I like) use the on-chip rectifiers. But again, $28 is what I want to hear for no DSD and no ADC support, with at least a mediocre DAC to try to justify the mark up.
     
    Last edited: Aug 16, 2018
  2. famish99

    famish99 Friend

    Pyrate
    Joined:
    Dec 26, 2017
    Likes Received:
    1,714
    Trophy Points:
    93
    Location:
    Austin, TX
    The one you forgot was Amanero
     
  3. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Seen Amanero as well. It seems that one is not DSD impotent (the miniDSP $100 streamer seems DSD impotent). But is it bidirectional?
     
    Last edited: Aug 16, 2018
  4. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Oh Shit! I thought Amanero was more of a daughter card end user deal based on XMOS or some other random device. They do have their own solution.

    https://amanero.com/

    It's an ARM M3 from what I can tell in their schematic + a Xilinx FPGA for HW acceleration. But again, it think it's unidirectional USB->I2S. I don't think it supports ADC functions as well.

    The FPGA is going to consume some power relative to ASIC cores. Still, an ARM M3 is nice. The CMedia deals use an 8051...

    There is another one though. Asian I think.
     
  5. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    BTW guys, this thread is open for all sorts of discussions regarding USB I2S bridges. Not just technical. If you have a solution that works for you and want to share anything about it, please do so.

    If it becomes central to a particular solution I can split the threads and give them a proper home.

    The one that currently has my attention (and there are threads about it in many places) is this one:

    https://www.ebay.com/itm/New-SA9227...146776?hash=item4b08cc30d8:g:SFYAAOSwU1FZ8Y84
     
  6. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Further disappointments after briefly going through this and associated links:

    http://processors.wiki.ti.com/index.php/C5000_Connected_Audio_Framework

    *sigh* I don't see it as worth the time. It is possible, but we are very likely talking time and $ to choose TI given the support for this. Even as a time waste basket hobby deal, those EVMs look like too much in, for too little out (goes against good lazy & frugal engineering practices).

    However, I found yet another Amanero related alternative!

    This is probably old news but here it is anyway:

    http://www.pavouk.org/hw/audiosystem20/en_at32uc3a3256usbi2s.html

    We'll see, but I think this can be made bidirectional. Dunno about DSD.

    I also tried to find that other Asian solution provider, but no luck. I think their devices started with a T or something. If I cannot find it easily, that's probably bad news anyway.

    LOL! This is proly becoming more like a monologue-ish blog. Feel free to comment if you guys had any experience with this or not. Doesn't matter.

    EDIT: If nothing of substance comes out of it, this will eventually be moved to Random Thoughts. Time availability, motivation, forum membership interest, and $ will say. I'll keep digging as motivation comes and goes.
     
    Last edited: Aug 17, 2018
  7. Dzerh

    Dzerh Friend

    Pyrate
    Joined:
    Apr 1, 2018
    Likes Received:
    425
    Trophy Points:
    63
    Location:
    San Ramon, CA, US
    You can look at DIY interface boards at aliexpress and taobao for usable chipset ideas... most are using XMOS/Amanero clones although.
     
  8. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
  9. Dzerh

    Dzerh Friend

    Pyrate
    Joined:
    Apr 1, 2018
    Likes Received:
    425
    Trophy Points:
    63
    Location:
    San Ramon, CA, US
    Sorry, I thought you were researching chipsets so I suggested to check what others are using on DIY market chipsetwise. If you are satisfied with complete boards I'd contact a board seller/maker about the board capabilities or a way to enable what you need.
    On aliexpress I had positive experience with "weiliang/breeze audio" store (but didn't need anything extra, just bought as-is).

    Also from what I see small manufactures of "legit" devices are often using CMedia, may be it is easier to get info/help even for very small production runs.

    Have you tried real DIY forums?
     
  10. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Nah you were right. I'm more interested in chipsets.

    CMedia seems pretty good indeed. I have a feeling they offer full and stable solutions that make sense at reasonable prices.

    CM6631A seems like the popular choice. It is bi-directional and it covers all of the important rates. I'm very curious about the CM6632A though.

    EDIT: The reason I'm also interested in the complete solutions is that unlike TI (with their EVMs), other companies don't offer reference designs unless NDA.
     
    Last edited: Aug 17, 2018
  11. Nimrodor

    Nimrodor New

    Joined:
    Dec 26, 2017
    Likes Received:
    11
    Trophy Points:
    3
    Location:
    California
    Click through on that page to the SDR-Widget link. The original project could do both directions. All the documentation should still be floating around the web, though finished boards are probably out of the question. No useful measurements I'm aware of, but I'm guessing it should perform similarly to its Audio Widget-based spinoffs.

    Earlier this year tdtsai finally posted the CM6631A reference design on diyaudio.
    http://www.diyaudio.com/forums/digital-line-level/217764-cm6631-usb-audio-interface-post5369052.html
    Third link down. "Main" is the CM6631A module, "Codec" is the DAC/ADC modules and power supply. First link is instructions and source code for custom firmware.

    I haven't dug through all of it yet. Looks like less work than learning XMOS from scratch, at least for basic functionality.
     
  12. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Considering Teensy 3.2 now.

    Information on the CM6631A @ diyaudio seems a bit fragmented. Can be put together and I did some of that already. Sample code looks reasonable. No RTOS. I don't want to deal with an RTOS (have done that). Maybe can purchase a cheapo solution and use it for development. If things work out, maybe I could layout a board down the road for random waste-of-time hobby projects. It's an option if I want to have fun with it.

    Note the CM6631A is an 8051 based solution (many popular USB/I2S bridges seem to be). If I recall correctly, the 8051 device is usually a choice among HW designs because the core is free. Many ICs I know use the 8051. I have also worked with it a few times. The problem I see is that the SW development tools of choice are Keil (have worked with those too). Those are not cheap. There maybe some free ones out there. But it is a low to moderate risk to use different compilers and tools (even versions).

    Anyhow, Teensy looks interesting too. No rush. In fact, I may not do anything. Time will say.

    EDIT: Teensy 3.2 is ARM based and like the C55xx, and it may afford considerable more fire power than an 8051. Which may or may not be necessary anyhow.
     
    Last edited: Aug 20, 2018
  13. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Very exited. Bought this crap for $27:

    https://www.amazon.com/gp/product/B072JL5C2G/

    Whatever comes out of it, it looks like it's packed with lots of fun and may support bidirectional I2S with high quality codecs. It's an ARM Cortex M4 with floating-point awesome sauce.

    Several possible freebie IDEs.

    I think it only has one I2S, so dedicated ADC/DAC may not be fully possible. But not sure. Can't find something with better bang for the buck for the frugal type kind of dudes though.

    EDIT: LOL! I actually just saw a Teensy 3.2 right now. It's tiny! Someone bought it for some random crap. Man one never knows (or pays attention). I do have a discontinued high end TI development board that blows everything away. Cannot use it though and don't care for that for several reasons. Man the world is small.
     
    Last edited: Aug 20, 2018
  14. Dzerh

    Dzerh Friend

    Pyrate
    Joined:
    Apr 1, 2018
    Likes Received:
    425
    Trophy Points:
    63
    Location:
    San Ramon, CA, US
    Hmm... Tons of functionality, from feature set looks like your DAC will be able to make coffee and bring slippers for you while playing. But are you sure it is suitable for "hi-fi" audio?
     
  15. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Actually I backed down and cancelled the order a few hours after I pulled the trigger.

    It has a lot of functionality. But only one bidirectional I2S interface. It should be able to support one DAC, one ADC, or one CODEC. But not two separate DACs and ADCs from what I can tell to get a primo ADC/DAC interface. CS and AKM offer pretty high quality CODECs though. I got the Cirrus Awesome Sauce one + XMOS inside my $150 2i2. So it's kind of hard to justify down to road.

    It is disappointing because there are ARM M4s K20 that do offer not one, but 2 I2S interfaces and they are not out of this world expensive.

    The TMS C55xx can support maybe 3 I2S in theory. Though their sample code uses one of the configurable interfaces as GPIO for configuration, so it's down to 2 I2S interfaces in their demo, which is good. I have a feeling though that in order to support two simultaneous devices (ADC and DAC) one might need to screw around with RTOS. But not sure. The TI guys gave me the impression that they had to with the C55xx. The XMOS guys may have something in their cores that may help with that by having low power multicores handling things independently. Hence the MiniDSP Streamer popularity for its ability to support independent converters as demoed by the DIYAudio Audio Analyzer deal.

    More learning is needed before pulling trigger.

    As far as being suitable for "hi-fi" audio, this dude got that Teensy with the CS4272 which is indeed the 2i2 high quality CODEC (THD+N results included). He milked out of it more than the Scarlett solutions, and close to what the Clarett offers for a couple of more bucks than the Scarlett :

    https://hackaday.io/project/5912/logs?sort=newest&page=2

    Basically, he pulled out a DIY Focusrite Clarett 2PRE with a Teensy instead of an XMOS. Except the Clarett offers a bit more functionality with the headphone output and mic pre-amps. The Clarett 2PRE is pretty impressive actually.

    I saw his unpopulated DIY board. It's about $95 if I remember correctly.
     
    Last edited: Aug 20, 2018
  16. Dzerh

    Dzerh Friend

    Pyrate
    Joined:
    Apr 1, 2018
    Likes Received:
    425
    Trophy Points:
    63
    Location:
    San Ramon, CA, US
    I asked mainly because I can't see usual for such interfaces two "big enough" clock crystals.
    But looks like this guy is getting the clock from a codec. But 48KHz only.
     
  17. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Yup. I see what you mean. There would need to be two clocks and associated logic. So yet more reason to back down.

    The MiniDSP streamer seems to have only one clock and they support all the right rates. Probably there is a PLL in the XMOS solution.

    EDIT: BTW, I do know the TMS DSPs have a pretty flexible PLL. And the internal clock can indeed be adjusted on the fly, along with all the interfaces. The main clock is a bit touchy though.
     
    Last edited: Aug 20, 2018
  18. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    CLOCK REQUIREMENTS

    Based on the above discussion with @Dzerh I got motivated to read a few specs on USB/I2S bridges. This little exercise gave me a feel for why two oscillators are needed to support 44.1 kHz and 48 kHz sampling rates in general.

    I went back and took a look at the C55xx datasheets to get a feel for the clocks (See section 1.2.2 of the pdf below):
    http://www.ti.com/lit/ug/sprufx4b/sprufx4b.pdf

    The formulas not only give one a feel for what rates and sampling rates are supported by the device before diving into it and spend $ on a development board. They also give a feel for what can be supported with a given crystal clock attached to the device. Ideally one would like a single clock to drive everything.

    The C55xx formulas are repeated here:

    Code:
    FSDIV = log2(2*W)-3;
    I2Sn_CLK = I2Sn_FS*(2^(FSDIV+3));
    CLK_DIV = round(log2(45e6/I2Sn_CLK))-1;
    SystemClock = I2Sn_CLK*(2^(CLK_DIV+1));
    
    For multiples of 48 kHz, these are the settings and crystal frequency that we need:

    I2Sn_FS W FSDIV I2Sn_CLK CLK_DIV SystemClock
    48 kHz 16 2 1.536 MHz 4 49.152 MHz
    48 kHz 32 3 3.072 MHz 3 49.152 MHz
    96 kHz 16 2 3.072 MHz 3 49.152 MHz
    96 kHz 32 3 4.9152 MHz 2 49.152 MHz
    192 kHz 16 2 4.9152 MHz 2 49.152 MHz
    192 kHz 32 3 12.288 MHz 1 49.152 MHz
    384 kHz 16 2 12.288 MHz 1 49.152 MHz
    384 kHz 32 3 24.576 MHz 0 49.152 MHz

    For 48 kHz sampling rate, it seem the device supports all the way to 384 kHz 32 bit all with a SystemClock of 49.152 MHz.

    For multiples of 44 kHz, these are the settings and crystal frequency that we need:

    I2Sn_FS W FSDIV I2Sn_CLK CLK_DIV SystemClock
    44 kHz 16 2 1.408 MHz 4 45.056 MHz
    44 kHz 32 3 2.816 MHz 3 45.056 MHz
    88 kHz 16 2 2.816 MHz 3 45.056 MHz
    88 kHz 32 3 5.632 MHz 2 45.056 MHz
    176 kHz 16 2 5.632 MHz 2 45.056 MHz
    176 kHz 32 3 11.264 MHz 1 45.056 MHz
    352 kHz 16 2 11.264 MHz 1 45.056 MHz
    352 kHz 32 3 22.056 MHz 0 45.056 MHz

    Note that if I have given the equations the more precise 44.1 kHz, all SystemClock values would have been 45.1584 MHz.

    I've seen 49.152 MHz and 45.184 MHz in many bridge implementations. This somewhat points to why.

    The questions is, can the C55xx generate these two SystemClocks? From experience changing the SystemClock on the fly is a bit tricky because the internal PLLs may be a bit sensitive. But it can be done. I've done it.

    Here is more on how the SystemClock gets generated (section 1.4):

    http://www.ti.com/lit/ug/sprufp0c/sprufp0c.pdf

    In general I would probably choose the 32.768 kHz RTC clock to driver things (unless supporting world clock). From what I can tell, one has to go into PLL mode back and forth with care (that's the tricky shaman magic part).

    Assuming PLLIN is 32.768 kHz and following something like the examples on table 1-36 we get

    RDBYPASS OUTDIVEN MH ML ODRATIO PLL Output Frequency
    1 0 176h 0 0 32.768 kHz x (176h << 2 + 0 + 4) = 49.15200 MHz
    1 0 158h 0 0 32.768 kHz x (158h << 2 + 0 + 4) = 45.21984 MHz

    The last one gets us close to 45.1584 MHz to support 44.1 kHz.

    One would have to test this. But at least it seems this device is able to support all the necessary rates for awesomeness. No need for extra crystals. As discussed somewhere in those pdfs, one may need to run the clocks a tiny bit faster.

    (EDIT: Crap, we need Table BB Code support. It is what it is :( )
     
    Last edited: Aug 21, 2018
  19. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    BTW, not to be a TI shill (I couldn't care less), but among the reasons the C55xx got me excited is that I think the part is < $2 and the development tools (Code Composer) are now free.

    Oh, and the thingy comes with not 3 (as I thought before) but 4 independent (or so they say) I2S ports.

    It really gave me a woody.

    EDIT: Well, it depends. The 5535 has 4 I2S, the 5515 proly has 3.
     
    Last edited: Aug 21, 2018
  20. Scott Kramer

    Scott Kramer Friend

    Pyrate
    Joined:
    May 3, 2016
    Likes Received:
    1,446
    Trophy Points:
    93
    @ultrabike

    What'cha building ?

    Do you know Schiit uses that CM6631A -- and trying to replace it with a minimalist in-house solution...?

    eitr/gen5 I think they took it to the limit, crystals/reclocking in a quiet section outside the full usb chip, (sending the master-clock back into usb chip (thru ground decoupling transformers) for metastability)

    some old refs:
    https://www.superbestaudiofriends.o...ultibit-i2s-input-mod.3492/page-2#post-105389
    https://www.superbestaudiofriends.org/index.php?threads/modi-multibit-i2s-input-mod.3492/#post-99861
    https://www.superbestaudiofriends.o...t-eitr-preview-thread.4729/page-6#post-150995
    https://www.superbestaudiofriends.o...hiit-multibit-bifrost.105/page-48#post-151684
     

Share This Page