Skip to content

ZoomIt: Fix silent recording audio on multichannel audio endpoints - #49400

Open
markrussinovich wants to merge 2 commits into
microsoft:mainfrom
markrussinovich:zoomit-fix-multichannel-audio
Open

ZoomIt: Fix silent recording audio on multichannel audio endpoints#49400
markrussinovich wants to merge 2 commits into
microsoft:mainfrom
markrussinovich:zoomit-fix-multichannel-audio

Conversation

@markrussinovich

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Two ZoomIt recording fixes:

  1. Fix silent recording audio on multichannel audio endpoints. On machines where the audio engine's processing format for the default render device is multichannel — most commonly when spatial sound (Windows Sonic / Dolby Atmos) is enabled — AudioGraph.EncodingProperties() reports 8 channels even though the device's shared-mode mix format is stereo. ZoomIt passed that channel count straight into AudioEncodingProperties::CreateAac() and the AudioStreamDescriptor, and the recording's audio track came out as 8-channel HE-AAC (AOT 5/SBR, 24 kHz core, channelConfiguration=7). The Media Foundation AAC decoder supports at most 5.1 AAC-LC, so players cannot decode the track and recordings play back silent for both microphone and system audio, with no error shown. The fix re-creates the AudioGraph with an explicit stereo format at the device sample rate whenever the default format has more than two channels (falling back to the default format if stereo creation fails). The microphone input node, loopback channel mapping, AAC encoding profile, and MediaStreamSource descriptor all inherit the graph format, so no other changes are needed.

  2. Record options tab layout cleanup. Left-align the "Record Toggle:" label and the two audio capture checkbox labels at the dialog margin (they previously had ragged left edges from right-aligned text), keep the capture checkboxes in the same column as the noise cancellation checkbox, and put the control block on a uniform 16-DLU row pitch (rows were previously spaced 18/18/18/18/14/15).

PR Checklist

  • Closes: no linked issue — found while dogfooding recording on a spatial-sound-enabled machine
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass — manual validation only (see below); the failure depends on host audio-endpoint configuration
  • Localization: All end-user-facing strings can be localized (no new strings; dialog layout coordinates only)
  • Dev docs: Added/updated
  • New binaries: Added on the required places

Detailed Description of the Pull Request / Additional comments

Root-cause analysis of the silent audio: parsing a repro MP4 showed a soun track with stsd/mp4a channels=8 and an esds AudioSpecificConfig of 2B 39 88 00 — HE-AAC (audioObjectType 5), 24 kHz core with SBR extension to 48 kHz, channelConfiguration 7 (7.1). MediaTranscoder.PrepareFileTranscodeAsync on that file fails to decode the audio, matching what every player does (video plays, audio silently missing). The channel count originated from AudioGraph.EncodingProperties() returning 48 kHz/8ch float on the repro machine even though IAudioClient::GetMixFormat for the same endpoint reports stereo.

The fix is confined to AudioSampleGenerator::InitializeAsync: if the freshly created graph reports more than 2 channels, close it and re-create it with AudioGraphSettings.EncodingProperties set to the same subtype/sample rate/bits but ChannelCount = 2. On stereo-endpoint machines the new path never executes.

Validation Steps Performed

  • Automated end-to-end repro on an affected machine (AudioGraph reporting 48 kHz/8ch): recorded the screen with both "Capture audio input" and "Capture system audio" enabled while a 440 Hz reference tone played through the default output.
  • Before the fix: audio track was 8-ch HE-AAC, undecodable by Media Foundation (silent in Media Player).
  • After the fix: audio track is standard stereo AAC-LC 48 kHz (esds decoder config 11 90, 1024-sample frames); decoding the track via MediaTranscoder to WAV succeeds; the PCM measures RMS −11.5 dBFS with a clean spectral peak at 440 Hz (Goertzel: magnitude 5999 at 440 Hz vs ≤17 at neighboring frequencies). Microphone audio is mixed into the same (now decodable) track.
  • Verified the stereo-graph re-creation path succeeds on the affected machine and is skipped on stereo endpoints.
  • Record options tab: rebuilt and visually verified label alignment, checkbox column alignment, and even row spacing in the rendered dialog.

Mark Russinovich and others added 2 commits July 18, 2026 11:54
When the audio engine's processing format for the default render device
is multichannel (e.g. 7.1 with spatial sound enabled), AudioGraph
inherits that channel count and the recording's AAC track is encoded
with 8 channels. The encoder produces a multichannel HE-AAC stream that
most decoders (including the Media Foundation AAC decoder, which
supports at most 5.1 AAC-LC) cannot play, so recordings play back
silent for both microphone and system audio.

Re-create the AudioGraph with an explicit stereo format at the device
sample rate when the default format has more than two channels.
Everything downstream (microphone input node, loopback channel mapping,
AAC encoding profile, MediaStreamSource descriptor) inherits the stereo
format, so no other changes are needed.

Co-Authored-By: Claude Mythos 5 <noreply@anthropic.com>
Left-align the Record Toggle label and the two audio capture checkbox
labels at the dialog margin (they previously had ragged left edges from
right-aligned text), keep the capture checkboxes in the same column as
the noise cancellation checkbox, and put the whole control block on a
uniform 16-DLU row pitch (rows were previously spaced 18/18/18/18/14/15).

Co-Authored-By: Claude Mythos 5 <noreply@anthropic.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added Area-Localization issues regarding to Localization the application Product-ZoomIt Refers to the ZoomIt tool labels Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Localization issues regarding to Localization the application Product-ZoomIt Refers to the ZoomIt tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants