Skip to content

bug: low-resolution capture retry requests audio with the video device id #347

Open

Description

@BernardJen

What

When a device opens at 640 wide or less, startVideoStream stops the tracks and retries at up to 1920x1080. The retry asks for audio with the video device id:

if (hasAudio) {
  retryConstraints.audio = { deviceId: { exact: deviceId } }
}

input_viewer_electron/src/renderer/renderer.js:927-929

That is the bug #151 fixed on the main path: a video deviceId never matches an audioinput, so the combined open fails with OverconstrainedError and the code falls through to the bare { video: { deviceId } } re-acquire in the catch -- at default resolution, with no audio.

Effect

Only on the retry path, i.e. USB and virtual cameras that open low. The wall's PCIe cards negotiate 3840x2160 and never retry. But for a device that does, the retry that exists to fix its resolution is defeated by its own audio request.

Fix

Use the paired audio device found by groupId on the main path (renderer.js:836-866), or request audio only when that pairing found one.


Found while reconstructing the Electron app's decisions as ADRs for the egui port (#346, docs/adr/open-questions.md). Line numbers are from main at 787375b (v3.4.1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions