Teensy LC & Audio library issue

Status
Not open for further replies.

jmzjmzjmz

Member
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?
 
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? :(
 
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 .....
 
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-Teensy-LC-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.
 
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:
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.
 
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
 
Status
Not open for further replies.
Back
Top