Skip to content

Do not show a modal error when input monitoring cannot open the device - #12073

Merged
grliszas14 merged 1 commit into
audacity:masterfrom
jonata:fix-monitoring-error-dialog
Sep 16, 2026
Merged

grliszas14 merged 1 commit into
audacity:masterfrom
jonata:fix-monitoring-error-dialog

Conversation

@jonata

@jonata jonata commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Resolves: #12070

AudioIO::StartMonitoring raised a modal ShowErrorDialog when it could not
open the input device. Input monitoring restarts on its own whenever the
project changes, so the dialog appeared in the middle of unrelated work — for
example while importing a file, which has nothing to do with the input device
and completes successfully either way. The user is interrupted by a modal error
about a device they were not using.

The failure is now logged instead of shown.

Starting a recording still reports it. That is a separate path
(Au3Record::start → src/record/recorderrors.h) and is untouched, so
pressing Record with an unusable device still produces the error.

Not addressed here: PlaybackController guards monitoring with
inputDevices().empty() || inputChannelsAvailable() <= 0, while
Au3AudioInput::startAudioEngineMonitoring() does not. That guard would not
have helped in this case anyway — -9996 Invalid device means a device is
enumerated but cannot be opened — so I left it alone rather than widen the
change.

Verified: builds, ctest 5/5, codestyle clean.

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Testflow test cases have been run

@grliszas14
grliszas14 self-requested a review September 8, 2026 14:35
@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 425bf59a-c49a-40de-ba6d-eab09ad036a2

📥 Commits

Reviewing files that changed from the base of the PR and between d18124a and f4107e25ac6014e9a6bb157ea3a0f7235966e851.

📒 Files selected for processing (1)
  • au3/libraries/au3-audio-io/AudioIO.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

When StartMonitoring cannot open the recording device, it now logs the PortAudio error code with wxLogMessage. It no longer displays a modal error dialog for this failure.

Priority: ⬇️ Low — Defer this narrow input-monitoring change because it only replaces an intrusive device-open error dialog with logging while leaving recording error handling unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to cf0c7

Input-monitoring device-open failures are now logged rather than interrupting users with a modal dialog, while the separate recording error path remains unchanged. The focused change is ready to merge.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: preventing a modal error when input monitoring cannot open the device.
Description check ✅ Passed The description explains the motivation, implementation, scope, linked issue, validation results, and checklist status. The unchecked Testflow item is non-critical because build, ctest, and codestyle …
Linked Issues check ✅ Passed The change satisfies issue [#12070] by logging the input-monitoring device-open failure instead of displaying a modal error dialog. Recording error handling remains unchanged and is outside the issue …
Out of Scope Changes check ✅ Passed The changes are limited to the input-monitoring failure path in AudioIO.cpp and do not modify unrelated recording behavior or monitoring guards.

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.


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

Comment @coderabbitai help to get the list of available commands.

Input monitoring runs on its own whenever the project changes, so a device it
cannot open produced a modal error dialog in the middle of unrelated work -
importing a file, for instance, which has nothing to do with the input device
and completes fine. The failure is now logged instead.

Starting a recording still reports the error: that path goes through
Au3Record::start and recorderrors.h, which is untouched.
@grliszas14
grliszas14 force-pushed the fix-monitoring-error-dialog branch from f4107e2 to cf0c756 Compare September 16, 2026 08:53
@grliszas14
grliszas14 merged commit 8d0ab82 into audacity:master Sep 16, 2026
5 of 10 checks passed
@grliszas14

Copy link
Copy Markdown
Contributor

@jonata thank you! merged

kryksyh added a commit that referenced this pull request Sep 22, 2026
Do not show a modal error when input monitoring cannot open the device (#12073)
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.

Fix -9996 Invalid device error

2 participants