io.lotus.set_audio_output stores the host's deviceId as-is; audio_output_state never sends the promised device list #44

Closed
opened 2026-10-05 00:17:58 -04:00 by jared · 1 comment
Owner

The fork half of cinny#310 (call-bar audio output switch). startLotusAudioOutput (src/lotus/lotusAudioOutput.ts) has two problems:

  • It passes the host's id straight to mediaDevices.audioOutput.select(). That id comes from enumerateDevices() in the chat page, a different frame and origin, so it never matches this frame's ids. select() writes it to matrix-setting-audio-output anyway, and selectDevice$ then falls back to the default output. Measured: the host sent 91fc1920… for "Fake Audio Output 2", the fork's own id for that device is 03ad4b42…, and the output stayed on Default.
  • io.lotus.audio_output_state sends only { deviceId }. The doc comment says { deviceId, available: [{id,label}] }. Without the list, the host can't offer ids that work.

Fix (with cinny#310):

  • Include available (this frame's audioOutput.available$ as {id, label}) in audio_output_state, and re-send it on devicechange.
  • Accept set_audio_output { deviceId } only when it is one of this frame's ids. Otherwise try { label } matching, and ignore unknown ids rather than persisting them.
  • Update the doc comment to match.

Found in the October 2026 client audit (Playwright against a local Synapse + LiveKit stack, plus code reading). Code refs are at cinny 30e2dbcd, cinny-desktop 8f67ec7, element-call 3b0050e8.

The fork half of cinny#310 (call-bar audio output switch). `startLotusAudioOutput` (`src/lotus/lotusAudioOutput.ts`) has two problems: - **It passes the host's id straight to `mediaDevices.audioOutput.select()`.** That id comes from `enumerateDevices()` in the chat page, a different frame and origin, so it never matches this frame's ids. `select()` writes it to `matrix-setting-audio-output` anyway, and `selectDevice$` then falls back to the default output. Measured: the host sent `91fc1920…` for "Fake Audio Output 2", the fork's own id for that device is `03ad4b42…`, and the output stayed on Default. - **`io.lotus.audio_output_state` sends only `{ deviceId }`.** The doc comment says `{ deviceId, available: [{id,label}] }`. Without the list, the host can't offer ids that work. **Fix (with cinny#310):** - Include `available` (this frame's `audioOutput.available$` as `{id, label}`) in `audio_output_state`, and re-send it on `devicechange`. - Accept `set_audio_output { deviceId }` only when it is one of this frame's ids. Otherwise try `{ label }` matching, and ignore unknown ids rather than persisting them. - Update the doc comment to match. --- _Found in the October 2026 client audit (Playwright against a local Synapse + LiveKit stack, plus code reading). Code refs are at cinny `30e2dbcd`, cinny-desktop `8f67ec7`, element-call `3b0050e8`._
jared added the bugpriority: mediumarea: widget-actions labels 2026-10-05 00:17:58 -04:00
Author
Owner

Fixed by #49 (released as 0.25.0-lotus.24): io.lotus.audio_output_state now carries the frame's own available list, and the host builds its menu from it (cinny #417). Verified with the published package: picking an output saves a real frame device and the ✓ follows it.

🤖 Claude Code

Fixed by #49 (released as **0.25.0-lotus.24**): `io.lotus.audio_output_state` now carries the frame's own `available` list, and the host builds its menu from it (cinny #417). Verified with the published package: picking an output saves a real frame device and the ✓ follows it. 🤖 Claude Code
jared closed this issue 2026-10-18 15:26:56 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/element-call#44