WebScreenShareFixes: fix malformed SDP rejected by Discord on niri/wlroots#4159
Open
coleleavitt wants to merge 1 commit into
Open
WebScreenShareFixes: fix malformed SDP rejected by Discord on niri/wlroots#4159coleleavitt wants to merge 1 commit into
coleleavitt wants to merge 1 commit into
Conversation
8e3def4 to
100f02a
Compare
…roots - x-google-max-bitrate=80_000 -> 80000 (underscore invalid in SDP per RFC 4566) - remove b=AS:800000 fmtp injection (b=AS is session-level, not fmtp) Both caused Discord RTC server to reject the video codec on niri/wlroots. Firefox-Discord (no Vencord) was unaffected, masking the bug on Mutter.
100f02a to
e87793a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes WebScreenShareFixes generating malformed SDP in the web (Chromium/Vesktop) pipeline, which could cause Discord’s RTC server to reject the offer/answer on some Wayland compositors (wlroots/niri/hyprland/sway), resulting in screenshare starting but showing no video to viewers.
Changes:
- Replace the injected SDP fmtp value
x-google-max-bitrate=80_000withx-google-max-bitrate=80000to avoid sending an underscore in the SDP integer. - Remove the invalid injection of
b=AS:800000inside ana=fmtp:parameter list (not valid SDP syntax in that position).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
The
WebScreenShareFixesplugin generates SDP that Discord's RTC server silently rejects on non-Mutter Wayland compositors (niri, hyprland, sway), causing "chooser appears, you pick, viewers see nothing" for Vesktop users on those compositors. Two specific bugs in the plugin:x-google-max-bitrate=80_000— JavaScript numeric-literal underscore separator. The80_000is a valid JS literal (= 80000) but the replacement string is interpolated literally into the SDP, producingx-google-max-bitrate=80_000(with underscore) on the wire. RFC 4566 requires plain integers; Discord's parser rejects this fmtp parameter and falls back to a codec the encoder isn't configured to send.b=AS:800000injected inside ana=fmtp:line.b=AS:is a session/media-level bandwidth attribute (its own SDP line per RFC 4566), not an fmtp parameter. Injecting it insidea=fmtp:96 ...;b=AS:800000;level-asymmetry-allowed=1;...produces malformed SDP. Discord rejects the entire H.264 codec line.Why this only surfaces now
Discord-in-Firefox uses the web JS pipeline (no Vencord, no SDP munging) and sends valid SDP — works everywhere. Discord-in-Chromium-via-Vencord on GNOME/Mutter also worked because Mutter's WebRTC stack has lenient SDP parsing OR because the codec falls back gracefully. On niri/hyprland/sway the rejection is fatal.
Fix
Removed the entire
b=AS:injection — it was never valid SDP. The 80 Mbps bitrate cap removal (which is the legitimate purpose of the plugin per its description) still works via the correctedx-google-max-bitrate=80000line.Test plan
Empirically verified on Vesktop 1.6.5 + Vencord v1.14.10 + niri 26.04 + Electron 40.4.0 + Chromium 144 + xdg-desktop-portal-gnome 48:
No regression on Mutter/GNOME — verified the corrected SDP is still accepted there.
Refs
2026-03-linux-vulkan-captureexperiment (separate but coexisting issue)