Open Source DSP XOs

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi all,

I decided few days ago to make something with dsp boards.
I descovered the STM32Fx family.
I think it could be a nice starting point.
I bought this one on ebay, very cheap: STM32F4 DISCOVERY STM32F429 TFT LCD STM32 ARM Cortex-M4 Development Board

I didn't want to go for STM32f0 chip as it is not based on ARM M4 architecture.

ARM M4 has DSP instruction set and this chip is around 200MHZ speed.

As opensource project,
It is time for DIYers to have an opensource solution like audio weaver, and DRC solutions.

This chip can be a cheap and good start.
 
Best is overstating it a little, the generic CMSIS-DSP library leaves plenty of room for improvement. I think the best known case is NXP's M3 and M4 libraries, where the M4 ends up the same speed as the slower M3's because NXP hand optimised the M3's library.

So use the manufacturer distributed libraries where you can. You don't really need to hand optimise until you run out of processing power though.
 
You don't really need to hand optimise until you run out of processing power though.

Yesm that was what i meant to say. And then when you run out of processing power there will usually be a faster chip, or you can take another similar and distribute the processing. For digital crossovers this means you may have dedicated processor for each (stereophonic etc.) channel.

Of course you can/must first use DMA with proper block size (and alignment) to make the processor / manufacturer specific DSP libraries work properly, so some kind of user optimisation is needed anyway.
 
Hi all,
I received my STM32F4 Discovery,
I succesfully set up a developmement environnement under Ubuntu/eclipse CDT.
simple "hello world" demo in c done.
board linked to PC and debugging is working under eclipse.
as proof of concept, next step will be to use DSP functions & I2S IN and OUT.

My target project will be to develop an "audio os" framework for micro controller.
This one looks good for a proof of concept.
Any interested peole with knoledge in C language as well as DSP ?
 
I have started something similar (on STM32 Nucleo cards) but it's not very high on priority of my all unfinished projects. However, if you are seriously starting at something please start a new build thread and we can talk there. This thread is more like a general thread for discussing the subject.

In the meantime please check out the SMT32 tools like STM32CUBEMX which is a great time saver and error preventer.

STM32CubeMX STM32Cube initialization code generator (UM1718) - STMicroelectronics

There is also a similar Eclipse pluging. However, the tool is not directly integrated to ARM GCC Eclipse toolchain, though you can copy (or link if you want) the generated C-modules quite easily to your Eclipse project. It's even possible to insert your code inside the generated code blocks - if you use the tool that way then it's better not to touch the comments ("insert your code here" etc. kind of descriptions) as they direct the code generation. You can later change pin/port mapping and generate the code still retaining your own.
 
Anyone played with Cypress PSoC's? They have for an example about 5$/€ kit with a CY8C4245AXI-483 Cortex-M0 @48 MHz MCU.

Interesting bits are the four programmable digital (with 8 cells) blocks on the device which allows for implementing I2S interface:

http://www.cypress.com/?docID=43207

If someone is going to buy one be sure that you get the 42xx part, the 41xx part has not those programmable logicks blocks.

This is the one to get:
CY8CKIT-049-42XX - CYPRESS SEMICONDUCTOR - PROTOTYPE BOARD, CY8C4245AXI-483 MCU | Farnell element14 Suomi

Here is a list of available components:

http://www.cypress.com/?app=search&searchType=advanced&keyword=&rtID=377&id=4749&applicationID=0&l=0
 
I'm interested in this as well. I want to build an active sound bar for my tv that has full range left, center and right channels + sub out, and I want to run off of the optical out from my tv.


So.. I need a crossover for the L/R, a mixer for the center and another crossover for the subwoofer out.

I'm considering using a Wolfson 8804 for the optical->I2S, have a Nucleo F411RE board (mentioned earlier) that has several I2S both full and half duplex for receiving signal from the 8804. Then it's a matter of writing code and feeding some DACs (2x DACs for 4 channels of output) to provide the LCR/sub signals. After I get it breathing, I guess I could also do equalization.

Am I crazy for thinking of going this path? Is there a design out there already that doesn't involve DSP?
 
If you just want to build a sound bar, why go to the workup of doing that with an STM32F-based digital XO when analog XOs will probably be eminently suitable and a quicker solution (no DSP, no software). There are plenty of amp boards on eBay which implement 2.1, not sure about if they support centre channels though.
 
Anyone played with Cypress PSoC's? They have for an example about 5$/€ kit with a CY8C4245AXI-483 Cortex-M0 @48 MHz MCU.

Interesting bits are the four programmable digital (with 8 cells) blocks on the device which allows for implementing I2S interface:

http://www.cypress.com/?docID=43207

Got my CY8CKIT-049-42xx kit, been playing with it little bit. Implemented just a simple sine wave to I2S to TDA1543 synthesizer. It was a joy to program using the PSoC Creator and the nice C API the software generated from the (graphical) logic design (I2S and UART components). PSoC 4 doesn't support DMA for I2S, and doesn't have much PGA/PLD power either - the single I2S transmitter and UART (for MIDI) just about maxed it. Got to try a multichannel full-duplex I2S another time anyway. Regarding TDA1543 the chip could maybe work as digital inverter for multiple converters in balanced application, don't know for sure yet (anyone can download the PSoC Creator and try him/herself even without the $4 kit). Good thing is that you don't have to do RBIT (which is not available on Cortex-M0 anyway) for I2S like you have to with SPGIO on LPC platform.

Anyway, noticed that (selected) more powerful PSoC 3 and 5LP parts come with a special Digital Filter block with a single cycle 24x24 to 48 bit (saturating) MAC:

Digital Filter - Cypress

