Repository navigation
Require Windows 10 and remove the format change broadcast - #158
Draft
eiz-claude wants to merge 3 commits into
Draft
eiz-claude wants to merge 3 commits into
eiz-claude wants to merge 3 commits into
Conversation
Issue #2: after the host's sample rate changed, the audio engine kept the endpoint's old format until a reboot. Adds format-* scenarios to the issues group that run the same endpoint IDs at 48 kHz, 96 kHz, 48 kHz again and then in mono, and SarTest --expect-format, which fails streams whose engine format doesn't match --rate and --channels. Streams also record their engine sample rate. The channel step uses mono because Windows gives SAR endpoints with more than two channels a stereo shared-mode format even when they are new (seen with fresh IDs at four and eight channels), so a four-channel step can't distinguish a stale format from that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows 7 and 8 have been out of support for years, the x64 driver already targets Windows 10 (its catalog is generated for 10_X64 only), and nothing tests anything older. Drop what was left for them: - The driver always encodes the format into endpoint IDs; the bare-ID path for Windows before 10 is gone. - The driver's remaining Win32/ARM/ARM64 configurations target Windows 10, and SarAsio and the installer actions build with _WIN32_WINNT for Windows 10. - README: Windows 10 or later, and no Windows 7 installation note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whenever any audio endpoint became active, SarAsio had the driver send KSEVENT_PINCAPS_FORMATCHANGE to every SAR filter on its next tick, and the audio engine invalidated every stream open on a SAR endpoint. Its check for SAR endpoints passes for any endpoint (IPropertyStore returns S_OK and VT_EMPTY for a missing key), so starting a host invalidated its own fresh streams, and so did every endpoint Windows rebuilt and any other device appearing. The event was added for #2, so the audio engine would re-read the format of an endpoint recreated at a different sample rate. It wasn't enough on Windows 10, whose format cache ignored it, so the driver also puts the channel count, sample rate and sample size into each endpoint's KS reference string there, which makes such an endpoint a new one to Windows. With Windows 10 required, the event does nothing useful. Remove it, SarAsio's endpoint notification client that only existed to trigger it, the driver's SAR_SEND_FORMAT_CHANGE_EVENT IOCTL, and SarConfigure's -u switch that sent it by hand. On the test VM (16 endpoint pairs, three start/stop iterations), the loopback run saw 34 to 116 stream invalidations per run with the broadcast (3 runs) and none without it (8 runs). The format-* checks (same endpoint IDs at 48 kHz, 96 kHz and 48 kHz again) pass with and without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eiz-claude
force-pushed
the
mack/fix-format-change-broadcast
branch
from
October 3, 2026 20:19
6452cf3 to
6e48a90
Compare
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.
Drops support for Windows 7 and 8 and removes the format-change broadcast, which only made sense there.
Require Windows 10
10_X64only. Nothing tests anything older._WIN32_WINNTset to Windows 10.Remove the format-change broadcast
Whenever any audio endpoint became active, SarAsio asked the driver to send
KSEVENT_PINCAPS_FORMATCHANGEto every SAR filter on its next tick. The audio engine then invalidated every stream open on a SAR endpoint.SarAsio's check for SAR endpoints passed for any endpoint, because
IPropertyStore::GetValuereturnsS_OKwithVT_EMPTYfor a missing key. So it fired for:History:
With Windows 10 required, the event does nothing useful. This removes:
SAR_SEND_FORMAT_CHANGE_EVENTIOCTL (code 5 is left unused);-uswitch, which sent it by hand.Test
New
format-*scenarios in the issues group run the same endpoint IDs:Each step fails if a stream's engine format doesn't match (
SarTest --expect-format). On the test VM all four pass with and without the broadcast. The engine format follows every change: 48000/2, 96000/2, 48000/2, 48000/1.Stream invalidations in the 16-pair loopback run (
run-16x2):The remaining full-suite invalidations come from the endpoint builder rebuilding endpoints after the matrix's 1 s restarts (see #157). They hit endpoints in creation order about 0.5 s apart, in the 2nd and 3rd iterations.
Found along the way, not changed
Windows gives SAR endpoints with more than two channels a stereo shared-mode format, even brand-new ones (seen with fresh IDs at 4 and 8 channels; mono endpoints get mono). Apps that use the Windows mixer only reach the first two channels unless a different speaker or default format is set in Windows. That's why the format checks use mono for the channel step.
🤖 Generated with Claude Code