STM32 USB to I2S multi channel - log - ask for help

Thanks TNT for the feedback,

Toslink was not on my radar. Do you know about the implementation? Is it integrated modules to connect to 3.3V signal?

Which type of devices would you connect with Toslink (I don't see that many on the market, but maybe I look in the wrong place).

You currently use 196kHz sampling rate in your system?

Best regards,

JMF
 

TNT

Member
Joined 2003
Paid Member
Hi!

Toslink only on the output side... USB in still. But!!... ADAT in and toslink out is very interesting as one could then build 16 or 32 channels system.

Yes, senders only need 3,3V, ground and signal.

Most DACs do support toslink and it is a great way to isolate everything upstream from the delicate DAC.

Standard toslink support 192 ksps. I currently only play 24/44 - but I have plan to use CDSP upsampling of everything to say 96 or maybe 192...

TORX/TOTX: TOTX147(F,T)DigiKeyhttps://media.digikey.com › pdf › TOTX147_F_T


//
 
STM32 SAIs support SPDIF out. Actually I started my USB-I2S development with SPDIF output as that was easiest to test. 8-channel spdif/I2S output should not be a problem for STM32F7/H7 MCUs and TDM is also a possibility for multi-channel output. Some STM32 MCUs have also FW support for spdif input but I haven't tested that.
 
My request is on the DAC chip side:
Example https://www.cirrus.com/products/cs43131/
The DAC has Programmable Filter Coefficients. 3 x 2. order IIR and individual volum control.
1. I would like to be able to set HP filters on each analog output. So that low freq filters or signal earlier in the chain dont destroy drivers by mistake during XO filter programming. (Lets say using a HP filter 3 octaves lower than x-over freq.. Maybe at 500 Hz for tweeter, 10 or 20 Hz for SUB)
2. I would like a -20dB "PAD" on output. That is a button that sets all the DAC volume controls to -20dB. Also to protect the drivers during developement.
 
Like TNT coming from CDSP thread
and echo TNTs' thoughts :)

This looks like a great project to provide a digital audio off-ramp for a compute device, using the USB capabilities present virtually everywhere
  • Keeping the device simple and modular is a good idea, including the kitchen sink will create more problems than solutions
  • External DACs ... There are many excellent low cost DACs ... but not easy to achieve a synchronised output with more than 2 channels ...
    SPDIF/Toslink is a good approach. This serves a valuable need in the audio world
  • Either SPDIF or Toslink output would be good. They can be converted
  • ADAT looks great but is not consumer tech so a bit specialised. Is it difficult / expensive to add ?
  • The main criteria are to have more than 2 channels and for their clocks to be synchronised ... which is what I understand you're achieving
  • No real advantage to including DAC into the build, it will probably just create unnecessary implementation challenges
  • Modularity is very useful, 8 channel is probably a realistic target ... that accounts for 90% of consumer space.
    Ability to add more channels would be nice but not so valuable that the first release should be delayed to achieve it

You're doing a great job, keep up the good work !

cheers
Rob
 
  • Like
Reactions: 1 user
Thanks all for the feedback,

SPDIF and Toslink seems to be a must have. And not too difficult to implement. At least Toslink. For the RCA, I have a working simple implementation with few resistors and a capacitor, but I remember that the correct implementation is with a pulse transformer.

So maybe the best option would be to have the stm32 board with a connector for the 4xI2S, GND and Power. Then few daugther board:
  • 4 Toslink,
  • or 4 SPDIF cinch,
  • or 8x DAC (ES9080).

The Stm32 SAI is designed for I2S, SPDIF, TDM. No ADAT... So not for this round.

@torgeirs, my idea is not to look for DSP on board, but to provide "the missing brick" between Host with DSP power (ex CamillaDSP) to Analog or DAC. I already have a project with a TI TAS3251 (https://github.com/jmf13/NeatAmpTAS3251) that provides DSP+Amp with I2S input. My esperiments show that with a stm32F7, ThreadX, USBX there is not that much margin with 8 channels. I still have to assess 24 bit depth and 96k or 192k.

I did DSP with CMSIS on the stm32F7 for my LXmini: https://github.com/jmf13/F7USBAudio

@All: I'm not a professional in the domain. So it is amateur work... and will be open source. I should succeed for "simple things". I'm more a software guy. Success of the TAS3251 shows that with time and dedication, the USB to... bridge is achievable if things are kept simple. Help will be very welcomed :)

Key specs are:
-USB HS to 4 I2S,
-Stm32 generates the master clock, from a crystal allowing 48k familly and 44.1K familly sampling rates,
  • Async feedback to the host ,
  • Correct selection of the components for reasonable cost (on par with commecial products, no snake oil or golden graal here).
 
  • Like
Reactions: 1 user
For best results MCU should only generate I2S signals (BCK, LRCK, SD) from external MCK provided via I2S_CKIN. So MCU clock is independent of audio clock.

I understand that it is the "clean" way to proceed. What type of device is needed to generate the I2S_CKIN? Can it be done with a simple crystal?

It also needs to be investigated if from the same single clock, using clock and PLL parameters, the 2 famillies of frequencies can be generated.
 
@TNT, the stm32F7 has 4 SAI, which cqn each manage sterero channels. So on the paper, the needed peripherals are available. But it has to be checked if:
  • all SAI can be synchronized together,
  • if there are no overlap on pins with other needed functions,
  • not sure there is enough CPU to do all the processing for so many channels.

I'm more the "less is more" type of person, than "Mister plus". Is there a use case for 8 Toslink, or is it to max the thing.

JMF
 
I understand that it is the "clean" way to proceed. What type of device is needed to generate the I2S_CKIN? Can it be done with a simple crystal?
Standard clock oscillator is sufficient.
It also needs to be investigated if from the same single clock, using clock and PLL parameters, the 2 famillies of frequencies can be generated.
With external MCK no PLL is used but simply MCK divider. Two clock oscillators are used: one for 44k1 family and other for 48k family. GPIOs can be used to enable correct oscillator.
 
Ok. So more like the https://www.minidsp.com/products/usb-audio-interface/mchstreamer-lite

If it is open source I would like a H series instead of an F series. Not much difference in price. But twice as powerful.

Then user could have free FIR DSP
Last time I checked, on JLCPCB, they had stm32H7 and no stm32F7. So it would ne the natural way to go. The mchstreamer-lite could be a good inspiration source for the pinouts. But I won't be able to all the functions they do. It looks like a really versatile product a reasonable price.