Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 14 of 14

Thread: 6 inputs audio recorder with CS42448 audio card from OSH Park

  1. #1

    6 inputs audio recorder with CS42448 audio card from OSH Park

    Hello all,

    first post here.
    I'm planning to build a 6 inputs audio recorder with the CS42448 audio card from OSH Park.
    The recorded signals would be the sound of separate strings from a guitar so the 6 inputs will be all recorded at the same time.
    It would need 16 bits of depth and frequency resolution of 44100 Hz.

    Is it doable or is there any hardware limitation ? Are there other audio file format appart from RAW ?

    Thanks !

  2. #2
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    270
    I think that codec is supported already in the audio library from a control perspective, but I don't think the existing i2s objects support 6 channel. Dual and quad, yes.

    If I2S is protocol you want to use, at the very least, you need to expand the input_i2s_quad class to become six channel, as well as use the processor datasheet to figure out what pins can be configured for the 3rd I2S data lines, and hope they are connected on the teensy board.

    It might be easier (but difficult none the less) to use three Teensy audio shields and two Teensy boards, One Teensy and two audio shields setup in quad mode to cover 4 strings, then the second teensy with one audio shield to cover the last two.

    If the two teensy's run independent, the two separate recording groups will not be perfectly synchronized (they'll drift apart over long recordings). If you need to fix that problem, you need to configure the second Teensy/Shield in slave mode and send the clock signals over from the first group. This would ensure any recordings are synchronized.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,642
    Quote Originally Posted by Blackaddr View Post
    but I don't think the existing i2s objects support 6 channel. Dual and quad, yes.
    Correct about I2S, but the 16 channel TDM object does indeed support this chip. For output, 8 of the 16 channels are used. For input, 6 are used, or 8 if you've connected another codec chip to CS42448's aux input.

    Of course, the CS42448 needs to be configured for TDM mode. That OSH Park shared board does exactly that.

  4. #4
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    270
    Quote Originally Posted by PaulStoffregen View Post
    Correct about I2S, but the 16 channel TDM object does indeed support this chip. For output, 8 of the 16 channels are used. For input, 6 are used, or 8 if you've connected another codec chip to CS42448's aux input.

    Of course, the CS42448 needs to be configured for TDM mode. That OSH Park shared board does exactly that.
    That's awesome, didn't even realize the TDM mode was supported.

  5. #5
    Quote Originally Posted by PaulStoffregen View Post
    Of course, the CS42448 needs to be configured for TDM mode. That OSH Park shared board does exactly that.
    Perfect ! Boards just ordered, I'll let you know how it goes !

    Thanks !

  6. #6
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    270
    For those who may be looking, I think this is the board referred to in this thread https://oshpark.com/shared_projects/2Yj6rFaW

  7. #7
    Yes it is ! Yeah sorry I should have posted that earlier.

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,642
    If you're going to put it to serious long-term use, maybe also get a tiny heatsink. That Cirrus chip runs very hot.

  9. #9
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    270
    Don't forget you probably still need 6 channels of high impedance preamps. You didn't say exactly what your analog source was but since it's the six individual strings on a guitar, I presume you are using piezo pickups in the saddles or some other hexaphonic pickup? That OSH park board looks like it takes line level in.

    Ceramic pickups like piezo's in particular can put out high voltages but still need very high impedance inputs. You might even need more headroom that that provided on the board. I had to boost up the preamp voltage to 9V to power the guitar preamp on my board.

    Take a look at the datasheet link from here and scroll to the end where the schematic is shown, you'll see how the preamp is designed.

  10. #10
    Quote Originally Posted by Blackaddr View Post
    Don't forget you probably still need 6 channels of high impedance preamps. You didn't say exactly what your analog source was but since it's the six individual strings on a guitar, I presume you are using piezo pickups in the saddles or some other hexaphonic pickup? That OSH park board looks like it takes line level in.

    Ceramic pickups like piezo's in particular can put out high voltages but still need very high impedance inputs. You might even need more headroom that that provided on the board. I had to boost up the preamp voltage to 9V to power the guitar preamp on my board.

    Take a look at the datasheet link from here and scroll to the end where the schematic is shown, you'll see how the preamp is designed.
    Thanks for those inputs ! And by the way, very nice project of yours !
    Indeed I'm using piezo pickups, but they could be magnetic as well like the GK-3. For now I'm using a Godin Multiac and a Godin xtsa. Those already have a preamp in the guitar which need to be powered with 9V. For the moment I'm using a home-made breakout box which just splits the GK-13 cable coming out of these guitars into 6 monophonic Jack mono inputs. Not clean but working with mixing desk and a RME soundcard.
    But to use the Godin guitars with the teensy and the CS42448, yes a better designed preamp is the next step !

    @Paul : thanks for the advice, i'll do it.

  11. #11
    Hello,

    I've received the boards and components and built two of them. I've got problem on both of them and can really figure out where it's coming from.
    On the first one ouputs don't work (no sound out of it and nothing except noise when looked at the outputs of the codec or the teensy). LED on the Teensy (pin 13) is also on (kinda) all the time even when no sound is applied to the input. The codec runs indeed hot.
    Second board is the opposite, outputs are working properly but inputs don't give anything. The LED is not working. The codec doesn't run really hot.
    I should probably build the third one to have all inputs and outputs working correctly .

    The code used to test outputs is this one :
    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    int freq [] = { 55, 110, 220, 440, 880, 1720, 600 };
    int NB_OUTPUTS = 8;
    
    // GUItool: begin automatically generated code
    //AudioSynthWaveformSine   sig;          //xy=347,152
    //AudioSynthWaveform       sig;
    AudioSynthToneSweep      sig;
    AudioOutputTDM           tdm_out;           //xy=695,232
    AudioConnection          patchCord1(sig, 0, tdm_out, 0);
    AudioConnection          patchCord2(sig, 0, tdm_out, 1);
    AudioConnection          patchCord3(sig, 0, tdm_out, 2);
    AudioConnection          patchCord4(sig, 0, tdm_out, 3);
    AudioConnection          patchCord5(sig, 0, tdm_out, 4);
    AudioConnection          patchCord6(sig, 0, tdm_out, 5);
    AudioConnection          patchCord7(sig, 0, tdm_out, 6);
    AudioConnection          patchCord8(sig, 0, tdm_out, 7);
    AudioConnection          patchCord9(sig, 0, tdm_out, 8);
    AudioConnection          patchCord10(sig, 0, tdm_out, 9);
    AudioConnection          patchCord11(sig, 0, tdm_out, 10);
    AudioControlCS42448      cs42448;      //xy=206,594
    // GUItool: end automatically generated code
    
    
    void setup() {
      AudioMemory(16);
      cs42448.enable();
      cs42448.volume(0.5);
      
    //  for( int i = 0 ; i < NB_OUTPUTS ; i++ )
    //  sine1.frequency( freq[ 4 ] );  
    //  sine1.frequency( 0.75 );
    
    //  saw.begin(WAVEFORM_SAWTOOTH);
    //  saw.amplitude(0.75);
    //  saw.frequency( freq[ 4 ]);
    //  saw.pulseWidth(0.15);
    
      sig.play( 0.6, 50, 1500, 60 );
      
    }
    
    void loop() {
    
      if( !sig.isPlaying() )
        sig.play( 0.6, 50, 1500, 60 );
      
    }
    The second test code is to test direct link between inputs and outputs :
    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioInputTDM            tdm1;           //xy=555,297
    AudioOutputTDM           tdm2;           //xy=837.25,297.75
    AudioConnection          patchCord1(tdm1, 0, tdm2, 0);
    AudioConnection          patchCord2(tdm1, 2, tdm2, 2);
    AudioConnection          patchCord3(tdm1, 4, tdm2, 4);
    AudioConnection          patchCord4(tdm1, 6, tdm2, 6);
    AudioConnection          patchCord5(tdm1, 8, tdm2, 8);
    AudioConnection          patchCord6(tdm1, 10, tdm2, 10);
    AudioConnection          patchCord7(tdm1, 12, tdm2, 12);
    AudioConnection          patchCord8(tdm1, 14, tdm2, 14);
    AudioControlCS42448      cs42448_1;      //xy=883.25,490.75
      
    // GUItool: end automatically generated code
    
    void setup() {
      // put your setup code here, to run once:
      AudioMemory( 16 );
      cs42448_1.enable();
      cs42448_1.volume( 0.7 );
      cs42448_1.inputLevel( 10 );
    
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
    
    }

  12. #12
    This is really interesting. Looking at the datasheet, it seems the DC-blocking highpass filter on the inputs can be disabled which should leave it DC coupled on in and out.

    I'd like to use this for CV in and out for control of synth modules. Any issues come to mind?

  13. #13
    Looks like some hardware work called for to match levels, protect the chip, and eliminated DC-blocking caps. Is there a schematic for the present board? I imagine the ins and outs are wired with some version of the passive circuits shown in the data sheet.

  14. #14
    Junior Member
    Join Date
    May 2016
    Posts
    9
    How is this project going? Do you end up with a lot of cross-string leaking? How did you isolate your magnetic signal to one string per signal? I played around with using a laser module and a phototransistor to pick up vibrations for only one string at a time, I don't know whether that might be important or helpful in your project. There are pitfalls relating to cancelling our light "noise", you have to pick up the reflection from an angle that reduces other light. or use baseline phototransistors to subtract ambient light from the signal.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •