Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 32 of 32

Thread: What is the current state of Audio Library support for the Teensy 4.0?

  1. #26
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    258
    The reference manual for the processor is not helpful...because the missing piece of information is which Teensy pins (which I2S lines) are used by the I2S_quad class. That's the part I can't figure out. That's a question that is entirely within the Teensy universe.

    It is *so* awesome that someone (Paul?) Did all the hard and thankless labor to get it to work! Bit which I2S pins did they end up using?

    Thanks!

    Chip

  2. #27
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,688
    Sorry, I am not much of an Audio guy.

    But a couple of quick searches in source files may give you your answers.
    Example I did a global search in sublime text for i2s_quad

    And with that found the file input_i2s_quad.cpp
    Code:
    void AudioInputI2SQuad::begin(void)
    {
    	...
    #elif defined(__IMXRT1062__)
    	const int pinoffset = 0; // TODO: make this configurable...
    	AudioOutputI2S::config_i2s();
    	I2S1_RCR3 = I2S_RCR3_RCE_2CH << pinoffset;
    	switch (pinoffset) {
    	  case 0:
    		CORE_PIN8_CONFIG = 3;
    		CORE_PIN6_CONFIG = 3;
    		IOMUXC_SAI1_RX_DATA0_SELECT_INPUT = 2; // GPIO_B1_00_ALT3, pg 873
    		IOMUXC_SAI1_RX_DATA1_SELECT_INPUT = 1; // GPIO_B0_10_ALT3, pg 873
    		break;
    	  case 1:
    ...
    So looks like pins 6 and 8 are of interest.

    And in the output_i2s_quad.cpp I see
    Code:
    void AudioOutputI2SQuad::begin(void)
    {
    ...
    #elif defined(__IMXRT1062__)
    	const int pinoffset = 0; // TODO: make this configurable...
    	memset(i2s_tx_buffer, 0, sizeof(i2s_tx_buffer));
    	AudioOutputI2S::config_i2s();
    	I2S1_TCR3 = I2S_TCR3_TCE_2CH << pinoffset;
    	switch (pinoffset) {
    	  case 0:
    		CORE_PIN7_CONFIG  = 3;
    		CORE_PIN32_CONFIG = 3;
    		break;
    	  case 1:
    ...
    Looks like pins 7 and 32 might be of interest...

    But again I am only guessing.

  3. #28
    Junior Member
    Join Date
    Dec 2019
    Location
    Rockledge, Florida or Linn Creek Missouri
    Posts
    1
    Paul,
    Having an issue with a fairly large project (HF/VHF Ionospheric Simulator ~ 2300 lines on a Teensy 4.0) Am using 32 Audio "components" including in and out ports but if I try to add an audio component (I need a couple more) the following happens:
    1) Compiles OK and attempts load.
    2) My startup splash screen activates but then hangs...no other functions work. If I remove the added "component" all is OK.
    3) Not running low on Memory about 7 % program storage and 36 % dynamic memory. Have 100 audio blocks allocated max is something like 30.
    The good news is almost everything is working and the audio components have worked well and the simulator is useful and performs well...its just a couple of "bells and whistles" I wanted to add.
    Any help or pointers would be appreciated. Tom Lafleur is helping me on this project....he did all the PCB layouts etc.
    Thanks....keep up the great work...I just ordered a Teensy 4.1!
    Rick Muething rmuething@cfl.rr.com

  4. #29
    Junior Member
    Join Date
    Sep 2018
    Posts
    7
    Does anyone know what the status is for dual audio shields with the Teensy 4.0, has anyone tried it yet? Wanted to make a carrier board to connect a teensy and two audio shields without stacking. The audio app seems to suggest the 4.0 supports dual audio shields but the wiring instructions linked to Sparkfun are still for the 3.2.

  5. #30
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,767
    Quote Originally Posted by colinza View Post
    has anyone tried it yet?
    Yes, it's works. Here you can see a test I ran shortly after it was first supported. I created 4 waveforms using PWM and resistor-capacitor filters. The 4 waveforms go into the inputs of both shields, and a program routes the digital data to the 4 outputs (crossing from 1 board to the other), and I checked all 4 shield outputs have the signals the PWM created.

    Plenty of photos, so you can see for sure it works and exactly how it was wired.

    https://forum.pjrc.com/threads/61123...l=1#post242054

    PaulS also checked in on that thread using just digital signal loopback.

    You can see a followup in msg #22 on that thread, where the problem initially reported turned out to be a wiring error. That's a 3rd confirmation it definitely is working!

    The data pins from the 2nd audio shield need to connect to pins 6 and 32. If you're using Teensy 4.0 that means running a wire to one of the surface mount pads on the bottom side, since that's the only way to access pin 32 on the smaller Teensy 4.0 board.

  6. #31
    Junior Member
    Join Date
    Sep 2018
    Posts
    7
    Fantastic, thanks so much Paul!

  7. #32
    Junior Member
    Join Date
    Sep 2018
    Posts
    7
    Quote Originally Posted by PaulStoffregen View Post
    If you're using Teensy 4.0 that means running a wire to one of the surface mount pads on the bottom side, since that's the only way to access pin 32 on the smaller Teensy 4.0 board.
    Time to order some pogo pins!

Posting Permissions

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