Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions GPU/encode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion GPU/encode/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.1
3 changes: 3 additions & 0 deletions GPU/encode/scripts/doctor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
14 changes: 14 additions & 0 deletions GPU/encode/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions GPU/encode/scripts/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading