• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

GPU Memory/Image flicker/blinking

Scheduled Pinned Locked Moved Troubleshooting
11 Posts 4 Posters 6.6k Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    Mykle1 Project Sponsor Module Developer
    last edited by Mykle1 Mar 23, 2017, 10:57 AM Mar 23, 2017, 2:29 AM

    0_1490234415240_cpu.JPG

    Above is my Pi3 setting. I suppose this is the default as I never changed it. I’m trying to troubleshoot a problem I am having with a module I am working on. I think this may have something to do with it but I am hesitant to change anything because my mirror works flawlessly, except when I introduce this module. I should mention that it does not affect any of the other modules when introduced.

    I’m trying to create an animated gif effect with pictures that I am fetching from an API. I started with png files, then moved to jpg files, thinking it was the size of the file that was causing the problem. I even went so far as to fetch only thumbnails ( a dozen at 5kb each) but the problem persists. The problem being this: The images periodically flicker, or blink when displaying, ruining the smooth animated gif effect. I have fadeSpeed and animationSpeed both set to 0. Even when the rotateInterval is set to 3-5 seconds, or more, the problem still arises. Note: When the pictures are cached in the browser after fetching, it seems to happen less often but it still happens. I’m only fetching the images every 30 minutes to avoid the necessity of an API key. Would that make a difference? Would fetching more often improve the performance? That doesn’t seem logical to me.

    I should also mention that this does not happen on a laptop that I have MM installed on. It works beautifully, even with the largest png files. Smooth as silk. No Flicker, no blink, just a seamless transition to the next image.

    So, would increasing the GPU Memory likely help to alleviate this problem? Or is there another way, within the module itself that would help? In case it’s important, my System Load with this module running is 0.45 with 13% Free RAM

    I’m reaching out to you all because I don’t want to bombard one single person with all my questions about making a module. I think he may be thinking, “What did I get myself into?” ;-)

    Create a working config
    How to add modules

    J 1 Reply Last reply Mar 23, 2017, 12:46 PM Reply Quote 1
    • J Offline
      johnnyboy @Mykle1
      last edited by johnnyboy Mar 23, 2017, 3:44 PM Mar 23, 2017, 12:46 PM

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • C Offline
        cowboysdude Module Developer
        last edited by cowboysdude Mar 23, 2017, 2:37 PM Mar 23, 2017, 1:06 PM

        LOL noooooooooooooo… it’s a great question though!! May solve problems others may be having. I believe you could cache the images so when it loads may take care of that.

        J M 2 Replies Last reply Mar 23, 2017, 3:43 PM Reply Quote 0
        • J Offline
          johnnyboy @cowboysdude
          last edited by Mar 23, 2017, 3:43 PM

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • M Offline
            Mykle1 Project Sponsor Module Developer @cowboysdude
            last edited by Mykle1 Mar 23, 2017, 7:55 PM Mar 23, 2017, 7:50 PM

            @cowboysdude said in GPU Memory/Image flicker/blinking:

            I believe you could cache the images so when it loads may take care of that.

            Does this look like it might work? With some modification, of course.

            function preloadImages(array) {
                if (!preloadImages.list) {
                    preloadImages.list = [];
                }
                var list = preloadImages.list;
                for (var i = 0; i < array.length; i++) {
                    var img = new Image();
                    img.onload = function() {
                        var index = list.indexOf(this);
                        if (index !== -1) {
                            // remove image from the array once it's loaded
                            // for memory consumption reasons
                            list.splice(index, 1);
                        }
                    }
                    list.push(img);
                    img.src = array[i];
                }
            }
            preloadImages(["url1.jpg", "url2.jpg", "url3.jpg"]);
            

            Or perhaps this? Again, with some modification.

            var images = [
            '/path/to/image1.png',
            '/path/to/image2.png'
            ];
            
            $(images).each(function() {
            var image = $('<img />').attr('src', this);
            });
            

            The quote that comes with this second example:

            you can preload images using javascript by putting all of the images you want to preload into an array and putting all of the images in that array into hidden img elements, you effectively preload (or cache) the images. <

            Create a working config
            How to add modules

            M 1 Reply Last reply Mar 23, 2017, 8:01 PM Reply Quote 0
            • M Offline
              Mykle1 Project Sponsor Module Developer @Mykle1
              last edited by Mykle1 Mar 23, 2017, 8:19 PM Mar 23, 2017, 8:01 PM

              And last, but not least, this example, with some modification.


              Create a working config
              How to add modules

              C 1 Reply Last reply Mar 23, 2017, 8:22 PM Reply Quote 0
              • C Offline
                cowboysdude Module Developer @Mykle1
                last edited by Mar 23, 2017, 8:22 PM

                @Mykle1 getting info from a json file so we need to get the image names then put them in the array and call them before they load to precache or preload the image so when it’s time it just pops up :)

                M 1 Reply Last reply Mar 23, 2017, 8:24 PM Reply Quote 0
                • M Offline
                  Mykle1 Project Sponsor Module Developer @cowboysdude
                  last edited by Mar 23, 2017, 8:24 PM

                  @cowboysdude
                  Yes, but the names will change every day

                  Create a working config
                  How to add modules

                  M 1 Reply Last reply Mar 23, 2017, 8:25 PM Reply Quote 0
                  • M Offline
                    Mykle1 Project Sponsor Module Developer @Mykle1
                    last edited by Mykle1 Mar 23, 2017, 8:28 PM Mar 23, 2017, 8:25 PM

                    @Mykle1 BTW, they can’t keep up with their own API. They skipped 3 days of images, MF’s! :-) And they only made 8 images available from yesterday. Grrr

                    Create a working config
                    How to add modules

                    C 1 Reply Last reply Mar 23, 2017, 8:30 PM Reply Quote 0
                    • C Offline
                      cowboysdude Module Developer @Mykle1
                      last edited by Mar 23, 2017, 8:30 PM

                      @Mykle1 well need to find a stable source of pictures and that’s ok if the names change… won’t matter :)

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        1/11
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy