Repository navigation
xgameruntime_offline: one silent speech voice with WAVE streams, display power requests for timeout deferrals (RT-GDK-SPEECH-DISPLAY-LIFECYCLE) - #401
Conversation
…pCapture, suspend-on-close
- Implement silent 44-byte 16 kHz mono 16-bit PCM WAVE streams for
XSpeechSynthesizer in XAccessibilityImpl.
- Back XLauncherImpl::XDisplayAcquireTimeoutDeferral / Close with Win32
PowerCreateRequest / PowerSetRequest(PowerRequestDisplayRequired).
- Add offline XAppCaptureImpl stub returning ERROR_NOT_SUPPORTED.
- Add runtime/shims/lifecycle.{h,cpp} providing app-state notification
registration and CreateWindowExA/W oversized-window fitting plus
suspend-on-SC_CLOSE dispatch.
|
Holding. Please split this into separate PRs (one topic per PR): the speech, capture and launcher stubs in one, and the lifecycle callback and
For the hook:
Drop 'Depends on #357' if it's unused. |
…nregister race - Only the title's first top-level window (no parent, not WS_CHILD, not WS_EX_TOOLWINDOW) is fitted to the work area and gets the SC_CLOSE hook; WM_NCDESTROY releases the claim. Other windows the title creates are left alone instead of ending the process on close. - The suspend thread and the 1 s deadline end the run through the title's own ExitProcess shim (process.cpp end_run), so the host finishes its cleanup, instead of TerminateProcess. - Suspend callbacks run under the (now recursive) registration lock and each id is looked up again before its call, so a routine never runs after UnregisterAppStateChangeNotification returned, and an unregister from inside a callback works. - docs/runtime_imports.md: speech, XLauncher and XAppCapture text matches the code; new lifecycle shim paragraph. - lifecycle_test: unregister-from-callback and title-window claim checks. AI-assisted. Tested: lifecycle_test (29 checks), xgameruntime_offline_test (69 checks), docs and gdk_runtime_calls pytest; clang 23 / mingw x64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ime/lifecycle: add silent speech WAV streams, display power requests, XAppCapture stub and suspend-on-close hook (RT-GDK-SPEECH-DISPLAY-LIFECYCLE) [Andretuta] # Conflicts: # scripts/build_runtime.ps1
…e XAppCapture's offline E_NOTIMPL availability - runtime_imports.md's served-classes note cited #4235/#4307/#4248, pull requests of the deleted predecessor repository (none exist in this one); the live PR serving XAccessibilityImpl and XLauncherImpl is ProjectLeonida#401 (RT-GDK-SPEECH-DISPLAY-LIFECYCLE), which also serves XAppCaptureImpl - noted as overlapping this pull request's g_app_capture. - The XGameRuntimeFeatureImpl row now states that XAppCapture being "served" means the class and interface ids answer QueryApiImpl while every method of the offline object returns E_NOTIMPL.
|
Coordination note from the RT-XAPPCAPTURE claim (#14): open pull request #537 also serves XAppCaptureImpl, and both pull requests update runtime/test/xgameruntime_test.cpp, tests/test_gdk_runtime_calls.py and docs/runtime_imports.md. If both merge, class a4f1aee2-4bf1-4485-b008-a7c26d52ac27 is served by two objects (one per xgameruntime*.cpp file), and the shared test/doc files conflict on whichever merges second. The difference: #537's layout was measured against the retail executable - it queries that class id for IXAppCaptureImpl4 and calls slot 5 (XAppCaptureTakeScreenshot), the executable's one thunk of the class; #537 serves the full 18-slot layout answering the class id and the v1-v4 interface ids, every method E_NOTIMPL offline. With it, all 158 thunks the executable references are served (the data point reported in #14). Proposal: drop the XAppCaptureImpl part from this pull request (the speech, display and lifecycle work has no overlap), or rebase this one after #537 lands and remove the duplicate class object plus its test/doc updates. Happy to discuss on the Discord if easier. |
…lifecycle shim (#401 review) - Speech is consistent now: XSpeechSynthesizerEnumerateInstalledVoices calls back once with a silent voice (XSpeechSynthesizerVoiceInformation in the GDK reference's layout), and SetCustomVoice accepts that voice id only. The enumeration takes (context, callback), the GDK reference's order; main read them the other way round. - XAppCaptureImpl is left to #537, which serves it in xgameruntime.cpp with its full layout. - The lifecycle shim (app-state callbacks, CreateWindowEx hook) moves to its own pull request. - docs/runtime_imports.md: the speech and launcher bullets match the code; the launcher's display power request is called out as a side effect on the host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings 58 PRs integration did not have (among them ProjectLeonida#359 ProjectLeonida#360 ProjectLeonida#402 ProjectLeonida#497 ProjectLeonida#557 ProjectLeonida#558 ProjectLeonida#560 ProjectLeonida#561 ProjectLeonida#572 ProjectLeonida#573 ProjectLeonida#574 ProjectLeonida#577) and the newer heads of ProjectLeonida#401 and ProjectLeonida#404. 15 files conflicted; resolved by hand: - frame_pacer.h, d3d12_xs_device.h/.cpp: ProjectLeonida#402's pacer (per-event ticks, issue_token_locked) now issues from ProjectLeonida#414's shared FrameTokenSource, so a token from the device-side WaitFrameEventX is one the pacer accepts (towade's ProjectLeonida#14 finding: without it every PresentX is refused). The dead frame_next_token and issued_ counters are dropped. Queue slot 32 stays ProjectLeonida#414's PresentX; ProjectLeonida#402's presentation-handler routes serve slot 30 or LEONIDA_XS_PRESENT_X_SLOT. ProjectLeonida#402's GetFrameStatisticsX route moves into ProjectLeonida#385's route_xbox_device_slot. - acphal.cpp/acphal_test.cpp: upstream's reworked SHAPE allocation and release; the release writes nothing through its first argument, as ProjectLeonida#405 requires; both sides' tests kept. Upstream's ProjectLeonida#401/ProjectLeonida#404 heads remove lifecycle.cpp and the C++ xma2_decoder.cpp (replaced by runtime/xma_decoder), so build_runtime.ps1's cl.exe list drops them and keeps ProjectLeonida#549's and ProjectLeonida#400's files. - vulkan_backend.h, statistics_sum.comp, its SPIR-V header, d3d12_mesh_test, replay_query_edges_test, d3d12_vulkan_device.cpp, docs: ProjectLeonida#577's clipping counter on top of ProjectLeonida#540, which both sides carry; the Timestamps sentence keeps integration's corrected wording (c33ce87). - xs_proxy_mock_test.cpp: both sides' cases; pr_conflict_label.py keeps the guarded reconfigure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n (XAppCapture offline E_NOTIMPL availability)
…lifecycle shim (ProjectLeonida#401 review) - Speech is consistent now: XSpeechSynthesizerEnumerateInstalledVoices calls back once with a silent voice (XSpeechSynthesizerVoiceInformation in the GDK reference's layout), and SetCustomVoice accepts that voice id only. The enumeration takes (context, callback), the GDK reference's order; main read them the other way round. - XAppCaptureImpl is left to ProjectLeonida#537, which serves it in xgameruntime.cpp with its full layout. - The lifecycle shim (app-state callbacks, CreateWindowEx hook) moves to its own pull request. - docs/runtime_imports.md: the speech and launcher bullets match the code; the launcher's display power request is called out as a side effect on the host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…w-hook lifecycle: suspend callbacks on window close and fit the title window (RT-GDK-SPEECH-DISPLAY-LIFECYCLE, split from #401)
… (split from ProjectLeonida#401) RegisterAppStateChangeNotification / UnregisterAppStateChangeNotification under api-ms-win-core-psm-appnotify-l1-1-0/-l1-1-1 and kernelbase.dll, and CreateWindowExW/A under user32.dll and ext-ms-win-rtcore-ntuser-window-l1-1-0/-l1-1-1, plus CreateWindowExA under ext-ms-win-rtcore-ntuser-window-ansi-l1-1-0, the set the title's import table names. The title's first top-level window is fitted to the work area and hooked: SC_CLOSE runs the suspend callbacks (quiesced TRUE) and ends the run through the title's ExitProcess, with a 1 s deadline. Split from ProjectLeonida#401 (a02134a), as the maintainer asked for one topic per pull request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claimed in the coordination issue as:
RT-GDK-SPEECH-DISPLAY-LIFECYCLE(#14 (comment))Split after review: this PR keeps the speech and launcher stubs. The lifecycle callback and
CreateWindowExhook are now in #769, andXAppCaptureImplis left to #537, which serves it with its full layout.What and why
XAccessibilityImplspeech (runtime/shims/xgameruntime_offline.cpp), consistent now:XSpeechSynthesizerEnumerateInstalledVoicescalls back once with one silent voice (leonida-silent,en-US), using theXSpeechSynthesizerVoiceInformationlayout of the GDK reference (Description,DisplayName,Gender,VoiceId,Language).XSpeechSynthesizerCreatehands out a synthesizer that speaks with it.SetCustomVoiceaccepts that voice id only. Streams from text and SSML return a valid 44-byte RIFF/WAVE header (16 kHz, 16-bit mono PCM, no samples), so a title that plays narration reads a silent stream.XSpeechSynthesizerEnumerateInstalledVoices(void* context, callback).mainread them the other way round, so a null context was refused withE_INVALIDARG.XLauncherImpl:XDisplayAcquireTimeoutDeferralcreates a Win32PowerCreateRequest/PowerSetRequest(PowerRequestDisplayRequired)request and returns its handle;XDisplayCloseTimeoutDeferralHandleclears and closes it. Side effect on the host: while the title holds a deferral, Windows keeps the PC's display on.XLaunchUristill fails (E_FAIL).docs/runtime_imports.md: the speech and launcher bullets match the code. The served-classes table and its paragraph are left alone, because RT-XAPPCAPTURE: serve XAppCaptureImpl in the xgameruntime shim - the exe's last unserved thunk #537 rewrites them; the two merge cleanly.Tested
xgameruntime_offline_test(69 checks, 0 failures) andxgameruntime_testpass under CTest. New checks: the enumeration passes its context back and reports one voice;SetCustomVoiceaccepts the enumerated id and refuses another id or null.test_gdk_runtime_callsand build-script pytest: 81 passed.GPUs tested: n/a (CPU-only GDK runtime tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — runtime shims only)🤖 Generated with Claude Code