So my first approch faild gloriously, I need some hints.
What I have is a selfbuilt WS2812 matrix 32x64 Pixel. I also habe a mp4 video (in the same resolution), which should be displayed on the matrix.
First try was (actually by my son, he does the programming, I do teh hardware):
Converting each frame into the according RGB matrix (at 25fps) with a python programm and direct the output into a textfile ( I know that this is not the most resource saving way, but quick to do). I think the teensy 3.2 we use for driving the Display should have enought memory to handle that.
Sadly I can't figure that out, because the arduino IDE crashes while c&p the file.
Our next approach would be to use a Pi (or any other PC) to deliver the frames "on the fly" via UART to the teensy and let it only do the matrix driving.
But I really would like to get it running on the teensy stand alone. Any other ideas to handle that one?
Prefereable something that is doable in a few days without investing some 100 Euros?
DUPLICATED THREAD IN PROGRAMMING FORUM
Not exacly sure, because that part is done by my son. So I'l asked him to provide that info.
As a rought calculation:
24 sec times 25 frames 600 frames, each containing RGB info for 2048 LEDS, that would be close to 4MB, plus seperators should be 8MB already.
I was wondering, if some trick already exists like for the other compressions to only hand over the pixels that actualla have changed from teh last frame and rewrite the matrix instead of holding the data of all frames ...
EDIT: Me: idiot! 264 kb flash memory is a lot, but not enough for that info. So I guess having a raspi feeding the frames and letting the teensy "only" do the displaying work should be the right path...
So next try wored a bit better.
We were able to set up a raspi with python and UART communication to the teensy.
But teh UART seems to slow to gice 25fps.
To ways to think of: use I2C communication between the 2
use the raspi directly to drive the Display.
Any tips hits experienece which way to go?
Calculate how many bytes you are transferring per frame. Then you can see how long it takes for any baud rate. I2C is slow it is about the same as a baud rate of 9600.
The AdaFruit neopixel library will only work on the model 1 raspberry Pi not on the 2 or 3.
ok, that would be RGB for 2048 pixel, that is 6144, but then I'm abit lost to calculate that to a baudrate.
As I understand it, I'll need the clockspeed of the teensy for that calculation?
Is that the CPU speed (I guess not) or the bandwith mentioned here:
(I know, I#m a overnoob..)
EDIT: Got knowledge: 6144 bytes per pic, that is about 48 kbit, which means 2,5 pics per second max at 115200 (so I#ll need at least 10 times of that, which doesn't exist for UART, so I'm out)
Any chance to get it done via USB?
No it is simply
For one frame 6144 bytes
It takes 10 serial bits to send one byte so to transfer one frame in a second you need 61440 baud. For 25 frames per second you need a speed of 61440 * 25 = 1536000 baud.
Which Is equal to forget it.
Geussed that much. Next fail is the try with the raspi directly (all I found only works with the Raspi 1 and I of course have the 2...)
There is a rumor that the Pimoroni libiary will work on the Pi 2 but I have not tried it.
Yeah, we are about to de-rumor that (one or the other way. Momentarily the other, sadly).
I'll keep you posted
SPI will get to that speed fairly easily. Does the Rasberry have a good SPI output?
There must be some way of compressing the raw video. Instead of 8 bits per colour per pixel, why not 4? You won't see the difference.
OK after we got it working and I ctched up some more sleep:
One problem is that the raspi delivers 3.3V on GPIO, but the WS2812 need 5V. I couldn't get hands on a stepup chip in time, but a friend jummped in, delivering hardware, time and programming.
So at about 3:30 am we had it running with this:
I'll try that in future projects. The proplem wasn't to get the circuit. I simply didn't found a hardwarestore, that had one in stock with opening hours between 9:00pm and 3:00am (yes that way around :-)).
I'll post a link to some pics and movies the moment the owner puts it online (he promised to do so from gamescom, where the display is currently installed)
Topic re-opened at the request of @Paul_B