Skip to content

Audio pipeline: remove the legacy float stream path - #1698

Merged
Mysticial merged 2 commits into
mainfrom
audio-legacy-float-path-removal
Oct 24, 2026
Merged

Mysticial merged 2 commits into
mainfrom
audio-legacy-float-path-removal

Conversation

@pa-devbot

Copy link
Copy Markdown
Collaborator

Removes the legacy AudioFloatStreamListener path per the removal checklist in the audio pipeline hand-off doc. With #1695 (stream history on the working stream) in main, this path has no consumers left. 19 files, ~460 lines out.

What

  • Delete AudioStream.h/.cpp: AudioFloatStreamListener and AudioStreamToFloat. sample_size() (declared in AudioInfo.h, still used by the sink gate tests) moves its definition to AudioInfo.cpp.
  • AudioSource: drops the AudioStreamToFloat reader, the InternalListener relay, 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 ctor argument (input volume rides the tree's RawAudio2WorkingAudio decoder, as it already did). The raw-stream accessors (raw_sample_rate()/raw_channels()/raw_sample_format(), add/remove_raw_listener) are untouched — the pipeline tree consumes the raw stream exactly as before.
  • AudioInputFile / AudioInputDevice: the double-feed is gone (m_reader.push_bytes in on_buffer_ready / writeData); the raw RawAudioStreamListener output is byte-identical to before.
  • AudioPassthroughPairQt: drops 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; the AudioPassthroughPair base and AudioPassthroughPairQtThread lose the matching virtuals/forwarders.
  • AudioSession: drops add/remove_stream_listener.
  • SinkPipeline_Tests.h: doc comment still described a raw-byte comparison against the legacy converter chain — the gate tests have been self-contained kernel chains since Audio pipeline: sink-side cleanups (dead output enumeration, legacy converter) #1668, so the comment is updated to match.
  • TestProgramComputer: stale AudioStream.h include; StreamHistorySession: one stale commented-out expected_samples_per_frame line.

Why this is behavior-neutral

The legacy reader only tapped the raw byte stream in parallel (its converted float output went to StreamHistorySession's old on_samples, whose tracker-side sink is inert). Nothing in the tree, the sink branch, the FFT branch, or the working-stream listeners read from it. The raw bytes reaching m_source_decoder are unchanged, and input volume was already applied in the tree's decoder (the reader's copy of the multiplier is gone, but it had no consumers).

Verified

  • pa-build green (-Wall -Wextra -Wpedantic -Werror), including the gate tests in SinkPipeline_Tests.cpp (they build the sink branch from plain kernel objects and are unaffected).
  • Full pa-test command-line suite: 18,272 passed / 0 failed / 3 skipped (skips = decode-backend tests, unavailable in the container).
  • Device/sink behavior additionally rides on -Werror + CI (x86) + live hardware, per the hand-off doc.

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).
@Mysticial
Mysticial merged commit 14d06c3 into main Oct 24, 2026
7 checks passed
@Mysticial
Mysticial deleted the audio-legacy-float-path-removal branch October 24, 2026 05:14
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants