Skip to content

libxwax: Exchange the static delayline with a generic ringbuffer - #15965

Merged
ywwg merged 1 commit into
mixxxdj:mainfrom
jclsn:feat/generalized-ringbuffer
Feb 17, 2026
Merged

libxwax: Exchange the static delayline with a generic ringbuffer#15965
ywwg merged 1 commit into
mixxxdj:mainfrom
jclsn:feat/generalized-ringbuffer

Conversation

@jclsn

@jclsn jclsn commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the build label Feb 10, 2026
@jclsn
jclsn force-pushed the feat/generalized-ringbuffer branch 8 times, most recently from d4be53e to 1696c12 Compare February 11, 2026 07:09
@jclsn

jclsn commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

Should be fine now. No idea why Windows ARM64 failed. It went through last time.

@jclsn
jclsn force-pushed the feat/generalized-ringbuffer branch 2 times, most recently from 8b04590 to 15f2ea2 Compare February 12, 2026 13:03
@jclsn
jclsn force-pushed the feat/generalized-ringbuffer branch from 15f2ea2 to aa979a9 Compare February 12, 2026 21:11
@ywwg
ywwg requested a review from Copilot February 13, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with rb_* ringbuffer operations.
  • Introduced new generic ringbuffer module and removed the old delayline implementation 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.

Comment thread lib/xwax/timecoder.c
Comment thread lib/xwax/timecoder.c Outdated
Comment thread lib/xwax/timecoder.c
Comment thread lib/xwax/ringbuffer.c Outdated
Comment thread lib/xwax/ringbuffer.c Outdated
Comment thread lib/xwax/ringbuffer.h Outdated
@jclsn
jclsn force-pushed the feat/generalized-ringbuffer branch from aa979a9 to b7e9129 Compare February 13, 2026 16:04
This ringbuffer is more versatile and can also be used for later filter
implementations.
@jclsn
jclsn force-pushed the feat/generalized-ringbuffer branch from b7e9129 to c37b552 Compare February 13, 2026 16:09
@jclsn

jclsn commented Feb 13, 2026

Copy link
Copy Markdown
Contributor Author

Should be fine now

@ywwg ywwg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks

@ywwg
ywwg merged commit c8bf9c4 into mixxxdj:main Feb 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants