diff --git a/VirtualDriverControl/package-lock.json b/VirtualDriverControl/package-lock.json index fcaf58a..96de919 100644 --- a/VirtualDriverControl/package-lock.json +++ b/VirtualDriverControl/package-lock.json @@ -1,12 +1,12 @@ { "name": "virtual-driver-control", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "virtual-driver-control", - "version": "2.0.0", + "version": "2.0.1", "license": "MIT", "devDependencies": { "@types/node": "^25.9.3", diff --git a/VirtualDriverControl/package.json b/VirtualDriverControl/package.json index 26dd58a..638725f 100644 --- a/VirtualDriverControl/package.json +++ b/VirtualDriverControl/package.json @@ -1,6 +1,6 @@ { "name": "virtual-driver-control", - "version": "2.0.0", + "version": "2.0.1", "description": "Modern control panel for the Virtual Display Driver (MttVDD)", "main": "./out/main/index.js", "author": "Virtual Driver Control", diff --git a/VirtualDriverControl/src/main/ipc.ts b/VirtualDriverControl/src/main/ipc.ts index 708943a..01c33d1 100644 --- a/VirtualDriverControl/src/main/ipc.ts +++ b/VirtualDriverControl/src/main/ipc.ts @@ -1,4 +1,5 @@ -import { BrowserWindow, ipcMain, nativeTheme, shell } from 'electron' +import { BrowserWindow, dialog, ipcMain, nativeTheme, shell } from 'electron' +import { MAX_STATIC_DESKTOP_REENCODE_COUNT } from '@shared/types' import type { AppPreferences, ManagedDriverId, PipeToggleCommand, VddSettings } from '@shared/types' import type { AudioService } from './services/audio-service' import type { DisplayService } from './services/display-service' @@ -20,7 +21,7 @@ const TOGGLE_COMMANDS: ReadonlySet = new Set([ 'LOG_DEBUG' ]) -const QUERY_COMMANDS: ReadonlySet = new Set(['D3DDEVICEGPU', 'IDDCXVERSION', 'GETASSIGNEDGPU', 'GETALLGPUS', 'GETSETTINGS', 'PING']) +const QUERY_COMMANDS: ReadonlySet = new Set(['D3DDEVICEGPU', 'IDDCXVERSION', 'GETASSIGNEDGPU', 'GETALLGPUS', 'GETSETTINGS', 'PING', 'GETIDDCXFEATURES']) /** Raw console commands: known verbs only, conservative charset for arguments. */ const RAW_COMMAND_PATTERN = /^[A-Za-z0-9_]+(?: [A-Za-z0-9_." -]{1,100})?$/ @@ -76,6 +77,11 @@ export function registerIpc(services: IpcServices, getWindow: () => BrowserWindo }) ipcMain.handle('pipe:get-driver-settings', () => pipe.getDriverSettings()) + ipcMain.handle('pipe:get-iddcx-features', () => pipe.getIddCxFeatures()) + ipcMain.handle('pipe:set-reencode-count', (_e, count: unknown) => { + assertReencodeCount(count) + return pipe.setReencodeCount(count) + }) // --- vdd_settings.xml ------------------------------------------------------- ipcMain.handle('settings:load', () => settings.load()) @@ -104,6 +110,17 @@ export function registerIpc(services: IpcServices, getWindow: () => BrowserWindo return settings.saveMonitorProfile(xml, edidBytes) }) + ipcMain.handle('settings:import-display-id', async () => { + const options: Electron.OpenDialogOptions = { + title: 'Import a standalone DisplayID descriptor', + filters: [{ name: 'DisplayID binary', extensions: ['bin'] }], + properties: ['openFile'] + } + const window = getWindow() + const selection = await (window ? dialog.showOpenDialog(window, options) : dialog.showOpenDialog(options)) + return selection.canceled || !selection.filePaths[0] ? null : settings.importDisplayId(selection.filePaths[0]) + }) + // --- Driver / system -------------------------------------------------------- ipcMain.handle('driver:status', (_e, force: unknown) => driver.status(force === true)) ipcMain.handle('driver:gpus', () => driver.gpus()) @@ -217,6 +234,12 @@ export function registerIpc(services: IpcServices, getWindow: () => BrowserWindo ipcMain.on('window:close', () => getWindow()?.close()) } +function assertReencodeCount(count: unknown): asserts count is number { + if (typeof count !== 'number' || !Number.isInteger(count) || count < 0 || count > MAX_STATIC_DESKTOP_REENCODE_COUNT) { + throw new Error(`Reencode count must be an integer between 0 and ${MAX_STATIC_DESKTOP_REENCODE_COUNT}.`) + } +} + function assertSettingsShape(value: unknown): asserts value is VddSettings { if (typeof value !== 'object' || value === null) throw new Error('Settings payload must be an object') const v = value as Record @@ -229,6 +252,7 @@ function assertSettingsShape(value: unknown): asserts value is VddSettings { 'colour', 'cursor', 'edid', + 'iddCx', 'edidIntegration', 'hdrAdvanced', 'autoResolutions', @@ -237,4 +261,11 @@ function assertSettingsShape(value: unknown): asserts value is VddSettings { if (!(key in v)) throw new Error(`Settings payload missing section: ${key}`) } if (!Array.isArray(v.resolutions)) throw new Error('resolutions must be an array') + const iddCx = v.iddCx as Partial | null + const edid = v.edid as Partial | null + if (typeof iddCx?.d3d12SwapChain !== 'boolean' || typeof iddCx.virtualI2c !== 'boolean' || + typeof edid?.customDisplayId !== 'boolean') { + throw new Error('Invalid IddCx feature settings') + } + assertReencodeCount(iddCx.staticDesktopReencodeFrameCount) } diff --git a/VirtualDriverControl/src/main/services/pipe-client.ts b/VirtualDriverControl/src/main/services/pipe-client.ts index e808947..01409a0 100644 --- a/VirtualDriverControl/src/main/services/pipe-client.ts +++ b/VirtualDriverControl/src/main/services/pipe-client.ts @@ -5,7 +5,7 @@ import { createConnection, Socket } from 'net' import { join } from 'path' import { promisify } from 'util' import { app } from 'electron' -import type { DriverLiveSettings, PipeResult, PipeToggleCommand } from '@shared/types' +import type { DriverIddCxFeatures, DriverLiveSettings, PipeResult, PipeToggleCommand } from '@shared/types' const execFileAsync = promisify(execFile) @@ -18,13 +18,15 @@ const PIPE_PATH = '\\\\.\\pipe\\MTTVirtualDisplayPipe' * Only a client with an overlapped read already pending in the kernel receives * the data - Node's net stack reads too late by design, .NET ReadAsync works. */ -const RESPONSE_COMMANDS = new Set(['GETSETTINGS', 'GETALLGPUS', 'GETASSIGNEDGPU', 'IDDCXVERSION']) +const RESPONSE_COMMANDS = new Set([ + 'GETSETTINGS', 'GETALLGPUS', 'GETASSIGNEDGPU', 'IDDCXVERSION', 'GETIDDCXFEATURES', 'SETREENCODECOUNT' +]) /** Round-trip helper: arms an overlapped read before writing the command. */ const HELPER_PS1 = `param([Parameter(Mandatory=$true)][string]$CommandB64, [int]$TimeoutMs = 10000) $ErrorActionPreference = 'Stop' $cmd = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($CommandB64)) -$pipe = New-Object System.IO.Pipes.NamedPipeClientStream('.', 'MTTVirtualDisplayPipe', [System.IO.Pipes.PipeDirection]::InOut, [System.IO.Pipes.PipeOptions]::Asynchronous) +$pipe = New-Object System.IO.Pipes.NamedPipeClientStream('.', 'MTTVirtualDisplayPipe', [System.IO.Pipes.PipeDirection]::InOut, [System.IO.Pipes.PipeOptions]::Asynchronous, [System.Security.Principal.TokenImpersonationLevel]::Identification) try { try { $pipe.Connect(4000) } catch { exit 3 } $buf = New-Object byte[] 65536 @@ -135,6 +137,31 @@ export class PipeClient extends EventEmitter { return { debug: match[1].toLowerCase() === 'true', log: match[2].toLowerCase() === 'true' } } + async getIddCxFeatures(): Promise { + const result = await this.send('GETIDDCXFEATURES', { quiet: true }) + const reply = result.response.match(/\bIDDCX_FEATURES (\d+)(?: I2C ([01]))?\b/) + if (!result.ok || !reply) return null + const features = Number(reply[1]) + if (!Number.isInteger(features) || features > 0xffffffff) return null + return { + d3d12: (features & 1) !== 0, + displayId: (features & 2) !== 0, + staticDesktopReencode: (features & 4) !== 0, + atomicI2c: reply[2] === undefined ? null : reply[2] === '1' + } + } + + async setReencodeCount(count: number): Promise { + const result = await this.send(`SETREENCODECOUNT ${count}`) + if (!result.ok || result.response.includes('QUEUED REENCODECOUNT')) return result + const error = result.response.includes('REENCODECOUNT_ACCESS_DENIED') + ? 'Run Virtual Driver Control as administrator to apply a live count.' + : result.response.includes('IDDCX_REENCODE_UNAVAILABLE') + ? 'The running driver or Windows runtime does not support live reencode changes.' + : 'The driver did not acknowledge the reencode request.' + return { ...result, ok: false, error } + } + private isReloadCommand(command: string): boolean { const head = command.split(' ')[0].toUpperCase() return RELOAD_COMMANDS.has(head) diff --git a/VirtualDriverControl/src/main/services/settings-service.ts b/VirtualDriverControl/src/main/services/settings-service.ts index 3edf66f..1bc09b7 100644 --- a/VirtualDriverControl/src/main/services/settings-service.ts +++ b/VirtualDriverControl/src/main/services/settings-service.ts @@ -1,11 +1,21 @@ import { XMLParser } from 'fast-xml-parser' +import { randomUUID } from 'crypto' import { promises as fs } from 'fs' import { existsSync, mkdirSync } from 'fs' import { join } from 'path' import { DEFAULT_VDD_SETTINGS } from '@shared/defaults' -import type { BackupInfo, ResolutionEntry, SaveResult, SettingsLoadResult, VddSettings } from '@shared/types' +import { + MAX_STATIC_DESKTOP_REENCODE_COUNT, + type BackupInfo, + type ResolutionEntry, + type SaveResult, + type SettingsLoadResult, + type VddSettings +} from '@shared/types' const MAX_BACKUPS = 20 +const MAX_DISPLAY_ID_BYTES = 64 * 1024 +const EDID_HEADER = Buffer.from([0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00]) type Raw = Record @@ -157,6 +167,44 @@ export class SettingsService { } } + async importDisplayId(source: string): Promise { + const folder = this.getBaseDir() + const target = join(folder, 'user_displayid.bin') + const temp = join(folder, `user_displayid.${randomUUID()}.tmp`) + try { + const file = await fs.open(source, 'r') + const buffer = Buffer.alloc(MAX_DISPLAY_ID_BYTES + 1) + let bytesRead: number + try { + const stat = await file.stat() + if (!stat.isFile() || stat.size < 5 || stat.size > MAX_DISPLAY_ID_BYTES) { + return { ok: false, error: 'Select a standalone DisplayID descriptor between 5 bytes and 64 KiB.' } + } + ({ bytesRead } = await file.read(buffer, 0, buffer.length, 0)) + if (bytesRead !== stat.size) return { ok: false, error: 'The descriptor changed or could not be read completely.' } + } finally { + await file.close() + } + if (bytesRead >= EDID_HEADER.length && buffer.subarray(0, EDID_HEADER.length).equals(EDID_HEADER)) { + return { ok: false, error: 'This file contains an EDID header. Select a standalone DisplayID descriptor.' } + } + await fs.mkdir(folder, { recursive: true }) + await fs.writeFile(temp, buffer.subarray(0, bytesRead), { flag: 'wx' }) + let backupCreated: string | undefined + if (existsSync(target)) { + await fs.mkdir(this.backupsDir, { recursive: true }) + backupCreated = 'user_displayid.previous.bin' + await fs.copyFile(target, join(this.backupsDir, backupCreated)) + } + await fs.rename(temp, target) + return { ok: true, backupCreated } + } catch (error) { + return { ok: false, error: error instanceof Error ? error.message : String(error) } + } finally { + await fs.rm(temp, { force: true }).catch(() => undefined) + } + } + private async backupCurrent(): Promise { if (!existsSync(this.settingsPath)) return undefined mkdirSync(this.backupsDir, { recursive: true }) @@ -201,6 +249,7 @@ export class SettingsService { const colourNode = asRaw(doc.colour) const cursorNode = asRaw(doc.cursor) const edidNode = asRaw(doc.edid) + const iddCxNode = asRaw(doc.iddcx) const integrationNode = asRaw(doc.edid_integration) const hdrNode = asRaw(doc.hdr_advanced) const hdr10Node = asRaw(hdrNode.hdr10_static_metadata) @@ -260,9 +309,17 @@ export class SettingsService { }, edid: { customEdid: toBool(edidNode.CustomEdid, d.edid.customEdid), + customDisplayId: toBool(edidNode.CustomDisplayId, d.edid.customDisplayId), preventSpoof: toBool(edidNode.PreventSpoof, d.edid.preventSpoof), edidCeaOverride: toBool(edidNode.EdidCeaOverride, d.edid.edidCeaOverride) }, + iddCx: { + d3d12SwapChain: toBool(iddCxNode.D3D12SwapChain, d.iddCx.d3d12SwapChain), + virtualI2c: toBool(iddCxNode.VirtualI2c, d.iddCx.virtualI2c), + staticDesktopReencodeFrameCount: Math.min(MAX_STATIC_DESKTOP_REENCODE_COUNT, Math.max(0, + Math.trunc(toNum(iddCxNode.StaticDesktopReencodeFrameCount, d.iddCx.staticDesktopReencodeFrameCount)) + )) + }, edidIntegration: { enabled: toBool(integrationNode.enabled, d.edidIntegration.enabled), autoConfigureFromEdid: toBool(integrationNode.auto_configure_from_edid, d.edidIntegration.autoConfigureFromEdid), @@ -405,10 +462,17 @@ export class SettingsService { lines.push(` `) lines.push(` `) lines.push(` ${b(s.edid.customEdid)}`) + lines.push(` ${b(s.edid.customDisplayId)}`) lines.push(` ${b(s.edid.preventSpoof)}`) lines.push(` ${b(s.edid.edidCeaOverride)}`) lines.push(` `) lines.push(``) + lines.push(` `) + lines.push(` ${b(s.iddCx.d3d12SwapChain)}`) + lines.push(` ${b(s.iddCx.virtualI2c)}`) + lines.push(` ${s.iddCx.staticDesktopReencodeFrameCount}`) + lines.push(` `) + lines.push(``) lines.push(` `) lines.push(` `) lines.push(` ${b(s.edidIntegration.enabled)}`) diff --git a/VirtualDriverControl/src/preload/index.ts b/VirtualDriverControl/src/preload/index.ts index 27c6d2f..edee5cf 100644 --- a/VirtualDriverControl/src/preload/index.ts +++ b/VirtualDriverControl/src/preload/index.ts @@ -5,6 +5,7 @@ import type { BackupInfo, BaseDirResult, DisplayLayoutInfo, + DriverIddCxFeatures, DriverLiveSettings, DriverStatus, GpuInfo, @@ -42,7 +43,9 @@ const api = { setGpu: (name: string): Promise => ipcRenderer.invoke('pipe:set-gpu', name), query: (command: string): Promise => ipcRenderer.invoke('pipe:query', command), sendRaw: (command: string): Promise => ipcRenderer.invoke('pipe:send-raw', command), - getDriverSettings: (): Promise => ipcRenderer.invoke('pipe:get-driver-settings') + getDriverSettings: (): Promise => ipcRenderer.invoke('pipe:get-driver-settings'), + getIddCxFeatures: (): Promise => ipcRenderer.invoke('pipe:get-iddcx-features'), + setReencodeCount: (count: number): Promise => ipcRenderer.invoke('pipe:set-reencode-count', count) }, settings: { load: (): Promise => ipcRenderer.invoke('settings:load'), @@ -51,6 +54,7 @@ const api = { raw: (): Promise => ipcRenderer.invoke('settings:raw'), backups: (): Promise => ipcRenderer.invoke('settings:backups'), restore: (fileName: string): Promise => ipcRenderer.invoke('settings:restore', fileName), + importDisplayId: (): Promise => ipcRenderer.invoke('settings:import-display-id'), saveMonitorProfile: (xml: string, edidBytes?: Uint8Array): Promise => ipcRenderer.invoke('settings:save-monitor-profile', xml, edidBytes) }, diff --git a/VirtualDriverControl/src/renderer/src/components/IddCxSettings.tsx b/VirtualDriverControl/src/renderer/src/components/IddCxSettings.tsx new file mode 100644 index 0000000..2653ac1 --- /dev/null +++ b/VirtualDriverControl/src/renderer/src/components/IddCxSettings.tsx @@ -0,0 +1,163 @@ +import { useEffect, useState } from 'react' +import { Cpu, FileUp, RefreshCw } from 'lucide-react' +import { MAX_STATIC_DESKTOP_REENCODE_COUNT, type DriverIddCxFeatures } from '@shared/types' +import { Card, NumberField, Toggle } from '@renderer/components/ui' +import { useDriver } from '@renderer/stores/driver' +import { useSettings } from '@renderer/stores/settings' +import { useUi } from '@renderer/stores/ui' + +export function IddCxSettings(): React.JSX.Element { + const online = useDriver((s) => s.status?.pipeConnected === true) + const busy = useDriver((s) => s.busy !== null) + const edid = useSettings((s) => s.draft.edid) + const savedDisplayId = useSettings((s) => s.saved.edid.customDisplayId) + const dirty = useSettings((s) => s.dirty) + const iddCx = useSettings((s) => s.draft.iddCx) + const patch = useSettings((s) => s.patch) + const toast = useUi((s) => s.toast) + const [features, setFeatures] = useState(null) + const [checking, setChecking] = useState(false) + const [refresh, setRefresh] = useState(0) + const [importing, setImporting] = useState(false) + const [applying, setApplying] = useState(false) + const [descriptorImported, setDescriptorImported] = useState(false) + const [restarting, setRestarting] = useState(false) + + useEffect(() => { + setFeatures(null) + setChecking(online) + if (!online) return + let active = true + void window.vdd.pipe.getIddCxFeatures().then( + (result) => { if (active) setFeatures(result) }, + () => { if (active) setFeatures(null) } + ).finally(() => { if (active) setChecking(false) }) + return () => { active = false } + }, [online, refresh]) + + const importDisplayId = async (): Promise => { + setImporting(true) + try { + const result = await window.vdd.settings.importDisplayId() + if (!result) return + if (!result.ok) { + toast('error', 'DisplayID import failed', result.error) + return + } + setDescriptorImported(savedDisplayId) + patch((draft) => (draft.edid.customDisplayId = true)) + toast('success', 'DisplayID descriptor imported', savedDisplayId + ? 'The driver reads the new descriptor on restart.' + : 'Save and apply the configuration to use it.') + } catch (error) { + toast('error', 'DisplayID import failed', error instanceof Error ? error.message : String(error)) + } finally { + setImporting(false) + } + } + + const restartForDisplayId = async (): Promise => { + setRestarting(true) + try { + const result = await window.vdd.installer.restartDevice('display') + if (result.ok) { + setDescriptorImported(false) + if (result.rebootRequired) toast('info', 'Restart Windows to apply DisplayID') + else toast('success', 'Display driver restarted') + } else { + toast('error', 'Display driver restart failed', result.error) + } + } catch (error) { + toast('error', 'Display driver restart failed', error instanceof Error ? error.message : String(error)) + } finally { + setRestarting(false) + } + } + + const applyReencodeCount = async (): Promise => { + setApplying(true) + try { + const result = await window.vdd.pipe.setReencodeCount(iddCx.staticDesktopReencodeFrameCount) + if (result.ok) { + toast('success', 'Live reencode change queued', 'The driver applies it to swap chains until its next restart. Save the initial count to keep it.') + } else { + toast('error', 'Live reencode change failed', result.error) + } + } catch (error) { + toast('error', 'Live reencode change failed', error instanceof Error ? error.message : String(error)) + } finally { + setApplying(false) + } + } + + const status = !online ? 'Driver offline. You can save settings for its next start.' + : checking ? 'Checking the running driver…' + : features ? 'Support reported by the running driver and Windows.' + : 'The running driver did not report IddCx 1.11 capabilities.' + const support = (available: boolean | null | undefined): string => { + if (available == null) return '' + return available ? ' Available on this system.' : ' Unavailable on this system.' + } + + return ( + setRefresh((n) => n + 1)}> + Check support + + )} + > +
+ patch((draft) => (draft.iddCx.d3d12SwapChain = value))} + label="Direct3D 12 swap chains" + sublabel={`Uses D3D12 automatically on compatible Windows runtimes and GPUs. Turn off to force D3D11.${support(features?.d3d12)}`} + /> + patch((draft) => (draft.edid.customDisplayId = value))} + label="Use standalone DisplayID" + sublabel={`Read user_displayid.bin. The driver falls back to EDID if Windows cannot use it.${support(features?.displayId)}`} + /> +
+ + {descriptorImported && savedDisplayId && !dirty && online && ( + + )} +
+ patch((draft) => (draft.iddCx.virtualI2c = value))} + label="Virtual I²C (DDC/CI)" + sublabel={`Answer read-only virtual monitor queries using atomic I²C when available.${support(features?.atomicI2c)}`} + /> + patch((draft) => { + draft.iddCx.staticDesktopReencodeFrameCount = Math.min(MAX_STATIC_DESKTOP_REENCODE_COUNT, Math.max(0, Math.trunc(value))) + })} + /> + {online && features?.staticDesktopReencode && ( +
+ +
+ )} +
+
+ ) +} diff --git a/VirtualDriverControl/src/renderer/src/pages/SettingsPage.tsx b/VirtualDriverControl/src/renderer/src/pages/SettingsPage.tsx index 1a2f9bb..9069096 100644 --- a/VirtualDriverControl/src/renderer/src/pages/SettingsPage.tsx +++ b/VirtualDriverControl/src/renderer/src/pages/SettingsPage.tsx @@ -11,6 +11,7 @@ import { Wand2 } from 'lucide-react' import { DEFAULT_BASE_DIR, type BackupInfo } from '@shared/types' +import { IddCxSettings } from '@renderer/components/IddCxSettings' import { Card, Field, Modal, NumberField, Segmented, Toggle } from '@renderer/components/ui' import { useSettings } from '@renderer/stores/settings' import { useUi } from '@renderer/stores/ui' @@ -67,6 +68,8 @@ export function SettingsPage(): React.JSX.Element { + +
diff --git a/VirtualDriverControl/src/renderer/src/stores/driver.ts b/VirtualDriverControl/src/renderer/src/stores/driver.ts index f830073..05f46f4 100644 --- a/VirtualDriverControl/src/renderer/src/stores/driver.ts +++ b/VirtualDriverControl/src/renderer/src/stores/driver.ts @@ -178,6 +178,10 @@ export const useDriver = create((set, get) => ({ const settings = useSettings.getState() const toast = useUi.getState().toast const count = settings.draft.monitors.count + const requiresDeviceRestart = settings.draft.edid.customDisplayId !== settings.saved.edid.customDisplayId || + settings.draft.iddCx.d3d12SwapChain !== settings.saved.iddCx.d3d12SwapChain || + settings.draft.iddCx.virtualI2c !== settings.saved.iddCx.virtualI2c || + settings.draft.iddCx.staticDesktopReencodeFrameCount !== settings.saved.iddCx.staticDesktopReencodeFrameCount const saved = await settings.save() if (!saved) return @@ -190,6 +194,16 @@ export const useDriver = create((set, get) => ({ set({ busy: 'Reloading driver with new configuration…' }) try { + if (requiresDeviceRestart) { + const result = await window.vdd.installer.restartDevice('display') + if (result.ok) { + if (result.rebootRequired) toast('info', 'Configuration saved', 'Restart Windows to finish applying the changes.') + else toast('success', 'Configuration applied', 'Display driver restarted.') + } else { + toast('error', 'Display driver restart failed', result.error) + } + return + } const result = await window.vdd.pipe.setDisplayCount(count) if (result.ok) { toast('success', 'Configuration applied', `Driver reloaded in ${(result.durationMs / 1000).toFixed(1)}s`) diff --git a/VirtualDriverControl/src/shared/defaults.ts b/VirtualDriverControl/src/shared/defaults.ts index cd2c5ab..c26c626 100644 --- a/VirtualDriverControl/src/shared/defaults.ts +++ b/VirtualDriverControl/src/shared/defaults.ts @@ -29,9 +29,15 @@ export const DEFAULT_VDD_SETTINGS: VddSettings = { }, edid: { customEdid: false, + customDisplayId: false, preventSpoof: false, edidCeaOverride: false }, + iddCx: { + d3d12SwapChain: true, + virtualI2c: false, + staticDesktopReencodeFrameCount: 0 + }, edidIntegration: { enabled: false, autoConfigureFromEdid: false, diff --git a/VirtualDriverControl/src/shared/types.ts b/VirtualDriverControl/src/shared/types.ts index 6e9982d..4095ece 100644 --- a/VirtualDriverControl/src/shared/types.ts +++ b/VirtualDriverControl/src/shared/types.ts @@ -6,6 +6,8 @@ // vdd_settings.xml model // --------------------------------------------------------------------------- +export const MAX_STATIC_DESKTOP_REENCODE_COUNT = 0x7fffffff + export type ColourFormat = 'RGB' | 'YCbCr444' | 'YCbCr422' | 'YCbCr420' export interface ResolutionEntry { @@ -39,9 +41,15 @@ export interface VddSettings { } edid: { customEdid: boolean + customDisplayId: boolean preventSpoof: boolean edidCeaOverride: boolean } + iddCx: { + d3d12SwapChain: boolean + virtualI2c: boolean + staticDesktopReencodeFrameCount: number + } edidIntegration: { enabled: boolean autoConfigureFromEdid: boolean @@ -131,6 +139,13 @@ export interface PipeResult { error?: string } +export interface DriverIddCxFeatures { + d3d12: boolean + displayId: boolean + atomicI2c: boolean | null + staticDesktopReencode: boolean +} + export interface DriverLiveSettings { debug: boolean log: boolean