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

Thread: Teensy 4.0 I2S MIC Breaks FastLED

  1. #1

    Teensy 4.0 I2S MIC Breaks FastLED

    Hello everyone! I have finally been able to assemble all my components for my LED project. It consists of:
    1. Teensy 4.0
    2. 1680 WS2813 LEDs
    3. SPH0645LM4H-B breakout microphone
    4. HC-05 Bluetooth
    5. Passives, level shifter, and minor sensors.

    The objective has been to display various patterns on the LED matrix (28*60), and to visualize music. The display works pretty well for displaying patterns, and my FFT code provides data to the serial monitor just as I expect it to. However, when I try to add the audio component with LED writeout the LEDs provide garbled output, even without calling any of the audio functions. It seems the act of including the 'AudioConnection' to the I2S mic is what breaks functionality. I have looked around the forms, and I haven't seen anyone describing the same problem.

    Here are some of the main things I have tried:
    1. Reducing the number of LEDs the program writes to, no effect
    2. Reducing the number of parallel outputs the program writes to, no effect
    3. Grossly simplifying the program, no effect
    4. Changing the LED write frequency, no effect
    5. #define FASTLED_ALLOW_INTERRUPTS 0, which throws an error: error.txt
    6. Substituting the I2S mic for an ADC, this doesn't generate the error, but this is not a good workaround, as the ADC mic has its own suite of problems
    7. Removing/adding the mixer
    8. Commenting out the 'AudioConnection' will preserve FastLED output, but obviously this kills audio

    I think it might be some sort of timing problem, but I am surprised that it kills FastLED functionality without even calling a function. This one is definitely at the limits of my understanding, and I would really appreciate any help, or potential options to test on the code that I have been using Audio_Simplified___lights_test_cutdown.ino. Thanks a bunch for any help you can provide.

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    128
    If you set up an AudioConnection to an input or output device the Audio system flies into action there and then,
    basically the first hardware audio component that has something useful to do initiates the Audio subsystem.

    Thus creating the AudioConnection is the point in time Audio-related interrupts are likely to start happening,
    every 2.9ms.

    The underlying issue is likely interrupt related, I don't know anything about FASTLED though, it may disable
    interrupts for too long perhaps?

    Hope this helps find a workaround.

  3. #3
    That makes sense. I'm just a little bit confused that it seems to break output even when FastLED is only writing one light. It break output even if it only writes to that light once every second, that's the tricky part. I'll have to look more at solutions for the FASTLED_ALLOW_INTERRUPTS 0, but I feel like there must be something else. Thanks for the help!

Posting Permissions

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