Skip to content

Fix webrtc multitrack audio#14

Open
FrantaBOT wants to merge 1086 commits intowebrtc-multitrack-audiofrom
webrtc-multitrack-audio-2
Open

Fix webrtc multitrack audio#14
FrantaBOT wants to merge 1086 commits intowebrtc-multitrack-audiofrom
webrtc-multitrack-audio-2

Conversation

@FrantaBOT
Copy link
Collaborator

  • Rebased to main
  • Made changes according to obs mantainer

pkviet and others added 30 commits March 17, 2025 16:25
For the background blur effect, it was found that destroying it and
then adding any other NVIDIA effect led to a blank picture.
This commit swaps the order of destroying the effect and the associated
cudaStream.
For other effects the order does not matter; I have no idea why the
order matters for blur effect and the SDK gives no indication about any
proper order at destruction time.

Fixes bug obsproject#11383.
Signed-off-by: pkv <pkv@obsproject.com>
This properly allocates the temporal state variable used in AI
greenscreen effect, when the latter is reset.

Signed-off-by: pkv <pkv@obsproject.com>
During the mapping and unmapping of resources, the CudaStream was not
always consistent.
This fixes the issue.
Thanks to Stephan from NVIDIA Dev support for noticing the mismatch.

Signed-off-by: pkv <pkv@obsproject.com>
The reset signal was triggered whenever there was an update in the
parent source. This destroys the effect and recreates it, which can be
resource heavy.
We now let the SDK handle the source update on its own rather than
manually resetting the effect on obs side.

Signed-off-by: pkv <pkv@obsproject.com>
On initial run of the Blur filter, some parameters are not all set when
there is the first call to load the effect. This is actually not an
issue, so the log is now silenced at this time.

Signed-off-by: pkv <pkv@obsproject.com>
46adc4b - Check source validity before attempting to log renderer crash
ac34d8e - Don't loop Cef exit while shutting down if task post fails
b56fd78 - Update version to 2.24.6
By adding the workflow_dispatch trigger, the scheduled workflow can
also be manually triggered if the scheduled run failed to run due to
scheduling issues or because of an error that might have been fixed
since then.
To emit frontend events early during OBS' initialization, the
disableSaving state variable needs to be "falsy" (as events will not be
emitted otherwise).

The code path taken for generating a new fallback scene collection
has disableSaving decremented to "enable" saving (and thus frontend
events) already, so it's just the code paths for existing collections
that need this workaround.

Emitting the scene changed and preview scene changed events when a
fallback scene collection has been created has side-effects when
OBS Studio is set to studio mode and can lead to potential crashes,
as the studio mode is still in an invalid state at this point.
Fix a possible crash when opening OBS in Studio Mode.
This makes all list widget spacing set to 1.
obs_get_transition_by_name is very problematic because transitions are
always private and their names aren't unique. This means that the method
iterates over all private sources and then takes the first that both is
a transition and matches the name we're looking for. However, this could
be from anywhere - it could be a frontend transition, but also a source
transition, quick transition, or even one from third-party plugins. This
is always never what is intended.

As such, this method (which should never have been added in the first
place) needs to go. In its place, obs_frontend_get_transitions returns a
list of all frontend transitions (which is usually what people are
looking for), and alternatively obs_get_source_by_uuid also provides
access to private sources.

While we're at it, obs_get_transition_by_uuid is basically a wrapper for
obs_get_source_by_uuid and not really necessary. UUID's are unique and
a source doesn't suddenly change its type, so if you have a transition's
UUID you can be pretty sure that when you do obs_get_source_by_uuid, it
will still be a transition.
Add graphics APIs to obtain the GPU driver version and renderer
strings, as well as GDDR memory sizes. The GDDR memory sizes
include the dmem (dedicated memory on the GPU) and smem
(shared CPU memory used by the GPU but resides in the CPU DDR).

The version and renderer strings are needed for identification
purposes, for example enhanced broadcasting used by Twitch, to
associate the GPU used by OBS with the PCIe-based identification
values such as device_id and vendor_id.
`os_get_free_size()` was simply returning 0. For Linux,
implement the free size calculation based on the `sysinfo()`
system call.
`get_rc_mode()` compares the incoming rate control mode string
to the .name member of rc_mode_t, and the table entries are
all upper-case. This caused a crash when the incoming string
is set to "cbr" instead of "CBR". Make the string comparison
case insensitive.
VAAPI encoders deviate from other encoders (e.g. AMF, NVENC) with
the "profile" setting being an integer instead of a string. With
enhanced broadcasting, "profile" is signalled as a string. Convert
the string-based profile to the appropriate integer-based profile
for VAAPI encoders as a workaround, until VAAPI supports string-based
"profile" (if ever).
Enhanced broadcasting requires system information to be gathered
on the client and submitted to the GetClientConfiguration request
in order to obtain a valid response from the server. This commit
adds support for gathering the required information on Linux-based
systems.
Allos creating additional views that act like a MAIN_VIEW instead of AUX_VIEW.
Signals when a video reset has completed. This is mainly useful when
canvases or views are used, whose mixes will have been freed or
recreated during the reset.
This adds a new obs_canvas object that acts as a shareable
(reference-counted) owner of views, mixes, and (optionally) scenes.

This is a step towards faciliatating multi-canvas and multi-output
features in OBS Studio.

It solves a number of complications that exist with the manual approach
of using views, such as audio mixing, source active-state tracking, and
scenes not havinga  reliable way of identifying the actual available
canvas size.
RytoEX and others added 25 commits July 11, 2025 21:35
The gh CLI utility will fail without a git checkout.
Canvas is a move-only type without a copy constructor. Since C++17
requires types stored in std::optional to be copy-constructible unless
explicitly allowed, Clang 20+ emits an error when attempting to
instantiate std::optional<Canvas>.

While GCC allows this as an extension, Clang enforces the standard
more strictly.

This PR replaces std::optional<Canvas> with std::unique_ptr<Canvas> to
resolve the build error with Clang 20+ while keeping functional
behavior identical.

Tested with GCC 15.1.0 and Clang 20.1.7.

Co-Authored-By: Ryan Foster <ryan@obsproject.com>
The generate-docs action started failing, presumably because it is using
Debian Buster. Update the pinned commit for the third-party
totaldebug/sphinx-publish-action to hopefully fix this.
v4l2-decoder: continue sending frame to codec
if avcodec_receive_frame() returns AVERROR(EAGAIN)
Move 3 headers out from the Linux-specific section.
Without these headers functions like open, close, drmXx aren't found.

* open requires <fcntl.h>
* close requres <unistd.h>
* drmXx requires <xf86drm.h>
Subsequent commits use g_clear_fd() added in GLib 2.76.
PipeWire format renegotiation runs in parallel with video rendering.

When the stream format is renegotiated, PipeWire removes the existing
buffers and closes the syncobj file descriptors. At the same time, the
video rendering thread may try to import the (already closed) syncobj
acquire fd, and hang on waiting for the fence to become available.

This is not a problem for the dmabuf fd because it's imported into a
texture right away, which doesn't disappear when PipeWire closes the fd.

This commit adds duping to the syncobj fds so that they too remain open
as long as the rendering thread may access them.
Since video rendering happens on a separate thread from PipeWire buffer
ingestion, it may happen that two buffers are ingested in quick
succession without the rendering thread ever getting to them. Since,
prior to this commit, the release sync point is only "primed" (set to
signal in the future) only on the video rendering thread, this results
in the buffer being returned to PipeWire's pool without anything ever
signaling the release point, effectively blocking it from ever getting
reused in the future. This quickly clogs up the buffer pool and leaves
only one buffer to circulate between the screencast source and OBS.

This commit adds a flag tracking whether the release point had been
primed. If, when ingesting a new PW buffer, the old buffer's release
point hadn't been primed, that means the video rendering thread never
got to that buffer, so the release point is immediately signaled,
marking the buffer reusable by the screencast source.
GitHub introduced a policy change on 2024-05-06 which deprecated
support for SARIF files that contain multiple runs for the same tool.
This reverts commit 4dfd0b3.

Also adds a FIXME comment.
This fixes a change in PR 11605 that breaks Decklink video outputs.
get_mix_for_video() returns NULL for those outputs, causing
start_raw_video() to return before connecting the output.
@FrantaBOT
Copy link
Collaborator Author

Hello,
@Sean-Der can you please review the last two commits? I didn't want to force push without you review it.

FrantaBOT and others added 2 commits August 19, 2025 21:22
Co-authored-by: Sean DuBois <sean@siobud.com>
Co-authored-by: Sean DuBois <sean@siobud.com>
@FrantaBOT FrantaBOT force-pushed the webrtc-multitrack-audio-2 branch from 19432ce to 33be0b5 Compare August 19, 2025 19:24
@FrantaBOT
Copy link
Collaborator Author

@Sean-Der Hello, sorry for pinging you. Did you get a chance to review this?

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.