Teensy 3.6 plays video from SD-Card

Status
Not open for further replies.
Flash 44.924 KB, RAM 160.296KB.
Teensy 3.6 @ 180 MHZ (maybe much much less ..maybe 144? MHz is enough.. not tested).
99% is done with DMA, so the CPU usage is not high. Maybe, we can add some alphablended overlays..?

@Paul, now that the audiolib is readyto use, we need a videolib :cool:
 
Last edited:
I think you answered the question I had in the Nextion thread the other day.

"So can a K66 running a 7" SSD1963 or RA8875 be cheaper and better then the Nextion?"

Pretty sure its a yes lol.
 
I think you answered the question I had in the Nextion thread the other day.

"So can a K66 running a 7" SSD1963 or RA8875 be cheaper and better then the Nextion?"

Pretty sure its a yes lol.

I don't know these displays, and can't give you an answer..
 
Guess what..it works like a champ with 144MHz and even less.. :)
BUT: I tried to run the sketch with a T3.5 - does not work. Currently, i have no idea, why.

As I want to add audio - is there any way to access the movie-audio in processing ? I really need a way to exctract the audio.. best case "in sync" with the video..

Edit:the "blue area" bug is fixed :)
 
Last edited:
GOTCHA.

VIDEO+Sound is working..
A bit complicated to use, because i use ffmpeg to create a RAW-File, then processing to create a combined video+audio file...
Hints to make it better appreciated..

A demo on youtube follows tomorrow.
 
Wow Amazing job.
The Teensy 3.6 is more powerful then the computers of 80s, 90s (ZX Spectrum, Atari 800, Atari 520ST, Commodore 64, Commodore Amiga 500, Apple II).
Frank thank you for doing this.
 
I've updated the video in post #1 (added sound and fixed the bug).

Yes, it is much more powerfull. I'm still working on a C64 emulation... not very intense, but i hope that it can run a c64-game in a few weeks/month.
 
Last edited:
I've uploaded the code (as example) here:
https://github.com/FrankBoesing/ILI9341_t3DMA

It still need some work to make it better, but it works.
I've the uploaded pre-processed example-video here: https://drive.google.com/drive/folders/0Bx2Jw84lqebkelF3MHg2eWVzb0U
So you can use this file without needing to convert it.

You need a) ffmpeg to create the audiofile, and b) Processing to create the videofile.

To create the audio-part, use this command:
ffmpeg -i "BigBuckBunny_512kb.mp4" -f s16le -ar 44100 -acodec pcm_s16le output.raw

ffmpeg is available for windows, too. Apple ? Don't know. Linux ? Yes, of course.


The Sketch works best with max-overclocked F_BUS (i.e. for 72MHz SPI with 144MHz F_CPU) - but still works without that (flickers a bit).
The example uses the Teensy - DAC for Audio, i did not try I2S.

Edit: almost forgotten.. you need the beta of SDFAT by Bill. It will NOT work with the audio-library, so perhaps make a copy of the Arduino-installation and delete the two conflicting audio-objects and references to sd.h
Sorry, it will be better when a "official" sd.h is available. Now, it is kind of hack..
Or, more simple, delete the audio-part from the sketch - you will have no audio but the video still works.
 
Last edited:
The Teensy 3.6 is more powerful then the computers of 80s, 90s (ZX Spectrum, Atari 800, Atari 520ST, Commodore 64, Commodore Amiga 500, Apple II).

Actually, even Teensy 2.0 (16 MHz AVR) is more powerful than most of those vintage computers. And I think Teensy 3.2 outperforms even the ST and Amiga.

That doesn't necessarily mean you could play old games with Teensies. Emulating those machines is a different story...
But I think 3.6 is powerful enough even for that.
 
Frank B, could this be used to reduce the amount of CPU time needed to send commands to the screen also. For a few of my projects I have had to add a second micro to do the screen control.
 
I guess, yes. But it's hard to say without knowing what you are doing :)
Or, just try it ? The library is very compatible to the existing ILI9341_t3.h (does not support the fonts at the moment).

The "trick" is simple, all commands write to the Teensy-ram, not to the display. That means : no waiting for the SPI-Transfer, never. That's damn fast.
The display gets updated automatically with DMA, completely in the background. But,the SPI transfers the whole screen (2 bytes per pixel), which means you can't use it for other things during that time.
 
Last edited:
Wow Amazing job.
The Teensy 3.6 is more powerful then the computers of 80s, 90s (ZX Spectrum, Atari 800, Atari 520ST, Commodore 64, Commodore Amiga 500, Apple II).
Frank thank you for doing this.

Chris, the Sinclar Spectrum runs in a 8 bit processor with no multiply o divide 4Mhz processor (and the processor has to refresh the ram in software).
And the Spectrum runs the processor at 3.5Mhz to avoid go mad with the limits. :p
 
Hey Frank,

Super excited to get video going...

I'm getting the following error:
ILI9341_T3_DMALIB_VIDEODEMO:28: error: 'SdFatSdio' does not name a type SdFatSdio sd;

I was able to run the TeensySdioDemo from the beta SdFat library. I deleted the audio part of the sketch but still get the same "does not name a type" error.

I'm running Arduino 1.6.11 and teensyduino 3.0. I have a few other versions of Arduino installed in different directories but usually that hasn't been a problem.
 
That would increase the needed throuput drastically.
Perhaps something with parallel interface. But with DMA, this will not be easy.
 
Last edited:
That would increase the needed throuput drastically.
Perhaps something with parallel interface. But with DMA, this will not be easy.

Seems like you have CPU clocks to spare, judging by what you have said. I realize that there will be a rate limit, but perhaps with fast SPI it can be done.
 
Seems like you have CPU clocks to spare, judging by what you have said. I realize that there will be a rate limit, but perhaps with fast SPI it can be done.

I doubt.
I have spare CPU-Cycles, but not spare SPI-Cycles.. not enough for higher resolution.
 
If you want higher video output resolution than 320x240, surely you should consider instead something like a Pi Zero, capable of 1080p on HDMI out? And it can do SPI as well, although not sure of the actual bandwidth limits there, I have seen one claim the practical RPi limit is a 32 MHz SPI clock.
 
Would it be possible for a Teensy 3.6 to do HDMI out? The processor is certainly fast enough, but I am not sure what else would be needed to accomplish this (short of a full blown OS and a graphics coprocessor of some sort). I guess I am hoping for either USB -> HDMI, using the secondary USB port, or perhaps some sort of fast SPI -> HDMI bridge.
 
If you want higher video output resolution than 320x240, surely you should consider instead something like a Pi Zero, capable of 1080p on HDMI out? And it can do SPI as well, although not sure of the actual bandwidth limits there, I have seen one claim the practical RPi limit is a 32 MHz SPI clock.

The Pi Zero is a giant scam. It costs $5 in the US for the board, but you can't buy more than Qty:1 anywhere in the US and then wind up being gouged $10 for shipping on it, bringing the price up to $15 and making it completely non-competitive with other boards.
 
Status
Not open for further replies.
Back
Top