J.A.R.V.I.S-rust/crates/jarvis-app
Bossiara13 01ea46c091 fix(app): show toast + open Sound settings when mic enumeration returns nothing
Before: clicking "Запустить" in jarvis-gui spawned jarvis-app, which
silently exited with code 1 (or in release builds, looked like the
console window flashed and closed). The pv_recorder library returns
INVALID_ARGUMENT from pv_recorder_init when Windows Core Audio reports
zero capture endpoints (some other app holding the mic exclusively,
or all input devices disabled in mmsys.cpl). User saw no actionable
feedback.

Now: on recorder::init failure jarvis-app calls notify_mic_problem()
which (Windows-only):
- Fires a long-duration Windows toast titled "J.A.R.V.I.S.: микрофон
  не найден" with a hint pointing at mmsys.cpl / Recording.
- Spawns "start ms-settings:sound" so the Sound settings page opens
  automatically — user can re-enable the mic in two clicks.

Then the original app::close(1, ...) path runs to keep the same exit
behaviour the GUI's get_jarvis_app_stats poller expects.

Cargo.toml: jarvis-app now pulls winrt-notification (already in
workspace.dependencies via jarvis-core) for the toast.

Also incidentally fixed: the release-build C0000139 (entrypoint not
found) loader crash that was showing up before this change. It went
away after the workspace dep was added and the release relink ran.
Most likely the previous release exe had a stale import table from an
earlier partial rebuild; the clean relink resolves it.

Non-Windows builds get a no-op eprintln so the binary still compiles
for Linux/macOS.
2026-05-15 11:58:47 +03:00
..
.cargo project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00
src fix(app): show toast + open Sound settings when mic enumeration returns nothing 2026-05-15 11:58:47 +03:00
build.rs project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00
Cargo.toml fix(app): show toast + open Sound settings when mic enumeration returns nothing 2026-05-15 11:58:47 +03:00
Makefile.toml project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00