Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/sync-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,53 @@ jobs:
sudo apt-get update
sudo apt-get install -y mesa-vulkan-drivers libvulkan1

# Hosted Windows runners have no audio endpoint, so WASAPI loopback
# capture (system audio) cannot run at all without a virtual sound
# card. Scream provides a signed null render device; with it installed,
# the loopback keepalive, AUDCLNT_BUFFERFLAGS_SILENT zeroing and QPC
# capture timestamps are exercised against a real audio engine.
#
# Pinned to 3.6: later releases (3.8/4.0) were signed after the 2021
# kernel cross-signing deprecation and PnP blocks their install on an
# interactive consent prompt, which hangs headless runners. The step
# timeout turns any such hang into a fast failure.
- name: Install virtual audio device (Windows)
if: runner.os == 'Windows'
timeout-minutes: 10
shell: pwsh
run: |
Invoke-WebRequest -Uri https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile Scream3.6.zip
$expected = "25ea5e778b4e6995a98d448b9b5f6d321f681663f1aeeec69d8e63183d008b19"
$actual = (Get-FileHash -Algorithm SHA256 Scream3.6.zip).Hash.ToLowerInvariant()
if ($actual -ne $expected) { throw "Scream3.6.zip SHA-256 mismatch: got $actual, expected $expected" }
Expand-Archive -Path Scream3.6.zip -DestinationPath Scream
$cert = (Get-AuthenticodeSignature Scream\Install\driver\Scream.sys).SignerCertificate

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We’re importing a cert from the downloaded zip straight into LocalMachine\\TrustedPublisher. It’d be good to sanity-check the Authenticode signature first (at least ensure it’s actually signed and not hash-mismatched) before trusting the signer cert.

Suggested change
$cert = (Get-AuthenticodeSignature Scream\Install\driver\Scream.sys).SignerCertificate
$sig = Get-AuthenticodeSignature Scream\Install\driver\Scream.sys
if (-not $sig.SignerCertificate -or $sig.Status -in @('NotSigned','HashMismatch')) { throw "Scream.sys signature invalid: $($sig.Status)" }
$cert = $sig.SignerCertificate

$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine")
$store.Open("ReadWrite")
$store.Add($cert)
$store.Close()
Scream\Install\helpers\devcon.exe install Scream\Install\driver\Scream.inf *Scream
if ($LASTEXITCODE -gt 1) { throw "devcon install failed with exit code $LASTEXITCODE" }
Start-Service -Name Audiosrv -ErrorAction SilentlyContinue

- name: Timestamp pipeline unit + property tests
shell: bash
run: |
cargo test --locked -p cap-timestamp -p cap-enc-ffmpeg
cargo test --locked -p cap-recording --lib
cargo test --locked -p cap-rendering

# Runs against the Scream endpoint installed above; the env var turns
# a missing endpoint (driver install regression) into a hard failure
# instead of a silent skip.
- name: WASAPI loopback endpoint tests (Windows)
if: runner.os == 'Windows'
shell: bash
env:
CAP_REQUIRE_AUDIO_ENDPOINT: "1"
run: |
cargo test --locked -p cap-recording --test windows_loopback -- --nocapture

- name: Synthetic device matrix
id: matrix
continue-on-error: true
Expand Down
25 changes: 13 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ members = [
[workspace.dependencies]
anyhow = { version = "1.0.86" }
# This includes a currently-unreleased fix that ensures the audio stream is actually
# stopped and released on drop on macOS
cpal = { git = "https://github.com/CapSoftware/cpal", rev = "3cc779a7b4ca" }
# stopped and released on drop on macOS, plus zeroing of WASAPI capture
# packets flagged AUDCLNT_BUFFERFLAGS_SILENT (loopback of an idle endpoint
# otherwise surfaces unspecified buffer contents as audio).
cpal = { git = "https://github.com/CapSoftware/cpal", rev = "6013cb5f8bd3" }
ffmpeg = { package = "ffmpeg-next", git = "https://github.com/CapSoftware/rust-ffmpeg", rev = "49db1fede112" }
tokio = { version = "1.39.3", features = [
"macros",
Expand Down
Loading
Loading