JohnCoates / Aerial

Apple TV Aerial Screensaver for Mac
MIT License
20.76k stars 1.05k forks source link

Screen Savers broken function on 2+ monitor system in Ventura 13.3 beta (FB12023530) #1286

Closed xmddmx closed 11 months ago

xmddmx commented 1 year ago

Hijacking the top post, this is FIXED in macOS 13.5.

--

macOS Ventura 13.3 beta 2 seems to severely break screen savers on multimonitor systems.

(This is not specific to Aerial, but describing it here in case others are wondering)

I just reported this issue to Apple as Feedback Case FB12023530:

To reproduce:

Regression:

xmddmx commented 1 year ago

From further debugging it appears as if:

glouel commented 1 year ago

Thanks, can confirm, I also reported it. I did see we were initialized on both screen but didn't catch that no StartAnimation event was sent. I'll update my FB with a referal here. The issue appeared in the 1st beta also, fyi.

xmddmx commented 1 year ago

In a prior version of macOS (can't remember if it was Monterey or Big Sur?) there was a bug where StartAnimation never fired, so I simply added a flag and a callback timer, e.g.

Init
  Set 1 second timer

StartAnimation
   bStartAnimationCalled=true

TimerCallback
   if bStartanimationCalled  == false
     StartAnimation()  // in case StartAnimation wasn't called, call it now

I wonder if this trick would help in Ventura?

glouel commented 1 year ago

I was having a second look, more precisely this part of your message :

Actual behavior: the screen’s rectangle seems to be offset by about 100 pixels (as if the NSView is not set to the actual screen coordinates)

I can't say I'm seeing this here, I get the correct coordinates passed in the init at least :

2023-03-01 18:11:12.711 : avInit .saver (0.0, 0.0, 2560.0, 1440.0) p: false o: false 2023-03-01 18:11:12.859 : avInit .saver (2560.0, 0.0, 2560.0, 1440.0) p: false o: false

(this is one 5K monitor and one 2560x 1440 monitor, so retina factor 2 and 1 respectively)

So at least here I can correctly match to the monitor informations. I don't seem to see an offset although maybe there's one and I didn't notice it with the videos. There's no black part anywhere at least.

Regarding startAnimation, this was on a run where it launched correctly on both :

2023-03-01 18:11:13.221 : <AerialView: 0x12a767eb0> startAnimation frame (0.0, 0.0, 2560.0, 1440.0) bounds (0.0, 0.0, 2560.0, 1440.0) 2023-03-01 18:11:13.383 : <AerialView: 0x12b8058c0> startAnimation frame (0.0, 0.0, 2560.0, 1440.0) bounds (0.0, 0.0, 2560.0, 1440.0)

This is however what I get with a more failed on first monitor launch :

2023-03-01 18:21:07.325 : <AerialView: 0x13e80a610> startAnimation frame (0.0, 0.0, 2560.0, 1440.0) bounds (0.0, 0.0, 2560.0, 1440.0)

Only one call of startAnimation.

So yeah, there's a good chance your workaround could actually work, I'll see if I can give it a shot quickly, it's likely you got the root cause here.

xmddmx commented 1 year ago

I, too, am seeing the correct monitor coordinates in my logs, but then the playback on the second screen (which seems to actually be the first screen's process) is offset.

My monitor setup:

Arrangement:

image

However, if I mess around with monitor arrangement, it always looks the same, so I suspect it's not the monitor's relative locations, but perhaps their Sizes which is relevant?

Here's what I see when running. The built-in screen is blank, and the 2nd monitor is offset:

image

Edit to add: in fact, I'm pretty sure that's the issue, the first screen is playing on the second screen, and since they aren't the same size, no wonder it doesn't fill the screen!

glouel commented 1 year ago

Yeah I was going to say, this looks like the size of your main monitor running on the second, because mine are similar sized I didn't see that part.

I'm wondering at what point the coordinates get wrecked, I'll try messing with resolution to dig a bit more.

glouel commented 1 year ago

Ok so, I tried your idea for a workaround but I think that the original issue that you noted is not allowing us to fix it ourselves :

2023-03-01 18:40:39.752 : avInit .saver (0.0, 0.0, 2560.0, 1440.0) p: false o: false 2023-03-01 18:40:39.753 : <AerialView: 0x13f13cd60> AerialView setup init (V3.2.4) preview: false

0x13f13cd60 : This is the init on main screen

2023-03-01 18:40:39.921 : avInit .saver (2560.0, 0.0, 2560.0, 1440.0) p: false o: false 2023-03-01 18:40:39.922 : <AerialView: 0x139922a60> AerialView setup init (V3.2.4) preview: false

0x139922a60 : This is the second screen, correct coordinates here

Now, this is the startAnimation that goes through :

2023-03-01 18:40:40.274 : <AerialView: 0x13f13cd60> startAnimation frame (0.0, 0.0, 2560.0, 1440.0) bounds (0.0, 0.0, 2560.0, 1440.0)

This is the init of the main screen. But we know it shows up on the secondary despite correct frame and bounds.

The workaround does kick in for the secondary monitor :

2023-03-01 18:40:40.967 : forcing startAnimation (workaround Ventura 13.3beta 2023-03-01 18:40:40.968 : <AerialView: 0x139922a60> startAnimation frame (2560.0, 0.0, 2560.0, 1440.0) bounds (0.0, 0.0, 2560.0, 1440.0)

This does not do anything for me, it doesn't replace the first one for example.

Again coordinates are correct, but the view is not displayed where it should despite what it says. So I think you're correct here, for some reason in some cases, the main screen thread's NSView is mistakenly put on the second monitor. I'll try to double check by changing resolution.

xmddmx commented 1 year ago

yeah, it feels as if this is an OS bug.

If I run Console set to show Errors and Warnings, and test using apple's Message screensaver, I see errors which are suggestive of some sort of problem:

error   09:49:11.053147-0800    CoreFoundation  ScreenSaverEngine   Attempt to load executable of a type that cannot be dynamically loaded for CFBundle 0x60000103a000 </System/Library/Frameworks/ScreenSaver.framework/PlugIns/Computer Name.appex> (executable, not loaded)
error   09:49:11.056956-0800    ExtensionFoundation ScreenSaverEngine   Extension request contains input items but the extension point does not specify a set of allowed payload classes. The extension point's NSExtensionContext subclass must implement `+_allowedItemPayloadClasses`. This must return the set of allowed NSExtensionItem payload classes. In future, this request will fail with an error.
error   09:49:11.062119-0800    SkyLight    WindowServer    CGLayerKit called back with no connection
error   09:49:11.073596-0800    SkyLight    WindowServer    CGLayerKit called back with no connection
error   09:49:11.064167-0800    pkd pkd could not fetch persona generation ID (Error Domain=PlugInKit Code=-1 "persona generation ID unavailable" UserInfo={NSLocalizedDescription=persona generation ID unavailable}), flushing cache
error   09:49:11.074242-0800    SkyLight    WindowServer    CGLayerKit called back with no connection
error   09:49:11.075145-0800    SkyLight    WindowServer    CGLayerKit called back with no connection
error   09:49:11.079260-0800    SkyLight    WindowServer    CGLayerKit called back with no connection
error   09:49:11.093786-0800    RunningBoard    runningboardd   memorystatus_control error: MEMORYSTATUS_CMD_CONVERT_MEMLIMIT_MB(-1) returned -1 22 (Invalid argument)
error   09:49:11.093914-0800    RunningBoard    runningboardd   memorystatus_control error: MEMORYSTATUS_CMD_CONVERT_MEMLIMIT_MB(0) returned -1 22 (Invalid argument)
error   09:49:11.100191-0800    SkyLight    WindowServer    CGLayerKit called back with no connection
error   09:49:11.107122-0800    AppKit  loginwindow Warning: Window LUI2Window 0x143b1c060 ordered front from a non-active application and may order beneath the active application's windows.
error   09:49:11.107300-0800    AppKit  loginwindow Warning: Window LUI2Window 0x143940890 ordered front from a non-active application and may order beneath the active application's windows.
error   09:49:11.107395-0800    AppKit  loginwindow Warning: Window LUI2Window 0x143d1c110 ordered front from a non-active application and may order beneath the active application's windows.
error   09:49:11.107772-0800    AppKit  loginwindow Warning: Window LUI2Window 0x143a0f780 ordered front from a non-active application and may order beneath the active application's windows.
error   09:49:11.108216-0800    AppKit  loginwindow Warning: Window LUI2Window 0x143b1c060 ordered front from a non-active application and may order beneath the active application's windows.
error   09:49:11.109992-0800    launchservicesd launchservicesd Application App:"loginwindow" asn:0x0-2002 pid:568 refs=7 @ 0x1294098e0 tried to be brought forward, but isn't in fPermittedFrontApps ( ( "LSApplication:0x0-0x1bd1bd pid=6021 "Screen Saver"")), so denying.
error   09:49:11.110061-0800    SkyLight    WindowServer    0[SetFrontProcess]: [cps/setfront] Failed setting the front application to <private>, psn 0x0-0x2002, securitySessionID=0x186ad, err=-13066
glouel commented 1 year ago

Test with resolution changed to 1920 on secondary :

[id=7, width=2560, height=1440, bottomLeftFrame=(0.0, 0.0, 2560.0, 1440.0), topRightCorner=(2560.0, 1440.0), isMain=true, backingScaleFactor=2.0] [id=6, width=1920, height=1080, bottomLeftFrame=(2560.0, 360.0, 1920.0, 1080.0), topRightCorner=(4480.0, 1440.0), isMain=false, backingScaleFactor=1.0]

What I get

2023-03-01 18:47:50.789 : avInit .saver (0.0, 0.0, 2560.0, 1440.0) p: false o: false 2023-03-01 18:47:50.789 : <AerialView: 0x13b033b30> AerialView setup init (V3.2.4) preview: false

0x13b033b30 : First screen

2023-03-01 18:47:50.950 : avInit .saver (2560.0, 360.0, 1920.0, 1080.0) p: false o: false 2023-03-01 18:47:50.951 : <AerialView: 0x13b0dfe50> AerialView setup init (V3.2.4) preview: false

Second thread with correct coordinates + size.

2023-03-01 18:47:51.311 : <AerialView: 0x13b033b30> startAnimation frame (0.0, 0.0, 2560.0, 1440.0) bounds (0.0, 0.0, 2560.0, 1440.0)

This is the main screen frame that is started ! And visually I can confirm, in my case it shows blown up (missing top/right part) on the secondary screen.

2023-03-01 18:47:51.994 : forcing startAnimation (workaround Ventura 13.3beta 2023-03-01 18:47:51.996 : <AerialView: 0x13b0dfe50> startAnimation frame (2560.0, 360.0, 1920.0, 1080.0) bounds (0.0, 0.0, 1920.0, 1080.0)

The secondary thread is force started but this is irrelevant.

So again thanks for your input on this, I'll update the FB again (I reported it as FB12007471).

xmddmx commented 1 year ago

I just tested 13.3 beta 3 - no change, it's still malfunctioning. :(

DSBlackHeart commented 1 year ago

Hello, I have this issue. If someone needs help with testing or if I can help please let me know. Screenshot 2023-03-09 at 12 53 35 PM

xmddmx commented 1 year ago

I just tested 13.3 beta 4, and had very weird results.

Tried Aerial: worked Tried a screensaver built using iScreensaver: did work. Tried a different screensaver saver built using iScreensaver: did not work

Went back and tried the prior screensaver: did not work.

Went back and tried Aerial again. did not work.

This seems reproducible:

Advice: If you test with 13.3 beta 4, don't just do a single test and say "good" - do some repeated tests.

Further testing:

glouel commented 1 year ago

So I'm not sure if anything really changed, because it worked some of the time previously here, and maybe it works a bit more often but if I launch 10 times in a row I still get some working and some failings. It may work more often that before, but it's not as clear as you described at least here, failures and workings are still intertwined (just testing with Aerial multiple times in a row).

xmddmx commented 1 year ago

Good point, I think you are right.

I just did a bunch of tests in a row with both the Aerial and macOS Messages screensaver and you seem to be correct - it's failing pretty much randomly now, working about 20%-30% of the time.

X = fail √ = works

Messages: X X X X X √ X X X √ X X √ √√ √ X X √ Aerial: X √ X X X X X X X X X √ X X √ √ X √ √ X X X

I did not do this sort of repeated testing in 13.3 beta 3 or earlier, so I can't say if anything has changed in beta 4.

DSBlackHeart commented 1 year ago

Afternoon, I just updated to the Beta 4 & Aerial is still not working, I tried to start it by using my Hot Corner.

I will see if a different SS has any better success.

Screenshot 2023-03-15 at 3 35 00 PM
DSBlackHeart commented 1 year ago

Tried the following

Message - Did not do anything, tried preview & hot corner activation Word Of Day - worked HC Activation Ventura - worked HC Activation Album Artwork - worked HC Activation Monterey - worked HC Activation

glouel commented 1 year ago

pretty much randomly now, working about 20%-30% of the time.

Can confirm I have the same in b4

I did not do this sort of repeated testing in 13.3 beta 3 or earlier, so I can't say if anything has changed in beta 4.

I didn't either, but I would have said it worked less frequently than that, maybe 15-20% ? At this point who knows. I updated my radar with the relevant info, I'm hopeful they are actively looking at it. Fingers crossed !

DSBlackHeart commented 1 year ago

You know My I-Mac woke me up the other day, it had a Panic Attack, I did not think about it till now, wonder if it had something to do with all this.....

Would the Diag Dump be some where ? If so would it help you ?

glouel commented 1 year ago

@DSBlackHeart did it fully woke up or did the screen just woke up (staying black) ?

I've had the second bug on my secondary screen for months (a regular non apple monitor, connected via USB-C to DP cable), it wakes up (staying black) and goes back to real sleep after 20-30s, maybe once an hour and I never bothered to look up what was happening.

In any case it's likely not related to this, at least not on the screen saver side as the screen saver has no power to either put your mac to sleep or wake it up, macOS is always the one in control.

Should this happen again, use Feedback assistant to collect the relevant data as soon as you see it waking up and note the time it happened, as only Apple can fix those issues.

DSBlackHeart commented 1 year ago

Panic attack - it restarted the system

The stuff above i tested the screen is black but backlight is lit

glouel commented 1 year ago

Kernel Panic ? Definitely report those to Apple, likely unrelated !

xmddmx commented 1 year ago

I just tested the latest beta, which no longer says Beta, version = 13.3 (22E252) and the bug is still there. Various websites are saying this version of 13.3 is the RC (Release Candidate) version.

Does anyone know a way to get some attention at Apple for this to escalate it?

DSBlackHeart commented 1 year ago

I still have the issue as well, I looked in the release notes and did not see any mention of a fix. The only problem with trying to get someone at Apple to do something about it is you have to go through about 10+ dumb people before you find someone who knows what is happening. The standard: Delete the Prefs reset the SMC do a clean system install

Things you know 110% are not going to fix the problem.

xmddmx commented 1 year ago

Related discussion on Apple Developer Forums: https://developer.apple.com/forums/thread/727168

glouel commented 1 year ago

@xmddmx @DSBlackHeart

Just installed 13.4beta1 (released today) and thankfully, they fixed it! Let's hope they don't break it again and they release 13.4 quickly now ;)

xmddmx commented 1 year ago

13.4 beta 1 also working for me in initial tests on a 2 monitor system.

DSBlackHeart commented 1 year ago

I am looking forward to trying out the update, I dont see it posted on my end yet but looking forward to the install. :)

spawnofbill commented 1 year ago

Unfortunately, updating to 13.4beta1 did not resolve this bug for me. I am running a three monitor system on a Mac Studio

glouel commented 1 year ago

Unfortunately, updating to 13.4beta1 did not resolve this bug for me. I am running a three monitor system on a Mac Studio

Do you have more info ? Can you replicate with the built-in Messages screensaver ? If so please make a bug report to Apple and mention FB12007471

spawnofbill commented 1 year ago

Unfortunately, updating to 13.4beta1 did not resolve this bug for me. I am running a three monitor system on a Mac Studio

Do you have more info ? Can you replicate with the built-in Messages screensaver ? If so please make a bug report to Apple and mention FB12007471

I cannot reproduce the issue with the built in Messages screensaver, it only happens with Aerial and other third party screensavers. I am seeing a single video playing on one of my secondary monitors but offset and smaller like shown above.

Screenshot 2023-03-29 at 11 50 00 AM
glouel commented 1 year ago

That's weird, thanks for following up. Please make a report to Apple as they might gather some information from your report to see why it's not fixed in your specific case, looks like they missed something.

xmddmx commented 1 year ago

@spawnofbill How are you launching the screensaver? Letting it time out? Using a Hot Corner? Using the "Preview" button (which means the System Settings panel is open. These situations are different and relevant for how the legacyScreenSaver process works...

Also, if you are able, would you please try a demo screensaver from iScreensaver, such as: https://iscreensaver.com/downloads/savers/InstallSpaceSaver.app.zip

spawnofbill commented 1 year ago

@spawnofbill How are you launching the screensaver? Letting it time out? Using a Hot Corner? Using the "Preview" button (which means the System Settings panel is open. These situations are different and relevant for how the legacyScreenSaver process works...

Also, if you are able, would you please try a demo screensaver from iScreensaver, such as: https://iscreensaver.com/downloads/savers/InstallSpaceSaver.app.zip

Preview, Hot Corner and letting the display time out all display the same symptoms with Aerial. iScreensaver does the same.

spawnofbill commented 1 year ago

So interesting update, I just unplugged one of my monitors and Aerial worked perfectly fine. So something is wrong with how MacOS 13.4 handles more than two monitors now instead of just more than one.

glouel commented 1 year ago

I updated my feedback with Apple but please file one so they get what they need to reproduce.

spawnofbill commented 1 year ago

I updated my feedback with Apple but please file one so they get what they need to reproduce.

Yup filed as FB12085443

spawnofbill commented 1 year ago

Oh this is fun. With four monitors it does this. IMG_1561

DSBlackHeart commented 1 year ago

I know this feeling....

DSBlackHeart commented 1 year ago

I have checked several times but i dont see this update posted yet, I am still at 13.3 ( 22E252 )

andydempster commented 1 year ago

I, too, am seeing the correct monitor coordinates in my logs, but then the playback on the second screen (which seems to actually be the first screen's process) is offset.

My monitor setup:

  • M1 Macbook Air Built in display : Default scaling (frame = 0,0, 1440x900)
  • External 24" monitor Default scaling (frame = 1440, -250, 1680x1050)

Arrangement:

image

However, if I mess around with monitor arrangement, it always looks the same, so I suspect it's not the monitor's relative locations, but perhaps their Sizes which is relevant?

Here's what I see when running. The built-in screen is blank, and the 2nd monitor is offset:

image

Edit to add: in fact, I'm pretty sure that's the issue, the first screen is playing on the second screen, and since they aren't the same size, no wonder it doesn't fill the screen!

I'm seeing this exact same behaviour on Ventura 13.3 after the recent security update. I can confirm that Aerial was working just fine before. When Aerial is set to main display or the Macbook display it doesn't show on the macbook, only the external screen.

jbkkd commented 1 year ago

Probably related, though not exactly the same - on a rotated screen, the video rotates wrong on the second screen and also cuts off (the video on the vertical screen is rotated 90 degrees, wrongly). On an M1 MBP WhatsApp Image 2023-03-30 at 13 13 47

glouel commented 1 year ago

@jbkkd the puzzling part to me on that one is that you have the text at the correct position at the bottom, so that means Aerial gets the correct stuff . It looks like a regression of an old bug though with the quicktime APIs not getting the rotation information, or getting wrong screen somehow. Weird.

This is on 13.4beta1?

jbkkd commented 1 year ago

Nope - I'm on 13.2.1, running Aerial 3.2.3

DSBlackHeart commented 1 year ago

Well did the update, NOT FIXED. I guess my question is how hard is this to fix? It worked fine before and then it stopped, so what did they change? Let me guess..... Apple added some new, improved, great features that no one will really like or use. IMG_2119 Screenshot 2023-03-30 at 3 05 24 PM

DSBlackHeart commented 1 year ago

Just an open thought....

Has anyone tried to replicate this on the production release?

Ventura 13.3 use "terminal" to download the full installer and then install it in a disk partition to see if it still fails ?

Or did I just volunteer to have something to do on my day off ? LOL

wblew commented 1 year ago

This issue is occurring on my production Ventura 13.3. In fact here is Activity, note the %100 percent CPU as well.

image

Fofer commented 1 year ago

Yes, I came here to report the same with macOS 13.3. I just added a 2nd 4K Dell display to enjoy it with Ventura on my M1 Mac mini. Only once, did I see Aerial display with the video "spanning" across both screens, and now I can't get it to display that way again. I've tried everything, It's only showing up on the left screen, not my primary. The other screensavers I have installed are working fine. Sad, as Aerial is, by far, the best screensaver in the universe! Hopefully it can be addressed, otherwise I'll miss it greatly :(

glouel commented 1 year ago

@Fofer this is not an Aerial bug, it affects every single 3rd party screen saver and some 1st party screensaver (for example the Message one from Apple). As to why it worked once, the bug happen about 80-90% of the time, so you may see the odd time when everything works.

The bug is in macOS Ventura 13.3 specifically and 13.4 has a (partial for now) fix for the issue.

JohnHales commented 1 year ago

I installed MacOS 13.3 release version. I have 4 monitors (M1 Mackbook built in, 1 FHD and 2 4K monitors). Desktop Aerial background works great. Screensaver won't launch (screen just goes black). I have updated to the latest beta of both Companion and Aerial. Latest GA version had the same issue. I can view them via the app, but the screensaver won't start. Options via Settings doesn't work, but does via the Companion app. I tried having the video play on all monitors (independently - which I've used for years) as well as one by one individual windows and it won't start. I also found that while I can use Aerial on my main screen for desktop, on all secondary screens I just get the usual Wallpaper setting. I wondered after read the Docs and FAQs if it might be an advanced setting, so I disabled Brightness control and Vibrance (under Filters). I'm using 4K videos as the format. Overlays seem to make no difference. Looking forward to a resolution to this!!

glouel commented 1 year ago

I installed MacOS 13.3 release version.

Please see my message above. If you have access to macOS Betas, the bug is partially fixed in 13.4beta1, although it seems it doesn't work with 3 monitors (and likely not 4 either).

Options via Settings doesn't work, but does via the Companion app.

Yes there's something weird with System Settings, again. Closing and reopening System Settings seems to fix it.