USB interface for multi channel outputs, not just stereo

Hello, I am hoping one of you can help be get past a roadblock:
@alex6679
@houtson
@h4yn0nnym0u5e

I am using the CS42448 board from aliexpress with teensy 4.0. I used the github provided by @alex6679 to make the required changes to:
- changedCorefiles
- changedConfigfiles
- changedGUI

I have installed teensyduino 1.59 as indicated in the github repo.
I am using Arduino IDE 2.3.2.

But when I attempt to verify, I get the following error:
exec: "C:\\Users\\rich4\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr/../tools/arm/bin/arm-none-eabi-g++": file does not exist

Compilation error: exec: "C:\\Users\\rich4\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr/../tools/arm/bin/arm-none-eabi-g++": file does not exist

Here is my layout:

layout1.png



Here is my code:

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

// GUItool: begin automatically generated code
AudioInputUSBOct         usb_oct1;       //xy=189,160
AudioOutputTDM           tdm1;           //xy=508,157

AudioConnection          patchCord1(usb_oct1, 0, tdm1, 0);
AudioConnection          patchCord2(usb_oct1, 1, tdm1, 2);
AudioConnection          patchCord3(usb_oct1, 2, tdm1, 4);
AudioConnection          patchCord4(usb_oct1, 3, tdm1, 6);
AudioConnection          patchCord5(usb_oct1, 4, tdm1, 8);
AudioConnection          patchCord6(usb_oct1, 5, tdm1, 10);
AudioConnection          patchCord7(usb_oct1, 6, tdm1, 12);
AudioConnection          patchCord8(usb_oct1, 7, tdm1, 14);

AudioControlCS42448      cs42448_1;      //xy=337,337
// GUItool: end automatically generated code

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

void loop() {
}


I found a related issue in the following link, and tried the suggestion @Paul made (despite it apparently being MAC specific, while I am using Windows 11), but it made no difference for me:

pjrc forum link
 
The definitive HowTo for installing Teensyduino can be found on the PJRC website - I took a quick look at Paul's github repo and didn't see any instructions there, so not entirely clear what you've followed!

It's often helpful to turn on verbose compiler output, as you get a lot more detail on errors, which is very useful to those Skilled in The Art. BUT please do post that output in code tags, as you did with your sketch (which looks fine) ... otherwise the post tends to get unmanageably long.
 
Thank you @h4yn0nnym0u5e
I re-installed the arduino IDE and Teensyduino according to the link you provided.
I also turned on verbose compiler output.

Here is the error I continue to receive:
Code:
FQBN: teensy:avr:teensy40
Using board 'teensy40' from platform in folder: C:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0
Using core 'teensy4' from platform in folder: C:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0

Detecting libraries used...
C:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\avr/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -IC:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy4 C:\Users\rich4\AppData\Local\Temp\arduino\sketches\E4155212CAB52734BBBD28C2961D381A\sketch\WaveformsTDM16_rich5.ino.cpp -o nul
exec: "C:\\Users\\rich4\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr/../tools/arm/bin/arm-none-eabi-g++": file does not exist

Compilation error: exec: "C:\\Users\\rich4\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr/../tools/arm/bin/arm-none-eabi-g++": file does not exist
 
Thank you @h4yn0nnym0u5e
I re-installed the arduino IDE and Teensyduino according to the link you provided.
I also turned on verbose compiler output.

Here is the error I continue to receive:
Code:
FQBN: teensy:avr:teensy40
Using board 'teensy40' from platform in folder: C:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0
Using core 'teensy4' from platform in folder: C:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0

Detecting libraries used...
C:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\avr/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -IC:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy4 C:\Users\rich4\AppData\Local\Temp\arduino\sketches\E4155212CAB52734BBBD28C2961D381A\sketch\WaveformsTDM16_rich5.ino.cpp -o nul
exec: "C:\\Users\\rich4\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr/../tools/arm/bin/arm-none-eabi-g++": file does not exist

Compilation error: exec: "C:\\Users\\rich4\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr/../tools/arm/bin/arm-none-eabi-g++": file does not exist

An additional note:
I only see this error after I implement the changes from @alex6679 repo linked below, and attempt to verify my new code using the 8 wide USB input:

repo
 
So the $64,000 question is ... does C:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\tools/arm/bin/arm-none-eabi-g++ exist? Clearly the IDE expects it to ... if it does then the IDE is being weird, if it doesn't then the installation has messed up somehow ... or based on what you've just posted, your implementation of alex6679's changes isn't right. But I don't see how that last happens, because you shouldn't be touching the compiler itself.
 
So the $64,000 question is ... does C:\Users\rich4\AppData\Local\Arduino15\packages\teensy\hardware\tools/arm/bin/arm-none-eabi-g++ exist? Clearly the IDE expects it to ... if it does then the IDE is being weird, if it doesn't then the installation has messed up somehow ... or based on what you've just posted, your implementation of alex6679's changes isn't right. But I don't see how that last happens, because you shouldn't be touching the compiler itself.
I wasn't sure of the exact path it was looking for, with the mix of backslashes and slashes. But the path does not appear to exist.

Here is a screenshot of my directory structure:

file_struct.png
 
Right ... so the IDE is right to complain, always assuming the toolchain is supposed to be where it's looking.

If you reinstall (sorry...) without the 8-wide USB mods, and look again, does the path exist? And does a verbose compile of e.g. the Blink sketch still show the same path to arm-none-eabi-g++?
 
Ah, hang on, I may have spotted it. The compiler path is specified in platform.txt, which you'll have overwritten with the changedConfigfiles one. The relevant part may be
Code:
# Teensyduino Installer
compiler.path={runtime.hardware.path}/../tools/
teensytools.path={runtime.hardware.path}/../tools/

# Arduino Boards Manager
#compiler.path={runtime.tools.teensy-compile.path}/
#teensytools.path={runtime.tools.teensy-tools.path}/
I've been using IDE 1.8.19 which uses Teensyduino Installer; your 2.3.2 is (I believe) using Boards Manager. So just maybe commenting out the Teensyduino lines and uncommenting the Boards Manager ones will fix it? Worth a try...
 
@h4yn0nnym0u5e You are correct, that change in platform.txt got me past that compile issue. Unfortunately, it led to new compile issues. So I decided to uninstall version 2.X.X of the Arduino IDE and use the version you are using, 1.8.19.

This worked like a champ! Thank you very much for your help. I programmed the Teensy 4.0 successfully, and the USB Audio Device shows up as having 8 outputs in Windows 11.

I am now able to target each of the 8 channels independently and play a .wav file.

device_with_8_outputs.png



cs42448_breadboard.jpg



I want to document some key points for anyone who intends to duplicate this strategy of using 8 outputs of the CS42448 board.

1. The repo shared by @alex6679 does not mention the version of Arduino IDE being 1.8.19, but that turned out to be important. I recommend using this version.
github repo

2. The following settings in the Arduino IDE are critical:
In the Tools menu:
- Select your Teensy board using the Teensyduino menu.
- Ensure USB type is Audio.
- Ensure USB channels is 8.
- Ensure you select your port from the "Teensy port" section.



tools_menu.png



arduino_ide_selections.png
 
Last edited:
Thanks for that, glad you have it working. I have a laptop with IDE 2.x on it so at some point I’ll fire it up and see what needs to be done to make this work there, too.
 
@h4yn0nnym0u5e and @rtms: Thanks for finding out what the problem was. I added the info about the Arduino IDE version to the readme file for now. I think I will further extend the readme file next weekend since it's there is no information about how to use/integrate h4yn0nnym0u5e's contriburions yet.
 
I've just found a few extra sections in platform.txt that are different between Teensyduino and Boards Manager, so we probably need two copies in the repo. However, playing around with it has also reminded me that IDE 2.x refuses to show the extra Tools options when you select Teensy 4.1 as the target, which is a bit of a showstopper :cry:
 
@h4yn0nnym0u5e and @rtms: Thanks for finding out what the problem was. I added the info about the Arduino IDE version to the readme file for now. I think I will further extend the readme file next weekend since it's there is no information about how to use/integrate h4yn0nnym0u5e's contriburions yet.
Done it for you ... assuming you like the result, of course ;). The PR is here, for anyone wanting a sneak preview.
 
I just tried TDM+TDMB together with USB_OCT IN + USB_OCT OUT ,
I recorded the inputs coming from TDMB (in), in goldwave,then listen to the goldwave output
via TDMB (out),I'm very impressed by the sound quality , hope it will be a part of the next teensy update
Big cheers to " h4yn0nnym0u5e " and "alex6679" and others for their lovely works (y)(y)(y)
 
Excellent news - big thanks to @AntiLoop for testing our efforts. That and bug reports are very important, without those we're never 100% sure how robust our code is :cool:
 
I'm using windows 11,
simple curiosity,what happens if i use 2X USB_OCT,how will this appears in windows or goldwave
have i a choice to do?
 
You can use one input and one output, but the Design Tool will indicate a clash (little yellow warning triangle) if you try to place two outputs, for example.
 
Is it alright?

AAAusb_oct.png

I've tried with 2 inputs but gave me a warning triangle
Made it with your special united index
 
That shouldn't work and should warn you - I'm getting this:
1725208703606.png

(You get the little beige message when you click the warning triangle.)

I need to check with the united Design Tool I uploaded, it seems there's a bug in it if you don't get the warnings. Either way, it won't work...
 
Here you go - this one should give you the warnings for multiple USB outputs. My mistake.
 

Attachments

  • index-with-multi-TDM-and-USB.zip
    46 KB · Views: 28
Back
Top