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

Thread: Teensy LC & Audio library issue

  1. #1
    Junior Member
    Join Date
    Mar 2015
    Posts
    7

    Teensy LC & Audio library issue

    On a new Teensy LC, when I compile any of the example sketches that come with the Teensy Audio Library I'm getting this error:

    Code:
    Using library Audio in folder: /Applications/ArduinoNew.app/Contents/Resources/Java/hardware/teensy/avr/libraries/Audio (1.0.x format)
    /var/folders/tk/rhpm6wds0t3_wm423m_cjxxw0000gn/T//ccSD5jvX.s: Assembler messages:
    /var/folders/tk/rhpm6wds0t3_wm423m_cjxxw0000gn/T//ccSD5jvX.s:339: Error: selected processor does not support Thumb mode `smuad r6,r6,r6'
    Error compiling.
    They all work fine when I switch back to a Teensy 3.1 . I've updated to the latest teensyduino and have tried using both Arduino 1.6.1 and 1.0.6 with no luck Has anyone else had this problem?

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,567
    On LC, the Audiolibrary is not supported.

  3. #3
    Junior Member
    Join Date
    Mar 2015
    Posts
    7
    Interesting--- Is there any documentation anywhere online saying this? I assumed since it had a DAC it would be just as capable with the audio library, or is it just not implemented yet?

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,567
    Well..the easy answer is: Look at your compileroutput:
    "Error: selected processor does not support Thumb mode `smuad r6,r6,r6'"
    The LC is a Cortex M0+ and it does not support the DSP-extensions.
    Even if it had it: the M0 is slower and with only 8K RAM .....

  5. #5
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,106
    Quote Originally Posted by jmzjmzjmz View Post
    Interesting--- Is there any documentation anywhere online saying this? I assumed since it had a DAC it would be just as capable with the audio library, or is it just not implemented yet?
    List of libraries tested with LC
    https://forum.pjrc.com/threads/27689...C-Beta-Testing

    The Audio library makes extensive use of the Cortex M4 DSP instructions, which the Cortex M0 on LC does not have. The memory requirements for most Audio library sketches also tend to rule out LC.

  6. #6
    Senior Member
    Join Date
    Jan 2015
    Location
    frisia
    Posts
    285
    As Frank said, If you get it working, I would expect only some light processing stuff to work.
    If you are willing to invest some time, you might replace the functions in Audio/utility/dspinst.h. Don't know how far you could get.
    This dspinst.h directly calls the assembly functions. If you replace the assembly by a function call to eg __SMUAD, then it should automatically replace this on the cortex m0 with replacements, as defined in arm_math.h
    as an example: replace
    Code:
    static inline int32_t multiply_16tx16t_add_16bx16b(uint32_t a, uint32_t b)
    {
            int32_t out;
            asm volatile("smuad %0, %1, %2" : "=r" (out) : "r" (a), "r" (b));
            return out;
    }
    by
    Code:
    static inline int32_t multiply_16tx16t_add_16bx16b(uint32_t a, uint32_t b)
    {
            return __SMUAD(a, b);
    }
    Edit: quickly tried commenting all assembly instructions (ie no replacement), just to see if it compiles, but immediately ran against all kinds of DMA stuff not defined.
    Last edited by kpc; 03-21-2015 at 07:32 PM.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,932
    Yeah, it's going to be a big job to get even a small part of the audio library working on Teensy-LC. Most of the audio objects will never run on LC, but a few probably can.

    I will work on this eventually, but I have several other higher priority tasks to do first.

  8. #8
    Junior Member
    Join Date
    Jun 2015
    Posts
    3
    i want to record and play raw data in teensy lc wihout using audio shield.....please suggest me how to go trough using dac and adc 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
  •