-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add I2S prefill & multisegment parallel output #17
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awawa-dev
force-pushed
the
parallel_mode
branch
2 times, most recently
from
January 12, 2023 23:10
a8002b4
to
bc2fb57
Compare
awawa-dev
changed the title
Add parallel output mode for multi-segments (WIP)
Add parallel output mode for multi-segments (Ready for testing)
Jan 12, 2023
awawa-dev
force-pushed
the
parallel_mode
branch
from
January 12, 2023 23:39
bc2fb57
to
aaa380f
Compare
awawa-dev
changed the title
Add parallel output mode for multi-segments (Ready for testing)
Add I2S parallel output mode for multi-segments (Ready for testing)
Jan 13, 2023
awawa-dev
changed the title
Add I2S parallel output mode for multi-segments (Ready for testing)
Add I2S parallel output mode for multi-segments LED strip (Ready for testing)
Jan 14, 2023
awawa-dev
changed the title
Add I2S parallel output mode for multi-segments LED strip (Ready for testing)
Add I2S parallel output mode for multi-segments LED strips (Ready for testing)
Jan 14, 2023
awawa-dev
changed the title
Add I2S parallel output mode for multi-segments LED strips (Ready for testing)
Add I2S parallel output mode for multi-segments LED strips (WIP)
Jan 20, 2023
awawa-dev
force-pushed
the
parallel_mode
branch
from
January 23, 2023 20:45
df31e72
to
e1aca1e
Compare
awawa-dev
changed the title
Add I2S parallel output mode for multi-segments LED strips (WIP)
Add I2S prefill & multisegment parallel output (WIP)
Jan 27, 2023
awawa-dev
changed the title
Add I2S prefill & multisegment parallel output (WIP)
Add I2S prefill & multisegment parallel output
Feb 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add true parallel output for HyperSerialESP32 based on development version of Neopixelbus library that already includes some of my changes (Fix frequency for 8/16bits parallel modes & add sk6812 modes Makuna/NeoPixelBus#609 ESP32 I2S 8/16 bits parallel channel support (WIP) Makuna/NeoPixelBus#606).
This feature is fully supported by ESP32 and ESP32-S2. Finally we switched to my optimized for HyperSerialESP32 fork: https://github.com/awawa-dev/NeoPixelBus
When using multi-segments in parallel mode, both segments are perfectly in sync: the signal for both segments is generated at exactly the same time.
Both single & multi segment mode are using live prefill processing now!
Two frames can be render&pre-render at the same time. Pre-filling provides a back buffer mechanism with little impact on RAM: there is no need to store a full second buffer, which can be a critical issue with larger LED strips or ESP32-S2. It is synchronized with DMA buffer processing.
fixed critical I2S bug in the core rendering library that could stop ESP rendering under certain circumstances and required the ESP board to be reset
better thread synchronization between the serial port client and the render&processing unit using new semaphore.
switched the ESP32-S2 from a resource-hungry real-time RMT to an I2S renderer.
update espressif32 to 6.0.0
Parallel refresh rate is about 10% lower than unsynchronized multi-segment mode.For ESP32 board I've fixed it thanks to my prefill I2S patch to Neopixelbus library (awawa-dev/NeoPixelBus@66ceae9).ESP32-S2 is still affected.ESP32-S2 is also fixed in the incoming patch for the render library.On the following screenshot HyperHDR and ESP32 & ESP32-S2 with HyperSerialESP32 are handling 1800 RGBW LEDs at the same time (two 900LEDs segments). First two lines are for ESP32-S2 sending output to the two LEDs segments, the third line is rendering new frame busy status (or sleeping and waiting for DMA buffer to be freed), the fourth line is is awaken and filling part of DMA buffer that was already sent. Next four lines are for the second device: ESP32 and its two 450 RGBW LEDs segments. RGBW LEDs (sk6812) requires much more data to be stored in memory, prepared and sent than RGB like ws2812b.
This shows how prefill for the second frame is started immediately while the first frame is still being rendered. It waits till DMA reports that it;s already processed part of the i2s buffer (with the first frame's data) so we can safely fill that part (with the second frame's data) and wait for the next call. Without it filling i2s buffer after the first frame is sent, can take up to few ms causing delay between frames.
It's highly recommended to customize the serial port speed in the firmware and set it to the maximum that your boards support e.g. 4000000 for CH9102x and 5000000 for ESP32-S2 lolin mini (CDC). For multi-segment mode we are no longer limited by 800KHz Neopixel LED strip data bus.