Skip to content
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

ARM 64 support #690

Open
old-dog-pear opened this issue Mar 1, 2023 · 39 comments · Fixed by #812
Open

ARM 64 support #690

old-dog-pear opened this issue Mar 1, 2023 · 39 comments · Fixed by #812
Labels
enhancement New feature or request in progress

Comments

@old-dog-pear
Copy link

Can an arm64 version be produced? X64 freezes when opening in Windows On Arm, thanks to the developer

@old-dog-pear old-dog-pear added the enhancement New feature or request label Mar 1, 2023
@old-dog-pear
Copy link
Author

image
I have found the developer's answer under other questions, although the problem of slow opening of the ARM version cannot be solved at present, I look forward to the future

@BumpyClock
Copy link

It compiles just fine on ARM64 and runs. @Spiritreader can you compile the releases for ARM64 and release them? I see significant perf improvements when running my ARM64 compiled version of the app vs the x86_64 version

@Spiritreader
Copy link
Member

Spiritreader commented Oct 23, 2023

As ARM support improves we will of course look at building for that arch.
However, our build and update system also needs to be adapted, otherwise the app will just sidegrade to x86.

Once we know for certain that the entirety of the System.Management tools are compatible, including WMI and #660, we can move ahead in looking at this.

So, the deal is this: I don't have an ARM system, so I can't test for it.

The most useful thing people can do to move this along would be to have testers on ARM actively compile that app and debug it to check whether the ManagementEventWatcher calls are working:

ManagementEventWatcher autostartWatcher = new(query);

They are used here:

globalThemeEventWatcher = WMIHandler.CreateHKCURegistryValueMonitor(HandleThemeMonitorEvent, "SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Themes", "CurrentTheme");

and here:

nightLightKeyWatcher = WMIHandler.CreateHKCURegistryValueMonitor(UpdateNightLightState, "Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\CloudStore\\\\Store\\\\DefaultAccount\\\\Current\\\\default$windows.data.bluelightreduction.bluelightreductionstate\\\\windows.data.bluelightreduction.bluelightreductionstate", "Data");

As well as in the UI here:

DWMPrevalenceWatcher = new ManagementEventWatcher(query);

and here:

private readonly ManagementEventWatcher autostartWatcher;

If that doesn't throw an exception, and works then we can move ahead.
What these handlers do:

  • update which Windows theme is currently active (critical)
  • check if night light is active (critical)
  • check which DWM settings are active for the UI (breaks the UI if not working properly)
  • check if autostart is enabled (not super critical)

Unfortunately, I don't have a lot of time at the moment and new features / arch changes will remain on the backburner for the forseeable future. However: The more preparation steps are done, the faster things move along in the future.

@xgdgsc
Copy link
Contributor

xgdgsc commented Jan 10, 2024

I did a search and found dotnet/runtime#81400 . Updating the dependency System.Management to 8.0.0 of AutoDarkModeApp and AutoDarkModeSvc seems to have fixed the UI error as #812 .

@Spiritreader
Copy link
Member

As ARM support improves we will of course look at building for that arch. However, our build and update system also needs to be adapted, otherwise the app will just sidegrade to x86.

Once we know for certain that the entirety of the System.Management tools are compatible, including WMI and #660, we can move ahead in looking at this.

So, the deal is this: I don't have an ARM system, so I can't test for it.

The most useful thing people can do to move this along would be to have testers on ARM actively compile that app and debug it to check whether the ManagementEventWatcher calls are working:

ManagementEventWatcher autostartWatcher = new(query);

They are used here:

globalThemeEventWatcher = WMIHandler.CreateHKCURegistryValueMonitor(HandleThemeMonitorEvent, "SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Themes", "CurrentTheme");

and here:

nightLightKeyWatcher = WMIHandler.CreateHKCURegistryValueMonitor(UpdateNightLightState, "Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\CloudStore\\\\Store\\\\DefaultAccount\\\\Current\\\\default$windows.data.bluelightreduction.bluelightreductionstate\\\\windows.data.bluelightreduction.bluelightreductionstate", "Data");

As well as in the UI here:

DWMPrevalenceWatcher = new ManagementEventWatcher(query);

and here:

private readonly ManagementEventWatcher autostartWatcher;

If that doesn't throw an exception, and works then we can move ahead. What these handlers do:

* update which Windows theme is currently active (critical)

* check if night light is active (critical)

* check which DWM settings are active for the UI (breaks the UI if not working properly)

* check if autostart is enabled (not super critical)

Unfortunately, I don't have a lot of time at the moment and new features / arch changes will remain on the backburner for the forseeable future. However: The more preparation steps are done, the faster things move along in the future.

@xgdgsc if you can verify that everything works here we can move along with this. The next challenge at that point would be modifying the update system to detect which arch windows runs on and modify it accordingly.
We also need to internally change our build pipeline to incorporate arm.

We could then also look into this again #658

