GameInput: a player for the DualSense's haptic actuators over USB audio #705
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/710"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by MrCheese5 on 2026-11-24T03:59:13Z.
Stacked on #552 and #709; only the top commit belongs here.
Over USB the DualSense is also a 4-channel audio output, and its channels 3 and 4 drive the two voice-coil actuators.
dualsense_hapticsfinds that output by name with WASAPI (shared mode) and plays from a thread of its own. The title's big motor becomes a 100 Hz tone, mostly on the left, and the small motor a 230 Hz tone, mostly on the right. The amplitudes glide over 10 ms so level changes do not click, and the speaker channels stay silent.start()refuses an output with fewer than 4 channels, so the caller can keep compatible rumble.Nothing starts it yet; #731 does. The
windowscrate gets three features for the device property store:Win32_System_Com_StructuredStorage,Win32_System_VariantandWin32_UI_Shell_PropertiesSystem. No new crates.What is in it
crates/xcl/src/hle/dualsense_haptics.rs: the synthesiser and the WASAPI player, with tests of the synthesiser (only the actuator channels play, the cross-mix, the glide, each tone's frequency by zero crossings)crates/xcl/Cargo.toml: the three featurescrates/xcl/src/hle/mod.rs: the moduleTested
cargo test -p xcl --lib dualsense_haptics: 2 passedcargo test --workspace -- --test-threads=1: 698 passed, 0 failed, 41 ignored; SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64)--test-threads=4, GPU tests on this machine hang or lose the device tonight onmaintoo (bdab194and91f9a5e;bdab194had passed with 4 threads earlier the same night, and the driver logs GPU errors). Single-threaded,main91f9a5epasses (cargo test -p xcl --lib -- --test-threads=1: 647 passed, 0 failed).Regression run
Both runs use a fresh data root of their own. The title is not driven by a controller during the run, so this shows that nothing else changes, not the new path.
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T04:46:55Z.
Tested exact head
4eebfdc(on its base91f9a5e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 698 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Not tested
scripts/smoke.ps1(no title on this machine), AMD, a release build.AI use
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:00:50Z.
Test run of
4eebfdca13fe91e94f0892435242854f96d7c001on AMD RDNA4. I merged it onto currentmain64b3f35locally (clean merge), so the tree tested includes the stack under it (#552, #709).Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 707 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 666 passed, 0 failed, 21 ignoredSKIPPED; thedualsense_hapticstests pass (no DualSense attached, so no WASAPI output was opened).Review: I reviewed the top commit only, as the description asks.
Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
upstream-sync referenced this pull request2026-11-24 13:02:47 +00:00
upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:18:29Z.
Empirical test report (
4eebfdca)Hardware / environment
4eebfdca13fe91e94f0892435242854f96d7c001, checked out detached on STOR-WINLAB.x86_64-pc-windows-msvc. DXC 1.9.2609.5 (01b62ad47). Cargo test profile unoptimized, with debug info and incremental compilation disabled.XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1. The build and all three runs were outsideInvoke-ArcTest.ps1, with no Arc GPU mutex held.Commands and results
cargo test --workspace --no-runcargo test -p xcl --lib hle::dualsense_haptics::tests::cargo test -p xcl --lib hle::dualsense_report::tests::cargo test -p xcl --lib hle::playstation::tests::The total was 6 passed, 0 failed, 0 ignored, and 0 case-sensitive
SKIPPEDlines. Each focused invocation filtered out 677 tests. The build emitted a deprecation warning forAtomic::fetch_updatein XGameRuntime.Observed behavior
Not tested
Physical DualSense USB audio hardware, Windows audio endpoint discovery and playback, the full GPU workspace suite, and game smoke runs.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr710-focused.log and published.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:54:23Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-26T16:55:32Z.
Code review location:
crates/xcl/src/hle/dualsense_haptics.rs; line 144Could this check inspect
WAVEFORMATEXTENSIBLE.SubFormatinstead of treating every 32-bit extensible format as float? Extensible formats can be either PCM or IEEE float; with a 32-bit PCM mix format, this branch selects the float render path and copies f32 bit patterns into an integer PCM stream. Please accept only the supported PCM/float subformats and add a focused format-selection test. AI-assisted review: I checked this against the Windows format definition, but I did not run tests.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:59:36Z.
Triage (#1607) – head
4eebfdcStacked on #552 (merged) and #709; only
4eebfdcbelongs here, and #715 / #731 build on it. No other open or merged PR plays haptics on the DualSense's USB audio channels.Minor, in
dualsense_haptics.rs:start: when the thread takes longer than 3 s to answer,startreturns false (the caller keeps compatible rumble) but the thread keeps going and may start playing too; andstartright afterstopreturns true while the old thread is still exiting, so nothing plays. Nothing calls it yet.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.