kolbyjack / MMM-Wallpaper

MagicMirror module to display wallpapers from various online sources
https://magicmirror.builders/
MIT License
99 stars 31 forks source link

Setting source: "/r/earthporn" causes MagicMirror crash/black screen. #3

Closed WalrusSwarm closed 5 years ago

WalrusSwarm commented 5 years ago

source: "bing" and source: "firetv" work perfectly. However reddit /r/earthporn photos consistently causes a crash after a few photos. I have tried using a RPi3B+ and RPi3A+ running magic mirror locally as well as running magicmirror using docker in a server-client configuration.

EDIT: The log error below appears that it is not relevant to the post. After disabling MMM-SystemStats the screen still goes black without any error.

Today the screen crashes on this photo https://i.redd.it/a7p2nmcfvu221.jpg (~1.8MB) Last week it was this photo https://i.redd.it/n2b2wf6dqe021.jpg (~8MB) Nothing particularly unique about these photos makes them stand out to me (filesize/dimensions/orientation) which would cause the module to crash. As the post ages, the module consistently fails on that picture.

~~Whoops! There was an uncaught exception... { Error: spawn ENOMEM at _errnoException (util.js:1024:11) at ChildProcess.spawn (internal/child_process.js:323:11) at exports.spawn (child_process.js:514:9) at Object.exports.execFile (child_process.js:224:15) at Object.module.(anonymous function) [as execFile] (ELECTRON_ASAR.js:199:20) at exports.exec (child_process.js:154:18) at childProcess.(anonymous function) (ELECTRON_ASAR.js:689:22) at /home/pi/MagicMirror/modules/MMM-SystemStats/node_modules/async/dist/async.js:66:19 at /home/pi/MagicMirror/modules/MMM-SystemStats/node_modules/async/dist/async.js:3880:24 at eachOfArrayLike (/home/pi/MagicMirror/modules/MMM-SystemStats/node_modules/async/dist/async.js:1069:9) code: 'ENOMEM', errno: 'ENOMEM', syscall: 'spawn' } MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues~~

humdinger44 commented 5 years ago

I've also been seeing the issue WalrusSwarm describes on my system. I haven't experimented with the other image sources, just r/earthporn.

Another thing i'd like to see is an improvement on the scaling of large images and the ability to ignore portrait oriented images. I setup the config for horizontal orientation but it doesn't have a noticeable effect.

Overall Ive been very happy with the mmm-wallpaper module. Thank you and good work :).

kolbyjack commented 5 years ago

Sorry for the delay, I was never notified of this issue's creation. Has there been another instance of a wallpaper crashing the module? Does it actually crash magicmirror, or just display black? Can you link me to either of the actual posts that crashed it, earthporn is really active, trying to find those posts over a month ago now would take a while.

humdinger44 commented 5 years ago

The mirror runs but the screen goes black and all other modules disappear. Its hard to say if individual images are the cause of the screen blanking or if some other issue exists. * To test, I set my image turn over to 30 seconds, with 20 images. The first time I think it got hung up trying to load "Sunrise by Fitz Roy, Argentina [5170x6462] [OC]." The seconds on the clock stopped refreshing for about 10 seconds then it went blank. After I reset the mirror next time through i think it just skipped that image.

Large images aren't resized to fit at all, so for high res shots only a small portion of the whole scene is visible.

*Edit: I've seen the same image cause the problem three times now.

kolbyjack commented 5 years ago

Which browser are you using on your pi? I have my display driven by a pi zero w running chromium, and I can't get it to exhibit the behavior you're seeing after changing my config to match yours. The fact that the wallpapers aren't scaling for you makes me think this may just be a browser issue.

Edit: and of course as soon as I send this, I get the "Aw, Snap!" screen

humdinger44 commented 5 years ago

I’m running a pi3B, and I believe it’s showing through electron.. Sorry, I’m not very good at this. The interface launches automatically and the window it shows up in has no identifying clues. Task manager shows electron as one of the few programs using any processing power.

On Thu, Jan 17, 2019 at 8:23 AM Jon Kolb notifications@github.com wrote:

Which browser are you using on your pi? I have my display driven by a pi zero w running chromium, and I can't get it to exhibit the behavior you're seeing after changing my config to match yours. The fact that the wallpapers aren't scaling for you makes me think this may just be a browser issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kolbyjack/MMM-Wallpaper/issues/3#issuecomment-455170297, or mute the thread https://github.com/notifications/unsubscribe-auth/Apu2-aAua0v_Nt4of4Klb3VP4UgjvgBgks5vEHlDgaJpZM4ZI-au .

kolbyjack commented 5 years ago

While this probably won't help with the sizing issue, I've just pushed some changes that grab the image url differently from reddit, and my pi hasn't crashed in a few hours using /r/earthporn. Can you update and see if it works for you?

humdinger44 commented 5 years ago

Initially I saw it fail a few times within the first 45 minutes or so but just came back 4 hrs later and it’s still up. My assumption is that I need to switch my system to chromium to optimize the experience, but that will take some time. For now I’m happy hitting Ctrl-Q from from time to time.

Thanks for looking into this -h.ding

On Fri, Jan 18, 2019 at 11:56 AM Jon Kolb notifications@github.com wrote:

While this probably won't help with the sizing issue, I've just pushed some changes that grab the image url differently from reddit, and my pi hasn't crashed in a few hours using /r/earthporn. Can you update and see if it works for you?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kolbyjack/MMM-Wallpaper/issues/3#issuecomment-455614819, or mute the thread https://github.com/notifications/unsubscribe-auth/Apu2-SKUKrkK6jbxGgsIZDssrDqUpT1Uks5vEfyrgaJpZM4ZI-au .

kolbyjack commented 5 years ago

On my rpi0w at least, this appears to be due to an out of memory condition. I've pushed some changes that may or may not actually help the gc clean up memory more, but I think the thing that's really helped me is that I changed the way I launch chromium to:

chromium-browser --kiosk --incognito --process-per-tab https://my.magic.mirror/

I think the --process-per-tab is helping reduce memory usage in my case, but ymmv. I don't think there's much else I can do about this, so I'm going to close it, even though I can't really say it's solved.

mlcampbe commented 5 years ago

I'm seeing the same issue. I've opened a new issue #5 if you have any suggestions.

humdinger44 commented 5 years ago

What is your mirror running in? I thought electrum was identified as the problem when it was designed for chrome .

On Wed, Apr 24, 2019 at 2:18 PM Mike Campbell notifications@github.com wrote:

I'm seeing the same issue. I've opened a new issue #5 https://github.com/kolbyjack/MMM-Wallpaper/issues/5 if you have any suggestions.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kolbyjack/MMM-Wallpaper/issues/3#issuecomment-486368057, or mute the thread https://github.com/notifications/unsubscribe-auth/AKN3N6MBHKZ3ZDQQ4ITZHWLPSCP75ANCNFSM4GJD42XA .

mlcampbe commented 5 years ago

I'm running on a Raspberry PI 3+ model b. Its not running from within a browser though. It autostarts at boot time and fills the desktop.