Skip to content

Conversation

@rbqvq
Copy link
Contributor

@rbqvq rbqvq commented May 25, 2025

Description

This PR adds an arm64 build for Windows.

Todo:

  • Cross compile build-deps for arm

  • Some dependencies not available in clang-aarch64 environment

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Question

Should we need disable all x86 hardware accel (nvenc, intel quicksync and amdvce) on windows arm64 build?

@rbqvq
Copy link
Contributor Author

rbqvq commented May 25, 2025

Known Issues

It crashed after moonlight connect

[2025-05-25 12:58:21.029]: Info: [libx264 @ 0000024346e9af20] kb/s:629.76
[2025-05-25 12:58:21.059]: Info:
Device Description : Qualcomm(R) Adreno(TM) 8cx Gen 3
Device Vendor ID   : 0x4D4F4351
Device Device ID   : 0x36333630
Device Video Mem   : 0 MiB
Device Sys Mem     : 1 MiB
Share Sys Mem      : 16081 MiB
Feature Level      : 0x0000B100
Capture size       : 2560x1440
Offset             : 0x0
Virtual Desktop    : 2560x1440
[2025-05-25 12:58:21.059]: Info: Active GPU has HAGS disabled
[2025-05-25 12:58:21.059]: Info: Using realtime GPU priority
[2025-05-25 12:58:21.059]: Info:
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.673828,0.317383]
Green Primary      : [0.280273,0.660156]
Blue Primary       : [0.142578,0.0449219]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.0745 nits
Max Luminance      : 445.761 nits
Max Full Luminance : 445.761 nits
[2025-05-25 12:58:21.059]: Info: Desktop resolution [2560x1440]
[2025-05-25 12:58:21.060]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-05-25 12:58:21.060]: Info: Display refresh rate [119.987Hz]
[2025-05-25 12:58:21.060]: Info: Requested frame rate [60fps]
[2025-05-25 12:58:21.065]: Info:
[2025-05-25 12:58:21.065]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2025-05-25 12:58:21.065]: Info:
[2025-05-25 12:58:21.065]: Info: Found H.264 encoder: libx264 [software]
[2025-05-25 12:58:21.065]: Info: Executing [Desktop]
[2025-05-25 12:58:21.182]: Info: New streaming session started [active sessions: 1]
libc++abi: terminating due to uncaught exception of type boost::wrapexcept<std::out_of_range>: config out of range

@rbqvq rbqvq force-pushed the master branch 4 times, most recently from 0ccee19 to 4039fec Compare May 25, 2025 10:23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file don't make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clangarm64 not support std
must use ::std

Copy link
Contributor Author

@rbqvq rbqvq May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its necessary for clangarm64

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the other hundreds of files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no problem.

After changing this file, clangarm64 works correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it only happend in config::amd namespace, might it same error on x86?
Can u check it on Clang64?

This comment was marked as off-topic.

This comment was marked as off-topic.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a great resolution

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem is actually caused by ln 115-117 in config.cpp. it imports headers in namespace amd, and the headers include std headers, which makes std redefine in namespace amd:

Sunshine/src/config.cpp

Lines 115 to 117 in a3ee774

#include <AMF/components/VideoEncoderAV1.h>
#include <AMF/components/VideoEncoderHEVC.h>
#include <AMF/components/VideoEncoderVCE.h>

@rbqvq
Copy link
Contributor Author

rbqvq commented Jun 2, 2025

Can we use this hardware encode? 🤔
obsproject/obs-studio#11993

@ReenigneArcher
Copy link
Member

I think MF encoder is already included with the FFmpeg build, so why not?

@rbqvq
Copy link
Contributor Author

rbqvq commented Jun 2, 2025

I think MF encoder is already included with the FFmpeg build, so why not?

Well, I didn't read the source code of sunshine.
This part is up to you. 🤪

@rbqvq

This comment was marked as resolved.

@rbqvq rbqvq force-pushed the master branch 11 times, most recently from 9d0c82c to b0e2234 Compare June 9, 2025 09:53
@rbqvq rbqvq force-pushed the master branch 2 times, most recently from 48376c4 to a3ee774 Compare June 30, 2025 05:21
@ReenigneArcher
Copy link
Member

ci has been refactored a bit, the windows build is now in a separate workflow. It's already setup for a matrix build so should be easy to adapt your changes.

@sonarqubecloud
Copy link

@LizardByte-bot
Copy link
Member

It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks!

@rbqvq
Copy link
Contributor Author

rbqvq commented Oct 21, 2025

:(

@ReenigneArcher
Copy link
Member

Boost issues

Likely fixed by #4253 but waiting on https://gitlab.com/eidheim/Simple-Web-Server/-/merge_requests/283

OR #4132 but isn't working yet

NSIS not available for ARM64... How to create installer?

#3916 in process, but needs some adjustments. The scripts don't actually run during install.

@LizardByte-bot
Copy link
Member

It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks!

@rbqvq
Copy link
Contributor Author

rbqvq commented Jan 20, 2026

PONG :)


I will pull some changes from #4521 later and rebase to master

@rbqvq
Copy link
Contributor Author

rbqvq commented Jan 20, 2026

Builds failed with

✗ Build failed in 258ms
error during build:
parseAsync is not a function
    at Module.setSource (file:///C:/a/Sunshine/Sunshine/node_modules/rollup/dist/es/shared/node-entry.js:17416:37)
    at ModuleLoader.addModuleSource (file:///C:/a/Sunshine/Sunshine/node_modules/rollup/dist/es/shared/node-entry.js:21493:26)

@ReenigneArcher ReenigneArcher added this to the windows-arm milestone Jan 20, 2026
@codecov
Copy link

codecov bot commented Jan 21, 2026

Bundle Report

Bundle size has no change ✅

rbqvq and others added 9 commits January 21, 2026 20:15
MinHook does not support arm64, add conditional check

Signed-off-by: Coia Prant <[email protected]>
Co-authored-by: ReenigneArcher <[email protected]>
Steam Audio Driver unavailable on Windows Arm64, add check

Signed-off-by: Coia Prant <[email protected]>
For AMF `#include`, clang will resolve `std` to `config::amd::std`

Use `::std` to force resolution to the global namespace

Signed-off-by: Coia Prant <[email protected]>
Co-authored-by: Ricky8955555 <[email protected]>
CLANGARM64 does not have libatomic which used by googletest, disable it

Signed-off-by: Coia Prant <[email protected]>
Add windows arm64 documents.

Signed-off-by: Coia Prant <[email protected]>
Co-authored-by: ReenigneArcher <[email protected]>
nsis does not support arm64, so we cannot create an installer at this time

Signed-off-by: Coia Prant <[email protected]>
Co-authored-by: ReenigneArcher <[email protected]>
Add missing TOSTRING for ICON

Signed-off-by: Coia Prant <[email protected]>
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.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants