Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
audio_probe.hpp File Reference

Realtime-safe audio output probe. More...

#include <pulp/audio/audio_probe_snapshot.hpp>
#include <pulp/audio/audio_stats.hpp>
#include <pulp/audio/buffer.hpp>
#include <pulp/runtime/spsc_ring_index.hpp>
#include <pulp/runtime/triple_buffer.hpp>
#include <cstdint>
#include <memory>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::audio::AudioProbeCaptureConfig
 Configuration for the optional last-N-frames capture ring. More...
class  pulp::audio::AudioProbe
 Realtime output-boundary probe. More...

Namespaces

namespace  pulp
namespace  pulp::audio

Detailed Description

Realtime-safe audio output probe.

AudioProbe::analyze_output() is callable from the audio callback and satisfies a strict RT ABI: no allocation, no std::vector growth, no locks, no file I/O, no logging, no exceptions, no UI/host/package callbacks, and no FFT/STFT. It performs only bounded per-block scalar work (peak, RMS accumulate, clip count, NaN/Inf count, silence-run) and publishes the latest summary through a runtime::TripleBuffer<AudioProbeSnapshot>.

Use this for scalar output-boundary diagnostics. For spectra and waveforms, pulp::view::VisualizationBridge uses a different RT-safe producer: its callback copies into fixed SPSC storage and its UI-owned poll() performs STFT work later. Neither path performs FFT or vector growth in the callback.

Gating: the whole probe lives behind PULP_ENABLE_AUDIO_PROBES. The release-safe counter subset (AudioStats) is always available without this flag. When the flag is OFF, this header still compiles (it is just not instantiated by any runtime), but probe call sites in runtime code are #if PULP_ENABLE_AUDIO_PROBES-guarded so an OFF build pays nothing.