CS42448 board ( 6 audio inputs / 8 outputs ) ?

waydenie

New member
Hi everyone!

I came across the audio board that Paul Stoffregen made up that provides for 6 inputs and 8 outputs on oshpark ( https://oshpark.com/shared_projects/2Yj6rFaW ). Wondering if that ever made it to a product or how it worked out?

I'm considering a project that will need to process and mix up to 6 audio input and output (mono) channels. I'll also need to have some user front panel i/o , a simple display ( oled or lcd ), so a few extra pins / i2c on the appropriate Teensy would be needed...

I guess a couple of questions... Did this ever pan out? and is there a version ( or is it compatible with ) Teensy 4.1?

Thanks! Wayde.
 
Great, I'll look at the updated board then! Looks like it's up to 8 in and 8 out , with the extra ADC chip, nice!

I assume these are line level? Will oshpark assemble, or how hard is the codec chip to solder by hand? :)


Thanks!W.
 
So... I've been googling around for CS42448 usage elsewhere for inspiration, and came across the following.. Does it look similar? Other than the teensy specific interface layout, which I could work around with a ribbon cable from my mainboard with my Teensy...

https://www.aliexpress.com/item/1005003576154152.html

( I wouldn't consider it if this was an actual pjrc product, but if I don't need to deal with sourcing and mounting a bunch of fine pitch SMD devices, it's a bonus :) )
 
Yes. Look for the 2 links below the parts placement image. One of those has lots of info, including the parts list. Technically that list is for the older version, but pretty much all the parts are the same. For the optional stereo ADC and its parts, you'll need to fill in the blanks. Hopefully not too complicated.
 
So... I've been googling around for CS42448 usage elsewhere for inspiration, and came across the following.. Does it look similar? Other than the teensy specific interface layout, which I could work around with a ribbon cable from my mainboard with my Teensy...

https://www.aliexpress.com/item/1005003576154152.html

( I wouldn't consider it if this was an actual pjrc product, but if I don't need to deal with sourcing and mounting a bunch of fine pitch SMD devices, it's a bonus :) )

I did not know somebody already asked this question - I just bought one of these for $25, will try to hook it up to Teensy 4.x
It would be great to know if anybody has done this already.
This is a picture of it i just took.
IMG_3498.jpg
 
@alfa66 I've experimented with one of those boards from ali express, they work fine with Teensy.

I captured a few details of the connections on my board - it look exactly the same as your board.

I have it running with the 6 ins and 8 out with breadboard wiring (you'd want to tidy up the wiring and keep it short if you're making any sort of permanent installations).

I've dumped the details below - any question just shout out.

Cheers Paul


Main Connector
CONNECTIONS1.jpg

Master Control Connector
CONNECTIONS2.jpg

A picture of it connected
IMG_0701.jpg

A test program
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputTDM            tdm1;           //xy=233,172
AudioOutputTDM           tdm2;           //xy=605,170
AudioConnection          patchCord1(tdm1, 0, tdm2, 0);
AudioConnection          patchCord2(tdm1, 0, tdm2, 12);
AudioConnection          patchCord3(tdm1, 2, tdm2, 2);
AudioConnection          patchCord4(tdm1, 2, tdm2, 14);
AudioConnection          patchCord5(tdm1, 4, tdm2, 4);
AudioConnection          patchCord6(tdm1, 6, tdm2, 6);
AudioConnection          patchCord7(tdm1, 8, tdm2, 8);
AudioConnection          patchCord8(tdm1, 10, tdm2, 10);
AudioControlCS42448      cs42448_1;      //xy=273,405
// GUItool: end automatically generated code


void setup() {
  AudioMemory(1000);
  Serial.begin(38400);
  while (!Serial)
    ;
  if (cs42448_1.enable() && cs42448_1.volume(0.7)) {
    Serial.println("configured CS42448");
  } else {
    Serial.println("failed to config CS42448");
  }
}

void loop() {}

audio.jpg
 
@alfa66 I've experimented with one of those boards from ali express, they work fine with Teensy.

I captured a few details of the connections on my board - it look exactly the same as your board.

I have it running with the 6 ins and 8 out with breadboard wiring (you'd want to tidy up the wiring and keep it short if you're making any sort of permanent installations).

I've dumped the details below - any question just shout out.

Cheers Paul


Main Connector
View attachment 31356

Master Control Connector
View attachment 31357

A picture of it connected
View attachment 31358

A test program
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputTDM            tdm1;           //xy=233,172
AudioOutputTDM           tdm2;           //xy=605,170
AudioConnection          patchCord1(tdm1, 0, tdm2, 0);
AudioConnection          patchCord2(tdm1, 0, tdm2, 12);
AudioConnection          patchCord3(tdm1, 2, tdm2, 2);
AudioConnection          patchCord4(tdm1, 2, tdm2, 14);
AudioConnection          patchCord5(tdm1, 4, tdm2, 4);
AudioConnection          patchCord6(tdm1, 6, tdm2, 6);
AudioConnection          patchCord7(tdm1, 8, tdm2, 8);
AudioConnection          patchCord8(tdm1, 10, tdm2, 10);
AudioControlCS42448      cs42448_1;      //xy=273,405
// GUItool: end automatically generated code


void setup() {
  AudioMemory(1000);
  Serial.begin(38400);
  while (!Serial)
    ;
  if (cs42448_1.enable() && cs42448_1.volume(0.7)) {
    Serial.println("configured CS42448");
  } else {
    Serial.println("failed to config CS42448");
  }
}

void loop() {}

View attachment 31359

Amazing, thank you for sharing!!!!!!!
 
Amazing, thank you for sharing!!!!!!!

@houtson, thank you again for sharing your experience with this.
I had some time to test it and it works really well (note: I am only interested in the separate 8 audio channels).

@PaulStoffregen, the following implements individual channel volume, it augments the functionality of control_CS42448.cpp.
It might be a good enhancement to your Audio Library wrt the support of CS42448.
Accordingly, the specs in the Audio Tool could be updated (we don't show support for individual channel volume).

bool AudioControlCS42448::volumeInteger(int channel, uint32_t n)
{

uint8_t aoutX_value;
aoutX_value = n;

if (channel < 1 || channel > 8) return false;

switch(channel) {
case 1: return write(CS42448_AOUT1_Volume_Control, aoutX_value);
break;
case 2: return write(CS42448_AOUT2_Volume_Control, aoutX_value);
break;
case 3: return write(CS42448_AOUT3_Volume_Control, aoutX_value);
break;
case 4: return write(CS42448_AOUT4_Volume_Control, aoutX_value);
break;
case 5: return write(CS42448_AOUT5_Volume_Control, aoutX_value);
break;
case 6: return write(CS42448_AOUT6_Volume_Control, aoutX_value);
break;
case 7: return write(CS42448_AOUT7_Volume_Control, aoutX_value);
break;
case 8: return write(CS42448_AOUT8_Volume_Control, aoutX_value);
break;
}
return true;
}

The following example uses the WaveformsTDM16 example code.
Here we use a potentiometer to test the individual volume for channel 1 and channel 2.

void loop() {

uint32_t val;
float f_val;

val = analogRead(A0);
f_val = 1 - val/1023.;
Serial.print("Analog value is: "); Serial.println(f_val,3);
delay(100);

//cs42448_1.volume(f_val);

cs42448_1.volume(1, f_val);
cs42448_1.volume(2, 1. - f_val );
cs42448_1.volume(3, 0);
cs42448_1.volume(4, 0);
cs42448_1.volume(5, 0);
cs42448_1.volume(6, 0);
cs42448_1.volume(7, 0);
cs42448_1.volume(8, 0);

}

It works as expected, but I am sure this could be further tested and improved.

I hope it will be useful to other members in the community.
Cheers,
alfa66
 
thanks alfa66, great job!!!

Got my board running, but had to add 2 pull-up resistors (2.2K) to the i2c bus.

Cheers, Trurl
 
I've committed a link to this forum thread into a TDM documentation on github.

https://github.com/PaulStoffregen/Audio/commit/4cee15b6d008dd9237ac413a946d84f1030790c0

Future updates of the design tool will have this link, so hopefully others can find this board and know it works.

@Trurl
I did not do much, besides re-enforcing the good behavior of a bunch of teensyduino fans ;)
****add 2 pull-up resistors (2.2K) to the i2c bus****
ABSOLUTELY!!!
Please, please, please, let's add the pull-up resistors - they are not included in the AliExpress board.
I can see how without the pull-ups one could experience some inconsistent behavior.


@paul
Would it make sense to also update AudioControl_CS42448.cpp and add the code to manage the output volume independently for each channel?

//current
//bool AudioControlCS42448::volumeInteger(int channel, uint32_t n)
//{
//
// return true;
//}


//suggested update
bool AudioControlCS42448::volumeInteger(int channel, uint32_t n)
{

uint8_t aoutX_value;
aoutX_value = n;

if (channel < 1 || channel > 8) return false;

switch(channel) {
case 1: return write(CS42448_AOUT1_Volume_Control, aoutX_value);
break;
case 2: return write(CS42448_AOUT2_Volume_Control, aoutX_value);
break;
case 3: return write(CS42448_AOUT3_Volume_Control, aoutX_value);
break;
case 4: return write(CS42448_AOUT4_Volume_Control, aoutX_value);
break;
case 5: return write(CS42448_AOUT5_Volume_Control, aoutX_value);
break;
case 6: return write(CS42448_AOUT6_Volume_Control, aoutX_value);
break;
case 7: return write(CS42448_AOUT7_Volume_Control, aoutX_value);
break;
case 8: return write(CS42448_AOUT8_Volume_Control, aoutX_value);
break;
}
return true;
}


Or do you suggest that we test this more thoroughly before committing?
There is no wrong answer.

Cheers,
alfa66
 
as I am brand new here let me say thank you to you all for the great forum and especially to Paul for the great Teensy!

Attached a screenshot of the Waveforms16.ino example, it doesn't look as good as a sawtooth might look; maybe R/C on the board are not optimal.

cs42488-saw.jpgcs42488-board.jpg
 
as I am brand new here let me say thank you to you all for the great forum and especially to Paul for the great Teensy!

Attached a screenshot of the Waveforms16.ino example, it doesn't look as good as a sawtooth might look; maybe R/C on the board are not optimal.

View attachment 31437View attachment 31438

This is a great forum, isn't it?

Waverforms looks good.
A good conversation about band-limited signals is here: https://www.youtube.com/watch?v=h7GFyM2v16U
Check @ time ~6:30
So, either the input waveform is band-limited, or the output is LP filtered very heavily....

Have fun!
alfa66
 
Hello alfa66, thanks for the video, very good!

I made 2 measurements with an external sawtooth (1038Hz)

first a passthrough and input and output measured with the Rigol: yellow is input, cyan is output. And saw those slight vibrations again. The board was connected to a power bank in the passthrough test to avoid interference from the laptop power supply.

I then routed the input to usb audio and measured the usb-audio on the laptop. The input signal looks very good.

Will feed the board with music later in passthrough and connect my CD player. Had the output on the amplifier, which is very quiet with no interference such as hum and crackling. Great little board!

is it possible to set the input gain, preferably per channel?

Cheers, Thomas
 

Attachments

  • cs42488_usb_capture.jpg
    cs42488_usb_capture.jpg
    62.6 KB · Views: 70
  • DS1Z_QuickPrint4.png
    DS1Z_QuickPrint4.png
    55 KB · Views: 91
Last edited:
update:

I connected my old Denon DCD-820 CD player to the board but it clipped. So I put my old Edirol M-10DX mixer in the chain as an attenuator and routed the signal to the board output and usb audio at the same time. (Test CD was https://www.youtube.com/watch?v=4Gxevlfk7fg :) )

The result is excellent, this is a very good audio board! No background noise or other disturbances and great sound.
 
I read the documentation again and cs42448_1.inputLevel(0.8); dampens the input sensitivity so that my cd player no longer overloads the input.

I then connected the odd inputs to the odd outputs in addition to the even ones, so that the full 24 bits are transferred from the cs42448.

AudioConnection p30(tdm_in, 0, tdm_out, 0);
AudioConnection p31(tdm_in, 1, tdm_out, 1);
AudioConnection p40(tdm_in, 2, tdm_out, 2);
AudioConnection p41(tdm_in, 3, tdm_out, 3);

@alfa66:
you already can set the channel output-volume individually: volume(channel, level)
and also the channel-input gain: inputLevel(channel, level)
https://www.pjrc.com/teensy/gui/?info=AudioControlCS42448

with the changes above, i get these measurements: cyan is input, yellow is output.

the high-frequency interference could be the sample frequency of 44.1 kHz, this needs to be measured more precisely.

the audio passthrough sounds fantastic.

cheers, T
 

Attachments

  • saw.png
    saw.png
    58.7 KB · Views: 61
  • sine.png
    sine.png
    55.7 KB · Views: 82
  • square1.png
    square1.png
    57.9 KB · Views: 70
  • square2.png
    square2.png
    48 KB · Views: 70
  • triangle.png
    triangle.png
    53.7 KB · Views: 67
That's almost certainly not high frequency interference, its the digital filtering on the converter I suspect, probably for anti-aliasing. It looks like a minimum phase brickwall filter, although there is a strange end to its impulse response with a slight kink...
 
Hello everybody,
i got this board,works like a charm,and i want to rely it with a pcb that have a teensy 4.1,
like a sandwich plugged into the "audio interfaces female pin header" of the CS42448 board.
But the distance separation of the pins is not 2.54,not 1.27,it's like ~1.5 to 1.7.
Does someone know the exact distance between 2 pins?
i'm talking about the pitch,is it really 2.0mm?
 
Last edited:
Now i did my PCB with teensy 4.1 and a wiring sandwich that put the cs42448 at the bottom side,the pitch that works is 2.0mm
There's a connector on the up side to connect a TFT 7" RA8875,and also and EXT SDCARD reader because the building SDCARD
of teensy card was in conflict with the TFT
 

Attachments

  • Teensy 4.1 & CS42448_a.jpg
    Teensy 4.1 & CS42448_a.jpg
    190.2 KB · Views: 80
  • Teensy 4.1 & CS42448_b.jpg
    Teensy 4.1 & CS42448_b.jpg
    156.4 KB · Views: 82
@alfa66 I've experimented with one of those boards from ali express, they work fine with Teensy.

I captured a few details of the connections on my board - it look exactly the same as your board.

I have it running with the 6 ins and 8 out with breadboard wiring (you'd want to tidy up the wiring and keep it short if you're making any sort of permanent installations).

I've dumped the details below - any question just shout out.

Cheers Paul


Main Connector
View attachment 31356

Master Control Connector
View attachment 31357

A picture of it connected
View attachment 31358

A test program
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputTDM            tdm1;           //xy=233,172
AudioOutputTDM           tdm2;           //xy=605,170
AudioConnection          patchCord1(tdm1, 0, tdm2, 0);
AudioConnection          patchCord2(tdm1, 0, tdm2, 12);
AudioConnection          patchCord3(tdm1, 2, tdm2, 2);
AudioConnection          patchCord4(tdm1, 2, tdm2, 14);
AudioConnection          patchCord5(tdm1, 4, tdm2, 4);
AudioConnection          patchCord6(tdm1, 6, tdm2, 6);
AudioConnection          patchCord7(tdm1, 8, tdm2, 8);
AudioConnection          patchCord8(tdm1, 10, tdm2, 10);
AudioControlCS42448      cs42448_1;      //xy=273,405
// GUItool: end automatically generated code


void setup() {
  AudioMemory(1000);
  Serial.begin(38400);
  while (!Serial)
    ;
  if (cs42448_1.enable() && cs42448_1.volume(0.7)) {
    Serial.println("configured CS42448");
  } else {
    Serial.println("failed to config CS42448");
  }
}

void loop() {}

View attachment 31359
Thank you for sharing this great information!

As I am new to this forum, please forgive this simple question.

I would like to use the Audio System Design Tool to program the Teensy to be a USB Audio device, with 8 output channels. I will write python code to target each channel individually, playing a unique .wav file on each.

I have the CS42448 board and Teensy 4.0 breadboarded, but I am unclear what to do in the Audio System Design Tool.

Any guidance about how to create the design is much appreciated.

Best Regards,
Rich
 
Thank you for sharing this great information!

As I am new to this forum, please forgive this simple question.

I would like to use the Audio System Design Tool to program the Teensy to be a USB Audio device, with 8 output channels. I will write python code to target each channel individually, playing a unique .wav file on each.

I have the CS42448 board and Teensy 4.0 breadboarded, but I am unclear what to do in the Audio System Design Tool.

Any guidance about how to create the design is much appreciated.

Best Regards,
Rich

@MarkT
@AntiLoop

Hello, perhaps one of you might help me understand how to make use of the Audio System Design Tool. I created the layout that @houtson shared. I get the confirmation message "configured CS42448" in Serial Monitor. But I don't really understand what this confirms.

Also, I don't understand why @houtson made the layout the way he did.

I would like to use the Audio System Design Tool to program the Teensy to be a USB Audio device, with 8 output channels. I will write python code to target each channel individually, playing a unique .wav file on each.

I have the CS42448 board and Teensy 4.0 breadboarded, but I am unclear what to do in the Audio System Design Tool.

Any guidance about how to create the design is much appreciated.

Best Regards,
Rich
 
@MarkT
@AntiLoop

Hello, perhaps one of you might help me understand how to make use of the Audio System Design Tool. I created the layout that @houtson shared. I get the confirmation message "configured CS42448" in Serial Monitor. But I don't really understand what this confirms.

Also, I don't understand why @houtson made the layout the way he did.

I would like to use the Audio System Design Tool to program the Teensy to be a USB Audio device, with 8 output channels. I will write python code to target each channel individually, playing a unique .wav file on each.

I have the CS42448 board and Teensy 4.0 breadboarded, but I am unclear what to do in the Audio System Design Tool.

Any guidance about how to create the design is much appreciated.

Best Regards,
Rich

@MarkT
@AntiLoop
@PaulStoffregen

I ran the example Audio/HardwareTesting/WaveformsTDM16 successfully. All 8 outputs are working.

But this plays generated waveforms. To accomplish making this Teensy 4.0/CS42448 act as an 8 channel USB Audio Device, I must modify the code to accept USB input.

This is where I get confused.

I tried the following, which resulted in the USB device showing up in Windows as having 0 inputs and 2 outputs. Whenever I played a .wav file on my PC, it showed up on all 8 outputs at the same time. I guess this makes sense. But I don't understand how I would modify this layout to program the device to show up as having 8 outputs.

usb1.png


It seems like it is a limitation of the USB Input object in the Audio System Design Tool, having only 2 outputs:

USB_outputs.png


These seems like a very useful, helpful tool, I'm just not getting it apparently. Can someone point me to another example that may help me understand how to program a Teensy 4.0 to be a USB Audio device and support 8 output channels?

Best Regards,
Rich
 
Hi Rich, The standard USB input object is only 2 channel. There is some experimental work for multi channel - check out this link if interested. Cheers, Paul
 
Back
Top