News:

SMF for DIYStompboxes.com!

Main Menu

Audio Effects DSP Board

Started by markseel, June 13, 2016, 11:53:46 AM

Previous topic - Next topic

pruttelherrie

#220
Yep, one BNC which can be configured to be master or slave:
https://medias.audiofanzine.com/images/normal/behringer-ultragain-pro-8-digital-ada8000-995195.png

It might be that I'm completely misunderstanding this sync-thing though.


markseel

OK good.  Both ADAT and SPDIF are designed such that some simple logic can be used to sense a run of bits (zero's or one's - can't remember which) that exceeds the same-bit run lengths in the encoded data bitstream.  This pulse can be used as a PLL sync input so that the PLL can lock on to it and multiply it in order to derive the master audio clock.  We'd still have to use a PLL/clock multiplier to derive the 12.288 or 24.576 MHz MCLK but we wouldn't need the additional logic to grab a pulse-train from the actual data bit stream.  XMOS already has code for clock recovery using the Cirrus Logic CS2000 family.

pruttelherrie

I think I understand what you're saying.

If I were to go the codec + preamps route, are there any codecs (or even separate A/D's and D/A's) you recommend? Especially with regards to ease of interfacing (towards the FlexFX I/O, the analog part I can handle). Preferably as easy to solder as is possible! SMD is ok, as long as it's not tooooo small, the bigger the better. Through-hole would be awesome but I've accepted the fact that that's probably not going to be possible.

I also found out that Reaper sends out lots of info over OSC about the tracks etc, whenever you open a project or even switch tabs between projects. So the configuration of the FlexFX mixer could possibly be directed completely by Reaper, with a bit of smart setup of the tracks, names, etc.

markseel

Yeah I have some ADC/DAC/CODEC favorites :-)  But any one will work as FLexFX supports I2S, LJ PCM, TDM, etc and if there's other I2S variants that need to be supported it's fairly easy for me to add that support and then update GitHub.

I don't like QFN parts since I put boards together by hand for hobby stuff - so I gravitate towards the leaded parts.

The AK4556 is low cost, simple to use, and has decent performance (44k1 to 192 kHz, TSSOP20, 103dB ADC and 106dB DAC dynamic range).  Really pretty good and also the latency is decent (18 samples for ADC, 21 samples for DAC).  No I2C/SPI control port therefore no volume control or other stuff but this keeps things really simple.

The AK4558 is a really nice upgrade (even lower latency, 108 dB dynamic range) but it's QFN.

The AK5386 ADC -- 192 kHz, 110dB dynamic range, TSSOP-16.  Only a handful of passive components needed.  No control port but simple, compact, and very quiet.  Moderately low latency of 16.5 samples.

The AK4420 DAC -- 192 kHz, 105 dB, TSSOP-16, single 5V supply, 19.3 sample latency, super easy to use.  Outputs are ground reference so this makes it even easier to use.

Those are my go to parts.

I've also use the TI PCM5102.  Also super easy to use and it even has a built in PLL that can derive its MCLK from the BCLK or WCLK signals if needed.  Ground referenced outputs, very high dynamic range, up to 384 kHz FS, and low latency.

Since FlexFX supports up to 32 channels and TDM one could use multichannel ADCs/DAC's.  The PCM1681 and AD1934 look interesting although I've never used them.

In all cases I prefer parts that have a HW control option and that don't require I2C or SPI just to keep things simple and to keep the FW agnostic of ADC/DAC/CODEC.  But FlexFX does support I2C so if you want to use part with I2C ports for filter selection, sample rate selection, volume control, etc you can easily do that.

pruttelherrie

I sense an AKM fan here :)

I did a bit more googling into the datasheets of TI, Cirrus and Analog Devices stuff. For higher channel counts it quickly begins to slide towards impractical packages and/or really tiny leads. So for the short term ADAT seems for me the way to go. Or is there a way to multiplex I2S outputs into I8S (TDM) streams? I guess the ADC's need to be clocked in sync for that, one master and multiple slaves or so.

pruttelherrie

#225
Also, what I don't understand is that both devicemakers and interfacemakers only seem to make multichannel products where the number of outputs is *always* higher than the number of inputs. I mean, 6 in/20 out interfaces, who on earth is using that? I just don't understand the market here.

I do understand that outputs are cheaper on silicon than inputs, but has nobody told these guys that they need to listen to their customers? Or is the thinking "outputs are practically free so let's just put them in there so that we seem to be better than the competitors"???

markseel

#226
Quote from: pruttelherrie on November 27, 2017, 12:33:31 PM
Or is there a way to multiplex I2S outputs into I8S (TDM) streams? I guess the ADC's need to be clocked in sync for that, one master and multiple slaves or so.
FlexFX supports 4 sets of I2S, I4S, or I8S input and output wires (four input wires, four output wires, each wire having 2, 4 or 8 channels) all synchronized to BCLK and WCLK.  For multichannel converters and/or multiple stereo converters there's a single set of MCLK, BCLK and WCLK.  For multi-channel converters not using TDM there's of course one SDIN or SDOUT for each pair of analog signals.  TDM lowers the SDIN/SDOUT wire count but finding lower pin-count (TSSOP-20 or 24) eight channel converters looks challenging.  Regardless of multi-channel solution (TDM, no TDM, one IC, multiple IC's) all devices share the clocks (MCLK, BCLK, WCLK) so that data channels and data signals (SDIN or SDOUT) clock edges are synced up.  Note that MCLK is generally used for the DAC/ADC converter's internal processing and I2S related port clock derivation whereas BCLK and WCLK are what SDIN/SDOUT are synced up to.  BCLK and WCLK are provided by FlexFX (FlexFX is the I2S/I4S/I8S clock master) therefore all converters must be used in slave mode.  So FlexFX provides BCLK and WCLK to converters and the master audio oscillator provides the (usually 24.576 Mhz or 22.5792 Mhz) MCLK to FlexFX as well a s all of the converters.

pruttelherrie

#227
Quote from: markseel on November 27, 2017, 05:06:40 PM
TDM lowers the SDIN/SDOUT wire count but finding lower pin-count (TSSOP-20 or 24) eight channel converters looks challenging.
True, although I did find LQFP-48 packaged codecs, lead pitch 0.5mm is only slightly narrower than the 0.65mm of TSSOP ;)
[edit] for example the Cirrus Logic CS5368 (which is actually not a codec but only the ADC's) [/edit]

QuoteSo FlexFX provides BCLK and MCLK to converters and the master audio oscillator provides the (usually 24.576 Mhz or 22.5792 Mhz) MCLK to FlexFX as well a s all of the converters.

So the FlexFX board doesn't provide a master clock, in your dev-IO-combo it's on the IO-board?

markseel

#228
There was a typo - corrected it reads: "So FlexFX provides BCLK and WCLK to converters and the master audio oscillator provides the (usually 24.576 Mhz or 22.5792 Mhz) MCLK to FlexFX as well as all of the converters."

"So the FlexFX board doesn't provide a master clock, in your dev-IO-combo it's on the IO-board?"

Correct.  FlexFX and the converters all receive MCLK from the master oscillator.  But, yes, there is a 24.576 MHz oscillator on the demo board that supplies the AK4556 and the FlexFX module with MCLK.  Like this:


Module              Demo Board
--------           -------------
   |                     |
   |<-----MCLK-----------+    24.576 Mhz oscillator on demo board (to CODEC and to Module)
   +------BCLK---------->|    To A4556 CODEC on demo board
   +------WCLK---------->|    To A4556 CODEC on demo board
   +------SDOUT[0:3]---->|    To A4556 CODEC (only SDOUT[0])
   |<-----SDIN[0:3]------+    From A4556 CODEC (only SDIN[0])
   |                     |





pruttelherrie


markseel

Here's another example.  From the FlexFX Github README:

Example Application #3 - Overdrive

Overdrive example demonstrating up/down sampling, anti-aliasing filters, and the use of look-up tables and Lagrange interpolation to create a simple preamp model. Up/down sampling by a factor of 2 brings the internal sampling rate to 384 kHz to help manage the aliasing of harmonics created from the nonlinear behavior of the preamp.

https://github.com/markseel/flexfx_kit/blob/master/README.md#example-application-3---overdrive

markseel

#231
Sorry for the board delays all.

The 50mil 2x5 ribbon cable as the interface between the XTAG and the board had issues.  Turns out that when using the high-speed debug features of XTAG2 the serial data was getting corrupt.  XMOS recommends LVDS when going over 10 cm or so and the ribbon cable and 2x5 connectors were a problem.

So I updated the board to incorporate the 100mil 2x10 header of the XTAG2 to eliminate the ribbon cable so that high-speed debug features work properly.  Now the XTAG2 just plugs into the board(s) directly.  Another delay but it's for the best :-)

I also added a board to the mix - the combo board.  It's the same as the small USB/XMOS digital board except that an audio interface (input buffers/filters, AK4420 DAC and AK5386 ADC) are added on the same board for convenience.

Both boards have the same pinout and dimensions except that the combo board is longer and has extra pins for analog input/output and separate ground/supply if desired. The ADC/DAC on the combo boards is hard-wired to the I2S interface and uses ADC0 and DAC0 signals leaving ADC1/2/3 and DAC1/2/3 available for external parts.  Boards should be back in a couple of weeks.



markseel

This board is ready to go!  It's the combo board an audio ADC/DAC built in.  An eBay store should be up in a matter of weeks.



markseel

#233
The dev kit was updated (https://github.com/markseel/flexfx_kit).  See 'efx_preamp.h' and 'efx_preamp.c'.

While there's already examples for cabsim, overdrive, chorus, etc. these are all for illustration and aren't necessarily optimized.  I added an optimized version of a digital preamp that *loosely* models three 12AX7 triode preamp stages following by a 9-band graphic EQ (rather than an FMV tone stack).  Each preamp stage processes samples at 960 kHz (20x oversampling, 4x at the ADC/DAC and then 5x in firmware) to manage antialiasing of artifacts created by non-linear sample processing.  This took a lot of optimization!  There's properties for setting each preamp stage's parameters (filtering, preamp drive and bias, etc), for the graphic EQ, and for output/volume control.  See 'efx_preamp.h' in the repository for details.

markseel

The FlexFX board outputs DSP thread timing info on the 'time' pin.  The 'time' pin is high while a DSP thread is active.  Since all five threads run in parallel the firmware alternates when a DSP thread asserts the 'time' pin so that each thread's run-time can be observed via a scope or logic analyzer.

Below is an example showing the run-times for the 'efx_preamp' firmware described in the previous post.  The sample rate is 192 kHz meaning that each DSP thread must complete its processing within 1/192k = 520.8 usec.  According to the capture DSP thread #1 takes 504 usec.  Threads 2,3,4 take around 508 usec.  Thread 5 takes about 480 usec.

So the 'time' pin can be used to verify that your algorithms running on each of the five DSP threads are completing in time and not causing timing problems.


briandress

mark hi, im reading through this and have a slight feeling that this may be something like a multifx and/or IR loader/conv reverb that can work as a usb audio interface?

briandress

reading through this mark and its quite incredible. i feel like it wouldnt be a large leap to make a box that loads amp sims.

markseel

#237
Quote from: briandress on January 30, 2018, 02:13:04 PM
mark hi, im reading through this and have a slight feeling that this may be something like a multifx and/or IR loader/conv reverb that can work as a usb audio interface?

Yep that's the idea. There really is a lot of processing power on one of these boards. I've been able to demonstrate 75 msec of IR cabsim, or a 3-stage tube preamp model running at 960 kHz internal sample rate.  Chorus/flanger/reverb would require less power than either of these.  The SDK available for download allows you to load firmware and to control effects all via USB MIDI.  And multichannel USB audio and multichannel I2S/PCM audio interfaces work at up to 192 kHz.  If you look at the examples you'll see how easy all of this really is!

Quote from: briandress on January 30, 2018, 02:19:08 PM
reading through this mark and its quite incredible. i feel like it wouldnt be a large leap to make a box that loads amp sims.

Nope it's not much of a leap. Having a USB MIDI interface means you just package up your data into MIDI SYSEX and sent them to the board.  You, of course, have to write a bit of firmware to handle the incoming data (like IR sample data) and place the samples in arrays and what-not, but it's not hard to do.

There's a python script (called flexfx.py) that shows how to do this already and it works with the CABSIM example provided in the SDK.  A fancy GUI front end would be nice.  I just finished some HTML5 code for Google Chrome that provides a GUI for the preamp and cabsim effects code that used the HTML5 MIDI support.  Wow, a few hundred lines of HTML/JS/CSS and I have a decent GUI interface to a pedal!  I'll show that off soon :-)

By the way I'm building boards for sale now - will be ready soon.

markseel

Seven FlexFX combo boards (these have the audio ADC/DAC on the board) built so far, two more to go.  Should have them done in a few days.

The FlexFX kit github repo was updated (https://github.com/markseel/flexfx_kit).  I added the HTML5 stuff for controlling effects and uploading firmware via a web interface (using Google Chrome).  So the idea is that a single web page will dynamically load effects interfaces as they're plugged into USB.  It's not done yet but you can take a look at the progress - the HTML files are all in the repo.  Just install Google Chrome and open the file 'flexfx.html'.

The web interface stuff is modular.  By design it will scan all USB MIDI devices and if they're a FlexFX board then an appropriate interface for that effect is added to the page dynamically.  You can create your own HTML5 and add your files to the HTML5 file collection and the core HTML5 stuff will incorporate your additions automatically.  Each effect must have it's own javascript (and CSS if you want) that generates the HTML5 for your effect.

Here's a screen capture from the cabsim effects controller ...



markseel

Quote from: markseel on February 01, 2018, 12:09:29 PM
... I added the HTML5 stuff for controlling effects and uploading firmware via a web interface (using Google Chrome) ...

I should clarify this ... the GUI interface via Chrome is, so far, only intended to update firmware, load data files, and set parameters in the presets that are not controlled via knobs.  I plan on making effects that have knobs for a few effect settings (volume, tone, etc) but using USB/MIDI to customize algorithms using parameters and presets.