Quitting a capture-card session crashed (SIGSEGV in _convert_gpu) in 3 of 4
runs: the card and CUDA were torn down under an NVDEC decode in flight. close()
now joins the reader first. 6 of 6 clean quits after the fix.
Measured on the GC311, 60 fps out, game locked 30: arrival->presented p50
20.3 ms (p99 24.8) with RTX VSR, the same with FSR 1.
- scripts/linux/smoovplay-capture.sh: fullscreen on SMOOVPLAY_MONITOR (default
HDMI-A-2), log in ~/.cache/smoovplay/last-run.log, notification on failure
- scripts/linux/install-desktop-entry.sh: 'SmoovPlay (capture card)' entry
- verified launching through KDE (kioclient exec) on the RTX 5080 box
- vfg_setup: pin the Linux nvidia-vfx 0.2.0.0 wheel's own sha256
- io: on Wayland fullscreen is the compositor's (a program can't place its own
window); --monitor NAME / SMOOVPLAY_MONITOR picks the output (e.g. DP-4)
- Verified on the RTX 5080: GC311 -> RIFE 120 Hz -> RTX VSR q4 to 4K, fullscreen
on DP-4
A GC311 (MJPEG) with GTA VI locked at 30 fps read as ~50 fps: its repeats
differ by a block max of 2.0-2.5, over the fixed threshold of 2, so most were
called new and almost nothing was interpolated. MJPEG/H.264 cards now learn the
line between repeats and new frames from the block max (DuplicateDetector
learn_on=max, ratio 2.5). Live on the GC311: N.N.N... -> 33 fps (was 50).
- framegen/capture_linux.py: devices via VIDIOC_QUERYCAP (/sys/class/video4linux),
formats via ENUM_FMT/FRAMESIZES/FRAMEINTERVALS -> capture.Mode, ALSA cards from
/proc/asound, busy/permission errors in plain words (names the app holding it)
- capture.CardSource: Linux opens video4linux2 + alsa as two inputs, sound on its
own thread; needs PyAV built against system FFmpeg (--no-binary av)
- PyAV's bundled libasound: point ALSA_CONFIG_PATH at the system config
- winutil: nice -10 via rtkit MakeThreadHighPriorityWithPID instead of SCHED_RR
(RLIMIT_RTTIME got the process SIGKILLed during startup); '--' before args
- Verified on the GC311: 1080p60 MJPEG via NVDEC, 62 fps, 0 dropped, sound in sync
- docs/linux-port/target.md: sm_120 native, RIFE 1080p 6.9 ms (PyTorch fp16),
NVDEC 0.61 ms, CUDA->GL on Wayland 0.18 ms, GC311 = 1080p60 MJPEG/H.264
- winutil: rtkit MakeThreadRealtimeWithPID (busctl is another process) and
lower the hard RLIMIT_RTTIME to rtkit's max; SCHED_RR 10 verified
- linux_spike: time the matmul with CUDA events
- frame tap: window_request word (offset 100, feature bit 32): SmoovPlay asks
chiaki-ng to minimise/restore its own windows (Wayland forbids doing it from
outside); run.py uses it on Linux. Covered by chiaki_tap/selftest.py
- chiaki_tap/PKGBUILD (chiaki-ng-smoovplay, v1.10.1) + build_linux.sh; built in
an archlinux:latest container (needs system curl: the bundled one fails with
Arch's OpenSSL)
- scripts/linux_spike.py: Phase 0 checks in one command
- docs/linux-port: progress log, QUICKSTART
- framegen/oslayer.py: config/cache/Videos folders (XDG on Linux, unchanged on
Windows), the frame tap's clock (CLOCK_MONOTONIC ns, qpc_freq 1e9) and its
shared memory (/dev/shm, mode 0600) with a futex wake-up
- frame tap (chiaki_tap/frametap.c, framegen/chiaki_tap.py, docs writer):
Linux backend; layout unchanged apart from a wake word at offset 96 behind
feature bit 16. Windows code path unchanged (cross-compiled with mingw)
- looks: LUT names and look ids lose folders on every OS. On Linux a shared
look code could carry ..\\..\\x.cube through Path.name untouched
- Windows-only modules import on Linux (WINFUNCTYPE stand-in)
- winutil.boost_thread: SCHED_RR 10 (direct or via rtkit) on Linux
- glcuda: finds libcudart.so from torch's nvidia wheels
- tests: frame tap tests run on Linux; tests/test_oslayer.py
pytest on Linux (CPU torch): 370 passed, 0 failed (was 328 passed, 6 failed).
chiaki_tap/selftest.py passes on Linux (C writer vs Python reader).
Baseline on Linux (CPU torch): 328 passed, 6 failed, 33 skipped.
Maps every Win32 dependency to a Linux replacement, phases 0-9 with
measured gates, risks and open questions.
Capture card resolution is greyed out unless a capture card is the source
picked on the Play page, with a note saying why (PS5 Remote Play streams
1080p at most; App window capture is scaled to 1080p; a frame tap app sends
its own size). Minimise chiaki-ng is greyed out unless PS5 Remote Play is
picked. A setting's spec lists the sources it's used with and a note for
the others; run.py uses the same rule for the in-video menu. Switches now
look disabled when they are.
Another app's compressed frames on the frame tap are no longer called
chiaki-ng: the log says "[tap] frames: ..." and the notes say "the app",
and a chiaki-ng running on its own is no longer minimised.
Beside Fill the screen's choices on the Settings page: the console's 16:9
picture, and this PC's widest screen (or a 21:9 example) with the picked
choice, or the one under the mouse. Fit shows the bars, Zoom the top and
bottom it cuts off (the HUD with it) outside the screen, Stretch an oval
sun, Panorama the lines spreading towards the edges with fill.py's curve.
So it's plain that every choice is the same 16:9 picture.
Checked in the launcher's own snapshots (SMOOVPLAY_SHOTS) with each
choice picked, on a 21:9 screen.
A capture card was always read at 1080p (run.py's --capture-size
default). A player with a 4K card edited their install to get 4K, so
it's now a setting: Settings, Picture, Capture card resolution, 1080p
(the default), 1440p or 4K, Experimental, for the next Play.
Every new frame is drawn at the size captured, so the hints, help and
impact line say plainly that it can run quite sluggish: 1440p is about
twice the work of 1080p, 4K about four times. On an RTX 4070 Ti SUPER
(scripts/benchmark.py, per 30 fps game frame of 33 ms): 1440p 20 ms at
60 fps, 26 at 90 with half motion detail; 4K 52 ms at full, 36 at half,
30 at a quarter. So Auto motion detail now uses half for 1440p at 90
fps and a quarter for 4K (its motion worked out at 960x540, as half's
is at 1080p).
run.py reads the setting when --capture-size isn't given and logs the
size asked for; a card without it still gets the largest it has under
it. The capture setup step, the source guide and the README say to set
the console to the picked resolution.
1080p, 1440p and 4K recordings standing in for a card all ran through
the capture path without errors.
An ultrawide player asked for more options than black bars. Consoles only
send a 16:9 picture, to a TV, a capture card or Remote Play, so there's no
more of the game to show: these are ways of laying out the same 16:9
picture, and the setting's help, hints, impact line and Z message say so.
- Fit: all of it, true to shape, with bars. The default, as before.
- Zoom: fills the screen by cutting off the top and bottom (the sides on
16:10), which can cut the HUD.
- Stretch: fills the screen by making everything wider.
- Panorama: the picture is drawn as for Fit into a half-float texture,
then bent across the screen with u = atan(t*x) / atan(t): the middle
5% (21:9) to 15% (32:9) wider than true, the sides taking the rest.
Settings, Display, Fill the screen; Z in the video window; --fill in
run.py. Messages, the menu and the stats go on the part of the picture
that's on screen. Clips record the stream, so they're unchanged.
Checked in the video window at 2560x1097 with a 720p test picture: each
mode's shape and bars as expected, the Z key, the menu and the overlay
placed on the picture; Panorama's pass about 0.02 ms on an RTX 4070 Ti
SUPER. Tests for the layout, the curve and the GL pass.
A player with a Radeon RX 9070 XT found chiaki-ng crashing with Vulkan,
its default renderer, which on Windows also makes it decode with Vulkan.
SmoovPlay draws the stream itself, so chiaki-ng's own window, hidden
behind it, loses nothing on OpenGL (with D3D11 decoding there).
Our chiaki-ng now honours CHIAKI_FRAMETAP_RENDERER=opengl: OpenGL for that
session, through chiaki-ng's own fallback but without its dialog, and the
saved setting (shared with a standalone chiaki-ng) left as it is. It's one
check beside chiaki-ng's test switch, in apply_patch.py like the rest of
the tap, so the shipped source has it. The launcher sets it when there's
no NVIDIA card (one already set is kept, e.g. "vulkan" to try it anyway)
and says so in the session log. On NVIDIA nothing changes: Vulkan works
there, and an HDR stream needs it.
Checked on this PC with the rebuilt chiaki-ng: with the switch it fell back
to OpenGL, without it it stayed on Vulkan, and the saved renderer and
Vulkan-crash flag were unchanged after both.
NVIDIA's package licence doesn't allow publishing results of testing it,
and the settings, the changelog and the developer docs compared RTX VSR's
speed and look with FSR 1's from our own runs (written when RTX VSR meant
the RTX Video SDK, whose licence allows that). They now say what it does
instead: an AI model on every frame, which can cost in-between frames at
90 and 120 fps. The SDK's figures stay with the SDK.
After the last fix a tester still heard a little popping in a heavy game.
Three things could still cause it:
- Windows got only about 20 ms of sound at a time (sounddevice's "low"),
and the output's callback is Python, so a moment when SmoovPlay's other
threads hold the interpreter made it later than that. On this PC, with
silence playing, hold-ups of 15 to 45 ms made 4 to 15 of 15 calls come
later than the buffer lasted, and PortAudio's underflow flag never said
so. Windows now gets 40 ms (50 as Windows sets it up), which the delay
already takes off: no call was late.
- The card's sound is read on the same thread as the picture, so a
hold-up there brought it in a burst after a longer wait than 0.3.5's
cushion covered. The queue is now kept at no less than the longest wait
between packets of the last minute plus 10 ms, up to 150 ms (waits over
half a second are the sound stopping and don't count). Simulated, with
a hold-up every 5 s for 2 minutes: 23 gaps before, 1 now (the first).
- Changes in the picture's delay of over 40 ms jumped (skipped or
paused). Up to 120 ms they're now played off 1% faster or slower.
Running dry also went on block after block from an almost empty queue;
it now pauses once until the queue is back at the delay. Where the sound
doesn't follow on (a jump, a gap) it's eased over 2 ms instead of
stepping, which is what clicked.
The log has a line once a minute when anything went wrong, and one for
the session at the end: gaps, late calls, skips and pauses, the longest
waits, and how much is held back.
The installed app had no RTX VSR: it needs NVIDIA's RTX Video SDK, which
is behind a developer login, and the wrapper links one of the SDK's
libraries, so it can't ship in the MIT app. NVIDIA's nvidia-vfx package,
which the launcher already downloads from NVIDIA for VFG once the user
accepts NVIDIA's licence, contains the same model and a VideoSuperRes
effect. VfxVsr runs it, and make_vsr picks it ahead of the SDK wrapper
(FRAMEGEN_VSR=sdk for developers).
- Frames go in and come out as NVIDIA's packed 10-bit RGB. The window
copies the output words into an R32UI texture and draws it through an
RGB10_A2 view of the same memory, so nothing unpacks them; alpha is
swizzled to opaque, as NVIDIA leaves it 0 at times.
- A capture card's raw frames use NVIDIA's models for clean video.
- RTX VSR is made the first time it's picked, so sessions that never use
it load nothing for it.
- NVIDIA's package licence forbids publishing benchmark results, so its
timings stay out of the log (Copy diagnostics includes the log).
- Settings, the launcher's VFG panel, the README and the developer docs
say RTX VSR comes with NVIDIA VFG's download; RTX VSR quality is marked
Experimental, and published per-quality timings are gone.
Checked on an RTX 40 series card: colours come out in the right order,
every quality and the clean-video models run, VFG and VSR work in one
process, and a 90 fps fake-PS5 session upscaled to 2560x1440 ran
without errors.
A capture card's sound comes in 20 ms packets. When the delay asked of
DelayLine (the picture's delay, less the sound output's own) was shorter
than a packet, the output ran dry before the next one came: a gap of
silence every packet or so, heard as pops as loud as the game (a player's
Elgato HD60 X, with NVIDIA VFG at 120 fps holding the sound back 31 ms).
Simulated with 20 ms packets, 4 ms of jitter and 10 ms output blocks, it
ran dry about 11 times a second at any delay under 20 ms, and never at
30 ms. The queue is now never kept below the longest recent packet plus
10 ms, so the sound is at most about 20 ms later than the picture instead,
and the capture source logs how often it ran dry when it closes.
The launcher's Upscaler list now says RTX VSR isn't in the installed app
(it needs NVIDIA's RTX Video SDK): picking it quietly used FSR 1. The
README's feature list says so too.
Also: the recording sound test skips the Waiting markers a source yields
while the clip opens, which made it fail when run on its own.
With Dip smoothing the menu had 22 rows by default, squeezed closer to fit
a 1080p window, and was hard to get through. Its main page now has the
quick picks that apply live (Frame generation, Output frame rate, Upscaler)
and a row for each section, from Spec.group as on the launcher's Settings
page (Smoothness, Picture, Looks, Display, Instant replay, PS5 Remote
Play). Enter or Right opens a section, Esc or Backspace goes back to the
main page on that section, and Esc there (or M anywhere) closes it. A
section reopens on the row it was left on, and the menu on the page it was
closed on. A section's row shows what's in it in the help area.
The panel is as tall as the longest page with the tallest help, whatever
page is shown, so nothing moves while going through it: 720 px at 1080p
against 1032 before, and a page has room for 15 rows before they're drawn
closer together. Restart now shows on every page when something needs it.
New settings still need no change to the menu.
The timed path (Even out 40-60, Dip smoothing) counted a real
frame as shown only once the game time on screen had passed it, but
place() already draws it as itself a display time earlier, when an
in-between frame would be over 96% of the way to it. Timed as they arrived,
on whole ticks, dip-timed frames were drawn as themselves a tick before
they counted: at 60 and 120 fps every frame was logged 17 ms late, at 90
fps about half of them (the rest fall between two output frames and still
count when their moment passes). Sound in sync and instant replay follow
this figure, so the sound was held back that much too long. With Even out
40-60 the change is small: about 5 ms on average for a 45 fps game at 60 or
120 fps, none at 90.
Through the fake PS5 at 90 fps, a 27 fps game with Dip smoothing on: median
delay logged 66 ms instead of 70 (37 with it off).
A 30 fps game that misses its slot holds a frame for 3 or 4 ticks (50 or
67 ms) and the next one jumps. With the new setting, Dip smoothing, on,
DipWatch spots two such dips within a second (by the picture's own call, so
it also works with Game frame rate 30 fps) and the pipeline times the
game's frames by the tick they arrived on (FrameTimeline.at_arrival, up to
3 ticks of delay), so a dip shows as a brief slow-down. It switches off 3 s
after the last dip, so a game holding 30 is unchanged. Made with big
open-world games on a base console in mind; it has its own section in the
patch notes.
On simulated games holding 10-20% of their frames, motion unevenness fell
from 0.23-0.59 to 0.02-0.12 with no frozen frames at 60 and 90 fps, for
17-25 ms more delay with 50 ms holds and 33-49 ms with 67 ms holds while
dipping. Through the fake PS5 on the GPU (a 27 fps game at 90 fps), extra
frames shown went from 97% to 79-83%, since every frame shown while
dipping is a generated one, and the logged median delay from 36 to 70 ms,
which overstates it: the delay figure counted these frames late (fixed in
the next commit; 37 to 66 ms after it). Not tried with a real game that
dips yet.
Auto went by each frame's compressed size, which misread locked 30 fps
games: a repeat can be nearly half a new frame's size, and after any still
scene the size check stopped answering for the rest of the session, leaving
a fixed picture line that calls most decoded repeats new. Remote Play now
uses the learned two-band picture check App window already uses. Replayed
over five real 30 fps frame logs, repeats are called right 93-99% of the
time over Ethernet (83% over Wi-Fi) instead of 3-35%, and Even out 40-60
switches on by mistake 0-5% of the time instead of 3-23%.
The size check stays for the stream check, test mode and the frame log,
and now recovers once many recent frames look big (the old xfail passes).
A scheduled workflow (every 6 hours, on each published release, or by hand)
adds GitHub's live SmoovPlay-Setup.exe download counts to the counts saved
before the release files were re-uploaded on 18 Nov (which reset them), and
writes downloads.json (a shields.io endpoint) and history.csv to the stats
branch, only when the total changed. The README shows it as a badge.
When a 30 fps game held a frame for a third tick, the rhythm lock stayed a tick out of step until its vote moved
(up to a second), and on the ticks it called repeats the pipeline showed the stream's frame: the game's next
frame, followed by the in-between frame from before it. Those ticks now show the frame the lock last called new,
so frames stay in order, a tick late, as the lock intended. Tests: a dipping game at 60, 90 and 120 Hz never
steps back, on the 30 fps setting or Auto, and a steady 30 fps game is unchanged.
- Works with: who tested what, on which hardware (PS5 with real 30 fps games, RTX 4070 Ti SUPER and 5070 Ti,
a player's AVerMedia GC573, a real PS5 HDR stream on an HDR monitor, the current Xbox app), and a short
"How it's checked" note.
- The 9 ms and 36 ms figures say what they measure, with the live 30 fps PS5 results; 120 fps is marked as not
yet shown live.
- Tips for locked 30 fps games and wired play, Ctrl+Alt keys in App window mode, Check for updates, the
Auto-detect VFG offer, and a link to the website up top.
- DEVELOPING.md: live 30 fps PS5 results replace "not measured yet"; capture card, window capture and HDR limits
updated.
Some capture cards (the AVerMedia Live Gamer 4K, GC573) carry their sound on the video device itself rather than as
a sound device of their own. When no sound device is named like the card, SmoovPlay now asks the card's own device
for sound, and plays the picture alone if it has none.
Setup now tries writing to the install folder (a test folder, removed straight away) before installing, so a folder
Windows protects, such as a Program Files folder on another drive, is caught with a clear message instead of an
"access denied" error partway through.