Repository navigation
test: Capture every tick a scene audio toggle may land in - #1852
Merged
Merged
Conversation
test_scene_audio_actions still failed now and then on a loaded machine after obs-rust#1835, with a change on sample 0 and no tone left out of any captured tick. The audio thread renders a tick one tick plus the audio buffering after the tick's time. libobs adds buffering when a source's audio comes late, so after a late tone the ticks rendered right after the call can have times well before it. The capture only took ticks from four ticks before the call, so it did not see them. If a tone was left out of one of them, the scene had no audio and libobs applied the action at once there, and every captured tick read the new level from sample 0. The capture now takes every tick rendered after it starts, whatever its time, and also records whether the scene itself had no audio in a tick: a toggle is tried again when a tone was left out of any of them, or the scene was while it still had audio to play. libobs also renders ticks it adds as buffering without delivering them, which the raw callback can't see, so the test sets fixed buffering (about 200 ms): libobs adds all of it on the first tick, before any case, and never again. Refs obs-rust#1834
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 #1834
What and why
test_scene_audio_actions (#1815) still failed now and then on a loaded machine after #1835:
show_over_other_itemonce against hybrid libobs andhide_over_other_itemonce against libobs (C backend). Both times the change was on sample 0, and no tone had been left out of any tick the test captured. The case ran fine alone most of the time, but not every time.obs_sceneitem_set_visible()can have times well before the call.scene_audio_render()applied the queued action at once (process_all_audio_actions()). Every captured tick then read the new level from sample 0.scene_audio_render()while an action was queued (the scene's time, each item'saudio_pendingand audio time, and whether the action was placed or applied at once), and each captured tick's flags. A switch in the test also made the tones' threads late by a set amount (fault injection). With the tones late long enough for libobs to add about 300 ms of buffering, and then late for 420 ms again, starting 250 ms before the call, master's test failed in 16 of 16 runs, alwayshide_over_other_itemwith "changed at sample 0 ... allowed none". The log shows the action applied at once in a tick whose time was 260 ms before the call, rendered after it, with both tones pending and the tick outside the capture.audio_callback()returns false), so the raw callback never sees them. An action applied at once in one of those would look the same.hide_only_item's hide, the scene has no audio because its only item is hidden, so that doesn't count.obs_reset_audio2()). libobs then adds all of it on the first tick, before any case runs, and never again, so no undelivered ticks happen during a case. The tones' threads can now be up to about 200 ms late before their audio is left out. Most of the earlier retries came from tones only a little late, and those are gone too.Headless: private Xvfb with
-noreset, private D-Bus, fresh HOME. "Under load" means 8 runs at a time per library, with all three libraries running together, 16 busy loops pinned one per CPU, and a full parallel build (ninja -j16, no ccache) of a separate tree; load average 30 to 37. The second batch of 96 had the busy loops but no build. After the rebase, 8 runs per library, 4 at a time, as a check.With fixed buffering, no try needed a retry in those runs under load; the retry path ran in the injected runs. The one crash: a segfault in
group_setup()(after the audio reset, before the first case) in 1 of 720 runs of the diagnostic build against hybrid libobs under load, no core kept. It is not in the code this PR touches and I haven't reproduced it.Mutants: each one was built into libobs (C backend), and the test from master and this branch's test each ran against it 3 times:
test_scene_audio_action_stepsreaches, as in libobs: Move the scene item visibility audio ramp into obs-scene-audio-actions.c #1815 and test: Retry a scene audio toggle when a tone's audio came late for a tick #1835.RED → GREEN
test_scene_audio_actions4/4 in every run above, against all three libraries: 0 failures in 1,008 runs under load and 48 idle.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