@Spiritreader Spiritreader reopened this Jan 13, 2024
@xgdgsc
Copy link
Contributor

xgdgsc commented Jan 14, 2024

Yes. It works. I have a group chat of people with arm devices testing this and no issue have been reported so far.

@BumpyClock
Copy link

I also have an arm device Surface Pro 9 if you need another tester.

@xgdgsc
Copy link
Contributor

xgdgsc commented Jan 14, 2024

Uploaded to https://github.com/xgdgsc/Windows-Auto-Night-Mode/releases/download/arm/adm-app.zip @BumpyClock can test.

Spiritreader added a commit that referenced this issue Feb 5, 2024
- support arm on publish profiles
- arch display on info
@Spiritreader
Copy link
Member

Spiritreader commented Feb 5, 2024

Please check if this works
https://github.com/AutoDarkMode/AutoDarkModeVersion/releases/download/10.4.2.8/ADM_ARM64.zip

And verify that it says "Arch: ARM64" or similar on the "About page"

Example: This should say ARM64 instead of X64
image

Once I know that this build works I can start integrating arm builds into the update system (where the idea is that ADM will automatically upgrade to an ARM version if one is available, no user input required)

@Spiritreader Spiritreader changed the title need ARM 64 ARM 64 support Feb 5, 2024
@Spiritreader Spiritreader pinned this issue Feb 5, 2024
@xgdgsc
Copy link
Contributor

xgdgsc commented Feb 7, 2024

I tested your package. It works as expected.
image

@Armin2208
Copy link
Member

Do you guys feel any improvements with the native ARM64 version compared to the previous x86 version?

@BumpyClock
Copy link

yep, feels way more responsive.

@Spiritreader
Copy link
Member

Alright, then the only thing we have to resolve is that the updater (which is still x86 due to technical reasons again) cannot seem to write to disk in x86 emulated mode.

Once we figured that out I'll update again.
In the meantime, arm builds will now be auto-published under
https://github.com/AutoDarkMode/AutoDarkModeVersion/releases

Atm they're stil unsigned, as soon as they are integrated into the update system I will include them into our signing system.

@Armin2208
Copy link
Member

Armin2208 commented Feb 10, 2024

Again needing a ARM user to verify that:

it seems like the updater doesn't have write access. Please download the newest STABLE Auto Dark Mode release version. Then open Auto Dark Mode App and navigate to settings. Enter the Beta channel and search for an update. Please try to install the update. Does it work or do you see an update error?

We would much appreciate if you would try this. This is a major issue.

@Spiritreader
Copy link
Member

Again needing a ARM user to verify that:

it seems like the updater doesn't have write access. Please download the newest Auto Dark Mode release version. Then open Auto Dark Mode App and navigate to settings. Enter the Beta channel and search for an update. Please try to install the update. Does it work or do you see an update error?

We would much appreciate if you would try this. This is a major issue.

You would need an older version than current to trigger the updater. So make sure to download stable release.

@HuaDeity
Copy link

I installed the latest stable X64 version and checked for updates within the application. Although I successfully updated to the Beta version, it remains an X64 application instead of being ARM64 as expected.

@old-dog-pear
Copy link
Author

The arm64 version has been used on Surface Pro X. Compared with the X64 version, the page opening speed is 4 seconds faster (x64 takes more than 8 seconds). The page cannot slide normally when the screen is touched. When selecting the BETA channel to update, it will prompt that there is no update content.
( Commit: d5fa712

  • Service/App: 10.4.2.8
  • Updater: 3.1.4
  • Shell: 1.3.3.0
  • .Net: 8.0.0
  • Windows: 22635.3140
  • Arch: Arm64

@Armin2208
Copy link
Member

I installed the latest stable X64 version and checked for updates within the application. Although I successfully updated to the Beta version, it remains an X64 application instead of being ARM64 as expected.

Yes, this is intended behavior, because we didn't implement the distribution of ARM based builds in the Updater yet. We just wanted to know if the Updater works in general, because on some ARM devices it doesn't seem to work.
grafik

When selecting the BETA channel to update, it will prompt that there is no update content.

Because you already use the newest Beta version of Auto Dark Mode. To test the Updater, you need to delete/uninstall the ARM64 version. Then you need to download the current stable version of Auto Dark Mode, like for example from the Microsoft Store. After that, join Beta channel and you will receive an update. Please try to update to the newest beta version and see if it succeeds or any error message appears.
Yes after that you will still be on X86, but we really need to know if the Update process works in general on ARM.

@HuaDeity
Copy link

I am running Windows on a Parallels virtual machine on my M1 Pro MacBook, and the update program is functioning normally.

@Spiritreader
Copy link
Member

Spiritreader commented Feb 14, 2024

Updating with the built-in updater should now upgrade all ARM users to the ARM64 version of Auto Dark Mode
!!ON THE BETA CHANNEL!!
If you're not on beta, you will have to update to beta first. Only then the ARM upgrade will be offered.

Once you're on beta, you will first be offered a non ARM upgrade.
After updating to the latest version, the ARM version will be offered.
If not, then you've probably configured the updater to not look for updates at ADM startup.
In that case, go to settings and click on "Check for updates" manually.
You should see a toast notification with the same version you currently have installed and (ARM64).

Keep in mind that this upgrade path is completely untested, please report issues with the upgrade process immediately.

@HuaDeity
Copy link

The upgrade failed, still in 10.4.1.1 version ,attach with the log:

service.log

updater.log

@xgdgsc
Copy link
Contributor

xgdgsc commented Feb 15, 2024

Downloading from https://github.com/AutoDarkMode/Windows-Auto-Night-Mode/releases/download/10.4.1.1/AutoDarkModeX_10.4.1.1.exe and update to beta version of 10.4.2.10 (x64) works for me on arm.

@Spiritreader
Copy link
Member

The upgrade failed, still in 10.4.1.1 version ,attach with the log:

service.log

updater.log

@HuaDeity Yep, you've run into a known issue where for some reason administrative privileges are required to run the updater. We're not yet sure what causes this.

@xgdgsc Can you now update to 10.4.2.10 ARM? Or do you run into the same issue?

@xgdgsc
Copy link
Contributor

xgdgsc commented Feb 15, 2024

No new update prompt on 10.4.2.10 (x64) version. While using https://github.com/AutoDarkMode/AutoDarkModeVersion/releases/download/10.4.2.10/ADM_ARM64.zip everytime I start I can see an update with same version number available and a download can be started and progress finished then nothing changes.

@Spiritreader
Copy link
Member

No new update prompt on 10.4.2.10 (x64) version. While using https://github.com/AutoDarkMode/AutoDarkModeVersion/releases/download/10.4.2.10/ADM_ARM64.zip everytime I start I can see an update with same version number available and a download can be started and progress finished then nothing changes.

Please check if it works now.
You should get an upgrade to 10.4.2.11 now on the ARM version

@HuaDeity
Copy link

@Spiritreader

I successfully upgraded to the Arm64 version 10.4.2.11 while running as an administrator. The upgrade process first installed the x64 version of 10.4.2.11 before proceeding with the Arm64 version.

However, even after upgrading to the Arm64 version, I continued to receive prompts for further upgrades which resulted in an infinite loop of launching and upgrading attempts.

@Spiritreader
Copy link
Member

Spiritreader commented Feb 15, 2024

@HuaDeity

However, even after upgrading to the Arm64 version, I continued to receive prompts for further upgrades which resulted in an infinite loop of launching and upgrading attempts.

Should be fixed with 10.4.2.12. The new update should be offered now and once you're on that version the loop should stop.

However I have no idea why administrator privileges are requires still? Is it not possible to launch x86-64 apps from an ARM context?

EDIT: I've pushed 10.4.2.13 which includes an ARM64 build for the updater. Please try updating and check if you still need administrator privileges to perform the update.

@xgdgsc
Copy link
Contributor

xgdgsc commented Feb 16, 2024

Updating from 10.4.2.10 to 10.4.2.13 works for me.

@HuaDeity
Copy link

@Spiritreader

The update was successful without requiring administrator privileges.

@Spiritreader
Copy link
Member

How's everyone's experience with the ARM build compared to the previous x86 version?

Did you encounter any issues so far?

@xgdgsc
Copy link
Contributor

xgdgsc commented Apr 25, 2024

No issue here.

@tangmc0210
Copy link

I am sorry but I didn't see any win arm64 version of ADM in releases, and the previous links have expired. Can anyone give me the latest version of ADM on win arm 64?

@iKineticate
Copy link

I am sorry but I didn't see any win arm64 version of ADM in releases, and the previous links have expired. Can anyone give me the latest version of ADM on win arm 64?我很抱歉,但我没有看到任何win arm64版本的ADM的版本,以前的链接已经过期。谁能给我最新版本的ADM在win arm 64上?

AutoDarkModeVersion/releases

@tangmc0210
Copy link

Thanks a lot!

@Spiritreader
Copy link
Member

We are currently preparing the stable release for ADMs ARM build.
It's been delayed a bit due to some design decisions and outstanding issues.

But there will be an installer that ships the ARM version soon

@tangmc0210
Copy link

We are currently preparing the stable release for ADMs ARM build. It's been delayed a bit due to some design decisions and outstanding issues.

But there will be an installer that ships the ARM version soon

Thanks a lot! Expecting the new release!

@xgdgsc
Copy link
Contributor

xgdgsc commented Oct 1, 2024

image
The UI doesn' t show suddenly on latest 24H2 Release Preview channel while the function works. Anyone same? Don' t know it' s only arm or also on x64. I' m on my own build that might be older than the master version.

@maxnabokow
Copy link

@Spiritreader what's the status on the ARM installer?

@Armin2208
Copy link
Member

@Spiritreader what's the status on the ARM installer?

You can expect it in late November or maybe even December.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants