fix(mirror): install gtksink on Arch; cancel stale video receivers - #5
Open
X-Ryl669 wants to merge 1 commit into
Open
fix(mirror): install gtksink on Arch; cancel stale video receivers#5X-Ryl669 wants to merge 1 commit into
X-Ryl669 wants to merge 1 commit into
Conversation
Two independent faults, both of which made screen mirroring look like it
had frozen while actually reporting the reason only to the log.
1. `gtksink` was never installed on Arch. Every mirror/second-screen/
camera pipeline ends in it (see ui-tauri `mirror.rs`), but Arch splits
the GTK sink OUT of gst-plugins-good into `gst-plugin-gtk`, which the
dependency list never asked for. The pipeline then fails to parse at
all ("gst parse: no element gtksink"), the window opens on its
spinner, and no picture ever arrives — with nothing in the UI to say
why. Added the package, plus a post-install check that inspects for
`gtksink` and prints the install command for the detected distro when
it is missing. Only the Arch name is a hard dependency; the
Debian/Fedora names are printed as hints rather than installed,
because an unresolvable name is all-or-nothing fatal on apt and
pacman (see the NODE_PKGS note above for the same trap).
2. The TCP video receiver outlived its session. It was spawned with its
`JoinHandle` dropped, so nothing could cancel it, and it retries the
connect for as long as the phone's video server stays closed — which
is exactly while the MediaProjection consent dialog is up. A second
Start (double click, or the address-retry pass) therefore left the
first receiver still looping; both then connected the instant the
phone opened its server, each holding a media key derived from its OWN
session's IK handshake hash. The phone encrypts for the session it
honoured — it debounces the duplicate START, see Android
`VortexStack.kt` — so the other receiver failed to open frame 0
("AEAD open failed counter=0"), closed the socket, and took the whole
stream down with it. The receiver is now tracked in `VIDEO_RX_TASK`
and aborted from `stop_mirror` and on each new spawn.
Fault 2's phone-side debounce already hinted at the duplicate sessions;
this fixes the laptop side that creates them.
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.
Screen mirroring does not work on Arch Linux KDE Desktop, due to missing gtksink GStreamer package and a bug in TCP video receiver. This was found and authored by Claude see below:
Two independent faults, both of which made screen mirroring look like it had frozen while actually reporting the reason only to the log.
gtksinkwas never installed on Arch. Every mirror/second-screen/ camera pipeline ends in it (see ui-taurimirror.rs), but Arch splits the GTK sink OUT of gst-plugins-good intogst-plugin-gtk, which the dependency list never asked for. The pipeline then fails to parse at all ("gst parse: no element gtksink"), the window opens on its spinner, and no picture ever arrives — with nothing in the UI to say why. Added the package, plus a post-install check that inspects forgtksinkand prints the install command for the detected distro when it is missing. Only the Arch name is a hard dependency; the Debian/Fedora names are printed as hints rather than installed, because an unresolvable name is all-or-nothing fatal on apt and pacman (see the NODE_PKGS note above for the same trap).The TCP video receiver outlived its session. It was spawned with its
JoinHandledropped, so nothing could cancel it, and it retries the connect for as long as the phone's video server stays closed — which is exactly while the MediaProjection consent dialog is up. A second Start (double click, or the address-retry pass) therefore left the first receiver still looping; both then connected the instant the phone opened its server, each holding a media key derived from its OWN session's IK handshake hash. The phone encrypts for the session it honoured — it debounces the duplicate START, see AndroidVortexStack.kt— so the other receiver failed to open frame 0 ("AEAD open failed counter=0"), closed the socket, and took the whole stream down with it. The receiver is now tracked inVIDEO_RX_TASKand aborted fromstop_mirrorand on each new spawn.Fault 2's phone-side debounce already hinted at the duplicate sessions; this fixes the laptop side that creates them.