Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

RivaTuner (MSI Afterburner OSD): software interface while it runs, OSD on the video only

Veyra Goal Agent28a440b7f5bf
diff --git a/apps/veyra-qml/main.cpp b/apps/veyra-qml/main.cpp
index 03dc8479..6a034cbc 100644
--- a/apps/veyra-qml/main.cpp
+++ b/apps/veyra-qml/main.cpp
@@ -411,6 +411,7 @@ static int runApplication(int argc, char** argv, QString& restartProgram, QStrin
// "Auto" leaves Qt following the Windows display scale.
int uiScale = 0;
bool obsGameCapture = false;
+ bool overlayCompatAuto = true; // 设置 → 监控软件兼容: "auto" (default) or "off"
{
int count = 0;
LPWSTR* args = CommandLineToArgvW(GetCommandLineW(), &count);
@@ -426,6 +427,7 @@ static int runApplication(int argc, char** argv, QString& restartProgram, QStrin
const auto saved = QJsonDocument::fromJson(prefs.readAll()).object();
uiScale = saved.value(QStringLiteral("uiScale")).toInt();
obsGameCapture = saved.value(QStringLiteral("obsGameCapture")).toBool();
+ overlayCompatAuto = saved.value(QStringLiteral("overlayCompat")).toString() != QStringLiteral("off");
}
obsGameCapture = obsGameCapture || obsGameCaptureArg;
if (uiScale == 100 || uiScale == 125 || uiScale == 150) {
@@ -440,9 +442,41 @@ static int runApplication(int argc, char** argv, QString& restartProgram, QStrin
// DXGI prevents its resize/destruction from freeing the video's capture
// resources on another thread. This opt-in affects UI drawing only;
// the native D3D12 video and enhancement pipeline are unchanged.
+ //
+ // Monitoring overlays: RivaTuner Statistics Server (MSI Afterburner's OSD) draws on one
+ // Direct3D 12 swapchain at a time, and a D3D12 interface next to the video's swapchain
+ // had the GPU device removed within a second of a video starting (gfx/PresentationHooks.h).
+ // A D3D11 interface survives but gets an OSD of its own showing the interface's rate, and
+ // crashed with XeSS frame generation in the field. Drawn in software the interface has no
+ // swapchain at all: RTSS sees only the video and puts its numbers there, as with 1.4.4's
+ // GDI interface. VEYRA_UI_RHI picks a renderer explicitly and skips this.
+ wchar_t forcedRenderer[16]{};
+ GetEnvironmentVariableW(L"VEYRA_UI_RHI", forcedRenderer, 16);
+ // VEYRA_TEST_IGNORE_RTSS=1 starts as if RivaTuner were not running (its late-start path).
+ const bool rivaTuner = !GetEnvironmentVariableW(L"VEYRA_TEST_IGNORE_RTSS", nullptr, 0)
+ && (veyra::gfx::rivaTunerRunning() || GetModuleHandleW(L"RTSSHooks64.dll"));
+ const bool overlayCompat = !obsGameCapture && overlayCompatAuto && rivaTuner && !forcedRenderer[0];
+ const bool softwareUi = obsGameCapture || overlayCompat;
if (obsGameCapture) {
QQuickWindow::setSceneGraphBackend(QStringLiteral("software"));
veyra::log::info("app", "OBS game capture compatibility: software UI; native D3D12 video unchanged");
+ } else if (overlayCompat) {
+ QQuickWindow::setSceneGraphBackend(QStringLiteral("software"));
+ veyra::log::info("app", "RivaTuner Statistics Server is running: software UI so its OSD draws on the video only; native D3D12 video unchanged");
+ }
+ {
+ // A GPU interface keeps RTSS from drawing in this process at all, so a RivaTuner
+ // started after Veyra (or kept with 监控软件兼容 off) cannot take the device down.
+ // RTSS reads the variable when it loads its profile here; a software interface
+ // leaves it out (and clears it after a restart from a GPU-interface run).
+ wchar_t current[64]{};
+ const DWORD length = GetEnvironmentVariableW(veyra::gfx::kRivaTunerProfileOverride, current, 64);
+ const bool ours = length > 0 && wcscmp(current, veyra::gfx::kRivaTunerOsdOff) == 0;
+ const bool gpuD3d12 = !softwareUi && _wcsicmp(forcedRenderer, L"d3d11") != 0;
+ if (gpuD3d12 && length == 0) SetEnvironmentVariableW(veyra::gfx::kRivaTunerProfileOverride, veyra::gfx::kRivaTunerOsdOff);
+ else if (!gpuD3d12 && ours) SetEnvironmentVariableW(veyra::gfx::kRivaTunerProfileOverride, nullptr);
+ veyra::log::info("app", std::format("RivaTuner running={} injected={} compat={} OSD in this process={}", rivaTuner,
+ GetModuleHandleW(L"RTSSHooks64.dll") != nullptr, overlayCompatAuto ? "auto" : "off", gpuD3d12 ? "off (GPU interface)" : "on"));
}
QApplication app(argc, argv);
// Qt does not automatically use the executable's Win32 icon for its windows.
@@ -467,18 +501,19 @@ static int runApplication(int argc, char** argv, QString& restartProgram, QStrin
// the XeSS swapchain through D3D11On12 (field dumps 2026-10-01). 1.4.4 drew its UI with
// GDI and had no D3D11 device; the overlays coexisted. VEYRA_UI_RHI=d3d11 restores
// Qt's default; without a usable D3D12 device Qt keeps it too.
- if (!obsGameCapture) {
- wchar_t forced[16]{};
- GetEnvironmentVariableW(L"VEYRA_UI_RHI", forced, 16);
- const bool wantD3d11 = _wcsicmp(forced, L"d3d11") == 0;
+ if (!softwareUi) {
+ const bool wantD3d11 = _wcsicmp(forcedRenderer, L"d3d11") == 0;
const bool d3d12Usable = SUCCEEDED(D3D12CreateDevice(nullptr, D3D_FEATURE_LEVEL_11_0, __uuidof(ID3D12Device), nullptr));
if (!wantD3d11 && d3d12Usable) QQuickWindow::setGraphicsApi(QSGRendererInterface::Direct3D12);
veyra::log::info("app", std::format("interface renderer={} (d3d12 usable={} forced={})",
- !wantD3d11 && d3d12Usable ? "d3d12" : "d3d11", d3d12Usable, QString::fromWCharArray(forced).toStdString()));
+ !wantD3d11 && d3d12Usable ? "d3d12" : "d3d11", d3d12Usable, QString::fromWCharArray(forcedRenderer).toStdString()));
}
app.setProperty("veyraLogFile", QString::fromStdWString(logPath.wstring()));
app.setProperty("veyraUiScale", uiScale);
app.setProperty("veyraObsGameCapture", obsGameCapture);
+ app.setProperty("veyraOverlayCompat", overlayCompat);
+ app.setProperty("veyraSoftwareUi", softwareUi);
+ app.setProperty("veyraUiRendererForced", forcedRenderer[0] != 0);
// Frameless windows have no menu, yet DefWindowProc turns a bare Alt tap into
// SC_KEYMENU and enters modal menu tracking: the next mouse click is eaten and
// input stalls for about two seconds. Qt has already handled the key itself
diff --git a/docs/RTSS_COMPAT_2026-10-03.md b/docs/RTSS_COMPAT_2026-10-03.md
new file mode 100644
index 00000000..c4768556
--- /dev/null
+++ b/docs/RTSS_COMPAT_2026-10-03.md
@@ -0,0 +1,53 @@
+# 小飞机(RTSS / MSI Afterburner OSD)适配(2026-10-03)
+
+用户要求:微星小飞机的 RTSS 监控叠加在 Veyra 上时必定闪退或显示异常;改界面为 D3D11 / D3D12 不解决问题(界面一个数值、播放窗口一个数值,界面不需要数值);同时保证 OBS 采集与 OBS 兼容模式采集正常。
+
+分支 `claude/rtss-compat-20261003`(基于 Codex 的 2.0.1 候选 `15a0e39`),工作区 `E:/项目/Veyra/worktrees/rtss-compat-20261003`,构建 `build/rtss-compat-20261003`,测试证据 `tests/rtss-20261003`。本机 RTSS 7.3.7 + MSI Afterburner、OBS 32.1.2 便携副本(`tmp/obs-test/obs`,不碰用户 OBS 配置)、RTX 5070。
+
+## 复现与根因
+
+本机 Afterburner 没配 OSD 项,测试用 RTSS SDK 的共享内存接口写一行 OSD 文字(与 Afterburner 写 OSD 的方式相同,`rtss_osd.py`,退出时释放)。
+
+| 条件 | 结果 |
+|---|---|
+| 2.0.1 候选(界面 D3D12)+ RTSS 注入,OSD 无内容 | 正常 |
+| 同上,OSD 有内容,打开视频 | 视频开始约 0.4 秒后 GPU 设备被移除(`0x887A002B` ACCESS_DENIED),画面定住 |
+| 界面 D3D11(`VEYRA_UI_RHI=d3d11`) | 不移除;但界面自己的交换链也画 OSD(首页显示界面的 320 FPS),即用户说的"两个数值";现场还有 XeSS 补帧时崩溃 |
+| 界面软件绘制(OBS 兼容模式那条路径) | 不移除;OSD 只在视频上;首页无 OSD |
+| 界面 DirectComposition / OpenGL / Vulkan | 仍移除或 OSD 跑到界面上(NVIDIA 把 GL/Vulkan 走 DXGI 互操作,仍是第二条 D3D12 交换链) |
+| RTSS 进程配置 `RestrictMultipleSwapChains=1`(临时文件,测后删除) | 不移除,但 OSD 锁在先出帧的界面交换链上,视频没有 OSD |
+| `RTSSHooksProfileOverride=EnableOSD,0` | 不移除,Veyra 里不画 OSD |
+
+反汇编 RTSSHooks64 的 Present 钩子:先 `GetDesc().OutputWindow`,窗口不可见才跳过;D3D12 下记住"当前交换链",换一条交换链出帧就重建它的 OSD 渲染器。界面和视频两条 D3D12 交换链交替出帧 → 反复重建 → 设备移除。`RTSSHooksProfileOverride` 环境变量(`名,值[,名,值…]`)只接受 EnableOSD、AppDetectionLevel、PositionX/Y、ZoomRatio 等约 25 项,不能按交换链控制。
+
+## 改动
+
+- `gfx::rivaTunerRunning()`:`RTSSSharedMemoryV2` 存在且签名为 `RTSS` 即视为小飞机在运行。
+- 启动时(`main.cpp`,Qt 创建前):设置 → **监控软件兼容** 为"自动"(默认)且小飞机在运行 → 界面改软件绘制(与 OBS 兼容模式同一路径;视频、NR/SR/补帧仍是原生 D3D12)。RTSS 只看得到视频交换链,OSD 只画在视频上。`VEYRA_UI_RHI` 显式指定时不自动切换。
+- 界面用 GPU(D3D12)绘制时,进程里设 `RTSSHooksProfileOverride=EnableOSD,0`:之后才启动的小飞机,或用户把兼容设为"关闭"时,RTSS 在 Veyra 里不画 OSD,不会再把设备拖垮。软件绘制时清掉这个变量(重启继承也会清)。
+- 运行中检测到小飞机后来才注入(GPU 界面、兼容为自动):弹"检测到小飞机(RTSS)",可一键重启切到兼容绘制。
+- OBS 游戏采集与小飞机同时注入:只提示一次(偏好 `obsRivaTunerHintShown`),说明在 RTSS 里给 veyra_qml_ui.exe 勾选"Use Microsoft Detours API hooking",或 OBS 改用窗口采集。
+- 设置页新行"监控软件兼容 自动/关闭",提示随状态变化;崩溃/设备丢失后的 RTSS 建议文字改为指向这个设置。四种语言已翻译。
+- 测试钩子 `VEYRA_TEST_IGNORE_RTSS=1`:启动时当作小飞机没运行(测试"后启动"路径)。
+
+## 验证(本机 RTSS 运行、OSD 有内容)
+
+| 项目 | 结果 |
+|---|---|
+| 自动:`overlay-stress.qml`(播放 → NR+SR → DLSS 补帧 → 全屏 → XeSS → FSR3 → 窗口 → 专业页 → 首页) | 全程正常、无设备移除;OSD 只在视频上,首页/专业页界面无 OSD |
+| 关闭:同一流程,界面 D3D12 | 全程正常、无设备移除;Veyra 内无 OSD |
+| 小飞机后启动(`VEYRA_TEST_IGNORE_RTSS=1`):界面 D3D12 播放中被注入 | 不冻结,弹重启提示,视频继续 |
+| 继承 `EnableOSD,0` 重启到软件绘制 | 变量被清,OSD 正常出现在视频上 |
+| OBS 窗口采集(WGC)+ 小飞机 | 6/6 帧有画面,含视频上的 OSD |
+| OBS 游戏采集,不受 RTSS 影响(`AppDetectionLevel,0`):GPU 界面 / OBS 兼容模式 | 6/6、6/6 帧为视频画面 |
+| OBS 游戏采集 + 小飞机(默认挂钩) | 0/6;**最小 D3D12 窗口程序同样 0/4**,是 RTSS 7.3.7 与 OBS 32.1.2 在 D3D12 上的通用冲突,改动前的 2.0.1 候选也 0/6 |
+| 同上,RTSS 进程配置 `UseDetours=1`(临时文件,测后删除) | 最小程序 4/4;Veyra 6/6 帧为视频、无设备移除 |
+| 单测 | i18n、qml-data、ui-contract 通过;Qt Quick 29/29 |
+| CPU(播放 1080p30) | GPU 界面约 6–16%,软件界面约 6–13%;首页软件界面约 4–25%(首页动画由 CPU 重绘) |
+
+## 限制
+
+- 软件绘制界面:首页图标光晕、背景渐变等 MultiEffect 效果简化(与 OBS 兼容模式相同)。
+- OBS 游戏采集与小飞机同开需要用户在 RTSS 里给 Veyra 开 Detours 挂钩(或用窗口采集);Veyra 不改小飞机、OBS 的配置文件。
+- 游戏加加(GamePP)等其他叠加层未在本机验证;可手动开"OBS 游戏采集兼容"走同样的软件绘制界面。
+- 未在 AMD/Intel 显卡、其他 RTSS 版本上验证。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 57058da6..9c1aac74 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,11 @@
# Veyra 工作记录
+## 2026-10-03 小飞机(RTSS)适配
+
+- 本机装了 RTSS 7.3.7 + Afterburner 后复现:界面与视频两条 D3D12 交换链,OSD 有内容时视频开始约 0.4 秒设备移除(ACCESS_DENIED)。根因与对照实验见 docs/RTSS_COMPAT_2026-10-03.md。
+- 修复:小飞机运行时(默认"监控软件兼容=自动")界面软件绘制,RTSS 只看到视频,OSD 只在视频上;GPU 界面时用 RTSSHooksProfileOverride=EnableOSD,0 防止后启动的小飞机拖垮设备,并提示重启。OBS 游戏采集 + 小飞机在任何 D3D12 程序上都抓不到(RTSS 默认挂钩冲突),提示在 RTSS 给 Veyra 开 Detours 挂钩或用窗口采集。
+- 分支 claude/rtss-compat-20261003(基于 15a0e39),构建/测试/日志:E:/项目/Veyra/build|tests|logs/rtss-compat-20261003、tests/rtss-20261003。未合并、未发布。
+
## 2026-10-02 Codex 接管 2.0.1:Xbox 修复、显存保护候选
- 当前用户要求先处理日志 8/12 爆显存与日志 11 Xbox 连接失败,再按 Claude 对话发 2.0.1;发布授权已存在,不另问批准。已读取 Claude 本机原对话:README 不动,Release 保留 2.0.0 全部内容并追加修复,中英及双 220px 二维码保留。
diff --git a/i18n/catalog.json b/i18n/catalog.json
index bc4a7f98..1ad470a1 100644
--- a/i18n/catalog.json
+++ b/i18n/catalog.json
@@ -1050,6 +1050,13 @@
"en": "OBS Game Capture compatibility",
"ja": "OBS ゲームキャプチャ互換"
},
+ {
+ "zh": "OBS 游戏采集兼容已让界面软件绘制,小飞机 OSD 只显示在视频上",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "OBS 遊戲擷取相容已讓介面軟體繪製,小飛機 OSD 只顯示在影片上",
+ "en": "OBS game capture compatibility already draws the interface in software; the RTSS OSD shows on the video only",
+ "ja": "OBS ゲームキャプチャ互換でインターフェースはソフトウェア描画です。RTSS の OSD は映像にだけ表示されます"
+ },
{
"zh": "PC 串流",
"src": "qml/CineBar.qml",
@@ -1505,6 +1512,13 @@
"en": "Xbox sign-in has expired; sign in again.",
"ja": "Xbox のサインインの有効期限が切れました。再度サインインしてください。"
},
+ {
+ "zh": "Xbox 连接失败:",
+ "src": "src/source/XboxSessionSource.cpp",
+ "zh-TW": "Xbox 連線失敗:",
+ "en": "Xbox connection failed: ",
+ "ja": "Xbox 接続に失敗しました:"
+ },
{
"zh": "XeSS 初始化失败;当前为普通呈现",
"src": "src/engine/EngineController.cpp",
@@ -1603,13 +1617,6 @@
"en": "{}GPU reset {} time(s); exported in {} parts and joined without re-encoding",
"ja": "{}GPU リセット {} 回、{} 分割で書き出し再エンコードなしで結合しました"
},
- {
- "zh": "。请确认本机网络没有拦截 UDP,主机与本机最好在同一局域网。",
- "src": "src/source/XboxSessionSource.cpp",
- "zh-TW": "。請確認本機網路沒有攔截 UDP,主機與本機最好在同一區域網路。",
- "en": ". Make sure this PC's network does not block UDP; the host and this PC should preferably be on the same LAN.",
- "ja": "。この PC のネットワークが UDP をブロックしていないか確認してください。ホストとこの PC は同じ LAN にあるのが理想です。"
- },
{
"zh": "一键还原",
"src": "qml/ColourPanel.qml",
@@ -2611,6 +2618,13 @@
"en": "Fullscreen",
"ja": "全画面"
},
+ {
+ "zh": "全屏期间显存持续增长了 %1 GB,已退出全屏保护播放;当前会话使用窗口播放。增强设置保留。原因尚未确认,可开启设置中的 OBS 游戏采集兼容、重启后测试全屏。",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "全螢幕期間顯示記憶體持續增加了 %1 GB,已退出全螢幕保護播放;目前工作階段使用視窗播放。增強設定保留。原因尚未確認,可開啟設定中的 OBS 遊戲擷取相容、重新啟動後測試全螢幕。",
+ "en": "VRAM kept growing by %1 GB in fullscreen. Playback has returned to a window for this session, keeping enhancement settings. The cause is unconfirmed. You can enable OBS game capture compatibility in Settings, restart, and test fullscreen again.",
+ "ja": "全画面中に VRAM が %1 GB 増え続けたため、この再生はウィンドウ表示に戻りました。映像処理の設定は維持します。原因は未確認です。設定で OBS ゲームキャプチャ互換を有効にし、再起動して全画面を再テストできます。"
+ },
{
"zh": "全屏画面(双击画面 / F11)",
"src": "qml/NodePage.qml",
@@ -3669,6 +3683,13 @@
"en": "No",
"ja": "いいえ"
},
+ {
+ "zh": "启动时检测到小飞机(RTSS)就改用软件绘制界面,OSD 只显示在视频上",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "啟動時偵測到小飛機(RTSS)就改用軟體繪製介面,OSD 只顯示在影片上",
+ "en": "When RivaTuner (RTSS) is running at start, the interface is drawn in software and the OSD shows on the video only",
+ "ja": "起動時に RivaTuner(RTSS)を検出するとインターフェースをソフトウェア描画にし、OSD は映像にだけ表示します"
+ },
{
"zh": "启动窗口大小",
"src": "qml/SettingsPage.qml",
@@ -4978,6 +4999,13 @@
"en": "Small",
"ja": "小"
},
+ {
+ "zh": "小飞机在 Veyra 之后启动。为避免画面卡住,它的 OSD 暂不在 Veyra 里显示。重启后界面改用兼容绘制,OSD 只显示在视频上。现在重启吗?当前播放或串流将停止。",
+ "src": "qml/Main.qml",
+ "zh-TW": "小飛機在 Veyra 之後啟動。為避免畫面卡住,它的 OSD 暫不在 Veyra 中顯示。重新啟動後介面改用相容繪製,OSD 只顯示在影片上。現在重新啟動嗎?目前的播放或串流將停止。",
+ "en": "RivaTuner started after Veyra. To keep the picture from freezing, its OSD is not shown in Veyra for now. After a restart the interface uses compatible drawing and the OSD shows on the video only. Restart now? Current playback or streaming will stop.",
+ "ja": "RivaTuner が Veyra の後に起動しました。映像が止まらないよう、今は Veyra に OSD を表示しません。再起動するとインターフェースが互換描画になり、OSD は映像にだけ表示されます。今すぐ再起動しますか?再生中の映像やストリーミングは停止します。"
+ },
{
"zh": "尚无导出任务",
"src": "src/engine/ExportJobManager.cpp",
@@ -5405,6 +5433,13 @@
"en": "A preset with this name already exists; choose another name to save",
"ja": "同じ名前のプリセットがあります。別の名前にすると保存できます"
},
+ {
+ "zh": "已检测到小飞机(RTSS):界面软件绘制,OSD 只显示在视频上;部分阴影与模糊简化",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "已偵測到小飛機(RTSS):介面軟體繪製,OSD 只顯示在影片上;部分陰影與模糊簡化",
+ "en": "RivaTuner (RTSS) detected: the interface is drawn in software and the OSD shows on the video only; some shadows and blur are simplified",
+ "ja": "RivaTuner(RTSS)を検出:インターフェースはソフトウェア描画、OSD は映像にだけ表示。一部の影とぼかしは簡略化されます"
+ },
{
"zh": "已登录",
"src": "qml/DialogHost.qml",
@@ -6820,13 +6855,6 @@
"en": "Could not start capture; see diagnostics",
"ja": "キャプチャーを開始できませんでした。診断を確認してください"
},
- {
- "zh": "无法和主机建立连接:",
- "src": "src/source/XboxSessionSource.cpp",
- "zh-TW": "無法和主機建立連接:",
- "en": "Could not connect to the host: ",
- "ja": "ホストに接続できません:"
- },
{
"zh": "无法复制轨道参数",
"src": "src/engine/VideoExportJob.cpp",
@@ -7080,18 +7108,11 @@
"ja": "VRAM 回収時に排出できませんでした"
},
{
- "zh": "显存在设置没变的情况下涨了 %1 GB。检测到 NVIDIA App 的画面插件(RTX HDR / 智能平滑运动 / RTX 动态鲜艳度)注入了 Veyra:它只在全屏时介入,这部分显存很可能由它占用,Veyra 重建也释放不了。请在 NVIDIA App → 图形 → 程序设置里为 Veyra 关闭这几项,或退出全屏;已占用的显存要重开 Veyra 才会释放",
- "src": "src/ui/QmlPlayerBridge.cpp",
- "zh-TW": "顯示記憶體在設定沒變的情況下增加了 %1 GB。偵測到 NVIDIA App 的畫面外掛(RTX HDR / 智慧平滑運動 / RTX 動態鮮豔度)注入了 Veyra:它只在全螢幕時介入,這部分顯示記憶體很可能由它佔用,Veyra 重建也釋放不了。請在 NVIDIA App → 圖形 → 程式設定中為 Veyra 關閉這幾項,或退出全螢幕;已佔用的顯示記憶體要重開 Veyra 才會釋放",
- "en": "Video memory grew by %1 GB with no settings change. NVIDIA App's picture plug-in (RTX HDR / Smooth Motion / RTX Dynamic Vibrance) is injected into Veyra: it engages only in fullscreen, this memory is most likely held by it, and Veyra cannot release it by rebuilding. Turn these off for Veyra in NVIDIA App → Graphics → Program Settings, or leave fullscreen; memory already taken is released when Veyra is reopened",
- "ja": "設定を変えていないのにビデオメモリが %1 GB 増えました。NVIDIA App の画面プラグイン(RTX HDR / Smooth Motion / RTX Dynamic Vibrance)が Veyra に挿入されています。全画面のときだけ動作し、このメモリはおそらくプラグインが確保していて、Veyra の再構築では解放できません。NVIDIA App → グラフィックス → プログラム設定で Veyra に対してこれらをオフにするか、全画面を解除してください。確保済みのメモリは Veyra を開き直すと解放されます"
- },
- {
- "zh": "显存在设置没变的情况下涨了 %1 GB,已自动重建显示链回收显存(画面会闪一下)。如果反复出现:常见原因是 NVIDIA Smooth Motion、游戏加加、小飞机(RTSS)、显卡叠加层/即时重放或录屏软件在全屏时注入了本程序,请关掉它们后再试,并把日志发给我们(vram-watch)",
+ "zh": "显存在设置未变时增加了 %1 GB,正在尝试回收;回收结果见诊断日志。原因尚未确认。",
"src": "src/ui/QmlPlayerBridge.cpp",
- "zh-TW": "顯示記憶體在設定沒變的情況下漲了 %1 GB,已自動重建顯示鏈回收顯示記憶體(畫面會閃一下)。如果反復出現:常見原因是 NVIDIA Smooth Motion、遊戲加加、小飛機(RTSS)、顯示卡疊加層/即時重放或螢幕錄影軟體在全螢幕時注入了本程式,請關掉它們後再試,並把日誌發給我們(vram-watch)",
- "en": "VRAM grew by %1 GB with no settings change; the display chain was rebuilt automatically to reclaim it (the picture blinks once). If it keeps happening, the usual cause is NVIDIA Smooth Motion, GamePP, RTSS (MSI Afterburner), a GPU overlay/instant replay or screen recording software hooking this app in fullscreen. Turn them off, try again, and send us the log (vram-watch)",
- "ja": "設定を変えていないのに VRAM が %1 GB 増えたため、表示チェーンを自動で再構築して回収しました(映像が一瞬点滅します)。繰り返し起きる場合、よくある原因は NVIDIA Smooth Motion、GamePP、RTSS(MSI Afterburner)、GPU のオーバーレイ/インスタントリプレイ、または録画ソフトが全画面時にこのアプリへ注入していることです。それらをオフにして再試行し、ログ(vram-watch)を送ってください"
+ "zh-TW": "顯示記憶體在設定未變時增加了 %1 GB,正在嘗試回收;回收結果請見診斷日誌。原因尚未確認。",
+ "en": "VRAM grew by %1 GB without a settings change. Recovery is being attempted; see the diagnostic log for the result. The cause is unconfirmed.",
+ "ja": "設定を変えていないのに VRAM が %1 GB 増加したため、回収を試みています。結果は診断ログをご覧ください。原因は未確認です。"
},
{
"zh": "显示",
@@ -7611,6 +7632,13 @@
"en": "This export uses AMD FSR super resolution",
"ja": "今回の書き出しは AMD FSR 超解像を使用します"
},
+ {
+ "zh": "本次播放检测到全屏显存持续增长,请使用窗口播放;重新打开片源后可再次测试全屏。",
+ "src": "qml/Main.qml",
+ "zh-TW": "本次播放偵測到全螢幕顯示記憶體持續增加,請使用視窗播放;重新開啟來源後可再次測試全螢幕。",
+ "en": "VRAM kept growing in fullscreen during this session. Use windowed playback; reopen the source to test fullscreen again.",
+ "ja": "この再生では全画面中に VRAM が増え続けました。ウィンドウ表示を使用してください。ソースを開き直すと全画面を再テストできます。"
+ },
{
"zh": "松开恢复",
"src": "qml/ColourPanel.qml",
@@ -7724,11 +7752,25 @@
"ja": "NVIDIA App の画面プラグイン(RTX HDR / Smooth Motion / RTX Dynamic Vibrance)が Veyra に挿入されています。キャプチャ開始時に GPU デバイスの喪失やクラッシュを起こすことが確認されています。NVIDIA App → グラフィックス → プログラム設定で Veyra に対してこれらをオフにしてから再試行してください"
},
{
- "zh": "检测到 RivaTuner(小飞机 OSD)注入了 Veyra,请在 RTSS 里为 veyra_qml_ui.exe 关闭检测(Application detection level 设为 None)后再试",
+ "zh": "检测到 OBS 游戏采集和小飞机(RTSS)同时注入 Veyra。两者默认的挂钩方式冲突,OBS 游戏采集可能抓不到画面(任何 D3D12 程序都一样)。在 RTSS 里添加 veyra_qml_ui.exe,并在它的设置中勾选“Use Microsoft Detours API hooking”;或在 OBS 改用窗口采集(Windows 10 1903+)",
"src": "src/ui/QmlPlayerBridge.cpp",
- "zh-TW": "偵測到 RivaTuner(RTSS OSD)注入了 Veyra,請在 RTSS 中為 veyra_qml_ui.exe 關閉偵測(Application detection level 設為 None)後再試",
- "en": "RivaTuner (RTSS on-screen display) is injected into Veyra; set Application detection level to None for veyra_qml_ui.exe in RTSS and try again",
- "ja": "RivaTuner(RTSS の OSD)が Veyra に挿入されています。RTSS で veyra_qml_ui.exe の Application detection level を None にしてから再試行してください"
+ "zh-TW": "偵測到 OBS 遊戲擷取和小飛機(RTSS)同時注入 Veyra。兩者預設的掛鉤方式衝突,OBS 遊戲擷取可能抓不到畫面(任何 D3D12 程式都一樣)。在 RTSS 中新增 veyra_qml_ui.exe,並在它的設定中勾選「Use Microsoft Detours API hooking」;或在 OBS 改用視窗擷取(Windows 10 1903+)",
+ "en": "OBS game capture and RivaTuner (RTSS) are both injected into Veyra. Their default hooking conflicts, so OBS game capture may get no picture (true of any D3D12 program). Add veyra_qml_ui.exe in RTSS and tick \"Use Microsoft Detours API hooking\" in its settings, or use Window Capture in OBS (Windows 10 1903+)",
+ "ja": "OBS ゲームキャプチャと RivaTuner(RTSS)が両方とも Veyra に挿入されています。既定のフック方式が競合し、OBS ゲームキャプチャで映像が取れないことがあります(D3D12 のプログラムすべてで同じです)。RTSS に veyra_qml_ui.exe を追加して設定で「Use Microsoft Detours API hooking」をオンにするか、OBS でウィンドウキャプチャ(Windows 10 1903+)を使ってください"
+ },
+ {
+ "zh": "检测到 RivaTuner(小飞机 OSD)注入了 Veyra。请把 设置 → 监控软件兼容 设为“自动”并在小飞机运行时重启 Veyra:界面改用兼容绘制,OSD 只显示在视频上",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "偵測到 RivaTuner(小飛機 OSD)注入了 Veyra。請把 設定 → 監控軟體相容 設為「自動」,並在小飛機執行時重新啟動 Veyra:介面改用相容繪製,OSD 只顯示在影片上",
+ "en": "RivaTuner (RTSS OSD) is injected into Veyra. Set Settings → Monitoring overlay compatibility to Auto and restart Veyra while RTSS is running: the interface uses compatible drawing and the OSD shows on the video only",
+ "ja": "RivaTuner(RTSS OSD)が Veyra に挿入されています。設定 → モニタリングソフト互換 を「自動」にし、RTSS の実行中に Veyra を再起動してください。インターフェースが互換描画になり、OSD は映像にだけ表示されます"
+ },
+ {
+ "zh": "检测到小飞机(RTSS)",
+ "src": "qml/Main.qml",
+ "zh-TW": "偵測到小飛機(RTSS)",
+ "en": "RivaTuner (RTSS) detected",
+ "ja": "RivaTuner(RTSS)を検出"
},
{
"zh": "模型参数",
@@ -8738,6 +8780,13 @@
"en": "Aspect ratio",
"ja": "アスペクト比"
},
+ {
+ "zh": "界面始终用显卡绘制;为避免冲突,小飞机 OSD 不在 Veyra 里显示",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "介面始終用顯示卡繪製;為避免衝突,小飛機 OSD 不在 Veyra 中顯示",
+ "en": "The interface always draws on the GPU; to avoid a conflict the RTSS OSD is not shown in Veyra",
+ "ja": "インターフェースは常に GPU で描画します。競合を避けるため RTSS の OSD は Veyra に表示しません"
+ },
{
"zh": "界面状态写入失败",
"src": "src/ui/PlayerUiFacade.cpp",
@@ -8878,6 +8927,13 @@
"en": "White glow",
"ja": "白い光彩"
},
+ {
+ "zh": "监控软件兼容",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "監控軟體相容",
+ "en": "Monitoring overlay compatibility",
+ "ja": "モニタリングソフト互換"
+ },
{
"zh": "目标",
"src": "qml/DialogHost.qml",
@@ -9011,6 +9067,13 @@
"en": "Offline",
"ja": "オフライン"
},
+ {
+ "zh": "稍后",
+ "src": "qml/Main.qml",
+ "zh-TW": "稍後",
+ "en": "Later",
+ "ja": "後で"
+ },
{
"zh": "稳定强度",
"src": "qml/ProPage.qml",
@@ -10323,9 +10386,9 @@
{
"zh": "设置已保存,但自动重启失败。请重新打开软件。\nSettings saved. Automatic restart failed; please reopen Veyra.",
"src": "apps/veyra-qml/main.cpp",
- "zh-TW": "",
- "en": "",
- "ja": ""
+ "zh-TW": "設定已儲存,但自動重新啟動失敗。請重新開啟軟體。",
+ "en": "Settings saved. Automatic restart failed; please reopen Veyra.",
+ "ja": "設定は保存されましたが、自動再起動に失敗しました。Veyra を開き直してください。"
},
{
"zh": "设置已保存,请等待导出结束后重启软件",
@@ -11902,6 +11965,13 @@
"en": "Redo",
"ja": "やり直し"
},
+ {
+ "zh": "重启",
+ "src": "qml/Main.qml",
+ "zh-TW": "重新啟動",
+ "en": "Restart",
+ "ja": "再起動"
+ },
{
"zh": "重启后生效",
"src": "qml/SettingsPage.qml",
@@ -13189,34 +13259,6 @@
"zh-TW": ";本次匯出使用 AMD FSR 超解析",
"en": "; this export uses AMD FSR super resolution",
"ja": ";今回の書き出しは AMD FSR 超解像を使用します"
- },
- {
- "zh": "全屏期间显存持续增长了 %1 GB,已退出全屏保护播放;当前会话使用窗口播放。增强设置保留。原因尚未确认,可开启设置中的 OBS 游戏采集兼容、重启后测试全屏。",
- "src": "src/ui/QmlPlayerBridge.cpp",
- "zh-TW": "全螢幕期間顯示記憶體持續增加了 %1 GB,已退出全螢幕保護播放;目前工作階段使用視窗播放。增強設定保留。原因尚未確認,可開啟設定中的 OBS 遊戲擷取相容、重新啟動後測試全螢幕。",
- "en": "VRAM kept growing by %1 GB in fullscreen. Playback has returned to a window for this session, keeping enhancement settings. The cause is unconfirmed. You can enable OBS game capture compatibility in Settings, restart, and test fullscreen again.",
- "ja": "全画面中に VRAM が %1 GB 増え続けたため、この再生はウィンドウ表示に戻りました。映像処理の設定は維持します。原因は未確認です。設定で OBS ゲームキャプチャ互換を有効にし、再起動して全画面を再テストできます。"
- },
- {
- "zh": "显存在设置未变时增加了 %1 GB,正在尝试回收;回收结果见诊断日志。原因尚未确认。",
- "src": "src/ui/QmlPlayerBridge.cpp",
- "zh-TW": "顯示記憶體在設定未變時增加了 %1 GB,正在嘗試回收;回收結果請見診斷日誌。原因尚未確認。",
- "en": "VRAM grew by %1 GB without a settings change. Recovery is being attempted; see the diagnostic log for the result. The cause is unconfirmed.",
- "ja": "設定を変えていないのに VRAM が %1 GB 増加したため、回収を試みています。結果は診断ログをご覧ください。原因は未確認です。"
- },
- {
- "zh": "本次播放检测到全屏显存持续增长,请使用窗口播放;重新打开片源后可再次测试全屏。",
- "src": "qml/Veyra/Main.qml",
- "zh-TW": "本次播放偵測到全螢幕顯示記憶體持續增加,請使用視窗播放;重新開啟來源後可再次測試全螢幕。",
- "en": "VRAM kept growing in fullscreen during this session. Use windowed playback; reopen the source to test fullscreen again.",
- "ja": "この再生では全画面中に VRAM が増え続けました。ウィンドウ表示を使用してください。ソースを開き直すと全画面を再テストできます。"
- },
- {
- "zh": "Xbox 连接失败:{}",
- "src": "src/source/XboxSessionSource.cpp",
- "zh-TW": "Xbox 連線失敗:{}",
- "en": "Xbox connection failed: {}",
- "ja": "Xbox 接続失敗:{}"
}
]
}
diff --git a/include/veyra/gfx/PresentationHooks.h b/include/veyra/gfx/PresentationHooks.h
index 81525e83..c5ab3bd4 100644
--- a/include/veyra/gfx/PresentationHooks.h
+++ b/include/veyra/gfx/PresentationHooks.h
@@ -46,6 +46,34 @@ inline std::wstring riskyInjections() {
return out;
}
+// RivaTuner Statistics Server (MSI Afterburner's OSD, also used by HWiNFO, CapFrameX and
+// others) is running: its shared memory exists and is live. True before it has injected
+// RTSSHooks64.dll here, which it does to every process that creates windows.
+//
+// Why it matters (reproduced 2026-10-03, RTSS 7.3.7, RTX 5070): RTSS draws on a single
+// Direct3D 12 swapchain at a time and rebuilds its renderer whenever a different one
+// presents. With the interface on D3D12 next to the video's own swapchain, the GPU device
+// was removed (DXGI_ERROR_ACCESS_DENIED) about half a second after a video started once its
+// OSD had something to draw. With the interface drawn without a swapchain, RTSS only sees
+// the video and draws its OSD there.
+inline bool rivaTunerRunning() {
+ HANDLE map = OpenFileMappingW(FILE_MAP_READ, FALSE, L"RTSSSharedMemoryV2");
+ if (!map) return false;
+ bool live = false;
+ if (const auto* header = static_cast<const DWORD*>(MapViewOfFile(map, FILE_MAP_READ, 0, 0, sizeof(DWORD)))) {
+ live = header[0] == 0x52545353; // 'RTSS'; 0xDEAD while the server shuts down
+ UnmapViewOfFile(header);
+ }
+ CloseHandle(map);
+ return live;
+}
+
+// RTSS reads this variable from the process it hooks whenever it (re)loads its profile for
+// it ("Name,value[,Name,value…]", RTSSHooks64.dll); EnableOSD is one of the properties it
+// accepts. With EnableOSD,0 it still counts frames but never draws in this process.
+inline constexpr wchar_t kRivaTunerProfileOverride[] = L"RTSSHooksProfileOverride";
+inline constexpr wchar_t kRivaTunerOsdOff[] = L"EnableOSD,0";
+
// The first injected overlay found, or nullptr.
inline const PresentationHook* injectedPresentationHook() {
for (const auto& hook : kPresentationHooks)
diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.h
index 3a53d141..aa946d5c 100644
--- a/include/veyra/ui/QmlPlayerBridge.h
+++ b/include/veyra/ui/QmlPlayerBridge.h
@@ -188,6 +188,9 @@ class QmlPlayerBridge : public QObject {
// The interface scale chosen for the next start (0 = follow Windows).
Q_PROPERTY(int uiScaleActive READ uiScaleActive CONSTANT)
Q_PROPERTY(bool obsGameCaptureActive READ obsGameCaptureActive CONSTANT)
+ // This run draws the interface in software because RivaTuner (RTSS) was running at start
+ // (设置 → 监控软件兼容, main.cpp): its OSD then sits on the video only.
+ Q_PROPERTY(bool overlayCompatActive READ overlayCompatActive CONSTANT)
// Audio output (P4-d): the active WASAPI render endpoints by device id, the
// stored choice (preferences.audioDevice, empty = system default) and what
// the renderer actually opened, including a fallback to the default.
@@ -618,6 +621,9 @@ public:
Q_INVOKABLE void resetShortcuts();
int uiScaleActive() const;
bool obsGameCaptureActive() const;
+ bool overlayCompatActive() const;
+ // RivaTuner Statistics Server is running now (gfx::rivaTunerRunning).
+ Q_INVOKABLE bool rivaTunerRunning() const;
Q_INVOKABLE void openFeedbackPage();
Q_INVOKABLE void openReleasesPage();
QVariantList audioDevices() const;
@@ -1033,6 +1039,9 @@ signals:
// User-facing notices the UI shows as a transient message: a rejected
// chain edit, an export that finished, a failed open.
void notice(const QString& text, bool isError);
+ // RivaTuner injected into a run whose interface draws on the GPU: its OSD is kept out
+ // of this process until a restart switches the interface to software drawing.
+ void overlayRestartSuggested();
// The UI moves to a page by name when a command implies it.
void navigate(const QString& page);
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index 6b81ca18..62d54c2b 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -634,9 +634,21 @@ Window {
}
}
+ // RivaTuner started after Veyra: its OSD is kept out until a restart (QmlPlayerBridge).
+ VConfirm {
+ id: overlayRestart
+ objectName: "overlay-restart-confirm"
+ title: qsTr("检测到小飞机(RTSS)")
+ text: qsTr("小飞机在 Veyra 之后启动。为避免画面卡住,它的 OSD 暂不在 Veyra 里显示。重启后界面改用兼容绘制,OSD 只显示在视频上。现在重启吗?当前播放或串流将停止。")
+ acceptText: qsTr("重启")
+ rejectText: qsTr("稍后")
+ onAccepted: veyra.restartApplication()
+ }
+
Connections {
target: veyra
function onNotice(text, isError) { toast.show(text, isError) }
+ function onOverlayRestartSuggested() { overlayRestart.open() }
function onNavigate(p) {
// A dialog key opens the dialog; anything else is a page.
if (p === "capture" || p === "ps5" || p === "moonlight" || p === "xbox" || p === "screen"
diff --git a/qml/Veyra/SettingsPage.qml b/qml/Veyra/SettingsPage.qml
index 5bcd9b98..abe9e780 100644
--- a/qml/Veyra/SettingsPage.qml
+++ b/qml/Veyra/SettingsPage.qml
@@ -242,6 +242,32 @@ VPage {
}
}
}
+ VRow {
+ // RivaTuner (MSI Afterburner's OSD): see main.cpp. Auto draws the interface in
+ // software when RTSS runs at start, so its OSD only sits on the video.
+ readonly property bool automatic: (veyra.preferences.overlayCompat || "auto") === "auto"
+ label: qsTr("监控软件兼容")
+ hint: veyra.obsGameCaptureActive
+ ? qsTr("OBS 游戏采集兼容已让界面软件绘制,小飞机 OSD 只显示在视频上")
+ : (automatic !== veyra.overlayCompatActive && (veyra.overlayCompatActive || veyra.rivaTunerRunning()))
+ ? qsTr("重启后生效")
+ : veyra.overlayCompatActive
+ ? qsTr("已检测到小飞机(RTSS):界面软件绘制,OSD 只显示在视频上;部分阴影与模糊简化")
+ : automatic
+ ? qsTr("启动时检测到小飞机(RTSS)就改用软件绘制界面,OSD 只显示在视频上")
+ : qsTr("界面始终用显卡绘制;为避免冲突,小飞机 OSD 不在 Veyra 里显示")
+ VSeg {
+ objectName: "set-overlay-compat"
+ options: [{ id: "auto", label: qsTr("自动") }, { id: "off", label: qsTr("关闭") }]
+ current: veyra.preferences.overlayCompat || "auto"
+ onPicked: id => {
+ if (veyra.setPreference("overlayCompat", id) && !veyra.obsGameCaptureActive
+ && (id === "auto") !== veyra.overlayCompatActive
+ && (veyra.overlayCompatActive || veyra.rivaTunerRunning()))
+ obsRestart.open()
+ }
+ }
+ }
VRow {
label: qsTr("启动窗口大小")
hint: qsTr("下次启动生效;超过屏幕时按屏幕缩小并居中")
diff --git a/scripts/ui-check/overlay-stress.qml b/scripts/ui-check/overlay-stress.qml
new file mode 100644
index 00000000..ace91852
--- /dev/null
+++ b/scripts/ui-check/overlay-stress.qml
@@ -0,0 +1,31 @@
+ // ---- monitoring overlay (RTSS / MSI Afterburner OSD) stress: every presenter path while the OSD draws ----
+ // Run with RTSS running and something writing OSD text. Each step logs the run status; a lost device or a
+ // crash ends the run early. Shots: windowed, fullscreen, each frame-generation backend, back to windowed.
+ Timer { interval: 150; running: true; repeat: true; onTriggered: veyra.logUi("uitest-tick", "") }
+ Timer {
+ interval: 1000; running: true; repeat: true
+ property int ticks: 0
+ function note(what) { veyra.logUi("uitest", "UITEST_NOTE " + what + " status=" + veyra.runStatus + " fg=" + veyra.fgBackendName + "/" + veyra.fgEnabled) }
+ onTriggered: {
+ ++ticks
+ if (ticks === 2) veyra.openUrl("@VIDEO@")
+ if (ticks === 6) { note("plain"); veyra.logUi("uitest", "UITEST_SHOT plain") }
+ if (ticks === 7) { veyra.nrEnabled = true; veyra.srEnabled = true }
+ if (ticks === 11) { note("nr+sr"); veyra.logUi("uitest", "UITEST_SHOT nrsr") }
+ if (ticks === 12) { veyra.fgBackendName = "dlss"; veyra.fgEnabled = true }
+ if (ticks === 17) { note("fg dlss"); veyra.logUi("uitest", "UITEST_SHOT fg-dlss") }
+ if (ticks === 18) root.toggleFullscreen()
+ if (ticks === 23) { note("fullscreen dlss"); veyra.logUi("uitest", "UITEST_SHOT full-dlss") }
+ if (ticks === 24) veyra.fgBackendName = "xess"
+ if (ticks === 30) { note("fullscreen xess"); veyra.logUi("uitest", "UITEST_SHOT full-xess") }
+ if (ticks === 31) veyra.fgBackendName = "fsr3"
+ if (ticks === 37) { note("fullscreen fsr3"); veyra.logUi("uitest", "UITEST_SHOT full-fsr3") }
+ if (ticks === 38) root.toggleFullscreen()
+ if (ticks === 42) { note("windowed fsr3"); veyra.logUi("uitest", "UITEST_SHOT win-fsr3") }
+ if (ticks === 43) { veyra.fgEnabled = false; root.goPage("pro") }
+ if (ticks === 47) { note("pro page"); veyra.logUi("uitest", "UITEST_SHOT pro") }
+ if (ticks === 48) root.goPage("home")
+ if (ticks === 51) { note("home"); veyra.logUi("uitest", "UITEST_SHOT home") }
+ if (ticks === 52) { veyra.logUi("uitest", "UITEST_DONE"); running = false }
+ }
+ }
diff --git a/scripts/ui-check/play-hold.qml b/scripts/ui-check/play-hold.qml
new file mode 100644
index 00000000..39e95ed3
--- /dev/null
+++ b/scripts/ui-check/play-hold.qml
@@ -0,0 +1,12 @@
+ // ---- plays @VIDEO@ for @SECONDS@ s and ends (for outside observers: OBS, RTSS) ----
+ Timer { interval: 150; running: true; repeat: true; onTriggered: veyra.logUi("uitest-tick", "") }
+ Timer {
+ interval: 1000; running: true; repeat: true
+ property int ticks: 0
+ onTriggered: {
+ ++ticks
+ if (ticks === 2) veyra.openUrl("@VIDEO@")
+ if (ticks % 10 === 0) veyra.logUi("uitest", "UITEST_NOTE t=" + ticks + " status=" + veyra.runStatus)
+ if (ticks === @SECONDS@) { veyra.logUi("uitest", "UITEST_DONE"); running = false }
+ }
+ }
diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cpp
index 85019a2d..36cf4534 100644
--- a/src/ui/QmlPlayerBridge.cpp
+++ b/src/ui/QmlPlayerBridge.cpp
@@ -120,8 +120,8 @@ QString injectionAdvice(const QString& modules) {
QStringList parts;
if (modules.contains(QStringLiteral("nvppex.dll"), Qt::CaseInsensitive) || modules.contains(QStringLiteral("NvPresent64.dll"), Qt::CaseInsensitive))
parts << QCoreApplication::translate("QmlPlayerBridge", "检测到 NVIDIA App 的画面插件(RTX HDR / 智能平滑运动 / RTX 动态鲜艳度)注入了 Veyra,它已知会在采集开始时让显卡设备丢失或让程序崩溃。请在 NVIDIA App → 图形 → 程序设置里为 Veyra 关闭这几项后再试");
- if (modules.contains(QStringLiteral("RTSSHooks64.dll"), Qt::CaseInsensitive))
- parts << QCoreApplication::translate("QmlPlayerBridge", "检测到 RivaTuner(小飞机 OSD)注入了 Veyra,请在 RTSS 里为 veyra_qml_ui.exe 关闭检测(Application detection level 设为 None)后再试");
+ if (modules.contains(QStringLiteral("RTSSHooks64.dll"), Qt::CaseInsensitive) && !qApp->property("veyraSoftwareUi").toBool())
+ parts << QCoreApplication::translate("QmlPlayerBridge", "检测到 RivaTuner(小飞机 OSD)注入了 Veyra。请把 设置 → 监控软件兼容 设为“自动”并在小飞机运行时重启 Veyra:界面改用兼容绘制,OSD 只显示在视频上");
return parts.join(QStringLiteral(";"));
}
// Messages and fixed table labels shown to the user, in the interface language
@@ -1022,6 +1022,33 @@ QmlPlayerBridge::QmlPlayerBridge(engine::EngineController& engine, std::filesyst
veyra::log::warn("overlay-hooks", std::format("{} is injected into this process ({})",
hook->product, QString::fromWCharArray(hook->module).toStdString()));
}
+ // RivaTuner arrived after a start with the interface on the GPU (it was not running
+ // then, see main.cpp). Its OSD stays out of this process (RTSSHooksProfileOverride),
+ // so nothing breaks; a restart moves the interface to software drawing and puts the
+ // OSD on the video.
+ static bool rivaTunerLate = false;
+ if (!rivaTunerLate && !qApp->property("veyraSoftwareUi").toBool() && !qApp->property("veyraUiRendererForced").toBool()
+ && GetModuleHandleW(L"RTSSHooks64.dll")) {
+ rivaTunerLate = true;
+ const bool automatic = impl_->prefString("overlayCompat") != QLatin1String("off");
+ veyra::log::warn("overlay-hooks", std::format("RivaTuner injected into a run with a GPU interface; its OSD is off in this process ({})",
+ automatic ? "started after Veyra: restart suggested" : "monitoring compatibility off"));
+ if (automatic) emit overlayRestartSuggested();
+ }
+ // RivaTuner's default hooking keeps OBS game capture from hooking any Direct3D 12
+ // program (2026-10-03, RTSS 7.3.7 + OBS 32.1.2, a bare D3D12 window included); its
+ // "Use Microsoft Detours API hooking" option lets both work. Said once, ever.
+ static bool obsWithRivaTuner = false;
+ if (!obsWithRivaTuner && GetModuleHandleW(L"graphics-hook64.dll") && GetModuleHandleW(L"RTSSHooks64.dll")) {
+ obsWithRivaTuner = true;
+ veyra::log::warn("overlay-hooks", "OBS game capture and RivaTuner are both injected: OBS may not get the picture unless RTSS uses Detours hooking for Veyra");
+ if (!impl_->prefs.value(QStringLiteral("obsRivaTunerHintShown")).toBool()) {
+ impl_->prefs[QStringLiteral("obsRivaTunerHintShown")] = true;
+ (void)impl_->savePrefs();
+ emit notice(tr("检测到 OBS 游戏采集和小飞机(RTSS)同时注入 Veyra。两者默认的挂钩方式冲突,OBS 游戏采集可能抓不到画面(任何 D3D12 程序都一样)。"
+ "在 RTSS 里添加 veyra_qml_ui.exe,并在它的设置中勾选“Use Microsoft Detours API hooking”;或在 OBS 改用窗口采集(Windows 10 1903+)"), false);
+ }
+ }
// Overlays inject when they decide the window is a game, e.g. on entering fullscreen
// long after start; after the first two minutes look every 10 s instead of every 2 s.
if (GetTickCount64() - started > 120000 && hookTimer->interval() < 10000) hookTimer->setInterval(10000);
@@ -4363,6 +4390,11 @@ bool QmlPlayerBridge::setPreference(const QString& key, const QVariant& value) {
bool ok = false; const int n = value.toInt(&ok);
if (!ok || (n != 0 && n != 100 && n != 125 && n != 150)) return false;
stored = n;
+ } else if (key == QLatin1String("overlayCompat")) {
+ // 设置 → 监控软件兼容; read by main.cpp before Qt starts.
+ const QString v = value.toString();
+ if (v != QLatin1String("auto") && v != QLatin1String("off")) return false;
+ stored = v;
} else if (key == QLatin1String("decode")) {
const QString v = value.toString();
if (v != QLatin1String("auto") && v != QLatin1String("software") && v != QLatin1String("hardware")) return false;
@@ -4512,6 +4544,8 @@ void QmlPlayerBridge::resetShortcuts() {
emit preferencesChanged();
}
bool QmlPlayerBridge::obsGameCaptureActive() const { return qApp && qApp->property("veyraObsGameCapture").toBool(); }
+bool QmlPlayerBridge::overlayCompatActive() const { return qApp && qApp->property("veyraOverlayCompat").toBool(); }
+bool QmlPlayerBridge::rivaTunerRunning() const { return gfx::rivaTunerRunning(); }
int QmlPlayerBridge::uiScaleActive() const { return qApp ? qApp->property("veyraUiScale").toInt() : 0; }
void QmlPlayerBridge::openFeedbackPage() {