• These commercial threads are for private transactions. diyAudio.com provides these forums for the convenience of our members, but makes no warranty nor assumes any responsibility. We do not vet any members, use of this facility is at your own risk. Customers can post any issues in those threads as long as it is done in a civil manner. All diyAudio rules about conduct apply and will be enforced.

New FIFO buffer for RPI/SBCs

Hi ,

in the past few months we have worked very hard on a new shield for RPIs/SBCs.

Basically the main idea belongs to Ian's. His hardware is actually superior to ours , mostly in the way he implemented the clocks and to the attention of the detail (like mounting xtals on a pcb supported by elastics ). So we credit Ian's idea and his great design.

Our hardware/soft is not a copy , its an implementation of the same idea. We use a FPGA and sram to buffer the DATA and we reclock bclk/mclk outside the FPGA using NDK (or Crystek) . The board has an eprom but its not HAT complaint (because of the space). FCC will be available for the board.

Main reason for making the board was to try to correct the audio clocks of SBCs and bring high quality audio to anyone that has an SBC around..for a great price.
 

Attachments

  • Kali1.jpg
    Kali1.jpg
    654.3 KB · Views: 7,063
Can you please tell in some articulated way, why you assume that the 40-pin connector of Raspberry Pi Single Board Computers (SBCs) can't deliver a high quality full duplex I2S digital audio stream?

Is it caused by some impossibility to route the Broadcom native I2S signals (LRCK, BCLK, TX, RX) to the 40-pin connector?

Is it caused by the absence of MCLK?
Please note, MCLK is not part of the I2S standard.

Is it caused by software issues?

Is it caused by the lack of proper 11.2896 MHz and 12.2880 MHz quartz?

Is it caused by the USB subsystem, demanding a fixed 48 MHz clock?​

Do you assume that the 40-pin connector Raspberry Pi can't deliver a high quality full duplex I2S digital audio stream :

- when the audio is coming from mass storage?
- when the audio is coming from USB using the Isochronous audio protocol?
- when the audio is coming from USB2 using Asynchronous audio protocol?
Are there workarounds like playing the audio at a stable speed, jitter free, that's not exactly 44.1 kHz and 48 kHz?

What about playing the audio through SPDIF? What will happen in case the SPDIF speed is not exactly 44.1 kHz or 48 kHz?

You wrote that you rely on a FPGA and SRAM for buffering the audio data, to be reclocked outside the FPGA using some Ultra Low Phase Noise Quartz Oscillator.

- Does it mean that your hardware always must act as Master Audio Clock?
- If yes, how to support the USB Isochronous audio protocol?
- Can you fine tune the frequency of the Ultra Low Phase Noise Quartz Oscillator, letting operate it as VCXO?
- In case the your audio SRAM write pointer is not operating at the exact same frequency as your read pointer, will you rely on sample drop or sample repeat to avoid a buffer overflow or underrun?​

What is the advantage of relying on a FPGA and SRAM, compared to relying on a SRC4382 chip like there is in the $45 MiniDSP DIGI-FP ?

Best Regards,
Steph
 
RPI has an on board xtal of 19.2Mhz. For the 44.1Khz audio the LR Clock must be running at exactly 44.1KHz, but this is not possible since the frequency is not a multiple of 19.2MHz. So RPI will either run at 44.138 or 44.036Khz

With a FIFO buffer everything is re clocked with one of the 2 xtals on board (with the correct value)

Regarding under/over run yes that's possible, but we calculated the file has to play continuously for a few hours before it can happen. In that particular case the buffer will be reset to initial condition (about 0.7s )
Otherwise as soon as a gap is detected (between songs) the fpga will reset the buffer.

This shield its meant to work only with SBCs i2s RPI connectors , so no USB/SPDIF for the moment
 
