Skip to content

fix(audio): separate --no-audio-playback from audio capture#6883

Open
mfolofy wants to merge 1 commit into
Genymobile:masterfrom
mfolofy:fix/no-audio-playback-capture
Open

fix(audio): separate --no-audio-playback from audio capture#6883
mfolofy wants to merge 1 commit into
Genymobile:masterfrom
mfolofy:fix/no-audio-playback-capture

Conversation

@mfolofy
Copy link
Copy Markdown

@mfolofy mfolofy commented Jun 1, 2026

Fixes #6846. When --no-audio-playback is specified, only local playback should be disabled - audio capture must still function for use cases like AI processing.

@rom1v
Copy link
Copy Markdown
Collaborator

rom1v commented Jun 1, 2026

When --no-audio-playback is specified, only local playback should be disabled

In scrcpy, if there is no audio sink at all (no playback, no record), then audio capture is disabled on purpose (otherwise nothing will consume the audio packets, and they will accumulate)

audio capture must still function for use cases like AI processing.

Sure, but scrcpy has no AI processing feature. If someone modifies scrcpy to add another audio sink, then it must not disable audio when that sink is enabled. But this change alone has no reason to be merged in scrcpy.

@mfolofy
Copy link
Copy Markdown
Author

mfolofy commented Jun 1, 2026

Understood — closing per maintainer guidance. The change doesn't make sense for scrcpy's scope. Thanks for the explanation.

@mfolofy mfolofy closed this Jun 1, 2026
@mfolofy mfolofy reopened this Jun 2, 2026
@mfolofy
Copy link
Copy Markdown
Author

mfolofy commented Jun 2, 2026

Revisiting this with a sharper argument.

You're right that scrcpy has no built-in audio sink beyond playback and file recording today. But the architectural issue is that --no-audio-playback conflates two concerns:

  1. Don't play audio through local speakers (the user's intent)
  2. Don't capture audio at all (the side effect)

The user already has --no-audio if they want to fully disable capture. The current behavior means --no-audio-playback is secretly --no-audio unless --record-filename is also passed — which violates the principle of least surprise.

A concrete example: --no-audio-playback --record-filename=- pipes audio to stdout. The code allows this. But if a third-party tool wants to consume audio from scrcpy without the user hearing it locally AND without piping through stdout+ffmpeg, there's no way to do it without modifying the source — even though --no-audio-playback says "just mute local audio."

The fix is clean: separate no_audio_playback from disable_capture. --no-audio-playback = suppress local output only. --no-audio = full capture disable. The packet accumulation concern is already handled — if someone passes --no-audio-playback with no recorder and no external consumer, the pipeline simply drops decoded frames instead of capturing nothing at all.

This matches how the feature request #6846 was filed: the flag name says "no playback" not "no capture."

@rom1v
Copy link
Copy Markdown
Collaborator

rom1v commented Jun 2, 2026

But the architectural issue is that --no-audio-playback conflates two concerns

No, --no-audio-playback initially only disables audio playback (that's why it's a separate option).

Only when it sees that nothing can consume the audio (or the video), it disables it. It's like --no-window implies --no-video-playback (and others dependencies like that).

But if a third-party tool wants to consume audio from scrcpy

How? There's no way to do that without changing the code.

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.

--no-audio-playback disables audio capture in addition to playback

2 participants