Screen Savers broken on 2+ monitor system in macOS Sonoma 14.0
This is a follow-up thread to https://github.com/JohnCoates/Aerial/issues/1286
Initial testing with macOS Sonoma (first beta, 23a5257q) suggests the problem has worsened again:
- with 2 screens, I am seeing the same problem we saw back in early 13.3 betas: screen 1 is blank, screen 1's content is showing up mis-sized on screen 2. And, it is now back to happening 100% of the time (20 out of 20 failures, using Aerial, using HotCorner)
- similar problem with other third-party screensavers (such as https://iscreensaver.com ) so this is again not a bug in Aerial.
- I'm also seeing the same problem with first-party Apple screensavers (such as Message and Shifting Tiles)!
Conclusion: the first beta of Sonoma 14.0 is broken, and seems to be as broken as early betas of Ventura 13.3.
Can confirm all of the same FYI.
Also, side note, while they added some "video wallpapers" based on Aerial, there's no screensaver. When you get out of the screensaver (whatever it is), the lock screen plays a video for 3 seconds and stays still.
That's... not what they showed with fanfare during the presentation (seemless playback between screensaver and desktop background, which is definitely an impressive syncing effort).
FYI, I've re-submitted this as FB12240576, referencing my prior feedbacks FB12023530 and FB12179420, and also fixed the TItle of this Issue (it said macOS 13.4, but should obviously be 14.0)
Version 14.0 Beta (23A5257q)
Aerial still does not function.
I have also reported it to Apple via the Feedback Assistant. Even the stock included Aerial Video Wallpapers don't work, they just show up as still wallpaper images. Everyone should report it, as the more reports to Apple the more attention it will get. Use the Feedback Assistant that came with the Sonoma Beta. If you don't have it installed, here are instructions for it: https://support.apple.com/guide/feedback-assistant/intro-to-feedback-assistant-fba2e39e53f5/mac
Even the stock included Aerial Video Wallpapers don't work, they just show up as still wallpaper images.
But to be clear, that's how Apple implemented them. They are not video wallpapers as in, they are not intended to playback all the time (like with Companion). They just play when you login basically, then slowdown to "become" a fixed wallpaper. That's how Apple implemented them. There's not (at least not yet) a screensaver with those dynamic wallpapers... it's weird right now. You can animate them for like 5 seconds by going to your Apple menu top left and pressing "lock screen" (2nd option from the bottom).
Yet they clearly talk about screensavers here : https://www.apple.com/macos/sonoma-preview/
New slow-motion screen savers of breathtaking locations from around the world look beautiful on your large Mac display. When you log in, they seamlessly become your desktop wallpaper.
The log-in thing is here, as long as it's from boot up, or when you come back from display off (basically, a blank lock screen). If you somehow run any screen saver, the (traditional) lock screen will appear on top of the screensaver.
So it's - at the moment - a "lock screen screen saver". I doubt this is their full plan. If it is, I mean... I have a hard time processing this, not gonna lie !
I'll point to this update here for reference : https://github.com/JohnCoates/Aerial/issues/1286#issuecomment-1583035720
Can confirm all of the same FYI.
I am running 3 monitors and all 3 of mine are using screen savers. I have different ones on each screen.
I am running 3 monitors and all 3 of mine are using screen savers. I have different ones on each screen.
Do you mean different screensavers or different Aerial videos on each screen using Aerial ? Not sure I follow what you mean here.
Sonoma beta 2 is out, and the Screen Saver System Settings has changed a lot.
- I am now seeing Apple's "Aerial" screensavers showing up in the Screen Saver settings - I was not seeing any of these in beta 1.
- there is a new 'Show on all displays' option (which when Off, gives you a choice of which monitor to show the screensaver on.
- behavior is superbly buggy, both with Apple screensavers and third party. I'm seeing new bugs where the legacyScreenSaver engine seems to get stuck running in the background, screensavers are not playing on 2 monitors correctly, etc.
Here's what the System Settings pane looks like now:
If you choose one of the Apple "Aerial" screen savers, you get a new Show as wallpaper option:
A new bug I've never seen before: when using your Aerial (not Apple's version) the screensaver actually worked on both screens, but then I was unable to exit! No keypresses or mouse clicks or movement would exit.
About 30 seconds later, the screensaver finally exited (and I heard some 'beep' noises) suggesting the whole system was lagging. Now legacyScreenSaver appears to have hung:
In short - lots of new stuff, much of it broken.
And when running on a 2 monitor system, with 'Show on all displays' enabled, behavior is again erratic: sometimes it plays only on screen 1, sometimes only on screen 2 (but with screen 1's content), and on rare occasion it will play on 2 screens nor mally, but I've only seen that about 1 out of 10 times.
Can confirm all this, including the new weird bugginess. Also note that if you go into desktop backgrounds (is it now called wallpaper in settings ??) you have the invert switch, use as screen saver :
The important bit is, screensavers can now be run independently on each screen, and in theory you can run 2 different ones simultaneously on different screens (at least that's what they are going for). I think that the new ability to set a separate screensaver on different screen is likely the root cause of all our issues, they might have started implementing stuff around this a while back.
Right now if I set Aerial to all screens in 2 monitor configuration, I get it on either one of them, primary or secondary. The bug previously never displayed on primary. If I set "individually" on both screens, I get the same thing. It's insanely buggy in any case.
Regarding their implementation of aerial screensavers, I think they simply use the desktop window and animate/stop it. they don't create a new separate view. This is what they did previously with the lock screen thing, they just animate the desktop and stop it.
It's unlikely we'll get the ability to make "dynamic wallpaper/screen savers" soon as 3rd party, which obviously sucks.
Hey is it just me or has this thing not worked even close to right for more than a year now ?
@DSBlackHeart I first reported the bug february 23rd, this was 13.3 beta where they broke it.
Back on topic, if I set a dynamic background (but not as screensaver), and launch screensaver (in that case aerial), when I come back to the desktop, I get the slowed down animation and...
Did they really implement this in LEGACYSCREENSAVER 😵💫
I can see how that would break legacyScreenSaver for "regular" uses. And that CPU usage for a still frame, seriously (and I have to force quit them if I switch back to regular wallpaper) !
Hey is it just me or has this thing not worked even close to right for more than a year now ?
More like 4 months - it's only been since 13.3 betas which started happening in March. Feels like a year though!
The important bit is, screensavers can now be run independently on each screen, and in theory you can run 2 different ones simultaneously on different screens (at least that's what they are going for).
Maybe? they don't really have a good UI for that, as it's only "Run on main screen" which if off, lets you choose 1 monitor to run on. I can't see any way to intentionally choose N arbitrary screensavers for N monitors, can you?
I think that the new ability to set a separate screensaver on different screen is likely the root cause of all our issues, they might have started implementing stuff around this a while back.
good theory
Did they really implement this in LEGACYSCREENSAVER 😵💫
Yeah, I'm seeing that too. That's a real WTF.
The important bit is, screensavers can now be run independently on each screen, and in theory you can run 2 different ones simultaneously on different screens (at least that's what they are going for).
Maybe? they don't really have a good UI for that, as it's only "Run on main screen" which if off, lets you choose 1 monitor to run on. I can't see any way to intentionally choose N arbitrary screensavers for N monitors, can you?
It's very clunky but it works just like on the desktop backgrounds side, whatever you set is persisted, if I setup Aerial on one and switch to the other screen, set monterey there, if I pick the first screen back it shows Aerial.
And in that case I can confirm it runs both (and in that case, weirdly enough, fine).
I feel like with Sonoma beta 1, some people were talking about the new screensavers. But most of us were not seeing any new screensavers, only wallpaper. This was very confusing to me, and I was wondering if they were confused.
Now in beta 2 I'm seeing actual screensavers.
Could it be possible that poeple were seeing the screensavers in beta 1, but it was only showing up for some people? (a certain region, model of mac, GPU, CPU or something else?)
I'm 100% sure people just got confused with the lock screen and Craig saying screensavers ;)
In beta 1, if you set the desktop background, you got the animation at login, back from sleep, or pressing lock screen in your Mac menu bar top left. I doubt they A/B tested anything, just people not understanding the difference or reusing Apple's marketing.
9to5mac was infuriating about this for example.
It's very clunky but it works just like on the desktop backgrounds side, whatever you set is persisted, if I setup Aerial on one and switch to the other screen, set monterey there, if I pick the first screen back it shows Aerial.
OK, I see what you are saying, and it kinda works.
Unfortunately, this means third-party screensaver authors now have to test for the difference between
- one screensaver, set to 'Show on all displays'
- the same screensaver, set to 'Show on one display', but set to show on all displays using this confusing UI.
as well as other possible issues such as
- two different versions of the same screensaver, both playing on different displays.
- etc.
Yikes!
It's very clunky but it works just like on the desktop backgrounds side, whatever you set is persisted, if I setup Aerial on one and switch to the other screen, set monterey there, if I pick the first screen back it shows Aerial.
OK, I see what you are saying, and it kinda works.
Unfortunately, this means third-party screensaver authors now have to test for the difference between
- one screensaver, set to 'Show on all displays'
- the same screensaver, set to 'Show on one display', but set to show on all displays using this confusing UI.
Yeah, I think it may not change much, we already had different situations in macOS where your plugin was launched by one process and ran on 2 windows, or launched by 2 separate processes. I know I have code about that laying around in Aerial, I can never remember what the current situation is. The tiny preview in System Preferences was also sometimes sharing the same process (I think they no longer do that, if I had to guess, but not sure).
as well as other possible issues such as
- two different versions of the same screensaver, both playing on different displays.
Usually this goes very wrong, it's worth trying putting one version in /Library and one in ~/ and set them both, see what happens. System Preferences for example couldn't handle this if you put 2 versions, itonly loaded the UI bundle from one, which lead to hilariously hard crashes to debug if you opened the second. Now I just don't let people put Aerial in /Library for that reason ;)
Adding a bit on the legacy thing, it's late and I'm a bit too tired to investigate but I'm starting to wonder if what they do is, run the unlock screen animation through legacyScreenSaver, and at the same time set the last frame of the animation as a "picture" desktop background proper, and hide (but not kill) the legacyScreenSaver process called Wallpaper. I'm saying this because force quitting it just results in nothing changing visually.
Edit : Thankfully all those changes are brilliantly documented... https://developer.apple.com/documentation/screensaver 😩
Yeah, I think it may not change much, we already had different situations in macOS where your plugin was launched by one process and ran on 2 windows, or launched by 2 separate processes. I know I have code about that laying around in Aerial, I can never remember what the current situation is. The tiny preview in System Preferences was also sometimes sharing the same process (I think they no longer do that, if I had to guess, but not sure).
So, with recent versions of iScreensaver, which are written in Swift, there's a nice multi-screen syncrhonization feature, so when transitioning to another asset (image, video, 3D GLTF file...) each screen would talk to the other one and try to wait until all were ready, so they can all run the next effect simultaneously. When it works it's pretty nice.
Because legacyScreensaver did run all instances in the same process, this was fairly easy to do, by just using Swift globals. Or at least it seemed easy and worked on Intel, but when Apple Silicon came around, the memory model changed and having mutliple threads accessing globals no longer worked, as described here: https://developer.apple.com/documentation/apple-silicon/addressing-architectural-differences-in-your-macos-code
In any case, it was solved by adding some protection around the memory access using the synchronized directive or similar, see https://stackoverflow.com/questions/24045895/what-is-the-swift-equivalent-to-objective-cs-synchronized
With Sonoma, this doesn't seem to be working, so I need to go back and check this assumption that all screens are running in different threads but the same process. Maybe it's not true any more?
Super interesting, I think it's quite possible they now run multiple instances of legacyScreenSaver, would be interesting to look at.
Thinking about it, I'm pretty sure I'm relying on sharing a playlist object on Aerial too, for the spanned effect where I play a single video across multiple screen (I don't use mutexes though). It's late so I'll try to check more tomorrow. Could be a huge mess indeed 😩
OK, I can clearly see one bug - here's a sample log from iScreensaver being launched on Sonoma beta 2 when set to Show on all displays
Process:Thread Library Message
1191: 0xaaf4 iScreensaver ########## iScreensaver.init frame=(0.0, 0.0, 1680.0, 1050.0) isPreview=false
1191: 0xaaf4 iScreensaver ########## iScreensaver.initalize 0x00007fca6c762830
1191: 0xaaf4 iScreensaver ########## iScreensaver.initalize isPreview=false previewMode=false debugFlag=false hudTestFlag=false
1191: 0xaaf4 iScreensaver ### getScreenNumber defaulting to 0
1191: 0xaaf4 iScreensaver ### screen=[0] globalTestVar=1 myAddress=0x00007fca6c762830
1191: 0xaaf4 iScreensaver # [0] screenNumber = 0
1191: 0xaaf4 iScreensaver # [0] mainScreen = false
1191: 0xaaf4 iScreensaver ### [0] hasCongfigureSheet 0x00007fca6c762830
1191: 0xaaf4 iScreensaver ### [0] hasCongfigureSheet 0x00007fca6c762830
1191: 0xaaf4 iScreensaver [0] # draw 0x00007fca6c762830
1191: 0xaaf4 iScreensaver ########## iScreensaver.init frame=(0.0, 0.0, 1440.0, 900.0) isPreview=false
1191: 0xaaf4 iScreensaver ########## iScreensaver.initalize 0x00007fca6c77d820
1191: 0xaaf4 iScreensaver ########## iScreensaver.initalize isPreview=false previewMode=false debugFlag=false hudTestFlag=false
Translating this gibberish:
- the ScreenSaverView.Initialize call is being called once for each screen
- screen[1] is being initialized first, which is unusual, but isn't a big problem, however...
- the frame is wrong - 1680x1050 is my second monitor, and it's definitely not at coordinates 0,0
- this incorrect X,Y coordinate is confusing our code (which figures out which monitor it's on based on the X,Y,W,H of the frame) so it's mis-detecting and defaults to Screen[0].
- Next, the real Screen[0] is initialized, which has the correct coordinates (0.0, 0.0, 1440.0, 900.0) so it detects it's on screen zero
- at that point, everythign is Fubar'd because there are two Screen[0]s running, and they step on each other.
Other thoughts:
- I may be misreading this, but the debug logging shows that not only are the two screens being run from the same process (1191) they are also being run from the same thread (0xaaf4). This doesn't seem right to me, and perhaps could be part of the OS bug we are seeing? I would assume that each screen should be running in it's own thread, right?
- is there another way to figure out which actual screen we are on? our code uses the x,y,w,h of the frame, but since x,y are wrong, this isn't working...
Another test, this time with the System Settings / Screen Saver pane open shows that the small screen saver Preview window is in fact run in a different process:
Process:Thread Library Message
1251: 0xc6cb iScreensaver ########## iScreensaver.init frame=(0.0, 0.0, 143.0, 80.0) isPreview=true
1268: 0xc7c3 iScreensaver ########## iScreensaver.init frame=(0.0, 0.0, 1440.0, 900.0) isPreview=false
Note: when isPreview=true, the PID and ThreadID are different.
So, in Sonoma, screensavers on multiple monitors are run in the same process and thread (!?) during normal operation, but the screen saver settings Preview mode runs in its own process.
I've done some more testing and I think this behavior is similar in Ventura.
Is it possible that the main bug in Sonoma beta 2 is that it's giving us the wrong X,Y coordinates for Screen[1], Screen[2] etc.? Perhaps a workaround is possible.
Also, on Ventura on a 2 monitor system, screen[0] is initialized first, followed by screen[1] which seems more logical.
Also, both instances get the correct coordinates (the .frame.x and .frame.y are not zeros for screen[1] and higher...)
Ventura:
0x21642 6202 iScreensaver ########## iScreensaver.init frame=(0.0, 0.0, 1440.0, 900.0) isPreview=false default legacyScreenSaver
0x21642 6202 iScreensaver ### screen=[0] globalTestVar=1 myAddress=0x00007fcaca005940 default legacyScreenSaver
0x21642 6202 iScreensaver ########## iScreensaver.init frame=(1440.0, 0.0, 2560.0, 1440.0) isPreview=false default legacyScreenSaver
0x21642 6202 iScreensaver ### screen=[1] globalTestVar=2 myAddress=0x00007fcaca008440 default legacyScreenSaver
My understanding of the original bug was that as part of it, primary screen was misplaced on last screen so the messed up coordinates are part of that, but as far as I know we can’t change them. This is probably more complicated now I’ll try to dig a bit but I think it’s going to be a long wait for beta 3 🫣
Random observations :
-
I found, while not using the new desktop stuff, and only using Aerial, that legacyScreenSaver (Wallpaper) was actually Aerial that kept running in the background. My guess, 3rd party screen saver end up on the same path and they get "thrown" as wallpapers and kept running (which would be great) but that just doesn't work. I don't expect this to actually happen to be clear, it's just IMO their own implementation of mixed desktop background/screen saver, and we get caught in the middle. Reported as FB12428045
-
As you pointed out, we are initialised incorrectly with coordinates that are always zeroed in for origin. This can happen even when we end up running on a screen not zeroed in (I have 2 screens side to side, main is left, if we run on right, we still get it). As far as I can see, in my testing, most of the time we run on one screen or the other, if I set different sizes for my screens, we end up with various configurations, but mostly never the correct view on the correct screen. This is a variant of the original multimonitor bug, except we don't always end up on the last screen as before, now it's random. I'm still working on how to report those changes, but it's terrible.
-
Most of the time it shows the wrong preview in settings, I get the Ventura one running :
Funnily enough, when you press the preview button, things work correctly (on multiple screens even) ! A refreshing bug. Options button is not there though. Selecting another screen saver and selecting Aerial back fixes it. Reported as FB12428208