[Guide] ili9341 SPI TFT Screen on Retropie

Various user-contributed guides for hardware-related things
User avatar
VeteranGamer
Posts: 1738
Joined: Thu Jan 26, 2017 11:12 am
Location: London, UK
Has thanked: 528 times
Been thanked: 909 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by VeteranGamer » Thu Nov 02, 2017 3:54 am

salami738 wrote:
Thu Nov 02, 2017 3:30 am
did you check the fps indicator before your tuning?
I was wondering about the results, because:

Raspberry emulator renders its output to fb0 (framebuffer 0), because this is the only framebuffer with hardware acceleration. This framebuffer is used for DPI, HDMI and composite displays.
If you use a SPI display, you have to use a tool like fbcp to copy the framebuffer contents from fb0 to db1 (SPI),
BUT: the emulator does not know that. So i think you saw the fps the emuator is rendering to the primary (fb0) framebuffer and the fps of your display varies, depending on your frequency. I am not aware of any tool to measure the fps of a display that ist used via SPI.

Any thoughts about this?
check this out.....

http://sudomod.com/forum/viewtopic.php? ... =30#p46917


.

salami738
Posts: 128
Joined: Sat Sep 09, 2017 6:06 am
Location: Germany
Has thanked: 60 times
Been thanked: 37 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by salami738 » Thu Nov 02, 2017 4:06 am

VeteranGamer wrote:
Thu Nov 02, 2017 3:54 am
salami738 wrote:
Thu Nov 02, 2017 3:30 am
did you check the fps indicator before your tuning?
I was wondering about the results, because:

Raspberry emulator renders its output to fb0 (framebuffer 0), because this is the only framebuffer with hardware acceleration. This framebuffer is used for DPI, HDMI and composite displays.
If you use a SPI display, you have to use a tool like fbcp to copy the framebuffer contents from fb0 to db1 (SPI),
BUT: the emulator does not know that. So i think you saw the fps the emuator is rendering to the primary (fb0) framebuffer and the fps of your display varies, depending on your frequency. I am not aware of any tool to measure the fps of a display that ist used via SPI.

Any thoughts about this?
check this out.....

http://sudomod.com/forum/viewtopic.php? ... =30#p46917


.
Ah ok, you can get around 33fps with the spi screen. Thanks for the reply!

User avatar
moosepr
Posts: 524
Joined: Wed Jan 25, 2017 6:18 am
Has thanked: 69 times
Been thanked: 241 times
Contact:

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by moosepr » Thu Nov 02, 2017 4:27 am

@salami738 you are correct!! the actual speed of the screen is not linked to the speed that emulationstation reports. There is a way to test the speed of the actual screen refreshes, and that is built in to the fbtft driver.

You can add into the end of the fbtft.config file some debug options, you can see the time it takes for each screen update, and subsequently, see the calculated FPS. In the past, i have added 'debug=32' bit looking at the actual documentation, im not sure which option its actually using

https://github.com/notro/fbtft/wiki/Debug
Get a small cheep LCD in your project https://www.sudomod.com/forum/viewtopic.php?f=22&t=2312
Wrap it all round a battery https://www.sudomod.com/forum/viewtopic.php?f=13&t=2292
Or use a custom PCB to make it really small https://www.sudomod.com/forum/viewtopic.php?f=13&t=2512
or make it really really really really tiny!! https://www.sudomod.com/forum/viewtopic.php?f=13&t=2919

salami738
Posts: 128
Joined: Sat Sep 09, 2017 6:06 am
Location: Germany
Has thanked: 60 times
Been thanked: 37 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by salami738 » Wed Nov 15, 2017 1:48 am

moosepr wrote:
Thu Nov 02, 2017 4:27 am
@salami738 you are correct!! the actual speed of the screen is not linked to the speed that emulationstation reports. There is a way to test the speed of the actual screen refreshes, and that is built in to the fbtft driver.

You can add into the end of the fbtft.config file some debug options, you can see the time it takes for each screen update, and subsequently, see the calculated FPS. In the past, i have added 'debug=32' bit looking at the actual documentation, im not sure which option its actually using

https://github.com/notro/fbtft/wiki/Debug
I think debug=32 is converted to 0010 0000 (binary), this should be equally to 1<<5 (one left shifted five times), so DEBUG_TIME_EACH_UPDATE is used.

User avatar
dotmick
Posts: 2
Joined: Wed Nov 29, 2017 2:36 am

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by dotmick » Wed Nov 29, 2017 2:54 am

Hi everyone!

First of all, thanks for the valuable details you've shared within this thread. This helped me having my Neosec 2.8 inch TFT display (using an ili9341 chipset) working properly.

I am working on a project of a portable console based on the PiGRRL Zero concept. So far, I've tried RetroPie and with the help of fbcp, I have been able to play games on the TFT. But I've got a tiny problem. After boosting the screen frequency and lowering the HDMI to 320x240, I think the screen responsivity/refresh is almost perfect. But I've noticed a tiny lag/delay from the input to what's happening on the screen (only on the TFT, not the HDMI). So my guess this is due to fbcp and the time it takes to copy from one framebuffer to another. Is there a way to reduce this delay to it's minimum? It might be a detail for some people but as a gamer it's the type of detail that can keep you away from using it.

:)

User avatar
RedPixel
Posts: 15
Joined: Sun Sep 17, 2017 4:41 am
Has thanked: 6 times
Been thanked: 9 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by RedPixel » Wed Nov 29, 2017 5:52 am

dotmick wrote:
Wed Nov 29, 2017 2:54 am
Hi everyone!

First of all, thanks for the valuable details you've shared within this thread. This helped me having my Neosec 2.8 inch TFT display (using an ili9341 chipset) working properly.

I am working on a project of a portable console based on the PiGRRL Zero concept. So far, I've tried RetroPie and with the help of fbcp, I have been able to play games on the TFT. But I've got a tiny problem. After boosting the screen frequency and lowering the HDMI to 320x240, I think the screen responsivity/refresh is almost perfect. But I've noticed a tiny lag/delay from the input to what's happening on the screen (only on the TFT, not the HDMI). So my guess this is due to fbcp and the time it takes to copy from one framebuffer to another. Is there a way to reduce this delay to it's minimum? It might be a detail for some people but as a gamer it's the type of detail that can keep you away from using it.

:)
Maybe you can set the priority of the fbcp process higher? See https://en.wikipedia.org/wiki/Nice_(Unix)

I think you can use
nice -n -5 fbcp &

User avatar
dotmick
Posts: 2
Joined: Wed Nov 29, 2017 2:36 am

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by dotmick » Thu Nov 30, 2017 3:43 am

RedPixel wrote:
Wed Nov 29, 2017 5:52 am
dotmick wrote:
Wed Nov 29, 2017 2:54 am
Hi everyone!

First of all, thanks for the valuable details you've shared within this thread. This helped me having my Neosec 2.8 inch TFT display (using an ili9341 chipset) working properly.

I am working on a project of a portable console based on the PiGRRL Zero concept. So far, I've tried RetroPie and with the help of fbcp, I have been able to play games on the TFT. But I've got a tiny problem. After boosting the screen frequency and lowering the HDMI to 320x240, I think the screen responsivity/refresh is almost perfect. But I've noticed a tiny lag/delay from the input to what's happening on the screen (only on the TFT, not the HDMI). So my guess this is due to fbcp and the time it takes to copy from one framebuffer to another. Is there a way to reduce this delay to it's minimum? It might be a detail for some people but as a gamer it's the type of detail that can keep you away from using it.

:)
Maybe you can set the priority of the fbcp process higher? See https://en.wikipedia.org/wiki/Nice_(Unix)

I think you can use
nice -n -5 fbcp &
Thanks RedPixel, good idea!

I've also tried Recalbox instead of RetroPie and I've noticed better results. I remember reading somewhere that they have another implementation of fbcp (although I found Recalbox less flexible and stable).

To continue... :)

User avatar
abrugsch
Posts: 971
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 356 times
Been thanked: 430 times
Contact:

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by abrugsch » Sat Dec 02, 2017 7:39 am

I'd probably hold off on spending too much time trying to optimise fbcp since @bitbank and @hex are working on a much faster implementation of ili9341 SPi driver

Lpoolm
Posts: 392
Joined: Thu Jun 09, 2016 4:17 am
Location: uk
Has thanked: 76 times
Been thanked: 51 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by Lpoolm » Thu Dec 21, 2017 11:59 am

thanks for your guide, when i first tried it just could not get it working, anyway come back and followed your guide and its 100% working!
Check out my modding and repair channel of retro and modern consoles:
https://www.youtube.com/channel/UCFz7yW ... GtQ/videos

User avatar
moosepr
Posts: 524
Joined: Wed Jan 25, 2017 6:18 am
Has thanked: 69 times
Been thanked: 241 times
Contact:

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by moosepr » Fri Dec 22, 2017 4:27 pm

Lpoolm wrote:
Thu Dec 21, 2017 11:59 am
thanks for your guide, when i first tried it just could not get it working, anyway come back and followed your guide and its 100% working!
its always good to hear :) Glad i could help :)
Get a small cheep LCD in your project https://www.sudomod.com/forum/viewtopic.php?f=22&t=2312
Wrap it all round a battery https://www.sudomod.com/forum/viewtopic.php?f=13&t=2292
Or use a custom PCB to make it really small https://www.sudomod.com/forum/viewtopic.php?f=13&t=2512
or make it really really really really tiny!! https://www.sudomod.com/forum/viewtopic.php?f=13&t=2919

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest