Skip to content

ios.simulator.audio keeps every simulator silent #1238

Closed

Description

@V3RON

Part of #1118.

Scope

An operator sets ios.simulator.audio: false on a worker and restarts the daemon; from then on, every simulator Simlock makes ready for a lease on that worker has its volume set to 0 before it is ready, so no sound reaches the Mac's speakers. When the volume command fails, the device stays in use and the daemon log warns. The configuration reference lists the key.

In short

After this PR, a worker with ios.simulator.audio: false sets each simulator's volume to 0 right after it boots, on every makeReady (prepare: a new copy for a lease or the warm pool; recover: a reboot while leased), then hands the device on. If the command fails, it logs a warning. It does not check afterwards that the simulator took the change: the slow lane does, on each new Xcode. Apps keep playing at volume 0. The setting unset or true changes nothing. Baseline sources, booted to make copies from, are not touched: a copy's volume starts at 60 and its own makeReady silences it.

flowchart LR
  B[simctl boot + bootstatus, as today] --> S{ios.simulator.audio}
  S -->|true| R[ready, as today]
  S -->|false| V[set volume 0 - new] --> R
  V -->|command failed| W[warn in daemon log - new] --> R
Loading
$ simlock config set ios.simulator.audio false
Updated ios.simulator.audio in ~/.simlock/config.json; takes effect on daemon restart.

The daemon log line when it fails, at warn: Could not silence iOS simulator with deviceId and detail (the failed command's stderr, or timed out).

ios.simulator.audio Today After
unset loads; sound plays loads as true; sound plays
true Unknown config key warning; sound plays loads; sound plays
false Unknown config key warning; sound plays loads; silent
"no" Unknown config key warning invalid config naming ios.simulator.audio, as any non-boolean

If this goes wrong, a simulator on a silent worker plays sound out loud with no warning in the log.

Technical spec

Facts

Commit 0aa6a58, and PR #1210 (task #1204) where named.

# Fact Source
F1 Every boot of a device for a lease goes through makeReady (purpose prepare or recover), which calls #bootAndWait (simctl boot, bootstatus -b, an installer probe). On #1204's branch #makeSeed also calls #bootAndWait for a baseline source in the sources set src/drivers/ios/index.ts:761-787, src/drivers/ios/index.ts:799-817, src/core/managed-device-lifecycle.ts:171-175, src/core/managed-device-lifecycle.ts:240-244; PR #1210 src/drivers/ios/index.ts #makeSeed (await this.#bootAndWait(udid, sourceId, BOOTSTATUS_TIMEOUT_MS, this.#sourcesSet))
F2 On #1204's branch each simulator serves one lease and is destroyed; the next lease gets a new copy made ready with prepare; reclaim is for physical devices only #1204 body ("Every simulator and emulator serves one lease and is destroyed when it ends"; "reclaim and reclaimStrategy are for physical devices only")
F3 ios config today: defaultMode, defaultModels, slim; defaults and validator beside android.emulator (audio: boolean, default true, booleanValue); an unknown key warns Unknown config key: "<path>" src/core/config.ts:365-380, src/core/config.ts:395, src/core/config.ts:998-1015, src/core/config.ts:1162-1177, src/core/validation.ts:41
F4 The contract's config shape mirrors it, and is config.get's output; a field the schema does not declare is stripped from the answer src/contract/schemas.ts:1032-1047, src/contract/operations.ts:621-627, src/contract/AGENTS.md (Rules)
F5 A change to a contract shape file goes with a PROTOCOL_VERSION_RANGE bump (the protocol-bump check); #1206, #1207 and #1208 each bump it on the baselines stack .agents/scripts/protocol-bump-check.mjs:2-9; PR #1235 and PR #1236 change src/contract/protocol.ts; #1208 Modules touched
F6 The daemon passes config.ios.slim to the iOS driver and logs a slim skip at warn through the driver's onSlimSkipped callback; main.ts exports the bridge it builds for onSlimmed (emitSlimDiagnostic), tested in main.test.ts src/daemon/main.ts:466, src/daemon/main.ts:1433-1439, src/daemon/main.ts:1634, src/drivers/ios/index.ts:196
F7 In a booted simulator, simctl spawn <udid> notifyutil -s com.apple.springboard.volumestate 0 and notifyutil -p com.apple.springboard.volumestate both exit 0, and notifyutil -g com.apple.springboard.volumestate then prints com.apple.springboard.volumestate 0 (60 before). -g of an unknown key also prints 0, so -g proves nothing run on iOS 27.0 / Xcode 27.0, 2026-11-03 (this session)
F8 <data>/var/run/simulatoraudio/audiosettings.plist is an XML plist with sim_volume. After the volume command it read 60 for 4 s (iOS 26.4) and 13 s (iOS 27.0), then 0. It keeps 0 after shutdown, and reads 60 again once the next boot + bootstatus -b return, so a read after makeReady's boot never sees the last boot's value plutil -extract sim_volume raw, polled each second, iOS 26.4 (Xcode 26.4.1) and 27.0 (Xcode 27.0), 2026-11-03 (this session)
F9 Volume 0 made the simulator's output samples exactly 0 on iOS 26.4 and 27.0, slim or not; apps kept playing and went quiet within a second; the volume resets to 60 after shutdown+boot, simctl erase and simctl clone spike findings, #1118 (comment)
F10 notifyutil is in every installed iOS runtime, 18.0 to 27.0 (RuntimeRoot/usr/bin/notifyutil) ls of each runtime bundle, 2026-11-03 (this session)
F11 The configuration reference lists android.emulator.audio in its "Devices and drivers" table website/src/content/docs/docs/reference/configuration.mdx:202 (page)

Modules touched

Searches: android.emulator, emulator.audio, ios.slim, slim: in src/core/config.ts, src/contract/schemas.ts, src/daemon/main.ts, website/; #bootAndWait, makeReady in src/drivers/ios.

  • src/core/config.ts — ios.simulator.audio: type, default true, validator.
  • src/contract/schemas.ts — the config shape gains ios.simulator.audio; this PR bumps the protocol by one (src/contract/protocol.ts).
  • src/daemon/main.ts — passes the value to the iOS driver; exports logSilenceFailure(logger), the failure callback that logs the warning.
  • src/drivers/ios/index.ts — the option and the step in makeReady; src/drivers/ios/AGENTS.md says it.
  • website/src/content/docs/docs/reference/configuration.mdx — the row.
  • e2e/slow-ios-audio.test.ts — new slow-lane file.
flowchart LR
  CFG[core/config - changed] --> MAIN[daemon/main - changed]
  MAIN --> DRV[drivers/ios makeReady - changed]
  DRV --> SIMCTL[xcrun simctl spawn notifyutil]
  DRV -->|onSilenceFailed| LOG[logSilenceFailure: daemon log warn]
Loading

Contract and event changes

  • configSchema.ios.simulator: { audio: z.boolean() }, required in the output (the loaded config always has it). This PR bumps the protocol by one.
  • Config file ios.simulator.audio: boolean; any other type is an invalid config naming the key, as android.emulator.audio (F3).
  • No event: the failure is a log line, as a slim skip (F6).

Other code on the same state

Searches: volumestate, simulatoraudio, notifyutil in src/ and e2e/ (0 hits).

  • Slim mode disables launchd jobs before a second boot; the volume step runs after the last boot, and the spike found no conflict with every slim label disabled (F9).
  • simlock simctl passthrough lets a holder reboot its simulator or change its volume; Simlock does not re-apply (feature Non-goals).

Failure modes

Call Outcome What happens Limit, counted from
simctl spawn … notifyutil -s … 0, then -p both exit 0 device ready 30 s each (COMMAND_TIMEOUT_MS), from each call
same non-zero exit, timeout, or spawn error device ready; warning, detail the stderr or timed out as above

No state written by Simlock: the volume lives in the booted simulator. A daemon restart mid-step leaves a booted device whose next boot sets the volume again.

Rules in play

  • Feature Decisions: "granted with a warning in the daemon log, not failed" and "no check that the volume took" — makeReady never throws for the volume step and reads nothing back. A copy booted under load takes the volume 45 to 110 s after its boot began (sim audio bridge busy; no earlier signal found; a wait before sending does not help), so the step sends once and does not wait (decided in delivery, pending the maintainer).
  • Feature Non-goals: no host-wide audio change — the step only talks to the simulator.
  • src/core/config.ts:381-387 (android block's comment): "the core validates each value's type and hands the block to the driver without interpreting it" — the driver reads the boolean; the core only validates it.

Tests

Seam: the iOS driver's makeReady with a fake process runner, modelled on src/drivers/ios/index.test.ts ("slim mode", :1978); config on loadConfig and config.get, modelled on src/core/config.test.ts and src/contract/operations.test.ts:1299; the log bridge modelled on emitSlimDiagnostic's test in src/daemon/main.test.ts; slow lane modelled on e2e/slow-ios-slim.test.ts.

  • An operator sets ios.simulator.audio and the daemon loads it and answers it in config.get; cases: unset → true; true; false; "no" → invalid config naming the key; config.get returns ios.simulator.audio.
  • Simlock makes a simulator ready with ios.simulator.audio: false, and sets its volume to 0 before handing it on; cases: prepare; recover; slim and full; the setting true → no notifyutil call; the volume command fails or times out → device ready, onSilenceFailed with the stderr or timed out.
  • The daemon logs a silence failure; cases: one failure gives one warn line Could not silence iOS simulator with deviceId and detail.
  • A leased simulator on a worker with ios.simulator.audio: false reads volume 0; cases: first lease; a second lease (a new copy); after a recovery reboot (slow lane, e2e/slow-ios-audio.test.ts, waiting up to 120 s from the grant for sim_volume 0 in audiosettings.plist, and the daemon log holding no Could not silence iOS simulator line).

Done when

  • The Tests lines pass; the fourth in the slow lane (e2e/slow-ios-audio.test.ts, needs a Mac with Xcode and an iOS runtime).
  • The configuration reference lists ios.simulator.audio beside android.emulator.audio: boolean, default true, "false sets each simulator's volume to 0 after every boot; apps still play, unheard. On a busy Mac the volume can take up to 2 minutes after boot to reach 0. A Mac still counts audio as playing while an app plays.", Worker.
  • src/drivers/ios/AGENTS.md says the volume step and its warning.
  • The website build and its HTTP API check pass (the config shape changed).

Out of scope

  • A per-lease option, physical devices, Android, baseline sources, re-applying after a holder's own reboot or volume change, simlock doctor.

Depends on

Written by an agent.

Activity

  1. added
    task:draft
    on Nov 3, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Nov 3, 2026
  3. self-assigned this
    on Nov 4, 2026
  4. V3RON commented on Nov 4, 2026

    @V3RON
    ContributorAuthor

    Handoff

    Done: PR #1258 (head 3f0772c) builds ios.simulator.audio. Unit tests 5/5 green, audit done, review round 1 passed with 0 findings.

    Not done: Slow lane, e2e/slow-ios-audio.test.ts. The first lease reads volume 0. The second lease (a fresh copy, booted while the warm pool boots another) stays at sim_volume 60 for 60 s or more, even though notifyutil -s/-p exit 0 and notifyutil -g reads 0. 13 of 14 lane runs failed (15:16–16:24). Three fixes were tried and reverted.

    Findings: The one run that passed (simlock-slow-e2e-20261104-162105.log) had debug steps (a screenshot and a launchctl dump) before the check. That points to timing: SpringBoard not yet ready to take the volume after the boot under load. Scratch device sets do not reproduce it.

    Blocked on: a maintainer decision. Should the driver read audiosettings.plist back and retry, or wait for SpringBoard? Either reverses the spec's "no check that the volume took".

    Written by an agent.

  5. added
    task:blocked
    and removed
    task:ready
    on Nov 4, 2026
  6. removed their assignment
    on Nov 4, 2026
  7. added
    task:ready
    and removed
    task:blocked
    on Nov 4, 2026
  8. self-assigned this
    on Nov 4, 2026
  9. added a commit that references this issue on Nov 4, 2026
    7bb8ff7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

task:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions