pixelmatix / AnimatedGIFs

MIT License
62 stars 34 forks source link

Slowdown (or little freeze) during the animation #24

Open FrenchLab47 opened 5 years ago

FrenchLab47 commented 5 years ago

Hello,

I'm testing your AnimatedGifs library with a 64x32 RGB led panel connected to an ESP32. Everything seems to work normally, but I see a little slowdown (or freeze) during the animation.

This happens with all GIFs of more than 30 frames when passing around the frame 30, The animation remains fluid when the GIF contains less than 30 frames, or when the GIF is very compressed (and degraded).

I tested with many GIF of 64x32 pixels, compressed or not, with different color palettes. This slowdown to frame 30, is even more visible if I accelerate the treatment in this way: nextFrameTime_ms = millis () + (5 * frameDelay); // 5 instead of 10

I also found that this slowdown occurs in the decompressAndDisplayFrame () function after the following condition: if (result == ERROR_DONE_PARSING) { result = 1 when the decoder arrives around on frame 30 And it also matches when filePositionCallback () returns a number bigger 16000 (approximately)

I observed this data with the Debug mode, but I do not know how to fix it and make my animation more fluid. Is this a problem of memory or buffer, in my ESP32? Are there other parameters to adjust?

Thanks for your help. Cordially.

embedded-creations commented 5 years ago

From what I observed when working with the ESP32 SD (or whatever it's actually called) library, it was unstable and didn't behave as the Arduino SD library. I'm not sure about the specific issue you're observing. I didn't work enough with the ESP32 SD library or AnimatedGIFs sketch beyond seeing that it worked at least occasionally, and I'm not actively working on the ESP32 port right now. Sorry I don't have more info.

FrenchLab47 commented 5 years ago

Ok thanks anyway for your answer. For your information I use the library ESP32-RGB64x32MatrixPanel-I2S-DMA by mrfaptastic https://github.com/mrfaptastic/ESP32-RGB64x32MatrixPanel-I2S-DMA The rendering is stable, without flickering. I'm going to ask him if he also found this phenomenon.

Best regards.

embedded-creations commented 5 years ago

Thanks for the additional information. Have you tried using the SmartMatrix Library ESP32 port, or just the ESP32-RGB64x32MatrixPanel-I2S-DMA Library?

FrenchLab47 commented 5 years ago

No, just the ESP32-RGB64x32MatrixPanel-I2S-DMA library with the demo provided.