JohnCoates / Aerial

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

Thumbnails are created as empty black pictures on some macs (both jpg and png) on macOS 13.4 using OpenCore patcher #1307

Closed MetaChuh closed 1 year ago

MetaChuh commented 1 year ago

Description of issue:

Aerial 3.2.5 Thumbnails are always created as empty black pictures Both the large jpg and small png previews have smaller file sizes than usual This happens on every new Aerial install on Ventura 13.4

Way to reproduce: Install Aerial (fresh and clean install) Go to Settings > Browse Videos and wait until the thumbnails are created. All Previews are black

Alternative way to reproduce: Go to: ~/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver/Data/Library/Application Support/Aerial/Thumbnails delete all thumbnails Go to Settings > Browse Videos and wait until the thumbnails are created. All new thumbnails will be black images with very small file sizes

glouel commented 1 year ago

Hi @MetaChuh

Any chance you are behind some kind of a firewall or proxy ? Just tested here and it works fine.

Can you try this:

If none of that works I'd like to see the log.

But it's likely a network thing, you probably can't download videos either since it's the same servers.

MetaChuh commented 1 year ago

hi, @glouel many thanks for the quick reply.

But it's likely a network thing, you probably can't download videos either since it's the same servers.

videos play fine, it's just the thumbnails which are black on this specific mac.

browse videos

Any chance you are behind some kind of a firewall or proxy ? Just tested here and it works fine.

no, it is a direct connection to the internet, with dns set to 8.8.8.8 and 1.1.1.1

tell me the exact size of those small files & open one of them in a text editor (it might save the proxy/firewall error)

i've attached examples of both thumbnail types for you to analyze, because to me the headers look ok, but the content does not. (info: attached zip contains the same, just in case it gets altered if uploaded inline)

00BA71CD-2C54-415A-A68A-8358E677D750-large 00BA71CD-2C54-415A-A68A-8358E677D750 00BA71CD-2C54-415A-A68A-8358E677D750.zip

If none of that works I'd like to see the log.

i've cleared the cache and the thumbnails folder, enabled debug mode and switched over to "browse video to trigger log writing

AerialLog.txt

greetings, metachuh

glouel commented 1 year ago

Thanks for all this, but the log is wayyyyy too trimmed, please give me a full log as there's important debug information on startup that I can't see here.

In any case, this is super weird, the files are "correct" jpg/png files, just blanks. Logs don't show any error either.

It looks like you are using 1080p AVC video format. Are all your videos cached or not ? There are two different ways Aerial can generate thumbs, either from your local cache or online.

Also, is this running from System Settings or Companion?

MetaChuh commented 1 year ago

hi, @glouel

many thanks for your answers.

Thanks for all this, but the log is wayyyyy too trimmed, please give me a full log as there's important debug information on startup that I can't see here.

the log is untruncated what has been written since activation of the debug mode yesterday. before activating debug mode there was no log at all, so this was the best i could do to follow your request.

here is the log file from today, maybe you find more of what you are searching for. if not, tell me what to do to populate the log to your needs

AerialLog.txt

It looks like you are using 1080p AVC video format. Are all your videos cached or not ? There are two different ways Aerial can generate thumbs, either from your local cache or online.

i've tried both cached with unlimited cache and prior downloading of all videos, and default settings. all cached videos are in perfect health and can be played back by any player. i've also tried to delete all thumbnails and let them be recreated using the cached videos, still black thumbnails. video playback is always working.

Also, is this running from System Settings or Companion?

i've tried both prior to raise this ticket. whatever you want me to try, i'll happily do everything exactly as you'll request, regardless of whether i've tried it allready.

thanks and greetings, metachuh

glouel commented 1 year ago

Hey @MetaChuh

here is the log file from today, maybe you find more of what you are searching for. if not, tell me what to do to populate the log to your needs

This is perfect, thanks a lot.

i've tried both cached with unlimited cache and prior downloading of all videos, and default settings. all cached videos are in perfect health and can be played back by any player. i've also tried to delete all thumbnails and let them be recreated using the cached videos, still black thumbnails. video playback is always working.

I see

i've tried both prior to raise this ticket. whatever you want me to try, i'll happily do everything exactly as you'll request, regardless of whether i've tried it allready.

Ok great, so just in case in the future, considering you are running Ventura, if you don't already, try the beta of Companion as there are some subtle bugs with the old one when hosting the screensaver to display settings : https://github.com/AerialScreensaver/AerialCompanion/releases/download/v1.5.0b3/Aerial.Companion.app.zip

I don't think it should apply here though, and you tried both ways anyway.

Know however that if you delete the thumbnails while companion is still running, if you relaunch it (via Companion), you will get white tiles (because it's looking for files that it thinks exists, but can't find), but not your black ones. This is not your bug but just FYI.

To recap your important settings for later reference :

I did try to replicate the bug with those settings in macOS Sonoma beta 1 but couldn't, so I installed 13.4 in a VM to try again, and again I'm unable to replicate the issue.

At this point it's either that I'm missing something, or there could be a macOS bug specific to your GPU generation. Apple does use Intel QuickSync to decode the 1080pH264 videos and it's possible there's a driver bug (again) that corrupts the thumbnail generation.

Would you try this :

So you get this

Capture d’écran 2023-06-12 à 15 12 30

In your case are the icons black or not in this specific view ? This is not a 100% test as I believe Apple changed their thumbnail generation but definitely worth a check, bugs like these happened before.

The other option is I whip up a quick test app to narrow the bug down. Would you be willing to test that ?

Thanks

glouel commented 1 year ago

@MetaChuh

Please download this : https://github.com/glouel/ThumbGenTest/releases/download/v1.0/ThumbGenTest.app.zip

Run it and press the big button. This is what you should get on 13.4 :

Capture d’écran 2023-06-12 à 18 31 06

HDR is messed up but that's ok ;) Let me know if you get the same results or not, if not it's likely a specific bug with your mac generation.

davewantsmoore commented 1 year ago

If it helps, I am having issues with thumnail generaiton and videos hanging. I am running 3.2.6 beta. EDIT: Ariel defaults to 4k HVEC for my mac. 13.4 / iMac late 2015 (Radeon R9 2xx).

If I shut everyting down and delete the thumbs ... and then start up, sometimes they all generate, and sometimes random thumbs will be white.

If I open the cache, videos which hang in the Ariel settings up (cause the screensaver process to go not responding) - also do not play through finder/quickview (points to bug with mac generaiton!?)

When playing via the actual screen saver, when a video hangs it sits on a blank screen, with the overlays.

ThumbGenTest gives me the beachball afterclicking Fetch.

EDIT: I just nuked everything, and selected 1080P H264, and things look to be working much better, BOTH for thumbnails and for videos hanging.

glouel commented 1 year ago

That's super helpful @davewantsmoore thanks a lot, particularly the beachballing on ThumbGenTest. Could you open Console.app and see if you got a crash report there just in case ?

I may need to narrow it down with more buttons but it definitely looks like it's something common to multiple Intel chips in 13.4...

Edit : just saw your edit, on a 2015 iMac (I developped most of Aerial on that exact Mac !) 1080p H264 is the only mode that's truly hardware accelerated, so that's definitely a good hint.

glouel commented 1 year ago

Ok finally made the realisation that your macs are not officially supported by Apple, so you both are probably using opencore ?

There seems to be a host of graphics related issues in Ventura that may be part of this : https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1008

Considering this, I would highly recommend staying on 1080pH264 for the time being.

@davewantsmoore you may also want to try playback of a 4K video on quicktime too, see if it has issues. At this point this may be more of a OpenCore issue than mine. Also make sure your patches are updated.

davewantsmoore commented 1 year ago

Could you open Console.app and see if you got a crash report there just in case ?

I didn't think it had, but on second check... It did.

VTDecoderXPCService-2023-06-15-124224.ips.zip

Ok finally made the realisation that your macs are not officially supported by Apple, so you both are probably using opencore ?

Correct.

There seems to be a host of graphics related issues in Ventura that may be part of this : dortania/OpenCore-Legacy-Patcher#1008

Yes, the GPU doesn't support HVEC, so it must be (trying to) fall back to the CPU (?!) It's interesting that when the 4K HVEC videos DO play, they play nicely, with fan still down on silent.

Thanks for your time.

