Skip to content

fix(cli): explicit audio-input flags override persisted disable_audio#3804

Merged
louis030195 merged 1 commit into
screenpipe:mainfrom
BohdanChuprynka:fix/3648-audio-device-implies-enable
Jun 3, 2026
Merged

fix(cli): explicit audio-input flags override persisted disable_audio#3804
louis030195 merged 1 commit into
screenpipe:mainfrom
BohdanChuprynka:fix/3648-audio-device-implies-enable

Conversation

@BohdanChuprynka

Copy link
Copy Markdown
Contributor

Problem

When ~/.screenpipe/store.bin has disable_audio: true, passing --audio-device "<name>" on the CLI is silently ignored. In RecordArgs::apply_explicit_overrides (crates/screenpipe-engine/src/cli/mod.rs), an explicit --audio-device sets audio_devices and clears use_system_default_audio but never touches disable_audio, so the persisted disable_audio: true wins and recording stays off. There is no CLI flag to flip it back; the only workaround is deleting store.bin.

Reported in #3648 (caught after about 9 days of silent audio outage: video kept recording and /health looked fine, so it was easy to miss).

Fix

Treat an explicit --audio-device or --use-system-default-audio as a signal that the user wants audio on, so it clears a persisted disable_audio: true and logs a warning when it does. An explicit --disable-audio on the same invocation still wins (guarded), and when no audio flag is passed the persisted value is left untouched.

Because --audio-device counts as a recording override, the resolved settings (with disable_audio cleared) are persisted back to store.bin, the same as every other override flag, so a later run without flags keeps audio on.

The report also proposed a separate --enable-audio flag (Option B); treating the existing audio-input flags as the enable signal keeps the surface smaller and matches the reporter's stated preference.

Testing

cargo test -p screenpipe-engine --lib. Added three unit tests covering the precedence:

  • --audio-device over persisted disable_audio: true re-enables audio and sets the device,
  • explicit --disable-audio still wins when combined with --audio-device,
  • absent audio flags leave a persisted disable_audio: true unchanged.

Closes #3648.

When the persisted settings store has disable_audio: true, passing
--audio-device on the command line was silently ignored:
apply_explicit_overrides set audio_devices but never cleared disable_audio,
so recording stayed off with no CLI way to re-enable it short of deleting
store.bin. Reported in screenpipe#3648.

Treat an explicit --audio-device or --use-system-default-audio as a signal
that the user wants audio on, clearing a persisted disable_audio and logging
a warning when it does. An explicit --disable-audio on the same invocation
still wins, and absent flags leave the persisted value untouched.

Adds unit tests for the three precedence cases.

@louis030195 louis030195 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

crates/screenpipe-engine/src/cli/mod.rs:1028 — @BohdanChuprynka does coreaudio system flag also override disable_audio?

generated by the screenpipe pr-review pipe (https://screenpi.pe), not written by a human — reply and tag @louis030195 if it got something wrong.

@louis030195 louis030195 merged commit 597a0e0 into screenpipe:main Jun 3, 2026
11 checks passed
louis030195 pushed a commit that referenced this pull request Jun 3, 2026
Vision-side mirror of #3804. An explicit --monitor-id / --use-all-monitors now
clears a persisted disable_vision:true; otherwise the monitor is set but screen
capture stays off — the same silent failure as the audio case in #3648. An
explicit --disable-vision on the same command still wins (guarded), and a
flag-less run leaves the persisted value untouched (use_all_monitors's true
default is not counted as an explicit source).

Adds 3 unit tests covering the precedence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

--audio-device is silently overridden by persisted store.bin (disable_audio=true is sticky, no way to flip it off via CLI)

2 participants