Repository navigation
test: Check the samples PulseAudio monitoring plays at each sink format - #1728
Merged
Merged
Conversation
None of the PulseAudio tests looked at sample values: with the s16 saturation (obs-rust#1709) replaced by a wrap in the Rust port of obs-rust#1721, all 14 test_pulse* tests still passed in hybrid. test_pulse_monitor_samples runs libobs monitoring against the private PipeWire server of test_pulse_monitor_device.sh. For null sinks in s16le, s32le, u8 and float32le it plays a constant +0.75 / -0.75 at source volumes 0.5, 1 and 2 and records the sink's monitor with parec. Each expected level must be in the recording for at least 0.1 s, wherever it starts: the integer formats at their rail at volume 2, float at 1.5. It skips (77) without PipeWire, the pulse tools or parec. Refs obs-rust#1697
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.
Refs #1697
What and why
The deliberate-break check of #1721 (the Rust port of the PulseAudio monitor format and volume code) found that no PulseAudio test looks at sample values. With the s16 saturation from #1709 replaced by a wrap in the Rust conversion, all 14
test_pulse*tests still passed in hybrid. This adds the missing end-to-end check. Test only: no libobs or Rust change.test_pulse_monitor_samplesruns libobs audio monitoring against the private PipeWire + WirePlumber + pipewire-pulse server thattest_pulse_monitor_device.shstarts (own runtime dir, config and D-Bus, no hardware). It is registered the same way (tests.d,OS_LINUX AND ENABLE_PULSEAUDIO, skip 77).parec, in the same format, and plays a constant +0.75 (left) / -0.75 (right) at source volumes 0.5, 1 and 2, 0.3 s each.On master the test covers the C code. Once #1721 lands it also covers the Rust code in hybrid.
Headless (private Xvfb, private D-Bus, fresh HOME, private PipeWire), RelWithDebInfo:
process_s16wraps ((int16_t)(int32_t)v)monitor_samples_s16lescale_s16wraps ((v as i32) as i16)monitor_samples_s16leWith either wrap mutant the s16le recording holds L -0.5 / R +0.5 at volume 2 (-16384/+16384) instead of +32767/-32768. The 0.5 and 1 plateaus are exact (0.375 and 0.75).
RED → GREEN
scale_s16(libobs: Port the PulseAudio monitor format and volume to obs-audio-monitoring #1721's hybrid libobs) failsmonitor_samples_s16le5 of 5 runs ("s16le, volume 2.0: 0 frames at L +0.99997 R -1.00000"), and the wrap in Cprocess_s16fails it on master's C backend.uv run ci/local_gate.py --lane lint: ok.Checklist
master(or the description starts with a Stacked: note)docs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): built with scripting ON (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC