Repository navigation
Conversation
|
First device run of 29aa73c (verify run 42556236194). The log says
That's down from about 350 ms on both paths through the pipe source. Quality regression: the 100 ms beeps came apart into 68 runs instead of 10, with peaks of 0.098 against 0.049 through the pipe source. The reader ran dry: libobs's packets don't arrive evenly enough for a one-packet margin. RED 5cf75b3 / GREEN d6a538d make the reader a jitter buffer:
A device rerun will follow. |
|
Coordinator check-in: this draft has had no activity since 2026-11-09 06:24 UTC and now conflicts with master ( |
|
About the ~300 ms you see through the Virtual Camera, while Zoom with the camera directly has no delay: that difference agrees with what master adds today. The direct path has only the camera chain, so the 300 ms comes from OBS and the vcam path. These numbers come from the code and your earlier runs in #4119, not from a new measurement. Delay on master (pipe-source path), at 30 fps:
That adds up to about 250 to 300 ms. Since #4093 the sync is correct, but every delay on the audio side is also a delay on the video side. What follows for this PR:
Two checks that split the rest:
One thing to expect with a DSLR: a camera's HDMI output often comes 50 to 150 ms after the event. To match it, the usual fix is a positive Sync Offset on the mic. libobs raises its audio buffering to cover a positive offset, and the vcam then holds video for it too. So lip sync can be correct while the total delay grows by that offset. |
pipewire_reader_skips_only_stale_audio, video_waits_for_pipewire_audio and pipewire_node_carries_audio (test_v4l2_vmic_pipewire, private PipeWire) fail against the stubs. A prototype pw_stream Audio/Source measured 2-8 ms from write to a pulse reader, against ~150 ms through module-pipe-source.
…4119) With PipeWire the microphone is a pw_stream node fed from a lock-free ring: no FIFO and no pipe tunnel, whose fixed 8192-frame buffer (170.7 ms) both the audio and the frame-synced video paid. The reader drops stale audio only past 3072 frames beyond a cycle's request, then keeps one packet, so libobs's 1024-frame packets never trip it. module-pipe-source stays the fallback when no PipeWire daemon answers.
…er (#4119) On the device the node cut the delay to 190-235 ms but the beeps came apart into 68 runs instead of 10: libobs's packets arrive too unevenly to read the ring down to one packet. pipewire_reader_is_a_jitter_buffer fails against the stub plan.
…runs (#4119) The reader starts, and restarts after running dry, once 2048 frames beyond a cycle's request wait, and drops audio only past 4096. Underruns and dropped stale frames are logged at most once a minute.
…ncy without media decoding (#4119)
…4119) Ci-Attestation: {"at":1796412752,"gate":"general/all/client-lint","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"a8575493ce3e1fb0c4ccb7a7d2739360","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412753,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"7890b8a8b2cf61468787070c7c6173b5","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412753,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"b2fe07217aabf59d7c89ad66bf938352","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412753,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"a739d0579bdf951d770a7531df0c12b0","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412753,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"42c3ffd64c366fa5935abd8bb85c19d5","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412752,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"f4f6a8847fa928da26bc91eda7a93d23","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412752,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"6cd77c1e4afa100d7d76476174f77cf2","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412753,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"e3168715c983076780e2510358479a6d","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412753,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"e99378154e5389320e81408aad4d1a19","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412752,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"5de764e2929ac902c59672debfd5ea54","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412753,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"c657f96c7cba53d2490e0398349823a8","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412752,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"c79e8842d663e732b5f761126815f41a","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"} Ci-Attestation: {"at":1796412752,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"bae06c77069357b53a1f22ffbbcef19d9c7899852b0e7acb36a87127448efe23","lane":"client-lint","parents":["f65f316300f536d762561f51eec9ebb86a553dbb"],"secs":177,"stamp":"002b777982606579439fc4e8222548e8","tree":"c570cd7635148e7051a3ab0cd092f0eec0eff3cc","v":1,"via":"run"}
31a5cdb to
302fc1a
Compare
Refs #4119 (step 1 of the plan: the PipeWire tunnel delay)
Problem
Under pipewire-pulse,
module-pipe-sourcegoes through PipeWire's pipe tunnel. The tunnel buffers a fixed 8192 frames (170.7 ms at 48 kHz), and no argument changes it. Since #4093 the Virtual Camera holds video frames for the same time to stay in sync, so both the camera and the mic pay that delay.Change
HAVE_PIPEWIRE, linkingPipeWire::PipeWire), "OBS Audio" is a nativepw_streamAudio/Source node.obs_virtual_microphone, or_2... for a second OBS) and the same description, so existing app selections keep working.virtual_audiowrites packets into a lock-free single-producer, single-consumerspa_ringbuffer, under the sync mutex, whichvmic_pw_stopclears before freeing. The RT process callback reads from it.vmic_pw_skip). libobs's 1024-frame packets never trip this in steady state. When no app is linked, the ring fills and new packets are dropped, so a later reader starts from the newest audio.mic_lead_ns = 0).module-pipe-sourcestays the fallback when no PipeWire daemon answers within 3 s.A prototype
pw_streamAudio/Source measured 2 to 8 ms from write to a pulse reader. Throughmodule-pipe-sourcethe same probe measured about 150 ms.Tests
pipewire_reader_skips_only_stale_audiovideo_waits_for_pipewire_audiopipewire_node_carries_audio, which runs in the newtest_v4l2_vmic_pipewiretarget against the private PipeWire harness. It creates the node, checks it is listed through libpulse, writes a tone throughvirtual_audioand asserts that a linked capture stream receives it.test_v4l2_vcam_audio,test_v4l2_vmic_libpulse,test_v4l2_vmic_pipewireandtest_v4l2_vmic_serverall pass. The 3 unrelated failures are deinterlace and slideshow-mem-cap.pipewire_node_carries_audioran rather than skipped.