glouel commented 1 year ago

I didn't think it had, but on second check... It did.

VTDecoderXPCService-2023-06-15-124224.ips.zip

Yeah so it's the video decoder service that crashed, that's a classic. This is the one that does hardware decoding. You can see exactly where it fails, it tries to use hardware accelerated video decoding to get the first frame of the video, and that's where it crashes.

It's interesting that when the 4K HVEC videos DO play, they play nicely, with fan still down on silent.

Are you talking about Aerial's 4K HEVC videos specifically ? Off the top of my head mostly silent with 1 video, and partially CPU decoded, HDR was definitely not. More below

Yes, the GPU doesn't support HVEC, so it must be (trying to) fall back to the CPU (?!)

Wellllll, it's been a while but here's how it worked in general on Intel and official macOS :

The opencore patcher kinda implies that they offer hardware acceleration for some stuff, they even talk about video encoding/decoding which I'm 100% sure never kicked in on official macOS, and they say it's broken but I don't believe it ever worked. They do say non functionnal video acceleration which is hard to parse.

AMD's Encoder/Decoder are broken caused by AMDRadeonVADriver.bundle and AMDRadeonVADriver2.bundle extraction Currently stock VA is used to avoid outright crashing, however is non-functional

I can see two possible scenarios :

I would recommend asking the opencore people about it, using the ThumbGenTest repository as an example, they likely can better diagnose it than I do as I no longer have that hardware to test. Feel free to ping me in the issue you create there if they need anything from me.

davewantsmoore commented 1 year ago

Are you talking about Aerial's 4K HEVC videos specifically ? Off the top of my head mostly silent with 1 video, and partially CPU decoded, HDR was definitely not

