You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cross post: Weird Behavior ObjectFLED with Teensy Audio Library #2
Here's a video clip of the flicker. He has a lot of other DMA devices going on at the same time so this could be the cause. I'm asking him to isolate the project so that it just does fastled rendering and nothing else.
It kind of worked, as the fps jumped from 43 (plain FastLED) to 133 (the same I get with WS2812Serial), but there some issues, like random pixels flickering all the time (see video).
changed the title [-]Cross post: Weird behavior of v3.9.8 on Teensy 4.x with ObjectFLED driver [/-][+]Cross post: Weird Behavior ObjectFLED with Teensy Audio Library[/+]on Jan 1, 2025
Testing showed that FastLED is not the cause. It is DMA and/or timer conflict between ObjectFLED and Audio.h. Likely the conflict is inherited from OctoWS2811 library.
Happy New Year! I've reproduced this error and ruled out OctoWS2811 and FastLED as the cause. Apparently I introduced this error in ObjectFLED when I re-packaged the DMA driver code from OctoWS2811. So my PD is focused on this, and any differences I inadvertently introduced while refactoring OctoWS2811 code.
The conflict can be eliminated by commenting out this single line of code from the Audio library file output_i2s.cpp:
This is executed by the constructor for AudioInputI2S. I can't see any direct conflicts between this and ObjectFLED's use of quad timer, but I'm not expert in register-level hardware. Investigation continues. I didn't think I changed anything in OctoWS2811 DMA and timer configuration when I converted it to ObjectFLED. But I will dig deeper into this.
@KurtMF can you file an issue with Pauls Audio library and explain that we are investigating this issue and your potential fix to see what he has to say?
I don't think that will be necessary. Paul made contact with us here and Audio library isn't the one with the issue. Nor is OctoWS2811, the grandfather of ObjectFLED.
Apparently, I broke something when I refactored Octo to work in multiple objects. I'm determined to get to the bottom of it today.
@lpaolini, can you please give confirmation for this fix? To confirm, use the last test code from above, where you operated with ObjectFLED raw, declaring an ObjectFLED object, but use begin(1.2); instead of begin(); for overclocking?
Also this should work (with no overclocking):
begin(1.0, 1250, 300, 750, 75);
Good point. Others have made the same mistake of using #define FASTLED_OVERCLOCK.
I've changed it in master. Both will work and now you will get a compiler message indicating the FASTLED_OVERCLOCK is now active until you actively suppress the message with #define FASTLED_OVERCLOCK_SUPPRESS_WARNING.
Ok, I tested again my test sketch using FASTLED_LED_OVERCLOCK and it works, yay!
However, I've also tried replacing WS2812Serial with ObjectFLED driver in my library and I can't get a single overclock factor satisfying all my 4 strips at the same time (e.g. 20% overclock works for my newer 144 LED/m, but it doesn't for the older 60LED/m strips), while using WS2812Serial all strips work perfectly well.
ObjectFLED is optimized for performance! If you want to drive old clunkers with it , ya gotta slow it down. :-)
Haha! True, but I'm not a big fan of overclocking when it puts stability at a risk. For massive performance gain, more than stretching the specs to the limits, I would just drop WS2812 and go all in with APA102 or other synchronous LED chip.
Perhaps next version of ObjectFLED will handle 39/54 parallel outputs, with one reserved for a single shared clock... :-)
@KurtMF might be a good idea to use the 250 uS delay that the new WS2812-V5B uses.
I've increased the latch delay to be the default FastLED on master.
Yes, you guys are both right: I set the default timings too aggressive, and we have seen the result. After talking with Paul S. and doing some more testing I set default Latch Delay = 300 uS.
I also changed defaults for TH_TL, T0H, and T1H to fix the Audio lib problem.
Now... I think there's a way to close this issue and tie it to the latest release: 1.1.0
Activity
zackees commentedon Dec 29, 2024
Here's a video clip of the flicker. He has a lot of other DMA devices going on at the same time so this could be the cause. I'm asking him to isolate the project so that it just does fastled rendering and nothing else.
[-]Cross post: Weird behavior of v3.9.8 on Teensy 4.x with ObjectFLED driver [/-][+]Cross post: Weird Behavior ObjectFLED with Teensy Audio Library[/+]KurtMF commentedon Jan 1, 2025
Test code from @lpaolini:
`#include <FastLED.h>
#include <ObjectFLED.h>
#include <Audio.h>
#define PIN 17
#define NUM_LEDS 192
CRGB leds[NUM_LEDS];
uint8_t pinList[1] = {PIN};
ObjectFLED fled(NUM_LEDS, leds, CORDER_GRB, 1, pinList);
AudioInputI2S audioInput;
void setup() {
fled.begin();
}
void loop() {
fled.show();
delay(10);
}
`
Testing showed that FastLED is not the cause. It is DMA and/or timer conflict between ObjectFLED and Audio.h. Likely the conflict is inherited from OctoWS2811 library.
Investigating...
KurtMF commentedon Jan 1, 2025
@lpaolini, When you installed Audio library, did you grab the master, updated 2 years ago, or did you install the "latest" release updated 2015?
lpaolini commentedon Jan 2, 2025
Installed from the GitHub repo, so it ought to be master.
By the way, why "2 years ago"? Master has been updated several times in 2024.
KurtMF commentedon Jan 2, 2025
Happy New Year! I've reproduced this error and ruled out OctoWS2811 and FastLED as the cause. Apparently I introduced this error in ObjectFLED when I re-packaged the DMA driver code from OctoWS2811. So my PD is focused on this, and any differences I inadvertently introduced while refactoring OctoWS2811 code.
The conflict can be eliminated by commenting out this single line of code from the Audio library file output_i2s.cpp:
[CODE]393 CCM_CCGR5 |= CCM_CCGR5_SAI1(CCM_CCGR_ON);[/CODE]
This is executed by the constructor for AudioInputI2S. I can't see any direct conflicts between this and ObjectFLED's use of quad timer, but I'm not expert in register-level hardware. Investigation continues. I didn't think I changed anything in OctoWS2811 DMA and timer configuration when I converted it to ObjectFLED. But I will dig deeper into this.
zackees commentedon Jan 2, 2025
@KurtMF can you file an issue with Pauls Audio library and explain that we are investigating this issue and your potential fix to see what he has to say?
https://github.com/PaulStoffregen/Audio/issues/new
KurtMF commentedon Jan 3, 2025
I don't think that will be necessary. Paul made contact with us here and Audio library isn't the one with the issue. Nor is OctoWS2811, the grandfather of ObjectFLED.
Apparently, I broke something when I refactored Octo to work in multiple objects. I'm determined to get to the bottom of it today.
KurtMF commentedon Jan 4, 2025
YAY! Problem solved. Details here.
@lpaolini, can you please give confirmation for this fix? To confirm, use the last test code from above, where you operated with ObjectFLED raw, declaring an ObjectFLED object, but use begin(1.2); instead of begin(); for overclocking?
Also this should work (with no overclocking):
begin(1.0, 1250, 300, 750, 75);
Thanks!
lpaolini commentedon Jan 4, 2025
@KurtMF Yes, confirmed! They both work.
Thanks for looking into this issue.
KurtMF commentedon Jan 4, 2025
Excellent. Thank you also, @lpaolini, for helping me home in on this.
I'm going to change the hard-coded default values in ObjectFLED so this all works out of the box.
lpaolini commentedon Jan 4, 2025
How about ObjectFLED via FastLED? Would the following be enough for fixing the issue?
zackees commentedon Jan 4, 2025
Yes, it binds to the overclock factor passed into ObjectFLED so it should work great. Let me know if it doesn't, as it would be a bug.
lpaolini commentedon Jan 4, 2025
Hmm... I've just tried on my test sketch and it doesn't seem to work.
4 remaining items
KurtMF commentedon Jan 4, 2025
I wouldn't do that just yet, I have confidence it will work with the right define label.
1.1.0 should be out by Monday with default values fixed for this.
zackees commentedon Jan 4, 2025
Good point. Others have made the same mistake of using
#define FASTLED_OVERCLOCK.I've changed it in master. Both will work and now you will get a compiler message indicating the FASTLED_OVERCLOCK is now active until you actively suppress the message with
#define FASTLED_OVERCLOCK_SUPPRESS_WARNING.KurtMF commentedon Jan 4, 2025
#define FASTLED_OVERCLOCK
#define FASTLED_OVERCLOCK_SUPRESS WARNING
#define FASTLED_LED_OVERCLOCK
#define FASTLED_LED_OVERCLOCK_IGNORE_SUPRESS_WARNING
#define FASTLED_LED_OVERCLOCK_NEED_MORE_DEFINES_PLEASE
#define FASTLED_LED_OVERCLOCK_ZACK_MAGIC
#define FASTLED_LED_OVERCLOCK_:-)
lpaolini commentedon Jan 4, 2025
Alright, then the release notes for v3.9.8 should be fixed, I guess.
lpaolini commentedon Jan 4, 2025
Ok, I tested again my test sketch using FASTLED_LED_OVERCLOCK and it works, yay!
However, I've also tried replacing WS2812Serial with ObjectFLED driver in my library and I can't get a single overclock factor satisfying all my 4 strips at the same time (e.g. 20% overclock works for my newer 144 LED/m, but it doesn't for the older 60LED/m strips), while using WS2812Serial all strips work perfectly well.
KurtMF commentedon Jan 5, 2025
Hmm. I would try the following, in order, to get all working:
ObjectFLED is optimized for performance! If you want to drive old clunkers with it , ya gotta slow it down. :-)
zackees commentedon Jan 5, 2025
Thanks
zackees commentedon Jan 5, 2025
In FastLED this would be
zackees commentedon Jan 5, 2025
@KurtMF might be a good idea to use the 250 uS delay that the new WS2812-V5B uses.
I've increased the latch delay to be the default FastLED on master.
lpaolini commentedon Jan 5, 2025
Haha! True, but I'm not a big fan of overclocking when it puts stability at a risk. For massive performance gain, more than stretching the specs to the limits, I would just drop WS2812 and go all in with APA102 or other synchronous LED chip.
Perhaps next version of ObjectFLED will handle 39/54 parallel outputs, with one reserved for a single shared clock... :-)
zackees commentedon Jan 5, 2025
HD107s for the win
lpaolini commentedon Jan 5, 2025
Well, HD108 then :-)
KurtMF commentedon Jan 5, 2025
Yes, you guys are both right: I set the default timings too aggressive, and we have seen the result. After talking with Paul S. and doing some more testing I set default Latch Delay = 300 uS.
I also changed defaults for TH_TL, T0H, and T1H to fix the Audio lib problem.
Now... I think there's a way to close this issue and tie it to the latest release: 1.1.0
zackees commentedon Jan 6, 2025
Cool, I changed it master to also be 300 uS