Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animated GIF crashes smartmatrix 3.0 #7

Closed
tcottle opened this issue Apr 4, 2016 · 7 comments
Closed

Animated GIF crashes smartmatrix 3.0 #7

tcottle opened this issue Apr 4, 2016 · 7 comments

Comments

@tcottle
Copy link

tcottle commented Apr 4, 2016

I have been experimenting with animated GIFs on a 64 x 64 panel. Everything is working fine except for the attachment. It crashes the display. I am using the stock example with the following changes

kMatrixWidth = 64
kMatrixHeight = 64
kRefreshDepth = 24
kDmaBufferRows = 2
kMatrixOptions = (SMARTMATRIX_OPTIONS_BOTTOM_TO_TOP_STACKING);
matrix.setRefreshRate(60);

eyes

Thanks!

@embedded-creations
Copy link
Contributor

I'll take a look to see if I can reproduce the crash here, and if so, try to trace it down.

One thought though, if looks like the GIF is going to all white briefly, which would cause a surge of current going to the displays during the white frame. If your power supply or wiring or any other part of the power circuit isn't able to handle that and the voltage going to the Teensy drops, that could be the source of the crash. Try lowering the brightness and see if your crash goes away.

@tcottle
Copy link
Author

tcottle commented Apr 5, 2016

Thanks - I wondered if it could be a P/S problem. I reset the current
limit to 80W and the problem still persisted. I am out on travel for a
week but will adjust the brightness down and report back on the results

Can you recommend a tool that breaks down an animated GIF into its
component frames?

On Mon, Apr 4, 2016 at 7:12 PM, Louis Beaudoin notifications@github.com
wrote:

I'll take a look to see if I can reproduce the crash here, and if so, try
to trace it down.

One thought though, if looks like the GIF is going to all white briefly,
which would cause a surge of current going to the displays during the white
frame. If your power supply or wiring or any other part of the power
circuit isn't able to handle that and the voltage going to the Teensy
drops, that could be the source of the crash. Try lowering the brightness
and see if your crash goes away.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#7 (comment)

@embedded-creations
Copy link
Contributor

There's a couple here in this article I wrote for the Adafruit Learning System:
https://learn.adafruit.com/smartmatrix-animated-gif-player/gifs

GIMP and ezgif.com should work.

@embedded-creations
Copy link
Contributor

I'm able to reproduce the crash, but haven't yet been able to track down the bug. I ran the GIF through ezgif trying a 0-pixel crop first, and color reduction next, to try to keep the GIF content the same but reencode it, and still get crashes. I opened the file in GIMP, then exported as GIF animation, and that crashes as well.

I'm planning to track this down and fix it in the next minor release (excluding today's Arduino 1.6.8 fix release), sorry about this issue.

@tcottle
Copy link
Author

tcottle commented Apr 19, 2016

Thanks! It was on my to-do list for today to extract out all of the
frames and display it one at a time ...

On Tue, Apr 19, 2016 at 8:11 AM, Louis Beaudoin notifications@github.com
wrote:

I'm able to reproduce the crash, but haven't yet been able to track down
the bug. I ran the GIF through ezgif trying a 0-pixel crop first, and color
reduction next, to try to keep the GIF content the same but reencode it,
and still get crashes. I opened the file in GIMP, then exported as GIF
animation, and that crashes as well.

I'm planning to track this down and fix it in the next minor release
(excluding today's Arduino 1.6.8 fix release), sorry about this issue.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#7 (comment)

@embedded-creations
Copy link
Contributor

This is a weird GIF, it does things I didn't know were allowed by the GIF spec:

I saw some weird things when parsing through the file, including an X,Y coordinate that was outside of the 64x64 bounds. I opened the file in GIMP, then chose "Fit Canvas to Layers", and this weird stuff showed up outside of the 64x64 bounds.

ezgif_com-optimize___imported-2_0__rgb_color__4_layers__122x91 _gimp

A longterm solution is probably to throw out any pixels that are outside the bounds of the GIF decoder's buffer. I'm considering a rewrite of the GIF decoder, and I'll keep this feature in mind. A shortterm solution is to edit the GIF file manually to remove the extra stuff outside the bounds.

You can use ezgif's resize tool, but only one option works: Imagemagick + coalesce. The other two options either leave the graphics outside the bounds, or resizes the GIF to make the graphics out of bounds visible.

http://ezgif.com/resize/

Here's a version that doesn't crash the sketch:

ezgif com-resize-2

@embedded-creations
Copy link
Contributor

I added bounds checking in a couple places, and now even this weird GIF plays without crashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants