Repository navigation
Stream history: migrate off the legacy float listener path - #1695
Merged
Merged
Conversation
StreamHistorySession now consumes only the audio pipeline's working stream: - drop the AudioFloatStreamListener base, on_samples() and the AudioFloatStreamListener(1) constructor entry; - drop the add/remove_stream_listener(m_history) legacy attaches in ConsoleSystemSession (the working-stream attach is kept); - drop the expected_samples_per_frame plumbing in initialize() - the legacy framing values are no longer read by anything. The working-stream funnel (push_samples -> re-interleave -> tracker::on_samples) is unchanged, so the mainline trackers record exactly as before. This removes the last consumer of the legacy float path, so its removal checklist (AudioFloatStreamListener, AudioStreamToFloat, the AudioSource reader, the pair's SampleListener, AudioSession::add/remove_stream_listener) can follow in a separate PR.
LoadFull_RateMismatch and WavParse_PcmFormats both wrote the same
/tmp/pa_wav_test_s16_44100_2ch.wav while running in parallel, so one
could truncate the file out from under the other's probe and fail
intermittently ('probe failed for the S16 44100 stereo wav'). Give the
rate-mismatch test a unique temp file name.
Mysticial
added a commit
that referenced
this pull request
Oct 24, 2026
* Audio pipeline: remove the legacy float stream path With stream history migrated to the working stream (#1695), the legacy AudioFloatStreamListener path has no consumers left; delete it per the removal checklist in the audio pipeline hand-off doc: - Delete AudioStream.h/.cpp: AudioFloatStreamListener and AudioStreamToFloat. sample_size() (declared in AudioInfo.h, used by the sink gate tests) moves its definition to AudioInfo.cpp; the buffer-size constant had no other users. - AudioSource: drop the AudioStreamToFloat reader, the InternalListener relay, the float add/remove_listener, samples_per_frame(), m_sample_rate/m_channels/m_multiplier, the preset switch in init(), and the now-unused volume_multiplier constructor argument (input volume rides the tree's RawAudio2WorkingAudio decoder, as before). The raw-stream accessors (raw_sample_rate/raw_channels/ raw_sample_format, add/remove_raw_listener) are unchanged - the pipeline tree consumes the raw stream exactly as it did. - AudioInputFile / AudioInputDevice: no longer fed by the reader; the double-feed (m_reader.push_bytes) in on_buffer_ready / writeData is gone - the raw RawAudioStreamListener output is untouched. - AudioPassthroughPairQt: drop the SampleListener relay, m_sample_listener (and every reset()/new in the source/sink lifecycle paths), m_stream_listeners, and the float add/remove_listener overloads. AudioPassthroughPair (base) and AudioPassthroughPairQtThread lose the matching virtuals / forwarders. - AudioSession: drop add/remove_stream_listener. - SinkPipeline_Tests.h: the gate tests have been self-contained kernel chains since #1668; update the stale doc comment that still described a raw-byte comparison against the legacy converter chain. - TestProgramComputer: drop the now-unused AudioStream.h include; StreamHistorySession: drop a stale commented-out expected_samples_per_frame line. No behavior change for the pipeline tree, the sink/FFT branches, or the working-stream listeners: the raw byte stream reaching the source decoder is byte-identical to before (the legacy reader only tapped it in parallel, with no consumer). Verified: pa-build green (-Wall -Wextra -Wpedantic -Werror), full pa-test suite 18,272 passed / 0 failed / 3 skipped (decode-backend skips, unavailable in the container). * fix --------- Co-authored-by: PA Dev Bot <344001113+pa-devbot@users.noreply.github.com> Co-authored-by: Alexander Yee <a-yee@u.northwestern.edu>
Mysticial
pushed a commit
that referenced
this pull request
Oct 24, 2026
…sandbox fossils (#1699) * Nuke the dead audio stream conversion kernels and TimeSample tools. Follow-up to the StreamHistory migration (#1695) and the legacy float path removal (#1698); two pieces of the old audio stack are now unreferenced: - Kernels/AudioStreamConversion: the convert_audio_* raw sample-format kernels. The only call site in the tree was a #if 0 block in TestProgramComputer (removed with the include); the live pipeline converts formats through Kernels/AudioStreamConverter instead. - AudioPipeline/Tools/TimeSampleBuffer, TimeSampleBufferReader and TimeSampleWriter: the old fault-tolerant timestamped sample buffer the pre-migration stream history recording rode on. No references remain anywhere in the source. Both are dropped from SourceFiles.cmake; TestProgramComputer also loses its stale StreamConverters.h include (the header itself is kept - AudioInputDevice inherits from MisalignedStreamConverter / ObjectStreamListener). Full suite: 18,276 passed / 0 failed / 0 skipped. * Sweep the dead audio-system fossils from TestProgramComputer. The dev sandbox kept early versions of the pre-pipeline audio classes. Remove the #if 0 block using the long-deleted AudioSourceReader / AudioListener / AudioSampleFormat (plus the commented-out AudioStreamReader2 line) and the stale AudioConstants.h include (none of its constants are used in the file). The sandbox's #if 0 blocks that exercise the current kernels are left in place. Full suite: 18,276 passed / 0 failed / 0 skipped. --------- Co-authored-by: PA Dev Bot <344001113+pa-devbot@users.noreply.github.com>
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.
Migrates stream history (the existing code on main) fully onto the audio pipeline's working stream, ahead of the legacy float-path removal.
What
StreamHistorySessionno longer implementsAudioFloatStreamListener: the base,on_samples(), and theAudioFloatStreamListener(1)constructor entry are dropped, along with theexpected_samples_per_frameplumbing ininitialize()(the legacy framing values are read by nothing once the legacy attach is gone).ConsoleSystemSessionno longer callsadd/remove_stream_listener(m_history); the working-stream attach (set_audio_session+attach_working_listener, kept) is now the only audio feed into the session.push_samples()still re-interleaves the planar stream to the active preset's shape and forwards totracker->on_samples(), soStreamHistoryTracker_SaveFrames/Nullrecord exactly as before. Behavior on main is unchanged; the only observable difference is that the legacy float path (which was feeding the same tracker, whose audio capture is#if 0'd inStreamHistoryTracker_SaveFrames) is no longer attached.Why first
This removes the last consumer of the legacy float path, so the removal checklist from the audio pipeline hand-off (
AudioFloatStreamListener,AudioStreamToFloat, theAudioSourcereader, the pair'sSampleListener/m_stream_listeners,AudioSession::add/remove_stream_listener) can follow in a separate PR that lands after this one. PR #1563 (the ffmpeg ring) will rebase on top of this once it's in; its stream-history-side hunks become the ring-specific#ifadditions only.Also included (independent, 1 line)
The second commit fixes a pre-existing flake in the WAV loader tests:
LoadFull_RateMismatchandWavParse_PcmFormatsboth wrote the same/tmp/pa_wav_test_s16_44100_2ch.wavwhile running in parallel, so one could truncate the file out from under the other's probe (probe failed for the S16 44100 stereo wav— seen once in a full-suite run; the on-disk file at failure time was byte-for-byte the rate-mismatch test's version). The rate-mismatch test now uses its own temp file name.Verified
pa-buildgreen.pa-testcommand-line suite: 18,272 passed / 0 failed / 3 skipped (skips are the decode-backend tests, unavailable in the container). The flake repro'd and then stayed green after the fix.