Repository navigation
Conversation
… a channel and a test on the Audio tab
The ocarina's microphone mode (humming or playing an instrument) heard nothing through a Focusrite Scarlett Solo 4th
Gen: Windows' processed stream, which SDL's recording opens whatever SDL_AUDIO_DEVICE_RAW_STREAM says (SDL 3.4.20),
gave apps only the interface's first channel, silent, while the XLR microphone was on its second, and SDL's mono mix
of the 4 channels would have cut it to a quarter anyway. There was also no way to make a quiet microphone louder or
to see what the game hears.
- host/hos_sdl.c: on Windows the microphone is opened through WASAPI's raw stream (AUDCLNT_STREAMOPTIONS_RAW: every
channel, no capture effects), found by the name SDL lists it under, read by a thread of its own into an SDL audio
stream that converts it to the format asked for. One that cannot be opened this way, HOS_MIC_RAW=0, or SDL2: SDL's
own recording, as before. hos_sdl_mic_channels: the device's channel count.
- host/nn_audio_in.c: a mono stream's microphone is opened with the device's own channels and one is given to the
game: the Microphone channel row's (HOS_OPT_MIC_CHANNEL), or on Auto the louder of the first two (an interface's
inputs; its loopbacks of what the PC plays come after them, so the ocarina does not hear the game's music). The
Microphone volume (HOS_OPT_MIC_GAIN, 0 to 400 %) scales it, clipped at full scale; 100 % leaves it untouched.
- Test microphone (MkwVkHost mic_test, API version bump): the chosen microphone opened on its own while the Audio
tab shows the test, a level meter at the volume, the steady note it hears (McLeod pitch, 60 to 1500 Hz) and the
channel ("ch 2/4"). Let go when the menu closes or another tab shows.
- The Microphone row moves from Gameplay to Audio, beside Microphone volume, Microphone channel and Test microphone.
- tests/test_audio_in.py: the volume (every format, clipping, through a stream), a 4-channel device (Auto's second
channel, a loud loopback left out, the menu's channel, one past the device's), the test's states, level and channel,
the pitch (tones, a hum's harmonics, noise, silence), the notes and meter, the option ids on both sides, and that
Windows opens raw before SDL.
Measured on the Scarlett while humming: SDL's processed stream -84 dB on every channel; the raw path, through
hos_sdl.c itself, -13 to -39 dB on channel 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Joey-Magnus
reviewed
Nov 11, 2026
This was referenced Nov 11, 2026
Draft
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.
The ocarina's microphone mode (humming or playing an instrument) heard nothing through an audio interface such as a Focusrite Scarlett Solo 4th Gen, and there was no way to make a quiet microphone louder or to see what the game hears. This PR makes the microphone work on such interfaces and adds a volume, a channel choice and a test to the Audio tab.
Why the ocarina heard nothing
The Scarlett Solo lists 4 channels: its two inputs, then two loopbacks of what the PC plays. Windows' processed capture stream, the one SDL's recording opens, gave apps only the first channel. On this setup that channel is silent, while the XLR microphone arrives on the second. The device opened with no error, and the game read silence.
Measured on the Scarlett while humming:
SDL_AUDIO_DEVICE_RAW_STREAM=1(SDL 3.4.20)AUDCLNT_STREAMOPTIONS_RAW), through this PR'shos_sdl.cSDL's mono mix of the 4 channels would also have cut a single-input microphone to a quarter (−12 dB).
What changed
host/hos_sdl.c: on Windows, the microphone is opened through WASAPI's raw stream: every channel, no capture effects. It's found by the name SDL lists it under, and read by a thread of its own into an SDL audio stream that converts it to the format the game asks for. It falls back to SDL's own recording, as before, when the device can't be opened this way, withHOS_MIC_RAW=0, or on SDL2 (Linux).hos_sdl_mic_channelsgives the device's channel count.host/nn_audio_in.c:Test microphone (new
MkwVkHost::mic_test,MKWVK_API_VERSION18): opens the chosen microphone on its own while the Audio tab shows the test, and shows:The microphone is released when the menu closes or another tab shows.
Menu: the Microphone row moves from Gameplay to Audio, next to Microphone volume, Microphone channel and Test microphone. New options in the ini:
microphone_volume(HOS_OPT_MIC_GAIN29) andmicrophone_channel(HOS_OPT_MIC_CHANNEL30).Docs: the README's menu table and Microphone notes, and the development guide's options table.
How it was tested
tests/test_audio_in.py(76 cases, no game, no hardware):python -I -B tests/run_all.py. 3 checks fail, and all 3 also fail on unmodifiedmainon this PC:test_fpx_stickyandnx2/test_nup_paths(toolchain/encoding environment) andtest_vram_budget_row(an unused-constant warning in its fixture with this clang).hos_sdl.c's microphone path, compiled into a small harness on Windows 11 (build 26300) with a Scarlett Solo 4th Gen. The raw path opened 4 channels and the microphone came through on channel 2 (the table above).the default microphone open (48000 Hz, its 4 channels, one given to the game: Auto, ...), and the microphone works in game (reporter confirmed). Screenshots to follow.Not tested / open questions
🤖 Generated with Claude Code