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

Thread: Teensy Audio Example Sketches Won't Compile on Teensy LC

  1. #1
    Junior Member
    Join Date
    Jun 2019
    Posts
    2

    Teensy Audio Example Sketches Won't Compile on Teensy LC

    I bought the Teensy LC and the Prop Shield LC and soldered them together.
    I tried to compile the example audio sketches and none of them will compile.

    The most basic one that includes the binary files for the sounds should be the easiest one to work, right?
    Or is there a different example code I should try with the Prop Shield LC that's actually made for the LC version ?

    File->Examples->(Examples for Teensy LC)Audio->SamplePlayer

    Hitting Verify button gives these errors:

    Arduino: 1.8.9 (Windows 10), TD: 1.46, Board: "Teensy LC, Serial, 48 MHz, Smallest Code, US English"

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ analyze_fft1024.cpp:34:13: warning: 'void copy_to_fft_buffer(void*, const void*)' defined but not used [-Wunused-function]

    static void copy_to_fft_buffer(void *destination, const void *source)

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ analyze_fft1024.cpp:44:13: warning: 'void apply_window_to_fft_buffer(void*, const void*)' defined but not used [-Wunused-function]

    static void apply_window_to_fft_buffer(void *buffer, const void *window)

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ effect_midside.cpp: In member function 'virtual void AudioEffectMidSide::update()':

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ effect_midside.cpp:34:12: warning: unused variable 'pa' [-Wunused-variable]

    uint32_t *pa, *pb, *end;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ effect_midside.cpp:34:17: warning: unused variable 'pb' [-Wunused-variable]

    uint32_t *pa, *pb, *end;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ effect_midside.cpp:34:22: warning: unused variable 'end' [-Wunused-variable]

    uint32_t *pa, *pb, *end;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ effect_midside.cpp:35:11: warning: unused variable 'a12' [-Wunused-variable]

    uint32_t a12, a34; //, a56, a78;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ effect_midside.cpp:35:16: warning: unused variable 'a34' [-Wunused-variable]

    uint32_t a12, a34; //, a56, a78;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ effect_midside.cpp:36:11: warning: unused variable 'b12' [-Wunused-variable]

    uint32_t b12, b34; //, b56, b78;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ effect_midside.cpp:36:16: warning: unused variable 'b34' [-Wunused-variable]

    uint32_t b12, b34; //, b56, b78;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ input_adc.cpp: In static member function 'static void AudioInputAnalog::isr()':

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ input_adc.cpp:119:2: warning: 'daddr' is used uninitialized in this function [-Wuninitialized]

    if (daddr < (uint32_t)analog_rx_buffer + sizeof(analog_rx_buffer) / 2) {

    ^

    C:\Users\Brenna\AppData\Local\Temp\ccEFea6d.s: Assembler messages:

    C:\Users\Brenna\AppData\Local\Temp\ccEFea6d.s:291: Error: selected processor does not support `smull r0,ip,r3,r5' in Thumb mode

    C:\Users\Brenna\AppData\Local\Temp\ccEFea6d.s:292: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov ip,ip,asl r6'

    C:\Users\Brenna\AppData\Local\Temp\ccEFea6d.s:293: Error: unshifted register required -- `orr r0,ip,r0,lsr r7'

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ output_pt8211.cpp: In static member function 'static void AudioOutputPT8211::isr()':

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ output_pt8211.cpp:107:25: error: 'class DMAChannel' has no member named 'TCD'

    saddr = (uint32_t)(dma.TCD->SADDR);

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ input_i2s.cpp: In static member function 'static void AudioInputI2S::isr()':

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ input_i2s.cpp:110:2: warning: 'daddr' is used uninitialized in this function [-Wuninitialized]

    if (daddr < (uint32_t)i2s_rx_buffer + sizeof(i2s_rx_buffer) / 2) {

    ^

    Error compiling for board Teensy LC.

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  2. #2
    Senior Member
    Join Date
    Dec 2013
    Posts
    220
    Teensy Audio Library

    Supported Hardware:
    Audio Adaptor, for 16 bit stereo input and output.
    Dual Audio Adaptors for 16 bit quad channel input and output.
    S/PDIF optical digital audio output, for 16 bit stereo sound.
    Teensy 3.6, Teensy 3.5, Teensy 3.2 & 3.1 built-in DAC, for 12 bit mono output.
    Teensy 3.6 and Teensy 3.5 built-in DACs, for 12 bit stereo output.
    Teensy 3.6, Teensy 3.5, Teensy 3.2 & 3.1 & 3.0 ADC, for 13 bit mono input.
    Teensy 3.6, Teensy 3.5, Teensy 3.2 & 3.1 ADCs, for 13 bit stereo input.
    Teensy 3.6, Teensy 3.5, Teensy 3.2 & 3.1 & 3.0 PWM, for approx 9-10 bit mono output.

    USB Audio, for bi-directional stereo streaming to/from a PC.

  3. #3
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,093
    You could use the DAC (A12) jumpered to audioIn on the propshield with audio amp pin enabled to drive an 8 ohm speaker connected to shield. Here's a link on 8-bit WAV for LC https://forum.pjrc.com/threads/32477-Teensy-LC-DAC
    LC == Low Cost == Limited Capability
    Try a T3.2 with audio shield

  4. #4
    Junior Member
    Join Date
    Jun 2019
    Posts
    2
    I thought I could load a WAV file onto the 8MB storage on the prop shield and make it play through a speaker. Does it really need all this workaround and jumpers and things?

  5. #5
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,459
    Quote Originally Posted by ramgarden View Post
    I thought I could load a WAV file onto the 8MB storage on the prop shield and make it play through a speaker. Does it really need all this workaround and jumpers and things?
    But yes, you can. It's not about "workaround and jumpers", it's about engineering, which means processing and outputting a signal on the Teensy LC and feeding it into the appropriate pins of the prop shield. Since the prop shield is intended to interoperate with a whole bunch of different Teensy models, a minimum of wiring is naturally required to adapt everything to your specific setup.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,327
    The normal Audio library can't run on Teensy LC.

    But this port of Arduino's much simpler library (which only plays a single WAV file) can.

    https://github.com/PaulStoffregen/AudioZero

Posting Permissions

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