This shield its meant to work only with SBCs i2s RPI connectors , so no USB/SPDIF for the moment
I was referring to USB in the scenario of having the RPI acting as sophisticated USB soundcard, capable of FIR filter equalization. You can have USB Audio Isochronous (the audio source is the audio clock source). You can have USB2 Audio Asynchronous (the audio sink - aka the soundcard - is the audio clock source).
 
In most scenarios the RPI will be the audio player, an app , for example Qobuz/Spotify/Pandora/LMS , will run on CPU and output will be i2s to DAC. Our reclocker will work great in this scenario

Regarding the USB , it is possible to have the above scenarios , but in case of isochronous , the 2 time domains can be too far apart and the reclocker might over/under run faster that a 'few hours". However the asynchronus mode..in that case you will have a few hours (at least) since we know exactly how far is the RPI clock (on average)

I am not sure how much processing power you need for FIR filters , but I assume that on the newer generations of SBCs there is more than enough.
 
A very nice idea. How are the oscillators powered? It is a very critical part of the design and many users will appreciate the option to supply their own favourite off-board regulator, or battery power. There doesn't seem to be any kind of galvanic isolation from the SBC ground, right? I guess it is a reasonable price to pay for the simplicity of the shield.
 
Last edited:
The oscilators (only one is active) are fed by PSU filtered by LC filter + LDO

After the LDO we have some good esr capacitors to provide clean power

Correct the ground is not isolated from SBC.

A very nice idea. How are the oscillators powered? It is a very critical part of the design and many users will appreciate the option to supply their own favourite off-board regulator, or battery power. There doesn't seem to be any kind of galvanic isolation from the SBC ground, right? I guess it is a reasonable price to pay for the simplicity of the shield.
 
New DAC for RPI with subwoofer out (2.1 or 2.2)

We have designed a new DAC working with any SBC/RPI (i2s)

We are using 2 DAC ics PCM5142 with integrated DSP. The PurePath software from TI is available for download (registration required) and can be used to create specific filters and other audio functions.

The board will come pre programed as a 2.1 output (but you can create your own custom design and load it the board and can access the xover frequency directly from linux (we made a small app)

Hardware wise , we have split the digital and analog side with LDOs and we feed the analog side using an extremely capable (low noise ultrahigh psrr) LT3042. Basically each board has 4 LDO (2 for each DAC ic) (note that digital side uses cheaper LDOs)

Of course , on the analog side we used only thin film resistors and poly caps in audiopath.

This DAC has RCA outputs but also a small connector that will connect to our TPA3118 AMP shield (only LR)

Edit: it works as a 2.0 , 2.1 or 2.2
 

Attachments

  • piano2.1 top.jpg
    piano2.1 top.jpg
    897.4 KB · Views: 4,794
Last edited:
For an increased selling price say $99,

1) Is it possible to hook four STA326 I2S-in Class-D power amplifiers or two TDA7801 I2S-in Class-AB power amplifiers ?

I'm thinking about two 10-pin headers conveying the following signals :
VCC
AGND
DGND
SDA
SCL
MCLK
LRCK
BCLK
I2S_OUT_A
I2S_OUT_B​

Please note, the FPGA should issue four I2S lanes (with same master clocks).

2) Is it possible to hook two stereo ADCs for carrying 4-ch audio measurements ?

I'm thinking about one 10-pin header conveying the following signals :
VCC
AGND
DGND
SDA
SCL
MCLK
LRCK
BCLK
I2S_IN_A
I2S_IN_B​

IMO, the 11 LEDs are a waste of real estate.
Better keep one or two of them on board as debug, and have a 14-pin header carrying the 11 LEDs signals plus VCC plus GND enabling to built front panels, also featuring a 3-pin 36 kHz infrared receiver.

Best regards,
Steph
 
Last edited:
I think I can see where you are going with this..

1. Yes of course its possible. Actually we are looking right now at the new generation Kali reclocker. Its not the FPGA that sends the i2s signals out (because of the high jitter inherent to fpga silicon) . The re-cloaking its done at output of FPGA using flipflops
2. How many bits of resolution ? Why 2 ics..many ADCs have 4 channels..

