Commit Graph

415 Commits

Author SHA1 Message Date
Geoffrey McRae
cd27ffb06e [idd] network: use shared identity constants 2026-11-06 14:37:38 +11:00
Geoffrey McRae
6eb7c1698c [common] network: use LGProtocol codecs 2026-11-06 14:37:38 +11:00
Geoffrey McRae
adf9ac3035 [common] network: add service payload codecs 2026-11-06 14:37:38 +11:00
Geoffrey McRae
90d2867a78 [idd] network: start QUIC control server 2026-11-06 14:37:37 +11:00
Geoffrey McRae
a3f822685c [build] msquic: add static network dependency 2026-11-06 14:37:37 +11:00
Geoffrey McRae
298577d25a [idd] network: provision persistent server identity 2026-11-06 14:37:37 +11:00
Geoffrey McRae
5dcfad9bb0 [idd] network: add transport session foundation 2026-11-06 14:37:37 +11:00
Geoffrey McRae
5ba1bda0c8 [common] network: define transport wire protocol 2026-11-06 14:37:37 +11:00
Geoffrey McRae
536516be19 [idd] postprocess: accept effective output alignment
Ignore the driver-selected texture alignment when validating external
compute-effect destinations.

Keep layout and resource flags in the comparison.
2026-11-06 14:37:37 +11:00
Geoffrey McRae
36e170d93a [client/idd] audio: support multiple playback clients
Replace the single-owner PCM queues with one shared LGMP SPMC stream.
Give each admitted client reliable state and an independent playback
cursor, while clients without clock authority resample locally.

Extend the audio protocol with per-client epochs and barriers.
Keep capture exclusive and bound authority backpressure so slow
secondary readers cannot affect the disciplined low-latency path.
2026-11-06 14:34:25 +11:00
Geoffrey McRae
56f3305fe8 [client/idd] audio: prevent recording transport stalls
Give microphone data priority over replaceable clock feedback and
reduce feedback traffic on the shared client-to-host FIFO.

Retry short FIFO stalls outside the realtime thread and coalesce
consecutive packets in the existing fixed Windows buffers.

Avoid one broker write per tiny PipeWire quantum without adding
allocations or intentional capture latency.
2026-11-06 14:34:25 +11:00
Geoffrey McRae
efc9952e74 [idd] audio: support 32-bit and common channel layouts
Advertise signed and floating-point 32-bit formats across mono,
stereo, quad, surround, 5.1, and 7.1 at every supported rate.

Carry sample encoding through the broker and LGMP protocol so integer
and floating-point streams remain distinct.

Expand packet, shared-memory, and ring capacity for eight-channel
32-bit audio.
2026-11-06 14:34:25 +11:00
Geoffrey McRae
5681dcdbe7 [idd] audio: discipline playback clock from client
Forward coalesced feedback through the broker to the render clock.

Keep capture independent and apply the rate to WaveRT timing.

Bound and slew targets, then restore unity when feedback stalls.

Withdraw feedback after the watchdog makes fallback safe.
2026-11-06 14:34:25 +11:00
Geoffrey McRae
bf7c76c8db [idd] audio: stop paused streams after playback
Keep initial playback prewarming, but announce STOP when a stream that
has already run enters PAUSE or ACQUIRE. Restart it when RUN returns.

Keep RUN history across owner changes so a paused stream is not
mistaken for a new prewarm generation.

Only announce capture while it is running. Derive active status flags
from the stream generations successfully announced to the client.
2026-11-06 14:34:25 +11:00
Geoffrey McRae
c162d760a1 [idd] audio: configure kernel driver debugging
Persist hardware-ID installation for the LGAudio WDK project and
enable deployment in every existing solution configuration.

This allows LGAudio to run as the kernel-debugger startup project.
2026-11-06 14:34:25 +11:00
Geoffrey McRae
b75b90ff1d [idd] audio: publish render data promptly
Publish committed WaveRT render frames on a 4 kHz timer while keeping
packet completion and notification semantics unchanged.

Serialize clock sampling with position updates to prevent concurrent
queries from replaying elapsed time.
2026-11-06 14:34:25 +11:00
Geoffrey McRae
405233bfb9 [idd] audio: poll LGMP streams at low latency
Move audio ingress and playback-credit recovery off the display timer.
Poll through a dedicated MMCSS worker at sub-millisecond intervals.

Wake capture retries immediately and drain queued client records during
release so backpressure cannot stall recording or shutdown.
2026-11-06 14:32:15 +11:00
Geoffrey McRae
348f92d8b6 [idd] audio: bridge broker packets over LGMP streams
Add optional playback and capture streams to the LGMP transport.
Negotiate ownership over the existing control path and keep audio
availability isolated from display transport readiness.

Route broker packets through public LGMP stream APIs without changing
the LGMP queue table or shared-memory mapping.
2026-11-06 14:32:04 +11:00
Geoffrey McRae
947f03ede6 [idd] audio: add the mediated device connector
Open the optional audio broker from a passive worker and move bounded
playback and capture packets through a transport-neutral audio hub.

Attach audio sources after transport initialization without making audio
driver availability part of display transport readiness.
2026-11-06 14:01:34 +11:00
Geoffrey McRae
5e07786468 [idd] audio: add the mediated PCM data plane
Expose cancel-safe direct-I/O queues for reading rendered frames and
writing captured frames through the private broker endpoint.

Separate render and capture storage, publish format and state
generations, and preserve local loopback while no broker is bound.
2026-11-06 14:01:34 +11:00
Geoffrey McRae
c261fa053f [idd] audio: add mediated broker control endpoint
Expose a private, versioned control device that lets the IDD discover
and claim the active audio adapter without using the public PortCls
endpoints.

Restrict access to SYSTEM and UMDF hosts, track adapter and binding
generations, and keep broker failure optional. Reserve data-plane
capabilities without advertising them until PCM queues are available.
2026-11-06 14:01:34 +11:00
Geoffrey McRae
7c24b585af [idd] audio: add virtual playback and capture driver
Add a WaveRT adapter with render and capture endpoints backed by a
local ring buffer and shared presentation clock.

Advertise PCM formats through 192 kHz, eight channels, and packed
24-bit samples. Register LGAudio in the IDD solution and package it as
Looking Glass Audio.
2026-11-06 14:01:34 +11:00
Geoffrey McRae
432f4a0c9a [idd] installer: require Windows 10 1903 or newer 2026-11-06 12:57:28 +11:00
Geoffrey McRae
7794d619d3 [idd] rgb24: disable packing by default 2026-10-08 10:16:49 +11:00
Geoffrey McRae
8fbe3e7454 [repos] lgprotocol: import shared protocol definitions
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
Add LGProtocol as a pinned submodule and consume its KVMFR protocol
definitions throughout the client, host, IDD, OBS, and profiler.

Keep Looking Glass framebuffer helpers local while removing duplicated
protocol headers and migrating users to KVMFR-scoped types.
2026-09-01 20:58:25 +10:00
Geoffrey McRae
8e43d41873 [idd] app: seed random generator at startup 2026-09-01 18:38:29 +10:00
Geoffrey McRae
057073924a [idd] clipboard: handle delayed-render sequence changes 2026-08-25 22:22:11 +10:00
Geoffrey McRae
efb397bbaf [client/idd] input: wait for valid keyboard LED feedback
Do not publish the default all-off LED value until Windows supplies a
real HID output report. Treat the first all-off report as valid and
retain known state across pipe reconnects.

Serialize feedback processing with connection invalidation so a stale
message cannot restore validity after disconnect.
2026-08-21 13:55:15 +10:00
Geoffrey McRae
7ca94e8959 [idd] helper: expose PNG clipboard images as DIB
Advertise PNG offers as delayed CF_DIBV5 data while retaining the
registered PNG representation. Decode requests with the native WIC
PNG decoder so applications that only accept DIB formats can paste
the image.
2026-08-21 13:40:34 +10:00
Geoffrey McRae
71733433ed [client/idd] input: synchronize keyboard LEDs
Report guest HID keyboard LED state from LGInput to LGIdd and
publish it with the LGMP input endpoint status.

Forward SPICE modifier updates through the same provider state so evdev
can synchronize physical keyboard LEDs across transport changes and
reconnects.

Bump the versioned pipe and KVMFR input status contracts for the new
feedback state.

Accept earlier LGMP input status versions without LED feedback so the
client retains input while the guest driver is being upgraded.
2026-08-21 13:07:46 +10:00
Geoffrey McRae
82c59cecf2 [idd] helper: retry topology after desktop access failure
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
The interactive Helper can start when the console user token exists but
before WinSta0\Default is ready. SetDisplayConfig then returns
ERROR_ACCESS_DENIED while recovery exit caches the failure and keeps
topology enforcement suppressed.

Keep the recovery request pending while desktop access is transient.
Move the pipe worker to the input desktop and retry without caching
intermediate failures. Leave an exhausted access failure uncached so a
later replay can recover.

Restore the periodic enforcement timer and retry topology without
reapplying a display mode that Windows has already accepted.
2026-08-21 01:02:10 +10:00
Geoffrey McRae
60a51fccdf [idd] recovery: unplug monitor without helper
When LGIddHelper is unavailable, recovery requests could remain
pending until timeout while the virtual monitor stayed connected.
This could leave a logged-out guest without a usable display.

Fall back to departing the IDD monitor for active recovery, then
re-arrive it before normal recovery completes. Serialize monitor
lifecycle changes and preserve recovery ordering across Helper
reconnects, timeouts, and stale responses.
2026-08-20 16:12:24 +10:00
Geoffrey McRae
571a58b716 [idd] helper: preserve mode apply transaction 2026-08-17 13:22:52 +10:00
Quantum
cec1a16cfc [idd] helper: use registry boolean helper instead of duplication
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
2026-08-17 05:58:36 +10:00
Geoffrey McRae
2005ea5d69 [idd] capture: add forced indirect copy
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
2026-08-17 05:12:05 +10:00
Geoffrey McRae
96c3056cc9 [idd] capture: add direct full-copy workaround 2026-08-17 04:46:25 +10:00
Geoffrey McRae
4e15f3b68b [idd] transport: stream writes to WC mappings 2026-08-17 03:00:54 +10:00
Geoffrey McRae
4f695b93d6 [idd] helper: coalesce no-GPU notifications 2026-08-17 02:47:06 +10:00
Geoffrey McRae
66b9f18cb6 [idd] helper: scroll refresh rate input 2026-08-17 02:39:15 +10:00
Geoffrey McRae
94754051a8 [idd] helper: wait for display mode enumeration 2026-08-17 02:21:53 +10:00
Geoffrey McRae
9d074519b2 [idd] config: retain four-decimal refresh rates 2026-08-17 02:09:58 +10:00
Geoffrey McRae
c0de47b1e1 [idd] wcwrite: gate SIMD stores on SSE2 2026-08-17 02:08:29 +10:00
Geoffrey McRae
26cafbe3df [idd] lgmp: stream staged copies to WC memory 2026-08-17 01:27:38 +10:00
Geoffrey McRae
86b83f3e23 [idd] lgmp: reject invalid frame layouts 2026-08-17 00:59:27 +10:00
Geoffrey McRae
e08e03bec0 [idd] postprocess: normalize downsample layout 2026-08-17 00:59:20 +10:00
Geoffrey McRae
946e0f4945 [idd] capture: copy partial linear damage by byte range
Retained native candidates and framebuffer targets are both linear
buffers with the same pitched layout. Publish partial damage using
CopyBufferRegion with byte offsets instead of encoding the ranges as
texture-footprint copies.

Collapse full-width rectangles into one command. Fall back to a full
copy when the partial path would exceed 256 commands, copy at least a
full frame of data, or receive invalid damage coordinates.

This removes the native-only command path introduced by 650636cc that
can fault the D3D12 copy queue after RGB24 benchmarking selects native.
2026-08-15 20:19:54 +10:00
Geoffrey McRae
edeff3cce1 [idd] install: keep captured output in one encoding
nsExec merges stdout and stderr into one pipe and detects its
encoding once. Emit UTF-16LE on both streams so error output cannot
reinterpret progress messages as CJK text.

Disable CRT buffering on both streams so progress is visible while
service and SetupAPI operations are running.
2026-08-15 19:12:14 +10:00
Geoffrey McRae
5d51567fd5 [idd] install: let SetupAPI manage device updates
Remove the separate ConfigMgr disable and enable transaction. It
bypassed device class/co-installers, failed before DiInstallDriverW,
and could add two 30-second waits to every update.

Keep LGIddHelper stopped across both DiInstallDriverW calls and let
SetupAPI own PnP stop/start and report any required restart.
2026-08-15 19:11:48 +10:00
Geoffrey McRae
d23a7a3cf2 [idd] helper: release authority during device removal
Register the retained LGIdd authority handle for service device
notifications. Close the exact handle before granting query-remove.

Use cancellable overlapped control requests so the SCM handler never
waits for driver I/O while Plug and Play is removing the device.

Keep authority publication, host liveness, and child activation under
one synchronized state machine to prevent activation after removal.

Retire device notifications on the service thread and keep polling for
the interface so a manual re-enable recovers without a service restart.
2026-08-15 18:53:33 +10:00
Geoffrey McRae
a1f11bcc3e [idd] install: quiesce devices during driver updates
Stop LGIddHelper before updating either UMDF stack. Disable LGInput
before LGIdd, update both packages while quiesced, then restore the
provider before its dependent and start the service last.

Use in-use replacement for UMDF binaries and prevent the INF from
restarting the Helper during package installation. Report each
SetupAPI restart result and propagate it through NSIS.

Roll back transaction-owned devices, packages, and service state on
fresh-install failure. Preserve dependency order during removal and
select the package actually installed on each devnode.
2026-08-15 18:50:44 +10:00