fix(audio): support up to 64 microphone devices #751
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8015c9a
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!751
Loading…
Reference in a new issue
No description provided.
Delete branch "Phishinabowl/Longshot:fix/microphone-device-limit"
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?
Type: fix · Risk: low · Tested on: Windows and Ubuntu 24.04 WSL2 native fixtures; RTX 3080 RC4 integration play-test · Needs: native Linux build and real microphone validation; request T-9DPF submitted, awaiting maintainer approval
Why
PCs with many physical or virtual recording endpoints can have their preferred microphone omitted from Longshot's selector. Both the host and menu stop listing devices at 16. This affects setups using audio-routing software such as Voicemeeter or VB-Audio Matrix, even when Windows lists the missing device normally.
Raise both limits to 64 so those devices can be selected explicitly. Searches of the public issue tracker for microphone, mic, audio input and 64 devices did not identify a directly matching issue among the returned results.
How to reproduce
Seen on: Windows desktop with a Ryzen 9 5900XT, RTX 3080 and approximately 28 recording endpoints, including VB-Audio Matrix devices. Exact OS build and GPU driver were not recorded for the original report.
Settings and switches: Default microphone selection initially; no special switch is required.
Steps: With more than 16 recording endpoints, open the Insert menu, then Gameplay → Microphone on upstream RC4/current main. Cycle through the named devices and look for an endpoint beyond the first 16.
Expected: The desired recording endpoint is available by name.
Actual: The selector omits endpoints after the first 16. Default may still work if Windows routes it to the intended endpoint.
What changed
The host and menu now retain up to 64 recording endpoints. Selection by name, Default, Off and missing-device fallback keep their existing behavior.
Published source: implementation
22eb623fe0b6a2abcd1b78d485d6535a4ccfc691, documentation/test recordsee8ab5f05d7447bf3b5c111adc29561c24a5551f, based on maina00c485c71f50d3e698985d91a3f72edfb1ea020.MAX_DEVICESfrom 16 to 64 inhost/nn_audio_in.cso enumeration and device recovery use the expanded list.kMaxMicsfrom 16 to 64 ingpu/vk/vk_menu.cppso the selector can display every endpoint the host retains.tests/test_audio_in.pywith a 70-endpoint fixture covering an endpoint at index 23, the final supported endpoint at index 63, truncation at 64, disconnect/reconnect under a new ID, retained selection by name and Default.README.mdanddocs/development.md; add fifteen identified fixture/suite run records underdocs/tested/and a scoped guide-image review indocs/images/guide/source-review-microphone-device-limit.md.This PR contains the device-limit fix, its tests and supporting documentation. The microphone menu move, output selector, test button, meter and gain controls are separate changes.
Existing guide screenshots remain unchanged. The only published Longshot settings image shows Graphics, while this selector is on Gameplay. The limit change adds no row, label, layout or help-text change. The screenshot review records this decision and the existing upstream fingerprint drift; no PNG or capture/review fingerprint is refreshed. New high-index entries are demonstrated by the failing/passing regression rather than a replacement of an unaffected guide image. No pixel-equivalence or fresh-render claim is made.
Measurements
Verdict: After one warm-up of each variant, two interleaved main/fix pairs on each platform gave identical correctness results: main fails at the expanded-list boundary in 2/2 measured runs; the fix passes 55 native input-stream cases and the menu fixture in 2/2. This holds on Windows and Ubuntu WSL2. The full Windows suite separately completed with 537 passed, 21 failed and 35 skipped; 20 failures reproduce on main, and the remaining control-tool test passed on both main and an isolated topic-branch rerun.
Baseline: the failing control uses unchanged production sources exported from main
9e6f231dwith this PR's new test copied into the source snapshot. The passing runs measured implementation snapshoted097a30. The published PR head isee8ab5f0; its three implementation/test files are byte-identical to that measured snapshot, verified by an empty scoped Git diff. The final rebase adds only upstream's release-workflow skill (a00c485c) and our supporting docs/run records; no executable input changed, so the measured regression and suite evidence remain applicable. Historical run records retain the commits actually tested. In-game feedback comes from an RC4 integration build containing other audio changes and is supplementary evidence, not an isolated current-main play-test.Hardware: Windows desktop; native fixtures use fake SDL/menu state and no GPU. Supplementary RC4 gameplay used an RTX 3080 and Ryzen 9 5900XT; its original test log does not record the OS build, GPU driver or RAM.
Scene: game-free native host/menu fixtures on Windows and Linux; supplementary manual device-selection testing in the RC4 integration build.
Method: LLVM-MinGW on Windows and GCC/G++ 13.3.0 on Ubuntu 24.04.5 WSL2 compiled the host and extracted menu fixtures with warnings treated as errors. On each platform, run one main and one fix warm-up, excluded from results, then main → fix → main → fix sequentially on the same PC with unchanged compiler flags and fake-SDL inputs. Source hashes match the previously validated sources. Correctness is pass/fail, not a performance metric. Elapsed medians below are diagnostic only: the failing control exits before the complete passing test, so they cannot establish speed or overhead. No FPS or memory benchmark was taken.
How to reproduce: run
python -I -B tests/test_audio_in.py --cc clang --cxx clang++with the LLVM-MinGW binaries and runtime DLLs on PATH. For the failing control, run the same new test with unchanged current-main production sources. Runpython -I -B tests/run_all.py --jobs 4for the full suite.9e6f231dEach measured main invocation printed the following assertion, then the Python driver reported the native fixture's nonzero exit status 43 (driver exit 1). Both measured fix invocations on each platform printed the two PASS lines below (driver exit 0). Temporary-path tracebacks are omitted from this excerpt.
Flags and settings
No flags, menu rows or ini keys are added. The existing Microphone selector's fixed endpoint capacity changes.
Testing
Tested: Implementation snapshot
ed097a30, based on main9e6f231d. LLVM-MinGW: unchanged main fails the new regression; the fix passes 55 native host cases and the menu fixture.git diff --checkpasses, andgit range-diffconfirmed the first rebase preserved the original patch. Final published headee8ab5f0is based on current maina00c485c; an empty scoped diff verifies that host input source, menu source and the microphone test remain identical to the measured snapshot. The full Windows game-free runner completed: 537 passed, 21 failed, 35 skipped in 287 seconds. Rerunning its 21 failed checks on unmodified main gave 20 failures and one pass. The one passing check,test_longshot_ctl.py, then also passed in isolation on the measured topic (48 seconds); its full-run failure read an empty receipt file. No new reproducible failure remains observed from this patch. Supplementary microphone selection feedback comes from an RC4 integration build with additional audio changes.The following 20 checks fail on both this branch and unmodified main in the same environment:
test_fpx_sticky.py,test_cpp_preflight.py,test_appimage_player_build.py,test_cpm_discovery.py,test_crash_dialog.py,test_env_on.py,test_lift_cleanup_error.py,test_linux_preflight.py,test_make_game_cache.py,test_make_game_prepare.py,test_missing_nup.py,test_oot_state_tap.py,test_options_budget_once.py,test_readback_late.py,test_release.py,test_spawn_emit.py,test_tested_configurations.py,test_vk_pgo.py,test_walk_key.py, andtest_work_lock.py. These include Windows fixture/cleanup failures, toolchain/environment limitations, and source assertions; they are not all classified as upstream production bugs. The 35 skips are the runner's default Windows/platform rules, including GPU/game-dependent and Linux-only checks. No skipped check is counted as a pass.Tested on Linux: Ubuntu 24.04.5 WSL2, Python 3.12.3, GCC/G++ 13.3.0. The identical new regression fails on unchanged main at the expanded-list boundary (fixture exit 43), then passes all 55 native host cases and the menu fixture on the rebased fix. Both compile with warnings treated as errors; SDL and device events are fake.
Interleaved confirmation: Windows and Linux each completed one excluded warm-up per variant and two measured main/fix pairs. All four measured main controls failed for the expected boundary assertion; all four measured fix runs passed the host and menu checks. The published implementation/test files still match
ed097a30; supporting docs/run records are now committed. Individual run records identify each platform, pair, variant and result. All 25 documentation-record validation tests passed in WSL.Not tested: An isolated current-main game build/play-test, full Linux host/game build or real-device capture, real 64-endpoint hardware, memory/timing overhead, and the 35 runner-skipped checks. Baseline failures remain unresolved; the suite is not entirely green.
Must be tested:
tests/test_audio_in.py, and check Gameplay → Microphone with Off, Default and a named microphone; enable the game's microphone input where it reads the mic, expecting a successful build, passing fixtures, silence with Off, and actual input with Default/the chosen microphone. Unplug/reconnect the chosen device if supported, expecting default fallback and recovery of the saved selection (Test Farm: @Beanstalk linux, build and real microphone/default/named-device regression). Report distro, SDL backend, tested commit, device setup and the result. With more than 16 real endpoints available, also check a high-index device; this hardware setup is optional because the 64-endpoint boundary is already covered by native fixtures.Linux test request T-9DPF has been submitted through the project's test-request queue for this PR. It is waiting for a maintainer to add
testing wantedbefore it can be claimed, because this PR is from a fork rather than an upstream collaborator. No tester or result is implied. Keep the PR WIP until the outstanding Linux evidence is in. A full local WSL game build is not required to ask another tester for that coverage.Risks
What could break: Enumeration arrays become larger and high-endpoint setups perform more name comparisons. The limit remains finite: endpoints after the first 64 are still omitted. Existing duplicate-name and saved-name truncation behavior is unchanged. Resource cost has not been benchmarked.
Turning it off: Revert this focused commit; no runtime switch is introduced.
Compatibility: No save or options format change, no new ini keys, no renderer interface change or ABI bump, and no builder/tool dependency change. Existing selection remains name-based. The two production changes do not modify shader translation; shader/pipeline cache behavior is unchanged by this fix.
Checklist
Everyone
type(scope): description) of the status line's type.main(a00c485c, fetched 2026-11-15). The only upstream change since the measured base is a release-workflow skill; executable/test inputs are unchanged.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). Full run completed; 20 baseline failures are named above, and the remaining intermittent check passed on a topic rerun. 35 platform skips are disclosed.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.docs/tested/for each new measured run (format indocs/tested-configurations.md). Fifteen self-contained records include the eight measured interleaved invocations, initial Windows/Linux controls and passing fixtures, full suite, main-baseline comparison and isolated retry. Warm-ups are logged separately and excluded from measurements.mainand passing here.tests/that reads changed source updated in this PR, not weakened.@Beanstalk linux: Please verify a native Linux build and real microphone capture for this 16-to-64 endpoint fix. Test request T-9DPF is already submitted in the project queue.
Build PR head
ee8ab5f0using the development guide and runtests/test_audio_in.py. Then check Gameplay → Microphone with Off, Default and a named device while the game's microphone mode is actively reading. Expect a successful build, passing fixtures, silence with Off, and real input with Default/the chosen microphone. If supported, unplug/reconnect the chosen device and check default fallback and recovery. An existing setup with more than 16 recording endpoints would provide additional high-index coverage, but is optional.Please report the tested commit, distro, SDL/audio backend, device setup and results. Windows and WSL2 native fixtures already reproduce the expected main failure and pass two interleaved pairs with the fix. Real Linux audio capture remains untested; this PR stays WIP pending that evidence.
Maintainer: please add
testing wantedso the existing request can be claimed. The request tool reports that fork-contributor requests wait for this approval.@Phishinabowl only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it.Beanstalk test farm
Commit
d1f75a7· tier untrusted · approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.ee8ab5f05dd1f75a75bfWIP: fix(audio): support up to 64 microphone devicesto fix(audio): support up to 64 microphone devices