Repository navigation
Conversation
Ray-Ban Meta glasses pair to the Mac as a Bluetooth HFP microphone; the desktop app captured only from the system-default input with no way to pick a device or see which one is live. Now: - Settings -> Transcription gains a Microphone card: System Default or any input device, enumerated via the same CoreAudio HAL walk as findBuiltInMicDeviceID; persisted by device UID (IDs aren't stable across reconnects) and resolved at capture start via the existing AudioCaptureService(overrideDeviceID:) path. - Meta glasses are detected by precise product-name match (Ray-Ban / Oakley Meta — never generic 'glass') and labeled, with the HFP voice-quality tradeoff stated in plain language. - The Dashboard Listening button shows 'Ray-Ban Meta' while the glasses are the active capture source (recordingInputDeviceName already feeds input_device_name on memories, so provenance lands server-side too). - Silent-mic watchdog behavior is unchanged: a dead Bluetooth mic still falls back to the built-in mic so capture never silently records nothing. - Neutral styling (no purple) per design rules. Verified: xcrun swift build -c debug --package-path Desktop — zero errors (after merging upstream b4370fc, which fixes a pre-existing AgentBridge break at this branch's original base). On-device run via named bundle next.
On-hardware finding: Ray-Ban Meta glasses advertise a Bluetooth codename (observed: 'EL AI 000F'), not a Meta product name, so product-name matching alone can't identify them. When the user has explicitly chosen a microphone, show that device's real name on the Listening button (still 'Ray-Ban Meta' when the name does match a Meta product). Verified on hardware: glasses selected in the picker captured live audio end-to-end to transcript.
With the Settings microphone picker pinning transcription capture to a Bluetooth mic (e.g. Ray-Ban Meta glasses), push-to-talk could open a second CoreAudio IOProc against the same device — or join its A2DP-HFP profile flap — racing both captures' stream-format reconfiguration. PTT's existing guard only considered Bluetooth output. - AudioCaptureService gains a process-wide active-capture registry (register on successful start/reconfigure, unregister on stop). - preferredPTTInputOverrideDeviceID() now also yields to the built-in mic when the would-be input is held by another capture, or is Bluetooth while any capture is live — mirroring the existing isDefaultOutputBluetooth guard's philosophy. Verified: xcrun swift build — zero errors; behavior check on hardware (glasses Listening + chat shortcut concurrently) is the follow-up step.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Adds a user-selectable microphone input for macOS transcription (including Ray-Ban Meta glasses), surfaces the live capture source in the Listening UI, and introduces a process-wide “active capture” registry to reduce push-to-talk (PTT) contention with ongoing transcription capture.
Changes:
- Add a Settings → Transcription “Microphone” card to pick System Default vs a specific input device (persisted by device UID).
- Show the selected/live capture source name on the Listening button (with a “Ray-Ban Meta” label when name-matched).
- Add an active-capture registry in
AudioCaptureServiceand extend PTT mic override logic to yield to the built-in mic under contention/Bluetooth conditions.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| desktop/macos/Desktop/Sources/MainWindow/Pages/Settings/Sections/SettingsContentView+Transcription.swift | Inserts the new microphone picker card into the Transcription settings section. |
| desktop/macos/Desktop/Sources/MainWindow/Pages/Settings/Sections/MicrophonePickerCard.swift | New SwiftUI card that enumerates input devices and persists the preferred device UID. |
| desktop/macos/Desktop/Sources/MainWindow/Pages/DashboardPage.swift | Updates Listening button title to reflect capture source / Meta labeling. |
| desktop/macos/Desktop/Sources/FloatingControlBar/PushToTalkManager.swift | Extends PTT override selection to avoid active-capture and Bluetooth contention. |
| desktop/macos/Desktop/Sources/AudioCaptureService.swift | Adds input-device enumeration helpers + active-capture registry APIs. |
| desktop/macos/Desktop/Sources/AppState/AppState+Transcription.swift | Initializes AudioCaptureService with an override device ID when a preferred UID is set. |
| desktop/macos/changelog/unreleased/20260707-ptt-mic-contention.json | Changelog fragment for PTT contention fix. |
| desktop/macos/changelog/unreleased/20260706-rayban-meta-microphone-picker.json | Changelog fragment for microphone picker + capture source display. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Confidence score: 5/5
- Safe to merge after the addressed issues were fixed.
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.
Re-trigger cubic
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the focused desktop microphone-picker work here — the shape makes sense for Omi’s desktop transcription/smart-glasses use case, especially persisting CoreAudio UIDs rather than device IDs and reusing the explicit AudioCaptureService(overrideDeviceID:) path.
I’m going to hold this before merge for one concrete reason: the required Desktop Swift Build & Tests check is failing in the e2e flow coverage gate, not in compilation. The failing job reports these changed Swift files still need e2e flow coverage entries:
desktop/macos/Desktop/Sources/AppState/AppState+Transcription.swiftdesktop/macos/Desktop/Sources/FloatingControlBar/PushToTalkManager.swiftdesktop/macos/Desktop/Sources/MainWindow/Pages/Settings/Sections/MicrophonePickerCard.swiftdesktop/macos/Desktop/Sources/MainWindow/Pages/Settings/Sections/SettingsContentView+Transcription.swift
Please add/extend the relevant desktop/macos/e2e/flows/*.yaml coverage for the Settings → Transcription microphone picker and the PTT/mic-contention path (or otherwise satisfy the strict coverage checker), then rerun the desktop check.
A couple of maintainer notes for the human pass:
- Product fit looks qualitatively reasonable: a desktop microphone picker and explicit Ray-Ban Meta capture indication are aligned with Omi’s smart-glasses/transcription surface.
- This is still a nontrivial feature PR touching capture routing, Bluetooth/HFP behavior, dashboard UX, and PTT contention, so it should get human maintainer review after CI is green rather than an automated approval.
- I did not find an agent-instruction or AI-reviewer behavior change in this PR.
Once the coverage gate is fixed, I’d expect this to be a good candidate for a final desktop maintainer review with hardware/UX confirmation.
beginTurn() refreshes the voice seed asynchronously and then calls reconnectWarmSessionIfSeedStale(). When the seed fetch is slow (~5s observed), the check lands after a short turn has already committed and teardownSession() destroys the session the turn is awaiting its reply on — the reply silently never arrives. Observed on hardware (glasses Listening + chat shortcut): 'turn committed' at t+0ms, 'voice seed changed — reconnecting warm session' at t+13ms, no reply. Guard the reconnect on inputTurnInProgress/responding and defer to the next turn's check. Verified: xcrun swift build zero errors; hardware re-test of Listening+PTT is the follow-up.
|
Hardware verification of the PTT fixes (Ray-Ban Meta glasses paired, Listening active on the glasses, chat shortcut concurrently):
|
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/Desktop/Sources/FloatingControlBar/RealtimeHubController.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/FloatingControlBar/RealtimeHubController.swift:731">
P1: This guard makes the seed-stale reconnect a no-op from the only call site: `beginTurn()` always has `inputTurnInProgress == true` by the time the async refresh returns, so the warm session never reconnects and stale context can persist indefinitely.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Opening a CoreAudio input can take seconds under load (observed ~5s with
the capture pipeline spinning up, Bluetooth contention, or cold audiomxd
state). PTT cold-started a new AudioCaptureService every press, so short
turns heard nothing ('discarding hub turn — audio 0.00s') and even
successfully opened devices were thrown away when the open completed after
the turn ended.
- Turn end now PARKS the running capture (running-but-dropped via a
lock-guarded lease the frame closures consult per chunk) for 120s instead
of destroying it; the next press adopts it and hears audio immediately.
- Late-completing opens are parked warm instead of stopped.
- Frame/silent-mic closures route by lease (generation + batchMode), so a
parked capture never leaks frames and adoption needs no closure rebinding
on the live IOProc thread.
- Device-failure paths (silent-mic fallback, CoreAudio rebuild) discard
rather than park, so a broken device is never kept warm.
Verified: xcrun swift build zero errors; hardware retest (Capture ON +
Listening on glasses + rapid PTT turns incl. barge-in) is the follow-up.
There was a problem hiding this comment.
3 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/Desktop/Sources/AudioCaptureService.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/AudioCaptureService.swift:489">
P2: PTT contention checks can use a stale captured device after a live capture reconfigures to a new input. Consider refreshing `activeCaptures` with `newDeviceID` after the successful restart path in `reconfigureAfterChange`.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/AudioCaptureService.swift:511">
P1: Registry entries are only removed via `unregisterActiveCapture()` in `stopCapture()`. If an `AudioCaptureService` instance is deallocated while `isCapturing` is still true (the class reportedly has a `deinit` cleanup path for that case), its entry leaks in `activeCaptures`. This permanently makes `hasActiveCapture()` return `true` and poisons PTT routing. Adding `unregisterActiveCapture()` to `deinit` would prevent this leak.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
# Conflicts: # desktop/macos/Desktop/Sources/DefaultsKey.swift # desktop/macos/e2e/flows/settings.yaml
|
Addressed the latest PR review comments in Changes covered:
Local checks run:
CI is running on the updated branch. |
There was a problem hiding this comment.
All reported issues were addressed across 11 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
… into feature/rayban-meta-desktop-mic
|
@copilot resolve the merge conflicts on this branch. |
8064c2d to
02f63fe
Compare
02f63fe to
71c516e
Compare
4957623 to
f4fc857
Compare
|
@copilot resolve the merge conflicts on this branch. |
Theory Multi-device support failed because the app persisted one active BLE device and the onboarding scanner rendered only live scan results. A second saved device displaced the first, and offline saved devices disappeared from the connect flow. Scope - Adds `SharedPreferencesUtil.btDevices` list storage with legacy `btDevice` fallback. - Keeps `btDeviceSet` updating active device while preserving unique saved devices. - Adds `OnboardingProvider.savedDeviceList` and `visibleDeviceList`. - Updates Find Devices UI to render saved offline devices and replace them with live scan data when seen. Cut from #9084 - Meta glasses provider/page/runtime. - On-device transcription. - Android/iOS native recording churn. - Docs/plugin examples/auth changes. Tests - Red first: `flutter test test/providers/onboarding_provider_multi_device_test.dart` failed on missing `btDevices`, `savedDeviceList`, and `visibleDeviceList`. - Green: `flutter test test/providers/onboarding_provider_multi_device_test.dart`. - Green: `dart analyze lib/backend/preferences.dart lib/providers/onboarding_provider.dart lib/pages/onboarding/find_device/found_devices.dart test/providers/onboarding_provider_multi_device_test.dart`. Notes - Draft PR. Surgical generic multi-device persistence/UI slice of #9084. - Low overlap with #9181; this branch does not touch `app/lib/pages/home/page.dart`. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/9311?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
|
Hey @eulicesl 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
|
Closing as superseded: this branch predates the repository history rewrite and could no longer be merged. The same feature set — re-integrated with current Generated by Claude Code |
Port of PR BasedHardware#9181 onto current main (the original branch predates the repo history rewrite and cannot be merged). Same feature set, re-integrated with the code that landed on main since July 7: - Microphone card in Settings -> Transcription: System Default or any CoreAudio input, persisted by device UID (IDs are not stable across reconnects), applied through the existing AudioCaptureService overrideDeviceID path and honored when transcription starts (AppState+Transcription). Refreshes from a kAudioHardwarePropertyDevices listener, not polling. - Listening button surfaces the live capture source; an explicitly selected Meta-glasses mic shows as "Ray-Ban Meta". Integrated into CaptureListeningLogic (main's shared status derivation) so the persistent status bar and Home header both get it. - PTT mic contention: AudioCaptureService gains a process-wide active-capture registry; PTT routing yields to the built-in mic when the would-be input is held by another capture, or is Bluetooth while any capture runs. Integrated into PTTInputDeviceRouting's off-main-actor probe/snapshot seam (registry reads are lock-guarded process state, not HAL reads, so resolution stays main-actor safe). - PTT warm mic keep-alive: a finished turn parks its capture for 120s and the next turn with the same routing adopts it via a lock-guarded lease, instead of tearing down and rebuilding the CoreAudio IOProc. Adaptations vs the original branch, forced by current main: - listeningModeTitle override moved into CaptureListeningLogic (new home of that logic). - Contention policy reads default-input/built-in/transport info from the probe snapshot instead of calling the HAL on the main actor, honoring the PTT routing seam's no-main-actor-HAL invariant; explicit user mic choices are always respected. - MicrophonePickerCard uses availableInputDevices()/isBluetoothTransport (main's enumeration) rather than the original listInputDevices(). - Source-inspection tripwires live in PTTWarmMicKeepAliveTests.swift and assert current main's publish()-based coordinator strings; the hub seed-stale reconnect deferral they guard already landed on main, so its changelog fragment is not re-shipped here. Verification: python3 desktop/macos/scripts/check-e2e-flow-coverage.py --strict --base origin/main passes (8/8 changed Swift files covered); flow YAML parses; changelog fragments are valid JSON. No Swift toolchain exists in this Linux environment, so the Swift sources are NOT compiled here — CI must be the compile/test authority for this PR. Hardware validation of the original branch (glasses as picker selection, end-to-end transcript) was done on the fork before the rewrite; see PR BasedHardware#9181.
What
findBuiltInMicDeviceID, persisted by device UID (IDs aren't stable across reconnects), applied through the existingAudioCaptureService(overrideDeviceID:)path. Neutral styling; changelog fragments included.AudioCaptureServicegains a process-wide active-capture registry, andpreferredPTTInputOverrideDeviceID()now yields to the built-in mic when the would-be input is held by another capture or is Bluetooth while any capture runs — extending the existingisDefaultOutputBluetooth()guard's philosophy.main, fixed the stale active-capture registry windows, replaced fixed-interval microphone-device polling with a CoreAudio hardware-device listener, and hardened the relevant regression tests.Why
Ray-Ban Meta glasses pair to a Mac as a Bluetooth HFP microphone, but the app only captured from the system-default input with no picker and no visible indication of the live source. Companion to the mobile-side #9178.
Product invariants affected
How it was tested
git diff --check HEAD~1 HEAD— passed.python3 desktop/macos/scripts/check-e2e-flow-coverage.py --strict --base upstream/main— passed, 8 changed desktop Swift files covered, 0 uncovered.xcrun swift build -c debug --package-path Desktop— passed.xcrun swift test --package-path Desktop --filter PushToTalkStateMachineTests— passed, 8 tests, 0 failures.xcrun swift test --package-path Desktop --filter TranscriptionTransportTests— passed, 7 tests, 0 failures.dart format --line-length 120 --set-exit-if-changed --output=none ...on the previously failing formatting paths — passed.omi-rayban, prod backend) captured live speech → transcript end-to-end;recordingInputDeviceNameflows toinput_device_nameas before.Review notes
kAudioHardwarePropertyDevicesnotifications instead of a fixed 3-second polling loop.🤖 Generated with Claude Code