Repository navigation
Turning the camera off and on left no room for a screen share (GRYT-1329) - #625
Merged
Merged
Conversation
…329) The engine removed the camera's sender each time the camera went off. When the camera came back, it took the m-line the SFU had set aside for the screen, and a share after that never reached anyone. @gryt/voice 0.5.9 pauses the sender with replaceTrack(null) and reuses it, the way it already handles the screen (voice#63). A paused sender keeps its stream id, so the camera now comes back under the id it first went out with. forgetSenderStreamId is gone, and Controls keeps announcing the first camera stream's id for the rest of the connection. With the new engine and the old id handling, the camera never got a frame for the other guest after it came back. Two nightly tests cover it, each for two rounds. One turns the camera off and on, then shares. The other shares first, then turns the camera off and on. On client main with voice 0.5.8, the first fails on the screen tile's placeholder and the second on the camera never getting a frame. Both pass with this and the voice branch. Co-Authored-By: Claude Opus 5 <[email protected]>
Controls looked the camera's sender up by its track to set its encoding priority. A camera that comes back goes out on its paused sender, and that sender only gets the new track when replaceTrack resolves, so the lookup missed it. Since client#626 and voice 0.5.9 the effect no longer re-runs on every render, so nothing fixed it later. Turned back on during a share, the camera stayed at medium instead of dropping to low under the screen's high. roleSender remembers the camera's sender per connection, found by its track while the track is on it, and Controls uses that. The nightly tests now check that the camera gives way to the screen whenever both are on. Without this, the second round of the share-first test fails with the camera at medium. Co-Authored-By: Claude Opus 5 <[email protected]>
sivert-io
force-pushed
the
claude/GRYT-1329-camera-slot
branch
from
September 21, 2026 12:10
853f929 to
5b1c835
Compare
sivert-io
marked this pull request as ready for review
September 21, 2026 12:17
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.
Fixes GRYT-1329. Takes
@gryt/voice0.5.9, which has Gryt-chat/voice#63, andyarn.lockmoves only that package.What was wrong
Turn the camera on, off and on again, then share your screen, and everyone else gets "'s screen isn't coming through". Share first and then turn the camera off and on, and the camera doesn't come back. The engine removed the camera's sender each time the camera went off, and
addTracknever reuses a transceiver that has sent. So each time the camera came back it took another of the SFU's m-lines, and it only offers two for video. Gryt-chat/voice#63 has the transceiver dumps from before and after.It's probably behind some of the reports in GRYT-1324 and GRYT-1312: a share that didn't come through until the sharer reconnected, sometimes the camera too, from somebody who turned their webcam on and off a lot.
What changed
@gryt/voice0.5.9. It pauses the camera's sender withreplaceTrack(null)and reuses it when the camera comes back. 0.5.9 also carries Lower the microphone's default ceiling, and stop replacing the camera's track with itself (GRYT-1332, 1333, 1330) voice#64: the microphone's lower default ceiling, and no replacing the camera's track with itself.forgetSenderStreamIdis gone. The camera's sender now lasts as long as the connection, and so does its stream id, soControlskeeps announcing the first camera stream's id after the camera comes back.check-media-state-reassertchecks that turning the camera off doesn't change the id.roleSenderfinds the camera's sender for its encoding settings. A resumed sender only gets its new track whenreplaceTrackresolves, so the lookup by track missed it. Since The camera was re-added four times a second, and Video Debug's report count never filled in (GRYT-1333, 1334) #626, and with 0.5.9's getters staying the same between renders, nothing ran the effect again, and a camera turned back on during a share stayed atmediuminstead oflow.roleSenderremembers the sender per connection, found by its track while the track is on it.Two tests in
e2e/nightly/voice.spec.ts, each for two rounds:Both check that the camera gives way to the screen (
lownext to itshigh) while both are on, and that every stream id Alice announced is one Bob's tiles played.Tested
Locally, with two headless Chrome guests on fake devices, against a server (a49b2c4) and an SFU (3cd22b7) built from main:
roleSender: the share-first test fails in its second round, with the camera atmediumnext to the screen'shigh.test:*step inci.yml,yarn lint,yarn tsc -p e2eandyarn buildpass.yarn e2e: 46 passed and 1 skipped.sidebar-folders.spec.tsfailed, because my localserver:latestis four days old and predates Folders carry permissions their channels follow (GRYT-1306) server#207. CI pulls the current one.The phone needs the same stream id change when it takes 0.5.9. That's GRYT-1336.
🤖 Generated with Claude Code