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
2026-09-29 18:14:08 -04:00
2020-02-09 22:54:06 +01:00
2022-03-15 22:30:01 -04:00
2023-03-15 16:30:18 -04:00

Sunshine icon

Sunshine

Self-hosted game stream host for Moonlight.

Star History Rank GitHub Trending Repository of the Day

GitHub stars GitHub Releases Docker GHCR Flathub installs Flathub Version Winget Version GitHub Workflow Status (CI) GitHub Workflow Status (localize) Codecov SonarCloud

ℹ️ About

Sunshine is a self-hosted game stream host for Moonlight. Offering low-latency, cloud gaming server capabilities with support for AMD, Intel, and Nvidia GPUs for hardware encoding. Software encoding is also available. You can connect to Sunshine from any Moonlight client on a variety of devices. A web UI is provided to allow configuration, and client pairing, from your favorite web browser. Pair from the local server or any mobile device.

LizardByte has the full documentation hosted on Read the Docs

🎮 Feature Compatibility

Gamepad Emulation
Feature FreeBSD Linux macOS Windows
What type of gamepads can be emulated on the host.
Clients may support other gamepads.
Generic 🟡1 ✅ ✅2 ✅3
DualShock / DS4 (PlayStation 4) 🟡1 ✅ ✅2 ✅3
DualSense / DS5 (PlayStation 5) 🟡1 ✅ ✅2 ✅3
Nintendo Switch Pro 🟡1 ✅ ✅2 ✅3
Xbox 360 🟡1 ✅ ✅2 ✅3
Xbox One 🟡1 ✅ ✅2 ✅3
Xbox Series 🟡1 ✅ ✅2 ✅3

Note

1 Missing motion, touchpad input, battery state, RGB LEDs, adaptive triggers, and raw HID output reports. 2 Requires the separately installed and licensed Virtual HID Broker. 3 All profiles are available through the separately installed and licensed Virtual HID Broker. Xbox 360 and DualShock 4 can also use ViGEmBus.

Encoding API
Encoding API GPU Vendor FreeBSD Linux macOS Windows
AMF AMD ➖ ➖ ➖ ✅
Media Foundation Qualcomm ➖ ➖ ➖ ✅
NVENC NVIDIA ➖ ✅ ➖ ✅
QuickSync Intel ➖ ➖ ➖ ✅
VAAPI AMD ✅ ✅ ➖ ➖
Intel ✅ ✅ ➖ ➖
NVIDIA ➖ ✅ ➖ ➖
Video Toolbox Apple ➖ ➖ ✅ ➖
Intel ➖ ➖ ✅ ➖
Vulkan Video AMD 🟡 ✅ ➖ ➖
Intel 🟡 🟡 ➖ ➖
NVIDIA ➖ 🟡 ➖ ➖
Software Any ✅ ✅ ✅ ✅
Screen Capture
Capture Method FreeBSD Linux macOS Windows
DXGI Desktop Duplication ➖ ➖ ➖ ✅
KMS/DRM ✅ ✅ ➖ ➖
NvFBC (X11 only) ➖ ✅ ➖ ➖
ScreenCaptureKit ➖ ➖ ✅ ➖
Wayland (wlroots) ✅ ✅ ➖ ➖
Windows.Graphics.Capture ➖ ➖ ➖ 🟡
  ↳ Portable ➖ ➖ ➖ ✅
  ↳ Service ➖ ➖ ➖ ❌
X11 ✅ ✅ ➖ ➖
XDG Desktop Portal ✅ ✅ ➖ ➖
KWin Screencast ✅ ✅ ➖ ➖
Capture → Encoding Compatibility (Linux/FreeBSD)
Capture Method VAAPI Vulkan Video NVENC (CUDA) Software
KMS/DRM ✅ ✅ ✅ ✅
NvFBC ❌ ❌ ✅ ❌
Wayland (wlroots) ✅ ✅ ✅ ✅
X11 ✅ ❌ ✅ ✅
XDG Desktop Portal ✅ ✅ ✅ ✅
KWin Screencast ✅ ✅ ✅ ✅

Legend: ✅ Supported | 🟡 Partial Support | ❌ Not Yet Supported | ➖ Not Applicable

🖥️ System Requirements

Warning

These tables are a work in progress. Do not purchase hardware based on this information.

Minimum Requirements
Component Requirement
GPU AMD: VCE 1.0 or higher, see: obs-amd hardware support
Intel:
  FreeBSD/Linux: VAAPI-compatible, see: VAAPI hardware support
  Windows: Skylake or newer with QuickSync encoding support
Nvidia: NVENC enabled cards, see: nvenc support matrix
CPU AMD: Ryzen 3 or higher
Intel: Core i3 or higher
RAM 4GB or more
OS FreeBSD: 15.1+
Linux/Debian: 13+ (trixie)
Linux/Fedora: 43+
Linux/Ubuntu: 22.04+ (jammy)
macOS: 14.2+
Windows: 11+
Network Host: 5GHz, 802.11ac
Client: 5GHz, 802.11ac
4k Suggestions
Component Requirement
GPU AMD: Video Coding Engine 3.1 or higher
Intel:
  FreeBSD/Linux: HD Graphics 510 or higher
  Windows: Skylake or newer with QuickSync encoding support
Nvidia:
  FreeBSD/Linux: GeForce RTX 2000 series or higher
  Windows: Geforce GTX 1080 or higher
CPU AMD: Ryzen 5 or higher
Intel: Core i5 or higher
Network Host: CAT5e ethernet or better
Client: CAT5e ethernet or better
HDR Suggestions
Component Requirement
GPU AMD: Video Coding Engine 3.4 or higher
Intel: HD Graphics 730 or higher
Nvidia: Pascal-based GPU (GTX 10-series) or higher
CPU AMD: Ryzen 5 or higher
Intel: Core i5 or higher
Network Host: CAT5e ethernet or better
Client: CAT5e ethernet or better

❓ Support

Our support methods are listed in our LizardByte Docs.

💲 Sponsors and Supporters

Sponsors

👥 Contributors

Thank you to all the contributors who have helped make Sunshine better!

GitHub

GitHub contributors

CrowdIn

CrowdIn contributors

S
Description
No description provided
Readme GPL-3.0
875 MiB
0 Stars 1 Watchers 0 Forks
Languages
C++ 77.9%
Vue 5.7%
CMake 4.5%
Objective-C++ 4%
JavaScript 2.1%
Other 5.6%