Skip to content

Require Windows 10 and remove the format change broadcast - #158

Draft
eiz-claude wants to merge 3 commits into
mack/test-settle-after-racefrom
mack/fix-format-change-broadcast
Draft

eiz-claude wants to merge 3 commits into
mack/test-settle-after-racefrom
mack/fix-format-change-broadcast

Conversation

@eiz-claude

@eiz-claude eiz-claude commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Drops support for Windows 7 and 8 and removes the format-change broadcast, which only made sense there.

Require Windows 10

  • The x64 driver CI ships already targets Windows 10, and its catalog is generated for 10_X64 only. Nothing tests anything older.
  • The driver always encodes the format into endpoint IDs; the bare-ID path for Windows before 10 is gone.
  • The remaining Win32/ARM/ARM64 driver configurations target Windows 10.
  • SarAsio and the installer actions build with _WIN32_WINNT set to Windows 10.
  • README: Windows 10 or later, and the Windows 7 installation note (KB3033929) is removed.

Remove the format-change broadcast

Whenever any audio endpoint became active, SarAsio asked the driver to send KSEVENT_PINCAPS_FORMATCHANGE to 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::GetValue returns S_OK with VT_EMPTY for a missing key. So it fired for:

  • the host's own new endpoints;
  • every endpoint Windows rebuilt;
  • any other device appearing.

History:

  • The event was added in 2015 for Changes to supported sample rate not picked up by system audio engine #2: after a sample-rate change, the audio engine kept the old format until a reboot.
  • Windows 10's format cache ignored the event, so the driver started encoding channel count, sample rate and sample size into each endpoint's KS reference string. On 10+, an endpoint in a new format is a new endpoint to Windows.

With Windows 10 required, the event does nothing useful. This removes:

  • the broadcast itself;
  • SarAsio's endpoint notification client, which existed only to trigger it;
  • the driver's SAR_SEND_FORMAT_CHANGE_EVENT IOCTL (code 5 is left unused);
  • SarConfigure's -u switch, which sent it by hand.

Test

New format-* scenarios in the issues group run the same endpoint IDs:

  1. at 48 kHz;
  2. at 96 kHz;
  3. at 48 kHz again;
  4. in mono.

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):

build config invalidations per run
with the broadcast 16 pairs only 34, 116, 49 (3 runs)
without it 16 pairs only 0 in each of 8 runs
without it full suite, after the 1/4/8-pair runs 0, 5, 20

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

@eiz-claude
eiz-claude added this pull request to stack #154 October 3, 2026 18:22
eiz and others added 3 commits October 3, 2026 16:02
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
eiz-claude force-pushed the mack/fix-format-change-broadcast branch from 6452cf3 to 6e48a90 Compare October 3, 2026 20:19
@eiz-claude eiz-claude changed the title SarAsio: don't broadcast format changes on Windows 10 and later Require Windows 10 and remove the format change broadcast Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants