libxwax: Exchange the static delayline with a generic ringbuffer - #15965
Merged
Conversation
jclsn
force-pushed
the
feat/generalized-ringbuffer
branch
8 times, most recently
from
February 11, 2026 07:09
d4be53e to
1696c12
Compare
Contributor
Author
|
Should be fine now. No idea why Windows ARM64 failed. It went through last time. |
jclsn
force-pushed
the
feat/generalized-ringbuffer
branch
2 times, most recently
from
February 12, 2026 13:03
8b04590 to
15f2ea2
Compare
jclsn
force-pushed
the
feat/generalized-ringbuffer
branch
from
February 12, 2026 21:11
15f2ea2 to
aa979a9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the fixed-size, stack-allocated MK2 delayline implementation with a heap-allocated generic ringbuffer to support future runtime-sized FIR filter delaylines.
Changes:
- Replaced
delayline_*usage in MK2 processing withrb_*ringbuffer operations. - Introduced new generic
ringbuffermodule and removed the olddelaylineimplementation from the build. - Updated
timecoder/MK2 structs to store ringbuffers via pointers and added allocation/freeing logic.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/xwax/timecoder_mk2.c | Switch MK2 demodulation delayline operations from delayline to ringbuffer APIs. |
| lib/xwax/timecoder.h | Replace embedded delayline structs with struct ringbuffer* and include new header. |
| lib/xwax/timecoder.c | Allocate ringbuffers during init and free during clear; update MK2 sample access. |
| lib/xwax/ringbuffer.h | New ringbuffer API definition. |
| lib/xwax/ringbuffer.c | New ringbuffer implementation (alloc/free/reset/at/push). |
| lib/xwax/delayline.h | Removed old fixed-size delayline API. |
| lib/xwax/delayline.c | Removed old fixed-size delayline implementation. |
| CMakeLists.txt | Build ringbuffer.c instead of delayline.c for VINYLCONTROL/xwax target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jclsn
force-pushed
the
feat/generalized-ringbuffer
branch
from
February 13, 2026 16:04
aa979a9 to
b7e9129
Compare
This ringbuffer is more versatile and can also be used for later filter implementations.
jclsn
force-pushed
the
feat/generalized-ringbuffer
branch
from
February 13, 2026 16:09
b7e9129 to
c37b552
Compare
Contributor
Author
|
Should be fine now |
This file contains hidden or 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
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.
This ringbuffer is more versatile and can also be used for later filter implementations.
This is needed because I want to write a generalized filter function that can generate FIR filters at runtime, which need a lot of memory for the delayline.
The FIR filters are needed, because I need to exchange Exponential Moving Average filter with one, because it is IIR and distorts phase. Phase distortion means that it exhibits different delays for different frequencies -> non-constant group delay, which would in theory increase sticker drift, because the delay would be higher when scratching than during normal playback.