darickc / MMM-BackgroundSlideshow

MIT License
135 stars 78 forks source link

Any tip to improve the performance on Raspberry Pi 4B with 4K display? #103

Open openedhardware opened 3 years ago

openedhardware commented 3 years ago

This module works like a charm on RPi 4B with a 1080p display.

But with 4K display and 4k images, the transition isn't fluent and very choppy.

Any tips to improve the performance?

Here is my current config:

transitionImages: true,
transitionSpeed: "2s",
transitions: ['opacity', ],
resizeImages: true,
transitionTimingFunction: 'linear',
randomizeImageOrder: false,
recursiveSubDirectories: true,

Thanks!

scottdrichards commented 3 years ago

I have a pi3 and the transitions are choppy too (1080 display). As the transitions are handled by the browser, I would expect it to be optimized already. Perhaps there's a way to have the browser to render the transitions at a lower resolution and then scale it up?

darickc commented 2 years ago

I have found the transitions to be choppy as well. I don't think electron is using all the correct flags to allow hardware acceleration. One option would be to start magic mirror in server mode and enable hardware acceleration in chromium and use it instead. I can share some links on how to enable hardware acceleration on chromium, but they are on a different computer at home, so it will need to be later. I will try to do it tonight.

MacG-DD commented 2 years ago

I can share some links on how to enable hardware acceleration on chromium, but they are on a different computer at home, so it will need to be later. I will try to do it tonight.

That would be awesome. At my 2560x1080 the transitions are a bit choppy.

scottdrichards commented 2 years ago

I would also like to know how to enable the right flags. I am using a separate sever/browser setup so electron support isn't required. Thanks!


From: MacG-DD @.> Sent: Thursday, September 23, 2021 5:38:00 AM To: darickc/MMM-BackgroundSlideshow @.> Cc: scottdrichards @.>; Comment @.> Subject: Re: [darickc/MMM-BackgroundSlideshow] Any tip to improve the performance on Raspberry Pi 4B with 4K display? (#103)

I can share some links on how to enable hardware acceleration on chromium, but they are on a different computer at home, so it will need to be later. I will try to do it tonight.

That would be awesome. At my 2560x1080 the transitions are a bit choppy.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/darickc/MMM-BackgroundSlideshow/issues/103#issuecomment-925652972, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG4SWYQHGG7XFVQVQNUZ7ALUDLYPRANCNFSM463G6ERA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

darickc commented 2 years ago

Here are the links. https://lemariva.com/blog/2020/08/raspberry-pi-4-video-acceleration-decode-chromium https://stackoverflow.com/questions/58464329/raspberry-pi-4-with-buster-lite-chromium-webgl-not-hardware-accelerated

They are similar, but I think the stack overflow one has a couple more packages in the list. And then these are links I used to start it up in kiosk mode with a minimal install

https://die-antwort.eu/techblog/2017-12-setup-raspberry-pi-for-kiosk-mode/ http://meumobi.github.io/how%20to/2019/05/14/how-to-raspberry-digital-signage.html

Hope these help. The animations still aren't silky smooth for me, but much better than they were.

MacG-DD commented 2 years ago

Thanks! I've used the first link. The status of the devices are "okay" but Chromium says: Hardware-accelerated video encode - Not available on your platform.

My Raspberry Pi 4 Model B 2GB runs with Raspbian GNU/Linux 10 (buster).

darickc commented 2 years ago

Did you follow the rest of the article? There are some packages you install and then some flags that need to be set in chromium. Sorry, I've been pretty busy the past few months and just say this.