audio-thread

Outline forbidden operations and lock-free patterns for real-time audio threads.

195|21|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/Conceptual-Machines/magda-core --skill audio-thread
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-thread
Source: https://github.com/Conceptual-Machines/magda-core/tree/main/.claude/skills/audio-thread
Command: npx skills add https://github.com/Conceptual-Machines/magda-core --skill audio-thread

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Real-time audio processing on the JUCE/Tracktion Engine often incurs glitches when unsafe operations occur on the audio thread. This skill provides a practical guide to forbidden actions, safe cross-thread communication, and proven lock-free patterns to keep audio callbacks deterministic.

Core Features & Use Cases

  • Clear guidelines on what is forbidden on the audio thread (memory allocations, locks, file I/O, and Objective-C calls on macOS).
  • Lock-free communication patterns and practical code snippets to safely share state between the UI and audio threads.
  • Use cases include audio plugin processing, metering, real-time DSP callbacks, and any code executed within the audio thread.

Quick Start

Start by auditing your audio-path code for allocations, locks, and blocking operations, then apply the lock-free patterns shown to ensure real-time performance.

Frequently Asked Questions about audio-thread

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What operations are forbidden on a real-time audio thread in JUCE?

Forbidden operations on a real-time audio thread include memory allocations, locks, file I/O, and Objective-C calls on macOS. Preventing these blocking actions in JUCE audio callbacks ensures deterministic execution and avoids audio glitches.

How do I safely share state between the UI and audio thread?

You can safely share state between the UI and audio thread by using lock-free communication patterns. These patterns prevent the audio thread from waiting on locks, ensuring real-time DSP callbacks execute without blocking or causing glitches.

Why does my JUCE audio plugin glitch during playback?

JUCE audio plugins often glitch when unsafe operations like memory allocations or locks occur within the real-time audio callback. Auditing your audio-path code for these blocking operations and applying lock-free patterns resolves the timing issues.

Can I use Tracktion Engine for real-time audio metering without causing thread locks?

Yes, you can use Tracktion Engine for real-time audio metering without thread locks by applying lock-free communication patterns. This approach safely shares metering state between the audio thread and UI without blocking real-time DSP callbacks.

What's the best way to prevent memory allocation in audio callbacks?

The best way to prevent memory allocation in audio callbacks is to audit your audio-path code for dynamic allocations and pre-allocate necessary buffers. Applying lock-free patterns ensures safe cross-thread communication without triggering real-time audio thread allocations.