fix(host/audio): the mic pair gets the pad-proven coherent stereo stamp set

The user challenged the format-locked-pins verdict, and the pad program
is the counter-evidence: it hit the SAME 0x88890008 unopenable-endpoint
signature and cured it with a COHERENT stamp set, after which the same
driver family served 4ch happily. This branch previous attempts were
contaminated twice over — a float device-format (the pad bisect proved
the split must be PCM16 device / float mix+host) and no
AudioEndpointBuilder restart (Restart-Service Audiosrv never touches its
dependency, so endpoint configs were never rebuilt). Both mic endpoints
now get one identical coherent stereo set; the octave-low hypothesis
shifts from "raw crossing by design" to "the two endpoint stores
disagreed (stereo render default vs mono capture default)".
This commit is contained in:
2026-08-07 16:33:20 +02:00
parent cc53b3d6b0
commit 2eed9823e5
@@ -318,19 +318,21 @@ const WFX_F32_2CH_48K: [u8; 40] = [
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b,
0x71, // KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
];
/// The capture pin's one format: 1 ch / 48 kHz / 32-bit float, mask 0x4 (FRONT_CENTER).
const WFX_F32_1CH_48K: [u8; 40] = [
/// The PCM16 leg of the stereo set — the pad program's measured coherence rule: the DEVICE
/// format is 16-bit PCM, the mix/host formats float (a float device-format was part of the
/// incoherent sets that made endpoints unopenable).
const WFX_PCM16_2CH_48K: [u8; 40] = [
0xfe, 0xff, // wFormatTag = WAVE_FORMAT_EXTENSIBLE
0x01, 0x00, // nChannels = 1
0x02, 0x00, // nChannels = 2
0x80, 0xbb, 0x00, 0x00, // nSamplesPerSec = 48000
0x00, 0xee, 0x02, 0x00, // nAvgBytesPerSec = 192000
0x04, 0x00, // nBlockAlign = 4
0x20, 0x00, // wBitsPerSample = 32
0x10, 0x00, // wBitsPerSample = 16
0x16, 0x00, // cbSize = 22
0x20, 0x00, // wValidBitsPerSample = 32
0x04, 0x00, 0x00, 0x00, // dwChannelMask = SPEAKER_FRONT_CENTER
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b,
0x71, // KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
0x10, 0x00, // wValidBitsPerSample = 16
0x03, 0x00, 0x00, 0x00, // dwChannelMask = FL | FR
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b,
0x71, // KSDATAFORMAT_SUBTYPE_PCM
];
/// Best-effort: write the role's display name — plus, on the mic RENDER, the mono format set —
@@ -349,37 +351,36 @@ fn stamp_identity(endpoint_id: &str, role: Role, capture: bool) {
value: pe::StampValue::Str("Punktfunk"),
},
];
// Format stamps pin each mic-pair side to ITS pin's one supported format — measured: the
// render pin is stereo-only and the capture pin mono-only (stamping either differently
// makes the endpoint unopenable, 0x88890008 on every Initialize). These stamps exist to
// HEAL endpoints an earlier build of this branch mis-stamped, and to keep the pair pinned
// against drift; they cannot fix the raw crossing (see [`minted_ids`]).
// The mic pair gets ONE coherent stereo format set on BOTH endpoints, in the exact
// PCM16-device/float-mix split the pad program's stamp bisect proved the driver accepts
// (its first "unopenable endpoint" and "format can't be changed" verdicts were both
// incoherent-stamp artifacts — this branch re-derived the same false verdicts before the
// pad recipe was re-applied). Both sides identical: the driver moves one stream between
// the two endpoints, and the octave-low voice was the two sides DISAGREEING (stereo
// render default vs mono capture default). `capture` steers nothing today — kept so a
// per-direction split stays one edit away.
let _ = capture;
if role == Role::Mic {
let wfx: &'static [u8; 40] = if capture {
&WFX_F32_1CH_48K
} else {
&WFX_F32_2CH_48K
};
stamps.extend([
pe::Stamp {
label: "device-format",
key: pe::PKEY_DEVICE_FORMAT,
value: pe::StampValue::Format(wfx),
value: pe::StampValue::Format(&WFX_PCM16_2CH_48K),
},
pe::Stamp {
label: "mix-format-2",
key: pe::PKEY_MIX_FORMAT_2,
value: pe::StampValue::Format(wfx),
value: pe::StampValue::Format(&WFX_F32_2CH_48K),
},
pe::Stamp {
label: "mix-format-3",
key: pe::PKEY_MIX_FORMAT_3,
value: pe::StampValue::Format(wfx),
value: pe::StampValue::Format(&WFX_F32_2CH_48K),
},
pe::Stamp {
label: "host-format",
key: pe::PKEY_HOST_FORMAT,
value: pe::StampValue::Format(wfx),
value: pe::StampValue::Format(&WFX_F32_2CH_48K),
},
]);
}