That makes designing a digital crossover easy. It's quite powerful even though the Cortex-M3 core runs only at max. 80 Mhz frequency. You could run the Digital Filter as another core (supports using DMA) and use the M3 core as an additional computing platform. Surely enough for practically anything. There isn't too much RAM though only 64kb.

LP5 part is used as a debugger on PSoC 4 Pioneer Kit which is cheap - the 5LP chip can also be programmed and have some GPIO pins (programmable) available, and there is also the Schmartboard PSoC 5LP board available (difficult to find in Europe though, but Mouser at least distributes it).
 
Last edited:
There is a user guide for using the above mentioned $25 PSoC 4 Pioneer kit as USB Audio Interface (with a prototype I2S codec). There is a documented (working) I2S port mapping, and the PSoC Creator project can be used also as a template for a digital crossover project (just remove the USB stuff or replace the audio class driver with an UART or something useful):

http://www.element14.com/community/...22697/PioneerKit_P5LP_USB_Audio_UserGuide.pdf

http://www.element14.com/community/...unity-project102-usb-audio-using-the-psoc-5lp

https://github.com/yourskp/PioneerKit_P5LP_USB_Audio
 
Last edited:
Tested designing (did not run on actual hardware) a multichannel full-duplex design with the $4 PSoC 4 CY8CKIT-049-42xx kit (or actually a design using the same part as on the kit) I was able to max the UDB blocks usage with 1 stereo I2S channel input with 3 stereo I2S output channels (resulting as 2x6 config) and using single interrupt (which I used for rx channel). You can still add I2C and other hardware resources to the design but not any programmable logic (UDB) components.

In the design there is no master clock output, but I was also able the system clock to use external clock input (in this case 48 MHZ, it might be possible to use overclocking). The only available I2S desing is an I2S master, slave is not (yet) supported. In this case you can still use the best available external clock source.

This must be the lowest cost digital DSP crossover in the world I guess. Just add the converters, and maybe an I2C EEPROM for storing the coefficients which you the can program from PC using the programmer part of the kit as a USB-I2C bridge (yes it can to that as well).
 
Last edited:
Galvanically isolated S/PDIF active speakers are the way to go, embedding some volume control. Let's call this S/PDIFv.
Left S/PDIFv = audio data (MSB 16 bits audio).
Right S/PDIFv = mixed data (LSB 8 bits audio + 8 bits volume control).​
A S/PDIFv RCA connector conveys thus ONE 24-bit audio channel along with 8-bit volume control.

You thus need a S/PDIFv encoder, built around a STM32F756 (Cortex M4 @ 200 MHz).
Data-in = 1 x TOSLINK.
Data-out = 2 x RCA S/PDIFv.

In each loudspeaker you need an S/PDIFv decoder, a digital crossover, and a volume controller, built around a STM32F756 (Cortex M4 @ 200 MHz) featuring three half-duplex I2S. You can manage up to 6 audio channels. Six audio channels are more than required for a digital loudspeaker, even 4-way. You'll be able to experiment new schemes like phasing, arraying, beamforming, dipoles, etc.

One need to leave the I2S DACs out of the project.
This way, all kinds of I2S DACs and clocking schemes can be used, depending on personal preference, using "capes" or "shieds". We get the beginning of an ecosystem, here.
Some DACs like the WM8580/WM8581 require a crystal acting as local clock, able to sync on an incoming S/PDIF using some built-in PLL.
Some other DACs (mostly Cirrus and Sabre) require a MCLK straight coming from the DSP.
Some other DACs don't need a MCLK, those are NOS DACs (Non-Oversampling DACs) like the TDA1541 and TDA1387T.

With up to six channels at disposition, you can experiment push-pull schemes.
With plenty of MIPS at disposition, you can experiment 4x oversampling schemes using high-quality phase-controlled FIR filters.

You can view this like a next-gen Philips DSS (Digital Speaker System).
Actually, I'm not fierce about the way the volume gets conveyed over S/PDIFv, sacrificing one audio channel. In 2015, it's nothing more than an affordable and understandable way to ensure galvanic isolation and volume control passing.

It is compatible with 7.1 audio. How so ?
Buy a MINIDSP USBStreamer. Exploit the 4 x I2S header.
Hook four I2S to TOSLINK converters.
Hook four S/PDIFv encoders.
There is a master S/PDIFv encoder. It receives the volume info from the PC, or from some external volume pot attachment. The master S/PDIFv encoder outputs the volume data on a RCA connector.
There are three slave S/PDIFv encoders. They all read the volume data from the master S/PDIv encoder. Actually there is a parallel volume bus, formed by Vol-in and Vol-out Cinch connectors, appearing in series for the user.

As STM32F756 chips may not be available yet, there is the possibility to use :
- STM32F373 chips (Cortex-M4 @ 72 MHz) featuring three half-duplex I2S
- STM32F401 chips (Cortex-M4 @ 84 MHz) featuring two half-duplex I2S
- STM32F411 chips (Cortex-M4 @ 100 MHz) featuring two half-duplex I2S
- STM32F429 chips (Cortex-M4 @ 180 MHz) featuring two half-duplex I2S

If you don't like such scheme, ask yourself how difficult it is to build an audiophile stereo system featuring 3-way active speakers equipped with 3-way digital crossovers, relying on a collection of Raspberry PI B + boards, and a collection of HiFIBerry DACs. I'm not even sure, this to be feasible !
 
My aim in this thread was to go for maximum 'openness' with the hardware. Its one thing making the BOM and schematic freely available, but with a single-sourced part (the ADI DSP) there's only so much openness you can have. Even if the software were open too, its still a proprietary architecture. ARM it seems to me whilst offering a proprietary architecture does license it widely so no DSP software written for ARM need be particularly tied to a hardware manufacturer.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.