You are looking basically to make a digital active crossover device with microphone feedback .
 
You are looking basically to make a digital active crossover device with microphone feedback .
Better say microphone-based setup.

Typically :

1. Simply hook a TDA7801, and you'll get four 20 Watt channels, easy to handle as they are Class-AB. This is the beginner's stereo 2-way system.
2. Add a STA326 configured in stereo, and you become stereo 3-way, able to drive two 50 Watt woofers.
3. Add another STA326 configured in mono, and you can hook a 100 Watt subwoofer.​

Attached is a .jpg explaining why during the microphone-based setup, it is recommended to feature four analog inputs (two identical stereo ADCs).

1. The bare speaker transfer function is equal to Mike (1 or 2) divided by DSP (1 or 2 or 3)
2. The DSP correction that's currently in use is equal to DSP (1 or 2 or 3) divided by Ref
3. The global transfer function is equal to Mike (1 or 2) divided by Ref​

There are two distinct approaches regarding the software in charge of the setup :

1. Raspberry Pi as stand-alone. Requires a monitor, a pointing device, and a keyboard. Raspberry Pi to generate a pink noise, execute the DSP and compute the above transfer functions. Raspberry Pi to display realtime curves using HDMI.
2. Raspberry Pi as USB 4-channel audio out + bulk data in. Requires a PC. Raspberry Pi to generate a pink noise, execute the DSP, and return the 4 audio channels to the PC. PC to compute the above transfer functions. PC to display realtime curves. PC to communicate the required correction to the Raspberry Pi.​

By relying on FIR filters, the setup can be automated.

1. You specify a global transfert function as target, in gain and in phase, having the format of a 1024-FFT. You can specify a Linkwitz-Riley 4th-order exhibiting the usual phase distorsion, or you can specify a Linkwitz-Riley 4th-order exhibiting no phase distorsion.
2. You measure the bare speaker transfer function (see above), also having the format of a 1024-FFT.
3. You compare the global transfer function with the bare speaker transfer function, in gain and in phase. The result of such comparison is the required correction function, in gain and in phase, also having the format of a 1024-FFT.
4. You do an inverse FFT of such data, delivering the impulse response of the required correction function, which actually is the 1024-tap FIR filter coefficients list of the DSP.​

A few IIR Biquad filters can be manually added as channel equalizers each time a speaker driver is plagued by some severe high frequency resonance before extinction. This has the benefit of improving the stability/convergence of the automatic microphone-based setup, as this time the FIR filter doesn't need to battle against an impulse response that's corrupt by a big overshoot, and a long trailing edge.

IIR Biquad filters can be manually added in the context of a global equalizer like for reshaping the deep bass response, this is actually called a Linkwitz-Transform. Over there, a 32-bit resolution is mandatory, linear instead of floating point for the sake of the IIR Biquad filter stability and noise floor.

Best regards,
Steph
 

Attachments

  • DSP before DAC - 3-way speaker.jpg
    DSP before DAC - 3-way speaker.jpg
    73.5 KB · Views: 1,700
Last edited:
We looked at isolation , long and hard. However you have to isolate not only i2s , but also SPI , i2c and a bunch of other signals..the complexity and pricing of the board will increase significantly . In the end , we might release a second shield that will provide isolation for whomever needs it. As far as clocks , they are heavily filtered (LC , LDOs etc) so it does not matter than much.

For availability , we are currently talking to resellers and websites. Expect more news before the 25 August.
 
I am including a video of the Purepath so you can see the capabilities of soft. We are able to have 4 poles crossover filters , volume etc for files that are 24/192Khz
https://www.youtube.com/watch?v=fAbiMoIj53o

We send only HPF frequency's over 80Hz (chose from 60-150Hz) to main speakers and rest LPF to subwoofer.
Its hard to explain the sound improvement , but he unit sounds clean , effortless .

ETA to launch Aug 26. Price less than 50$