From 5c97222ad4174edff363860222313f169b1586d3 Mon Sep 17 00:00:00 2001 From: DrogaBox Date: Sat, 28 Nov 2026 01:31:41 -0300 Subject: [PATCH] encode 1.3.1: let FaceTime ask for a keyframe after a lost packet on the GPU With cc the GPU decodes FaceTime's HEVC. After a lost frame AppleGVA finds no reference and drops every frame up to the next keyframe (-17694), and VideoProcessing rewrites that error to noErr while TempSVCER is unset, so AVConference never requests a keyframe and the picture freezes. install.sh now sets TempSVCER = false in /Library/Preferences/com.apple.VideoProcessing.plist when cc is on; uninstall.sh and --no-cc remove it; doctor.sh shows it. --- GPU/encode/CHANGELOG.md | 13 +++++++++++++ GPU/encode/VERSION | 2 +- GPU/encode/scripts/doctor.sh | 3 +++ GPU/encode/scripts/install.sh | 14 ++++++++++++++ GPU/encode/scripts/uninstall.sh | 4 ++++ 5 files changed, 35 insertions(+), 1 deletion(-) diff --git a/GPU/encode/CHANGELOG.md b/GPU/encode/CHANGELOG.md index c2628b00..84d39604 100644 --- a/GPU/encode/CHANGELOG.md +++ b/GPU/encode/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 1.3.1 + +- FaceTime on the GPU after a lost packet: `install.sh` sets `TempSVCER = false` in + `/Library/Preferences/com.apple.VideoProcessing.plist` (every user) when cc is on; `uninstall.sh` and `--no-cc` remove it, + `doctor.sh` shows it. AppleGVA's own reference list (`getReferencePictureList`) finds no reference after a lost frame + and drops every frame up to the next keyframe with `-17694`; VideoProcessing's error policy rewrites that error to + noErr while `TempSVCER` is unset or true, so AVConference, which compares the status with `-17694` and requests a + keyframe, never learns of the loss and the picture freezes. With the preference off the error goes through. + Measured with the real decoder (Navi 21, 25G342, one frame in 30 lost): 150 of 295 frames out and five 29-frame + freezes before; 295 of 295, same quality as the clean stream, when the keyframe arrives on the next frame. The + keyframe request itself is checked in AVConference's code only, not in a call. Software decoding now asks for a + keyframe too instead of showing a damaged picture. + ## macOS 26.7.4 (25G422) (RyzenStatus 1.90.0) - Kext: 26.7.4 added to `kX6000Builds` (`F8070234-57B0-3107-AC79-F3AA1C816072`) and diff --git a/GPU/encode/VERSION b/GPU/encode/VERSION index f0bb29e7..3a3cd8cc 100644 --- a/GPU/encode/VERSION +++ b/GPU/encode/VERSION @@ -1 +1 @@ -1.3.0 +1.3.1 diff --git a/GPU/encode/scripts/doctor.sh b/GPU/encode/scripts/doctor.sh index 957626bf..b7d00337 100755 --- a/GPU/encode/scripts/doctor.sh +++ b/GPU/encode/scripts/doctor.sh @@ -59,6 +59,9 @@ else fi [[ -e /Library/LaunchDaemons/com.droga.vcnpreset.plist ]] && say " an earlier test version (com.droga.vcnpreset) is installed; ./install.sh replaces it" $tool status ${flags[@]} | sed 's/^/ /' +svcer=$(defaults read /Library/Preferences/com.apple.VideoProcessing TempSVCER 2>/dev/null) +if [[ $svcer == 0 ]]; then say " FaceTime keyframe request after a lost packet: on (TempSVCER = false)" +else say " FaceTime keyframe request after a lost packet: OFF (TempSVCER ${svcer:-unset}); 'sudo ./install.sh' turns it on"; fi if [[ -r /var/log/vcnencodefix.log ]]; then say "" say "Last log lines (/var/log/vcnencodefix.log)" diff --git a/GPU/encode/scripts/install.sh b/GPU/encode/scripts/install.sh index 75a147bc..e63e3ed2 100755 --- a/GPU/encode/scripts/install.sh +++ b/GPU/encode/scripts/install.sh @@ -151,6 +151,20 @@ pid=$(pgrep -f "^$bin_dst watch" | head -1) if [[ -n $pid ]]; then say "running (pid $pid)"; else say "warning: the service is not running; see $log"; running=0; fi tail -4 $log | sed 's/^/ /' +step "FaceTime on the GPU: keyframe request after a lost packet" +# With cc the GPU decodes FaceTime's HEVC. After a lost packet AppleGVA has no reference and drops every frame +# up to the next keyframe (-17694). VideoProcessing hides that error from FaceTime (preference TempSVCER, on +# when unset), so FaceTime never asks the other side for a keyframe and the picture freezes. Off here, for +# every user: the error reaches AVConference, which requests a keyframe (PLI) and the picture comes back. +vp_prefs=/Library/Preferences/com.apple.VideoProcessing +if (( ${args[(Ie)--no-cc]} )); then + defaults delete $vp_prefs TempSVCER 2>/dev/null && say "cc is off: removed TempSVCER from $vp_prefs.plist" +elif defaults write $vp_prefs TempSVCER -bool false && [[ $(defaults read $vp_prefs TempSVCER 2>/dev/null) == 0 ]]; then + say "set TempSVCER = false in $vp_prefs.plist" +else + say "warning: cannot set TempSVCER in $vp_prefs.plist; on the GPU a FaceTime call freezes after a lost packet until the next keyframe" +fi + step "Kernel half (VCNEncodeFloor.kext, VCN clock floor)" loaded=$(kextstat -l -b com.droga.VCNEncodeFloor 2>/dev/null | awk '{print $7}' | tr -d '()') if [[ -n $loaded ]]; then diff --git a/GPU/encode/scripts/uninstall.sh b/GPU/encode/scripts/uninstall.sh index f16ca4d7..8a5d014a 100755 --- a/GPU/encode/scripts/uninstall.sh +++ b/GPU/encode/scripts/uninstall.sh @@ -45,6 +45,10 @@ done for f in /usr/local/libexec/vcnencodefix /usr/local/libexec/vcnencodefix.new /etc/newsyslog.d/vcnencodefix.conf /usr/local/libexec/vcnpreset; do if exists $f; then rm -f -- $f && say "removed $f" || say "warning: cannot remove $f"; fi done +# set by install.sh for cc (FaceTime asks for a keyframe after a lost packet) +if defaults delete /Library/Preferences/com.apple.VideoProcessing TempSVCER 2>/dev/null; then + say "removed TempSVCER from /Library/Preferences/com.apple.VideoProcessing.plist" +fi say "the log /var/log/vcnencodefix.log was kept" if [[ -n $efi ]]; then