Electronics > Microcontrollers

IEEE 1588 (PTP) synchroniazable ethernet to I2S/TDM 8 channel DAC bridge

(1/3) > >>

Hello all,

completely new here but I think this might be the right place to ask my questions.

I want to build a large set of speakers that all need to be able to play audio synchronously but possibly different audio streams. The speakers are divided into sets of 8 which are in close proximity (all drivers are in one enclosure/cabinet). The groups are further apart but no more than 20 meters. All speakers receive the audio signal from a central PC. I am trying to come up with a cheap and modular way of connecting all these speakers and the PC. One design which I am trying to evaluate consists of an Ethernet based system. The central PC is equipped with a hardware PTP enabled gigabit NIC. The audio signal is streamed to a set of MCUs which each bridge the audio stream to 8 channel I2S/TCM and finally to DACs.

The viability of this design depends on the availability of an MCU that fulfills all of these requirements. I have been looking around and it seems that not many MCUs support PTP or for which a library is publicly available. I have found the ST32F429ZI. However, there is no information on how to use I2S/TDM with it. The ESP32-C3 support the TDM side of things but I cant find anything on PTP. How would I refine my search method to find what I am looking for?

You probably mean I2S, not I2C?

Yes, thanks. Corrected.

You'd need to run a PTP protocol stack for which there are open source versions available but likely you'll need to add low-level drivers for your microcontroller. And you'll also need some ways to steer the oscillator of the microcontroller to make the frequency adjustments.

In the end having 1ms accuracy should be good enough; NTP works just fine at that level for a local network and is massively simpler to implement. You'd still need an oscillator that can be adjusted somewhat but no hardware timestamping support. With a large number of speakers, you'll likely run into issues where listeners hear multiple speakers at different distances. You may want to include the ability to have adjustable delays.

This is a much harder challenge than it looks.

"Time-aligning" the sample stream between nodes is only half of the job.
The other problem, which is significantly more difficult, is to deal with sample clocks that are all different. Basically each DAC node will have its own sample clock, unless you can distribute a master clock, which is not possible using only Ethernet. To make up for that, there are essentially two methods: either adjust the sample clock on each node (assuming you can fine tune the frequency, which is not necessarily possible on typical MCUs), or resample on the fly (takes some DSP resources.) Either way, you'll need to estimate the frequency error for each node compared to one reference node, which can also be done using PTP. The whole thing is non-trivial and I don't know of any easy, ready to use piece of code for this.

Just as a gentle warning, it's much harder than it sounds (no pun intended).


[0] Message Index

[#] Next page

There was an error while thanking
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod