Skip to content

Stop Linux mic detection from counting Anarlog's own ALSA stream - #8286

Open
vitorhmcorreia wants to merge 3 commits into
fastrepl:mainfrom
vitorhmcorreia:fix/linux-detect-own-alsa-mic-stream
Open

vitorhmcorreia wants to merge 3 commits into
fastrepl:mainfrom
vitorhmcorreia:fix/linux-detect-own-alsa-mic-stream

Conversation

@vitorhmcorreia

@vitorhmcorreia vitorhmcorreia commented Nov 25, 2026 •

Copy link
Copy Markdown

Summary

Context: On Linux with PipeWire, Anarlog's own microphone capture is listed by PulseAudio as a source output whose application.name is PipeWire ALSA [anarlog] and which has no application.process.binary, so linux::list_mic_using_apps reports it with both id and name set to that string. On desktop 1.4.36 (Ubuntu 26.04, PipeWire 1.6.2), the journal shows detected event=MicStarted([InstalledApp { id: "PipeWire ALSA [anarlog]", ... }]) right after a recording starts, and mic_detected app_id=PipeWire ALSA [anarlog] threshold_secs=15 once the threshold passes.

Intention: is_self_app only matches exact self names, bundle IDs and .app paths, so Anarlog's own recording is tracked as another app using the microphone. It then shows up in every mic-app snapshot, for example the one confirmAutoStop takes. It isn't offered in the exclusion list either (that list shows "Anarlog"), so users can't exclude it.

Direction: Unwrap the ALSA client names that PipeWire (PipeWire ALSA [<process>]) and PulseAudio's ALSA plugin (ALSA plug-in [<process>]) give, and compare the process name with the existing SELF_APP_NAMES, reading hyphens as spaces so anarlog-nightly matches anarlog nightly. Other apps' wrapped names, such as PipeWire ALSA [teams], are unaffected.

Demo

N/A: a filter change with no UI. Before and after is the journal line above disappearing once the stream is recognized.

Verification

  • Local (Ubuntu 26.04, x86_64): cargo test -p detect --features list,mic --lib: 110 passed, including new cases in is_self_app_matches_only_anarlog_identities (own stream in PipeWire and PulseAudio form, the nightly name, and non-matches [teams], [charm] and trailing text).
  • cargo clippy -p detect --features list,mic --lib --tests: no findings in the changed file; rustfmt --edition 2024 --check clean.
  • Not run: a packaged build. The stream naming was observed on 1.4.36 with pactl list source-outputs and the app's journal.

🤖 Generated with Claude Code


Summary by cubic

Stops Linux mic detection from counting Anarlog's own ALSA stream as another app using the microphone, and also recognizes the dev build's stream.

On Linux with PipeWire, Anarlog's capture appears as PipeWire ALSA [anarlog] (or ALSA plug-in [anarlog] on PulseAudio) with no process binary, so is_self_app never matched it and the mic tracker treated it as another app using the mic. is_self_app now unwraps those ALSA client names and compares the process name against the self app names, treating hyphens as spaces so anarlog-nightly matches anarlog nightly. The dev build's anarlog-dev name is now included as anarlog dev so a development build also recognizes its own stream. Other apps' wrapped names, such as PipeWire ALSA [teams], are unaffected.

Written for commit e742722. Summary will update on new commits.

View guided diff

On PipeWire, the app's microphone capture is listed as
"PipeWire ALSA [anarlog]" (PulseAudio's ALSA plugin uses
"ALSA plug-in [anarlog]"), with no process binary, so is_self_app never
matched it and the mic tracker treated Anarlog as another app using the
microphone. Unwrap that client name and compare the process name with
the existing self names (hyphens as spaces, so anarlog-nightly matches
"anarlog nightly").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

is_self_app now checks parsed process names from supported PipeWire ALSA and ALSA plug-in client names against SELF_APP_NAMES, using both the app ID and name. SELF_APP_NAMES now includes anarlog dev. Tests cover Anarlog matches, unrelated names, and malformed client names.

Suggested reviewers: computelesscomputer

Merge Risk: Minimal · up to e7427

This change stops Linux microphone detection from treating Anarlog's own ALSA capture stream as another app using the microphone. Other wrapped app names such as Teams are intended to be unaffected, and unit tests cover those cases. No merge-blocking risk was found; the only gap is that no packaged build was run.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: Linux microphone detection will stop counting Anarlog's own ALSA stream as another app. The changeset adds ALSA client-name unwrapping to is_self_app in crates/detect…
Description check Passed The description explains the problem (PipeWire ALSA [anarlog] stream treated as another app), the intended fix (unwrapping ALSA client names and comparing against SELF_APP_NAMES), and the verification…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: Linux microphone detection will stop counting Anarlog's own ALSA stream as another app. The changeset adds ALSA client-name unwrapping to is_self_app in crates/detect/src/list/mod.rs, which matches this title. The title is specific and concise.

Full details: Description check

Explanation

The description explains the problem (PipeWire ALSA [anarlog] stream treated as another app), the intended fix (unwrapping ALSA client names and comparing against SELF_APP_NAMES), and the verification steps. It relates directly to the changes in is_self_app and the tests described in the summary.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 1c5f44df-b689-41f1-8eb0-b57f915071cc
Commits

Reviewing files that changed from the base of the PR and between 96395b2 and e742722.

Files selected for processing: 1

  • crates/detect/src/list/mod.rs
Files with no reviewable changes: 1

  • crates/detect/src/list/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

anarlog-dev normalizes to "anarlog dev", which was missing from the
self names, so a development build still saw its own microphone stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant