Repository navigation
Audio pipeline: WorkingAudioStreamListener path to StreamHistorySession - #1671
Merged
Merged
Conversation
pa-devbot
force-pushed
the
audio-working-path
branch
from
October 22, 2026 17:44
4e7bd69 to
a0061e9
Compare
Rebased #1671 onto main (incl. #1674's AudioFormat / WorkingAudio2WorkingAudio and #1676's tree simplification), and rewrote the attach path around the per-listener conversion node: - AudioPassthroughPair gains add_listener(const AudioFormat&, WorkingAudioStreamListener&) / remove_listener(WorkingAudioStreamListener&). The Qt pair builds one WorkingAudio2WorkingAudio per attached listener (source shape -> the requested shape), plus a small forwarder that carries the requested shape as its nominal one (the node validates its listeners against that; the user's listener may have any nominal shape of its own). Entries survive tree rebuilds: the nodes are rebuilt for each new source shape in build_tree() and detached in teardown_tree(). The INTERLEAVE_RL_96000 channel swap is applied to the node's matrix, the same way as for the sink branch. Unresolvable layouts are logged and skipped rather than thrown from the calling thread. - StreamHistorySession now implements both listener interfaces: the legacy AudioFloatStreamListener::on_samples path stays exactly as it was (kept until #1563 switches off it), and the new WorkingAudioStreamListener::push_samples re-interleaves the planar working stream at the active preset's physical shape (the shape its tracker records at; the RL swap already applied by the pair's node). The session attaches at start() and re-attaches in post_input_change(), removing the old-shape attach first so no push in the old shape can ever race the shape update. While both paths are attached the tracker is fed by both (double-record) - inert in the active tracker, and #1563 drops the legacy attach when it switches. - The console wires it up: set_audio_session() before start(), and the working-listener remove in try_shutdown(). Verified: -Werror clean on aarch64; full command-line suite green.
pa-devbot
force-pushed
the
audio-working-path
branch
from
October 22, 2026 18:05
a0061e9 to
1000f49
Compare
…uction. remove_listener() destroys a WorkingListenerEntry (m_working_entries.erase) at its call site, which instantiates ~unique_ptr<InternalWorkingListener>() there. The nested class was defined further down in the .cpp, so on GCC 15 (x86 CI) the deleter's sizeof static_assert fired on the incomplete type. aarch64's older GCC instantiated it lazily enough to miss it. Moved the definition above the first member-function body so the type is complete at every destruction site in the translation unit. Pure reordering, no behavior change.
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.
Adds a parallel listener path that taps the pipeline tree's working stream, alongside the legacy
AudioFloatStreamListenerpath. The legacy path is left fully in place (punted) until PR #1563 moves off of it. +149/−22.The path (
AudioPassthroughPair.h,AudioPassthroughPairQt,AudioPassthroughPairQtThread,AudioSession):add_listener(WorkingAudioStreamListener&)/remove_listener()on the pair (overloads alongside the float/FFT ones);AudioSession::add_working_stream_listener()/remove_working_stream_listener().m_source_decoder's output via a per-treeInternalWorkingListener(created inbuild_tree()with the decoder's physical shape, destroyed inteardown_tree()before the decoder — same lifecycle pattern as the branch heads andInternalFFTListener).push_samples(samples, stride, data): channelcstarts atdata[c*stride]and runssamplesfloats (stride may be 0 for the 1ch passthrough). The per-tree tap has the exact shape (validated by the decoder); the pair's listener set does not validate, so persistent listeners are safe across input changes.Carried to
StreamHistorySession: it now implementsWorkingAudioStreamListener(instead ofAudioFloatStreamListener) andConsoleSystemSessionattaches it through the new path (add_working_stream_listener/remove_working_stream_listener). The session:INTERLEAVE_RL_96000channel swap (matching the legacy reader'sreverse_channels);DUAL_44100was misreported to the tracker as mono, andMONO_96000was framed as 2-sample frames @ 48000. The active tracker's audio handling is dormant (#if 0), so this is inert today but correct when it's revived.Not changed (punted for #1563):
AudioStreamToFloat,SampleListener,m_stream_listeners,AudioSession::add_stream_listener()— all still present; the reader now simply has no consumers. See the companion hand-off doc PR for the migration plan.Verified:
-Werrorclean, full suite 18,207/0 (aarch64).