Repository navigation
feat(windows,audio,proto): plug the controller's microphone into Windows hosts through usbip-win2 - #151
Merged
Conversation
…ows hosts through usbip-win2 Windows hosts no longer use Steam Streaming Microphone (Steam had to be installed, its driver was installed from Steam's files with administrator rights, and its two sides usually needed exclusive mode). The controller's microphone is now Airhand Microphone, a USB Audio Class 1.0 microphone served by airhand-dock 0.3.0 and plugged through usbip-win2, like the gamepads: Windows drives it with its own usbaudio.sys, so nothing else is installed, no administrator rights, no exclusive mode, no sound settings changed, and it has the same name on every platform. - host/mic/usb.rs: plugged on the first "microphone on" of a session and ready once Windows has published its recording device (found by its interface name). The first time a computer sees it, Windows sets it up and briefly disables the recording device; the host waits for it to come back (about 6 s instead of 1 s). Turning the microphone off or switching connections doesn't unplug it, so programs that chose it don't fall back to the computer's own microphone; it is unplugged when every session that turned it on has ended (at once for a normal end, after 30 s without a reconnect otherwise). A fixed USB serial keeps programs' choice and the default device setting. - host/dock.rs: one airhand-dock Dock per process for gamepads and the microphone. - proto: MicState::NoDriver (usbip-win2 missing). NoDevice, SteamMissing and SetupFailed are only sent by older Windows hosts; the console keeps their texts. - The render loop's opener now says why it can't open yet (no driver, preparing) and polls faster while preparing; device format parsing for WASAPI is gone, as are the zip and tempfile dependencies. - Installer, usbip-win2 README and docs describe usbip-win2 as the gamepad and microphone driver. - Tests: mic_reaches_airhand_microphone records a 1 kHz tone back through the real device (AIRHAND_TEST_MIC_SERIAL simulates a first plug); e2e_mic uses it on Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows hosts no longer put the controller's microphone into Steam Streaming Microphone (Steam had to be installed, its driver was installed from Steam's files with administrator rights, and its two sides usually needed exclusive mode). The microphone is now Airhand Microphone, a USB Audio Class 1.0 microphone from airhand-dock 0.3.0 plugged through usbip-win2 like the gamepads. Windows drives it with its own
usbaudio.sys: nothing else to install, no administrator rights, no exclusive mode, no sound settings changed, and the same name as on Mac and Linux.Host (
client/src-tauri/src/host/mic/usb.rs)USB\VID_1D6B&PID_0101\<serial>) is only reported ready once its recording device has settled, about 6 s.host/dock.rs: one airhand-dockDockper process for gamepads and the microphone.zipdependency are gone.Protocol and UI
MicState::NoDriver(usbip-win2 missing); the host re-checks every 5 s, so installing it needs no restart.NoDevice,SteamMissingandSetupFailedare only sent by older Windows hosts, and the console keeps their texts. Older controllers treatNoDriveras unsupported.Tests
mic_reaches_airhand_microphone(Windows, usbip-win2 0.9.8.1): records a 1 kHz tone back through the real device with no gaps; still plugged after the microphone is turned off and after a dropped session, unplugged after a normal end.AIRHAND_TEST_MIC_SERIAL=<new>simulates a first plug (ready after ≈6 s, no invalidated recording).e2e_micthrough a local relay with 1 in 7 datagrams dropped: 3 s of tone, 0 silent 10 ms windows.e2e_roundtripandplugs_a_virtual_gamepadpass.cargo test --lib, clippy,npm test,airhand-proto/airhand-linktests pass. macOS and Linux builds weren't compiled here; their code changes are the opener signature and the new no-opended/MicSession.