Follow default audio devices when a headset connects or disconnects #12

Merged
adam merged 1 commit from codex/audio-device-routing into main 2026-12-02 13:30:57 -05:00
Owner

Connecting or disconnecting a VR headset could leave Crewbot speaking through the old output or submitting the first part of an interrupted push-to-talk request.

Crewbot now monitors system audio devices through Qt. When a device change requires a rescan, it closes its streams before refreshing PortAudio's device table and reopens the directions that were in use. The device menus retain a named microphone or speaker while it is unplugged. The system-default option follows the new endpoint.

Losing the microphone during push-to-talk discards that recording, even when the device returns before the driver releases the button. Output loss drops queued speech. Apply / retry output also recovers playback in an engineer-only session.

Verification

  • The repository CI script ran 163 unit tests. 162 passed and one Windows-only wheel test was skipped on Linux. The wheel build, offline voice preparation, and installed desktop smoke test passed.
  • Native PortAudio capture and playback switched from a virtual desktop endpoint to a headset endpoint and back using an isolated ALSA configuration. The recording held across the switch was discarded.
  • Physical Windows VR headset behavior still needs a hardware check.
Connecting or disconnecting a VR headset could leave Crewbot speaking through the old output or submitting the first part of an interrupted push-to-talk request. Crewbot now monitors system audio devices through Qt. When a device change requires a rescan, it closes its streams before refreshing PortAudio's device table and reopens the directions that were in use. The device menus retain a named microphone or speaker while it is unplugged. The system-default option follows the new endpoint. Losing the microphone during push-to-talk discards that recording, even when the device returns before the driver releases the button. Output loss drops queued speech. **Apply / retry output** also recovers playback in an engineer-only session. ## Verification - The repository CI script ran 163 unit tests. 162 passed and one Windows-only wheel test was skipped on Linux. The wheel build, offline voice preparation, and installed desktop smoke test passed. - Native PortAudio capture and playback switched from a virtual desktop endpoint to a headset endpoint and back using an isolated ALSA configuration. The recording held across the switch was discarded. - Physical Windows VR headset behavior still needs a hardware check.
Follow audio device changes and discard interrupted speech
All checks were successful
Test and build / build (push) Successful in 3m40s
Test and build / build (pull_request) Successful in 3m37s
Logging service / logging (push) Successful in 6m36s
Logging service / logging (pull_request) Successful in 6m35s
27600d3dcf
adam merged commit 27cc7429a6 into main 2026-12-02 13:30:57 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
adam/crewbot!12
No description provided.