Yes.

  • 13.4 removed the partial QuickSync decoding and the call to generate the thumbnail fails because of that (they had kicked all the macs that didn't handle main10 in 13)

Ahhh. Seems probable.

I would recommend asking the opencore people about it, using the ThumbGenTest repository as an example, they likely can better diagnose it than I do as I no longer have that hardware to test. Feel free to ping me in the issue you create there if they need anything from me.

Thankyou.

Thumbnails are created as empty black pictures on some macs (both jpg and png) on macOS 13.4 using OpenCore patcher

Just to be clear my sympoms in detail (for relating any other issues, or for relating to MetaChuh whos issue I have hitched myself too. :)

(Some) White thumbnails on the high-level screen (categories, locations, etc.) (Some) Black thumnails in the browse video screen Looking in the thumbnails folder the files don't exist for the ones displaying black or white. Wrong thumnails in the browse video screen (sometimes videos or categories will show the completely wrong thumbnail)

Some HVEC videos don't play (crash) Thumbnails and videos work 100% if H264 is selected.

... but given the offending videos also crash preview, and ThumbGenTest fails, then I suspect you have diagnoised the root cause.

davewantsmoore commented 1 year ago

Yes, the GPU doesn't support HVEC, so it must be (trying to) fall back to the CPU (?!)

Random shower-thought...

If I were to download the 4K HVEC videos .... and re-endcode them into H264 and replace the videos in the cache (give them the same file name) .... and then turn off any auto-downloading, so nothing HVEC was auto-added later.

Might this work? As a super-jank work-around for someone like me...

(Thanks again for your time, this is superb for free software).

glouel commented 1 year ago

If I were to download the 4K HVEC videos .... and re-endcode them into H264 and replace the videos in the cache (give them the same file name) .... and then turn off any auto-downloading, so nothing HVEC was auto-added later.

Might this work?

Yep definitely, just keep the filenames exactly the same, Aerial won't care a bit and will play the 4K H.264. You'll likely get full hardware acceleration too, if that's enabled.

MetaChuh commented 1 year ago

hi @glouel many thanks for ThumbGenTest.app, you are passionate and awesome 👍🙏

(sorry for my late answer, thankfully i've seen that you two found out everything relevant and more without my input)

i've now made a lot of tests with opencore legacy patched macs running ventura 13.4. good news: only the iMac 27 2013 (Nvidia Kepler, GeForce GT 755M, OpenCore 0.6.8 beta) has those thumbnail issues.

tested without issues: MacMini 2012 with iGPU works MacBook Pro 13" 2014 with iGPU works iMac 21" 2010 with radeon hd 4670 works

here is the ThumbGenTest.app screenshot: iMac 27 2013 (Nvidia Kepler, GeForce GT 755M, OpenCore 0.6.8 beta)

ThumbGenTest iMac 27 2013 (Nvidia Kepler, GeForce GT 755M)

1080p h264 is black, hevc works, hdr is corrupted

analogue to that, the finder thumbnail you've given us the hint on, reflects the same (1080p h264 is black, hevc works, hdr is corrupted) thumbs from h264

@davewantsmoore ideas to his needs led me to a solution that solved my needs: i've deleted the thumnails, switched to hevc, recreated the thumbnails by browsing the videos, and switched playback back to h264

so for me this issue can be closed, as it has nothing to do with aerial itself, as soon as you both agree.

private sideinfo if you are interested, why i suddenly needed the thumbnails in the first place, even if i never noticed them being black before:

i'm using 3 monitors. as a temporary workaround to get aerial on all 3 screens (at least pictures of it), i wanted to use the apple tiles screensaver, displaying the content of the aerial thumbnails folder.

many thanks again, and greetings, metachuh

glouel commented 1 year ago

hi @glouel many thanks for ThumbGenTest.app, you are passionate and awesome 👍🙏

(sorry for my late answer, thankfully i've seen that you two found out everything relevant and more without my input)

Thanks for following up.

i've now made a lot of tests with opencore legacy patched macs running ventura 13.4. good news: only the iMac 27 2013 (Nvidia Kepler, GeForce GT 755M, OpenCore 0.6.8 beta) has those thumbnail issues.

tested without issues: MacMini 2012 with iGPU works MacBook Pro 13" 2014 with iGPU works iMac 21" 2010 with radeon hd 4670 works

Per @davewantsmoore iMac 27 2015 (Intel Skylake, Radeon R295X) also exhibit the issue.

1080p h264 is black, hevc works, hdr is corrupted

Yeah, to be clear, HDR is considered unusable, I only added it to track if they fixed it in Sonoma (spoiler : they didn't). Aerial's HDR videos are Dolby Vision encoded and that's the part that doesn't work. This seems like an issue across all Apple platforms, as if you watch a HDR video in many streaming services, the thumbnails that show on the scrub bar are often wrong and appear blown out (they might be SDR fetched online, and show up wrong and blown up because of the wrong colorspace). Pretty sure this is the case with Disney+ and others.

analogue to that, the finder thumbnail you've given us the hint on, reflects the same (1080p h264 is black, hevc works, hdr is corrupted) thumbs from h264

Ok great, I wasn't 100% sure but the miniature thumbnails in 3 colons views are I believe generated the exact same way I do it for Aerial (and the ThumbGenTest).

If you click in that same view a video, the preview in the column is a video player, which incidently gives black bars that many people complained about. This ended up fixing the corrupted preview in HDR bug I had reported (but they didn't fix the API...). This was changed afair in 13.

If you use the "icon view" Apple puts a miniature video player as an icon. This changed semi recently too, though I'm not 100% confident that was in 13 too.

Because of that, if you use HDR in Aerial, the thumbnails are generated from the online source always, and not from your cached videos. Also this is why I default to a video player now if the video is available locally in the browse section.

@davewantsmoore ideas to his needs led me to a solution that solved my needs: i've deleted the thumnails, switched to hevc, recreated the thumbnails by browsing the videos, and switched playback back to h264

so for me this issue can be closed, as it has nothing to do with aerial itself, as soon as you both agree.

Good for me, but can you make sure you report those findings with OpenCore though ? I understand they closed the issue submission on github but take them through discord.

private sideinfo if you are interested, why i suddenly needed the thumbnails in the first place, even if i never noticed them being black before:

i'm using 3 monitors. as a temporary workaround to get aerial on all 3 screens (at least pictures of it), i wanted to use the apple tiles screensaver, displaying the content of the aerial thumbnails folder.

Understood ! Note that for each video, the thumbnails folders contains very small minatures in .png, and a full, large, 1st frame grab in jpg.

glouel commented 1 year ago

I'm closing this, feel free to ping me if needed.