Repository navigation
Record computer audio on surround outputs, and say when it can't. - #91
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
adavila0703
force-pushed
the
fix/system-audio-surround
branch
from
November 27, 2026 17:29
f082662 to
bb8fc41
Compare
Merged
- On Windows 11, capture computer audio with process loopback (loopbackWithoutChrome) instead of device loopback: device loopback fails with AUDCLNT_E_UNSUPPORTED_FORMAT on a 7.1 output, so calls were recorded mic only. - When computer audio doesn't open, keep its track, retry three times and on output changes, and show a lasting message with Retry; losing it mid-recording is shown too, not only logged. - Dim the speaker meter while computer audio isn't being recorded.
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.
Summary
Capture (the fix). On Windows builds with process loopback (20348+, i.e. Windows 11), the display-media handler now answers with Chromium's
loopbackWithoutChromeinstead ofloopback. The choice lives insrc/main/systemAudioSource.ts; older Windows, macOS and Linux keeploopback. Electron typesaudioas'loopback' | 'loopbackWithMute'but passes Chromium's other loopback ids through, so there's one@ts-expect-errorwith the reason.Why. A Logitech PRO X set to 7.1 surround (8 ch, 44.1 kHz) got mic-only recordings every time. Chromium's log showed device loopback opening WASAPI in stereo float and
IAudioClient::Initializefailing with0x88890008(AUDCLNT_E_UNSUPPORTED_FORMAT). Process loopback has Windows convert the format, captures every app's audio but Lyra's own, and follows audio to whichever output it plays on.Failure handling. When computer audio doesn't open, the capture keeps a (silent) computer track and retries 3 times with backoff, and again on output-device changes. Computer audio has its own state (
off | live | retrying | unavailable | blocked,nextSystemAudioinaudio/recovery.ts) and its own toast, so a mic notice can't hide it: "Trying again…", then "Couldn't capture computer audio, so this is your microphone only." with Retry (macOS keeps Open Settings). Losing it mid-recording is shown, not only logged, and the speaker meter dims while it isn't recorded.Verified. Standalone Electron test on the affected machine:
loopback/loopbackWithMutefail withNotReadableError: Could not start audio source;loopbackWithoutChrome/loopbackAllDevicesopen with real signal. Inpnpm dev:system: "live",systemPeakRms0.11–0.15 with a call playing (was 0). Not run:qa-testaudio pass and speaker evals (transcription/labeling untouched). The new source still gets the renderer's default constraints (AEC/NS/AGC on), asloopbackdid.Checks
pnpm typecheck(viapnpm check, with new unit tests)pnpm smoke:ui