Skip to content

host/audio_input: a DualSense's USB mic is selected and unmuted - #2999

Open
The-Inceptions wants to merge 1 commit into
seedds:mainfrom
The-Inceptions:dualsense-usb-mic
Open

The-Inceptions wants to merge 1 commit into
seedds:mainfrom
The-Inceptions:dualsense-usb-mic

Conversation

@The-Inceptions

Copy link
Copy Markdown
Contributor

What and why

A DualSense on a USB cable is a USB audio input, so the Mac microphone capture from #1822 (taken into main as c25d4011) records it like any microphone, but the controller's own mic can be muted or in power saving. Over Bluetooth it is in no input-device list at all.

When the capture opens a DualSense's USB audio (Sony's, on USB, with a DualSense or DualSense Edge HID device on USB beside it), the host first sends output report 0x02 (SetState) with only the mic sections allowed: the built-in mic, its volume at the top, echo and noise cancelling off, nothing muted, no power saving. The light bar, triggers and rumble keep what GameController set. dualsense_mic.c builds the report (no IOKit, so a test checks it byte for byte), and audio_input_dualsense.m finds the HID device in the registry and sends it, after the capture's permission check. The launcher's device picker marks that device "(USB)", for which the launcher now links IOKit. The report layout is from the controllers wiki's DualSense data structures and awalol/DS5Dongle (MIT).

The new reference entry "A DualSense's microphone over Bluetooth" (docs/reference/audio.md, with a line in the Ocarina of Time note and the symptom index) records why the controller's mic cannot be used over Bluetooth on a Mac: with the mic streaming (output report 0x32), GameController reads every mic frame, an input report 0x31 with byte 1 bit 1 set, as the pad's state (about 1,300 button presses and 300 sticks past half in 5 s with the controller lying still), and the Mac's 15 ms Bluetooth polling carries 43 of the mic's 100 frames a second.

Checked

  • Tests: make -C dm/host/tests GAME=0400486024DEC000 dualsense-mic (the report, byte for byte) and audio-input; the launcher type-check; the host test suite (make -C dm/host/tests GAME=0400486024DEC000 run); make -C dm/gfx/tests GAME=0400486024DEC000 -k run on Apple silicon: everything but check_t_dlss_mfx and check_t_dlss_scaler, which fail the same way on main (0b5fd602); test_usage, test_nsp_mac_app, test_docs, test_env_switches; python3 dm/tools/docs_symptoms.py (no change); lint_c.py tidy --against main with LLVM 23.1.4: no finding in the changed files (the one file/check pair above the baseline, bugprone-suspicious-memory-comparison in dm/gfx/tests/t_gl_imports.m, is in a file this change does not touch); lint_python.py --against main: 0 new
  • Games run: Ocarina of Time (0400486024DEC000, v131072), on Audio input streams on the Mac's microphone: Ocarina of Time's ocarina can be played into it, with a launcher permission step, device picker and gain #1822's capture before it was reworked into main (the hook sits at the same point here, after the permission check): the log's DualSense over USB (...): built-in mic selected and unmuted, capture at 48 kHz stereo with no underruns, zero fill or drops, and a live hum taken for Zelda's Lullaby at gain 2. Not yet played on this base.
  • Devices and OS: MacBook Pro, M5 Pro, macOS 27.2; a DualSense on a USB-C cable, and over Bluetooth for the reference entry. Not checked: a DualSense Edge.
  • regress.py: regress.py impact maps the change to the hle:*InputStream* rows (the games that import the SDK's input streams; its new files are in dm/tools/impact_map.tsv). The new code runs only when the microphone is on (DM_MIC=1) and the selected input is a DualSense on USB, so no game's default path changes and no regress.py check was run.

Docs

  • The finding is in its docs/reference/audio.md entry and the game note, and python3 dm/tools/docs_symptoms.py was run (the symptom index)
  • No game files, keys or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

A DualSense on a USB cable is a USB audio input device that the AUHAL capture records like any
microphone, but its mic can be muted or in power saving. Over Bluetooth it is in no input-device
list at all.

When the capture opens a DualSense's USB audio (Sony's, on USB, with a DualSense or DualSense Edge
HID device on USB beside it), the host first sends output report 0x02 (SetState) with only the mic
sections allowed: the built-in mic, its volume at the top, echo and noise cancelling off, nothing
muted, no power saving. The light bar, triggers and rumble keep what GameController set.
dualsense_mic.c builds the report (no IOKit, so a test checks it byte for byte), and
audio_input_dualsense.m finds the HID device in the registry and sends it. The launcher's picker
marks that device "(USB)", for which the launcher now links IOKit. The report's layout is from the
controllers wiki's DualSense data structures and awalol/DS5Dongle (MIT).

Over Bluetooth the host never asks for the mic. The new reference entry "A DualSense's microphone
over Bluetooth" (docs/reference/audio.md) records why that cannot work on a Mac: with the mic
streaming (output report 0x32), GameController reads every mic frame, an input report 0x31 with
byte 1 bit 1 set, as the pad's state (about 1,300 button presses and 300 sticks past half in 5 s
with the controller lying still), and the Mac's 15 ms Bluetooth polling carries 43 of the mic's
100 frames a second.

Checked on this base: t_dualsense_mic (make -C dm/host/tests GAME=<id> dualsense-mic), the host
test suite, test_nsp_mac_app and the launcher type-check. In the game, on seedds#1822's capture before
it was reworked into main (the hook sits at the same point, after the permission check): Ocarina
of Time (0400486024DEC000, v131072) on an M5 Pro with macOS 27.2 and a DualSense on a USB-C
cable: the log's "DualSense over USB (...): built-in mic selected and unmuted", captures at 48 kHz
stereo with no underruns, zero fill or drops, and a live hum taken for Zelda's Lullaby at gain 2.
Not checked: a DualSense Edge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers mac The Mac front end and app (dm/mac, front_mac.m) tools Tools and scripts (dm/tools, scripts) docs Documentation game: 0400486024DEC000 A game labels Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0400486024DEC000 A game host The Horizon host: SVCs, services, threads, memory (dm/host) mac The Mac front end and app (dm/mac, front_mac.m) packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant