-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Windows ARM64 Support (Qualcomm Snapdragon) #4521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Windows ARM64 Support (Qualcomm Snapdragon) #4521
Conversation
- Use ::std:: fully qualified namespace in template functions to avoid ambiguity with clang's namespace resolution - Fix boost::process inline namespace declaration for clang compatibility (clang doesn't support 'inline v1' syntax the same way as MSVC) These changes enable cross-compilation with llvm-mingw toolchain for Windows ARM64 targets.
- Fix icon path handling for cross-compilation with llvm-rc (use relative path from build directory) - Add ARM64 Steam audio driver subdirectory detection Enables building Sunshine for Windows ARM64 using llvm-mingw toolchain.
Add wgc_interop_guids.h which provides __mingw_uuidof specialization for IGraphicsCaptureItemInterop interface. This is required for constexpr GUID evaluation when compiling with clang/llvm-mingw. The header is conditionally included only when building with clang.
Add vendor ID detection for Qualcomm Adreno GPUs: - 0x4D4F4351: "QCOM" in ASCII (reversed as little-endian) - 0x5143: Alternate Qualcomm vendor ID When a Qualcomm GPU is detected, only Media Foundation encoders (h264_mf, hevc_mf, av1_mf) are considered compatible, as Qualcomm doesn't support NVENC, AMF, or QSV encoder APIs.
Add Windows Media Foundation hardware encoder support for platforms that don't have NVENC, AMF, or QSV (primarily Qualcomm Snapdragon). Encoders added: - h264_mf: H.264 via Media Foundation - hevc_mf: HEVC via Media Foundation - av1_mf: AV1 via Media Foundation Configuration: - Uses D3D11VA hardware device for GPU texture input - CBR rate control with display_remoting scenario for streaming - Only supports SDR 4:2:0 8-bit (Qualcomm MF encoder limitation) - Fixed GOP size of 120 frames since MF doesn't support on-demand IDR The mediafoundation encoder is probed after quicksync and amdvce, serving as a fallback for ARM64 Windows devices.
Add comprehensive build guide for cross-compiling Sunshine to Windows ARM64 from Linux using llvm-mingw toolchain. Includes: - Prerequisites and quick start - Step-by-step dependency building (OpenSSL, curl, miniupnpc, opus) - Stub libraries for unsupported features (MinHook, VPL) - CMake toolchain file for aarch64-w64-mingw32 - Hardware encoding notes and limitations - Troubleshooting section
|
|
Duplicate of #3905 |
| } else if (adapter_desc.VendorId == 0x4D4F4351 || // Qualcomm (QCOM as MOQC reversed) | ||
| adapter_desc.VendorId == 0x5143) { // Qualcomm alternate ID | ||
| // If it's not a MediaFoundation encoder, it's not compatible with a Qualcomm GPU | ||
| if (!boost::algorithm::ends_with(name, "_mf")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just move this check for _mf into the Unknown GPU Vendor ID section below. MF should be a generic fallback for any unknown GPUs (and should never be allowed for any GPUs where we have native API support).
Did anyone confirm that |
|
Also it may use IDR on |
Yeah, I expect that to work (as it's mandatory for any hardware encoder per MSDN). If the reason for this was the "Encoder did not produce IDR frame" warning, it's possible that was simply an output delay issue. If the MF encoder is delaying output frames for further input (which is bad for latency), then the warning will be displayed even though the key frame will come after submitting a subsequent frame. |
👀 I somehow doubt that Qualcomm supports these two though, that would be too nice. |




Summary
This PR adds support for building and running Sunshine on Windows ARM64 devices, specifically targeting Qualcomm Snapdragon X Elite/Plus laptops with Adreno GPUs.
Changes
Build System
Clang/MinGW Compatibility
::std::namespace qualification for clang template resolutionboost::processinline namespace syntax for clangwgc_interop_guids.hheader for WGC GUID constexpr evaluationQualcomm GPU Support
Media Foundation Encoder
mediafoundationencoder with h264_mf, hevc_mf, av1_mf codecsFIXED_GOP_SIZEflag for encoders without on-demand IDR supportDocumentation
docs/BUILD-ARM64.mdbuild guideTesting
Tested on:
What Works
Known Limitations
Checklist