Commit Graph
8 Commits
Author SHA1 Message Date
Carlos BarreroandClaude Opus 5 bfb7645cd1 fix(linux/audio): capture in the canonical channel layout
The PulseAudio backend built the capture stream's channel map from the Opus
channel mapping. That mapping is applied by the multistream encoder in
audio.cpp and undone by the client when it decodes, so the two cancel out.
Using it as the capture channel map makes PulseAudio reorder the samples as
well, and that second reordering is never undone.

It is invisible with the built-in mappings, which are all identities, so it
went unnoticed until custom surround-params arrived in #2424. A client that
requests its own mapping gets permuted channels: the webOS Moonlight client
asks for 0,1,4,5,2,3 and ends up with centre on rear left, rear left on
centre, LFE on rear right and rear right on the subwoofer.

Capture in the canonical layout instead, which is what the WASAPI and macOS
backends already do by ignoring the mapping argument entirely. Since
map_stereo, map_surround51 and map_surround71 are all the identity over
speaker_e, the canonical position of channel i is position_mapping[i], so
the map is now filled directly from the channel index.

Clients that do not send surroundParams are unaffected: the resulting
pa_channel_map is identical to the current one for every layout in
stream_configs. No other Moonlight client sends surroundParams today;
android, ios, qt, embedded and tizen send only the standard
surroundAudioInfo.

The map construction moves into fill_canonical_channel_map() so it can be
tested without a running PulseAudio server, and position_mapping becomes a
std::array bounded by speaker::MAX_SPEAKERS so the parallel-array
relationship with speaker_e is enforced by the compiler. Out-of-range
channel counts are now rejected rather than read past the end.

Refs: https://github.com/mariotaku/moonlight-tv/issues/575

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-09 15:51:12 -04:00
Raphael Derosso Pereira 899095522a fix(linux): close the DRM render-node fd owned by wl::dmabuf_t (#5764)
Signed-off-by: Raphael Derosso Pereira <raphael@insignis.com.br>
2026-10-09 12:52:40 -04:00
Dave Lane e306c8d904 test(linux): synchronize environment sanitizer tests (#5710) 2026-09-14 11:27:43 -04:00
c553565b98 Merge commit from fork
Sanitize GUI loader and plugin environment variables before privileged initialization, failing closed when the environment cannot be cleaned.

Retain CAP_SYS_ADMIN only on a dedicated DRM worker, route KMS and CUDA DRM access through it, reject queued work safely during overflow or shutdown, and drop the worker privileges when DRM access is no longer needed.

Add Linux regression coverage for the sanitizer and document the new privileged-worker interfaces.

Co-authored-by: Conn O'Griofa <749000+psyke83@users.noreply.github.com>
Co-authored-by: Kishi <41839133+Kishi85@users.noreply.github.com>
2026-09-13 16:37:49 -04:00
Dave Lane fb925302d0 fix(linux): export all Wayland DMA-BUF planes (#5699) 2026-09-13 09:31:45 -04:00
Dave Lane 2ebaae37d2 fix(linux): handle NVENC in builds without CUDA (#5698) 2026-09-12 16:30:01 -04:00
dasepmochandReenigneArcher 3841ac593c fix: iterator/stat utility edge cases and add tests (#5308)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2026-09-02 08:57:41 -04:00
Zach DentonandReenigneArcher 3dfbfe0906 fix(wayland): use the current wl_output mode (#5150)
Signed-off-by: Zach Denton <z@chdenton.com>
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2026-08-20 23:00:50 -04:00