RetroPie on a Raspberry Pi Zero at 50FPS on an SPI LCD Screen With ILI9341 Driver

Sdílet
Vložit
  • čas přidán 2. 05. 2021
  • Running RetroPie on an SPI LCD screen can be slow. 5 to 10 FPS is common. But with a bit of work we can get a smooth 50+ FPS using only a cheap, generic, SPI panel.
    In this video I'll show you how to set up RetroPie on a Raspberry Pi Zero, connect the LCD screen and then install and tune the FBCP-ILI9341 driver code. With just a small amount of tinkering you'll soon have a great start for your handheld retro games console.
    Make sure you check out my main website for full project details. View the circuit diagrams and get all the code used in the video.
    bytesnbits.co.uk/retropie-ras...
    If you want to pick up an SPI LCD to make this project yourself go to...
    Amazon
    amzn.to/3xJKGNa
    eBay
    ebay.us/hpEezX

Komentáře • 99

  • @beardedgitgaming6779
    @beardedgitgaming6779 Před 11 měsíci +6

    just got into the world of rasberry pi, bought a zero w. this helped me quickly set up the screen and its running great. thank you

  • @freddycisneros5634
    @freddycisneros5634 Před 3 lety +3

    Great video. Im glad I subscribed to your channel. I have watched a few of your videos so far and look forward to watch all of them. I have learned a lot by watching your videos. Thank you for making these videos. Keep them coming.

  • @criminalinfluencer071
    @criminalinfluencer071 Před 5 měsíci +1

    Thanks friend, it helped me a lot, I used your video as a basis to use this display to display PC statistics with MoBro, in an image customized for the RPI.
    Hugs from Brazil/Portugal!

  • @johnbillings5260
    @johnbillings5260 Před 9 měsíci +3

    That is pretty crazy. I have many of those screens and I have never seen performance like that!

    • @BytesNBits
      @BytesNBits  Před 9 měsíci

      Yes. The adaptive driver really makes a differemce.

  • @GorkaLarrazabal
    @GorkaLarrazabal Před 2 lety +1

    THANKS, THIS IS THE GREATEST EXPLANATION I HAVE SEEN.

  • @Sodwmistis
    @Sodwmistis Před 6 měsíci +1

    the best explanation for use this screens. thanks a lot for this great guild. work fine with adafruit 2.8 tft and zero 2 w. thanks againe mate.

  • @MarkMiller-wj3ym
    @MarkMiller-wj3ym Před 4 měsíci

    i was trying to get hdmi and the screen working together ..after much tweaking i have managed to get both working at same time ...excellent video ..

    • @BytesNBits
      @BytesNBits  Před 4 měsíci

      Great. I haven't tried that yet.

  • @KingALLO69
    @KingALLO69 Před rokem

    Very great explanation! Thank you.

  • @RoamingAdhocrat
    @RoamingAdhocrat Před 3 lety +1

    This is inspiring. I was up all night trying to get an ESP8266 to speak to a GC9A01-driven 240x240 screen over SPI and the results are… slideshow animation. I need smooth fullscreen updates for my application!

    • @BytesNBits
      @BytesNBits  Před 3 lety +2

      Hi. You need to use some of the techniques used in the Raspberry Pi driver. Create a frame buffer in the ESP8266 so that your drawing code is writing to memory rather than trying to send small updates to the screen over SPI. When you've got a frame ready use the block data method to write the whole frame to the screen in one go. If you're using the Adafruit graphics drivers they have all the methods you need built in.
      I hope this helps.

    • @BytesNBits
      @BytesNBits  Před 3 lety +1

      Don't forget to experiment with your SPI data rate to get the fastest transfer speed.

  • @SycoSpartan
    @SycoSpartan Před měsícem

    thank you. i had just chalked up my crappy frame rate to buying a cheap screen. now shes running a smooth 60fps !!!! since switching to this driver however my screensaver doesn't work in emulation station (playing game vids) i switched it off for now

    • @BytesNBits
      @BytesNBits  Před měsícem

      Glad to hear you got it running. Not sure why the screen saver would stop. I did find that some code needed the frequency lowered compared to other software.

    • @SycoSpartan
      @SycoSpartan Před měsícem

      @@BytesNBits i turned off oxm player in the UI settings and now it works :P thanks again :)

  • @alanturner1184
    @alanturner1184 Před 4 měsíci

    Absolutely made up Bob with your instructions on here and your web page took a few attempt's as I made mistakes then conflict with HMDI which got grey matter working. Only been playing with raspberry pi for a couple of months with grandson now have my eye on few more projects then maybe move up to Space Invaders a trip down memory lane lol. Thanks again all the best

    • @BytesNBits
      @BytesNBits  Před 4 měsíci +1

      Great to hear you're enjoying it. Have fun!

  • @stephenelliott7071
    @stephenelliott7071 Před 3 lety +3

    SSH or just access the Raspberry Pi running Retro Pie over wifi (on Windows 10) by clicking on the File Explorer Icon, scroll down to Network and typing \\ and the ip address (use show ip from the Retro Pie Menu). Certainly for adding ROMs quickly. Cool project btw.

    • @BytesNBits
      @BytesNBits  Před 3 lety +3

      Hi Stephen. Thanks for the tip.

    • @stephenelliott7071
      @stephenelliott7071 Před 3 lety +3

      @@BytesNBits that's the great thing about the internet - we all learn something from each other. As I have learnt from you and others. A really great channel, thoroughly enjoying it.

  • @ritwikdube2798
    @ritwikdube2798 Před 10 měsíci

    You are a legend

    • @BytesNBits
      @BytesNBits  Před 10 měsíci

      If only more people would realise this ;)

  • @Fachher
    @Fachher Před 11 měsíci

    I really like the content you are producing. How can I support your great work? Do you have Patreon

    • @BytesNBits
      @BytesNBits  Před 11 měsíci

      Thanks. Not yet. I think you can do a CZcams donation but not sure how it works. I haven't looked too much into monetising this project yet.

  • @dodzy
    @dodzy Před 2 lety

    Great video thank you, is there any way to add backlight control to switch off the screen LED on shutdown?

    • @BytesNBits
      @BytesNBits  Před 2 lety +1

      The backlight is controlled by a logic signal on the LCD panel connector. In this tutorial I've just wired it to the 5V supply to turn it on. If this pin is pulled low it will turn off. Your LCD driver needs to support an extra IO pin for the backlight control. Off the top of my head I can't remember if this driver does - you'll need to check the documentation.

  • @umutkayacan7659
    @umutkayacan7659 Před 3 lety

    A 45 min video? Nice!

  • @duanefreeman3152
    @duanefreeman3152 Před 9 měsíci

    Thank you so much friend I owe you my sanity!

    • @BytesNBits
      @BytesNBits  Před 9 měsíci

      Glad I could help

    • @duanefreeman3152
      @duanefreeman3152 Před 5 měsíci

      @@BytesNBits I finally got it to work tonite the 3.5 inch screen that looks identical to the one you use has a different driver. I almost danced with joy when I saw the screen light up thanx again!

  • @HitAndMissLab
    @HitAndMissLab Před 8 měsíci

    Fantastic video!
    How can one use this same SPI screen but with touch pen in order to manage an electronically driven project?

    • @BytesNBits
      @BytesNBits  Před 8 měsíci

      Thanks. There should be a driver for the SPI touch screen. There are a number of Waveshare screens that are basically the same device that have this all packaged up in their driver software.

  • @abreadofloaf9761
    @abreadofloaf9761 Před 4 měsíci

    hey, i just want to say that i find your videos to be very helpful. I just cant figure out how i can blug in a keyboard to my raspberyy pi zero 2w.

    • @BytesNBits
      @BytesNBits  Před 4 měsíci

      You either need an adapter to allow it to plug into the micro USB port, or if that's being used by something else you'll need a USB hub to give you more ports.

  • @ilyasseilyasse3093
    @ilyasseilyasse3093 Před 2 lety

    Great 💪💪✌️

  • @Ryan-cx2fn
    @Ryan-cx2fn Před 2 měsíci

    I have a 1.8in st7735s. I get picture but a grey bar on the right side appears making it more the size of a 1.3in display area. Is there away to get that grey bar off?

    • @BytesNBits
      @BytesNBits  Před 2 měsíci

      You need to play with the driver settings in config.txt to find a resolution that fills the screen.

  • @andersonand3720
    @andersonand3720 Před 10 měsíci

    Bom dia! como faço para interligar o touch do tft spi 3.2 com raspiberry pi 3 , as ligações de cabeamento com as portas . Obrigado

    • @BytesNBits
      @BytesNBits  Před 10 měsíci

      Dê uma olhada neste vídeo - czcams.com/video/w1PQXpp6jC8/video.html

  • @mrpaulvoline1275
    @mrpaulvoline1275 Před 6 měsíci

    Now I already have the raspian downloaded and the screen working now how do I get retro pie on all that? Cuz I have another raspberry pie but it works on the big screen with my raspberry pi, so now I'm trying to figure out how to get the raspberry pi working on the little screen nobody's doing those videos

    • @BytesNBits
      @BytesNBits  Před 6 měsíci +1

      You can install RetroPie manually - have a look at retropie.org.uk/docs/Manual-Installation/.
      I'd probably advise flashing a new SD card and installing RetroPie from scratch, then adding the screen code to that. It will work out easier in the long run.

  • @aaronkahraman5896
    @aaronkahraman5896 Před 2 měsíci

    Hey I dont know if you are still responding but I followed your tutorial and it worked great. But the next day when I powered it up it is stuck on a white screen. rebuilding or changing the configuration doesnt help. if you happen to know what this problem is I would love to hear it. Thank you.
    EDIT: the configuration I use: cmake -DILI9341=ON -DGPIO_TFT_DATA_CONTROL=8 -DGPIO_TFT_RESET_PIN=25 -DSPI_BUS_CLOCK_DIVISOR=10 -DSTATISTICS=0 -DDISPLAY_ROTATE_180_DEGREES=ON ..

    • @BytesNBits
      @BytesNBits  Před 2 měsíci

      I'm not sure why it would stop working. Can you get it working with the standard screen drivers to verify the screen is OK? Try lowering the data speed to see if it's set too high.

  • @thetrufflegouda
    @thetrufflegouda Před 5 měsíci

    The repo mentions fbcp is deprecated - any updates on how to get the 9341 working?

    • @BytesNBits
      @BytesNBits  Před 5 měsíci

      Yes. I see what you mean. I haven't looked at this project for a while. I'll have to see if there's another way around this. I guess at the moment you'd need to use an older version of the Pi OS which should still have support for the Dispmanx API.

  • @RichDMonte
    @RichDMonte Před 3 měsíci

    Hi, I get code "vc_dispmanx_display_open failed! Make sure to have hdmi_force_hotplug=1 setting in /boot/config.txt"
    even though I have set " # uncomment if hdmi display is not detected and composite is being output
    hdmi_force_hotplug=1 in /boot/config.txt.
    Any help?
    Im using Raspberry P 3 Model A+ and Raspberry Pi OS (Legacy 32 bit) Bullseye Released 2024-03-12. I tried Retropie but it wouldn't boot

    • @BytesNBits
      @BytesNBits  Před 3 měsíci

      I think we make a number of settings changes in the video for the screen display. It's probably one of those that's trying to put the Pi into a mode it doesn't support. Try commenting out the settings and let it run with the default video modes to see if you get anything on the screen.

  • @kiyoshinakamura8747
    @kiyoshinakamura8747 Před rokem

    The screen works but if i overclock the rpi zero the screen flick.
    Are there some settings to overclock and use the screen?

    • @BytesNBits
      @BytesNBits  Před rokem

      Hi. It's really a matter of playing with the various settings to get the best compromise between overclock / spi bandwidth / screen performance. The screen should be OK with overclocking but you might have to lower the speed setting.

  • @MistralKriss
    @MistralKriss Před 9 měsíci

    Very interesting : would you know how to display simple graphical dashboard on a tft like yours ? I have mine working, (7735) but I don't wan't to use retropie, but to display values on a dashboard, like IP adress, and various informations, I can see the console boot (that [OK] thingy, and the getty process which I dont want ...) How do I display my own graphics ?

    • @BytesNBits
      @BytesNBits  Před 9 měsíci

      This video series is about using the LCD panel as a replacement for the main display. You'd want to drive the LCD panel as a standalone SPI device that you can send alternative display data to. You'll need to write some sort of app (Python would be my choice) that will drive the GPIO pins and SPI channel. Then you can put whatever you want onto the screen, but you'll be coding it in terms of text here, image there, line there, etc. primitives.
      Have a look online. Someone will have written the driver libraries for all this. Good luck!

    • @MistralKriss
      @MistralKriss Před 9 měsíci

      @@BytesNBits isn't writing on /dev/fb0 an option (like retropie does, tbh I'm not so sure it does) ? I'd like to use a screen as a screen , apparently neither getty nor retropie have problems to write on the screen, I just don't want getty, neither do I want retrypie, juste the way they display is what I'm after. I was asking in case the answer was obvious. Thanks for your first reply.

    • @chrismason7294
      @chrismason7294 Před 7 měsíci

      @@BytesNBits this would be a great video as I would also be interesting in this. Also for some reason when I worked through the steps I got an error with running the command and after some googling I found that I had to use the following as well to get it running: cmake -DILI9341=ON -DSPI_BUS_CLOCK_DIVISOR=10 -DWAVESHARE35B_ILI9486=ON -DGPIO_TFT_DATA_CONTROL=24 -DGPIO_TFT_RESET_PIN=25 -DDMA_TX_CHANNEL=0 -DDMA_RX_CHANNEL=5 .. then did make -j thought this might be useful for someone else if they also have that issue
      edit: to put the full cmake options for clarity

  • @Ryan-cx2fn
    @Ryan-cx2fn Před 9 měsíci

    Does this way still work by chance? When I go to download the GitHub file the file fails to download. I’ve tried multiple times and have re flashed the sd to make sure it wasn’t that.

    • @BytesNBits
      @BytesNBits  Před 9 měsíci +1

      It should still work. I've checked the repository on GitHub and it's still all there. Cloning it should be fairly straight forward. The other option is to download the file archive and simply extract it into the correct location.

  • @CHIKKOAJ
    @CHIKKOAJ Před měsícem

    Can I order one of these cheap displays off of aliexpress? I found a 5$ one that looks the exact same. I am also using a pi 4.

    • @BytesNBits
      @BytesNBits  Před 28 dny

      Yes. But I do need to update the video as the newer version of the RPi OS have changed so the FBCP driver no longer works on the newer versions. If you want to try this project make sure you use a pre 2024 OS version.

    • @CHIKKOAJ
      @CHIKKOAJ Před 27 dny

      @@BytesNBits I’m pretty sure the display is useless as the drivers out of date or something. I guess it’s my fault for not doing more research

  • @EvanLandry
    @EvanLandry Před 7 měsíci

    I tried to follow all the instructions but got stuck at actually running the drivers, my screen just stays white. I think everything is connected properly so idk what it could be

    • @BytesNBits
      @BytesNBits  Před 7 měsíci

      Can you get the screen to work using the standard drivers? That will confirm that everything is connected correctly and working. Make sire you've got the pin assignments correct and start with a low bandwidth value. Hope you get it working.

    • @EvanLandry
      @EvanLandry Před 7 měsíci

      @@BytesNBits I rewired the connection and after a little bit for poking I got it to work. I think the main reason it that the connection is significantly less reliable than I thought so it’s now broken again. (this is the first time I’ve done anything with electronics, so I haven’t soldered it yet).
      It took a little while to realize it was a hardware problem on my end, I’m gonna try and solder a header on this week.

    • @BytesNBits
      @BytesNBits  Před 7 měsíci

      @@EvanLandry Great to hear you've got some progress. Good Luck.

  • @ds2kx
    @ds2kx Před rokem

    Failed to open VideoCore kernel mailbox! when we launch driver (even in SUDO). solutions ?

    • @BytesNBits
      @BytesNBits  Před rokem

      Hi. I've not come across that one. I'd check your Pi is fully updated and you're using the latest version of the driver. Check your setting and pin assignments.

    • @ds2kx
      @ds2kx Před rokem

      @@BytesNBits i have tried on bananapi, videocode seems not to be on bananapi. ??

    • @BytesNBits
      @BytesNBits  Před rokem

      @@ds2kx Hi. I haven't tried this project on anything other than the Raspberry Pi. I guess there will be differences in the kernel setup.

  • @RBIBIANO
    @RBIBIANO Před rokem

    Como você fez o comando Quit depois de instalar o monitor? Aqui aparece “…running main loop…” Como fazer para sair?

    • @BytesNBits
      @BytesNBits  Před rokem +1

      Hi. Ctrl C on your keyboard should quite the program.

    • @RBIBIANO
      @RBIBIANO Před rokem

      @@BytesNBits Muito obrigado pela dica. Depois de sair, a tela lcd volta a ficar branca, apenas consigo ver através do monitor hdmi… O que posso estar fazendo de errado?
      Depois de inserir as configurações de resolução no HDMI, a tela LCD continua branca, mas agora o monitor HDMI conectado está com uma resolução em letras muito grandes! Não consigo mais acessar o terminal para refazer os comandos…😢

    • @RBIBIANO
      @RBIBIANO Před rokem

      @@BytesNBits Consegui remover toda a pasta com o comando rm -r fbcp-ili9341. Refiz todos os passos. Consegui fazer funcionar!

  • @justicestorm1942
    @justicestorm1942 Před rokem

    does this work on rpi 3 b+?

  • @A_Malefic
    @A_Malefic Před rokem

    error git (clone mkdir etc) command not found. What i doing wrone?

    • @BytesNBits
      @BytesNBits  Před rokem

      It sounds like you haven't got GIT installed. Either update your sd card to the latest version of Raspian as GIT is pre installed or install GIT separately.
      sudo apt update
      sudo apt install git

    • @A_Malefic
      @A_Malefic Před rokem

      @@BytesNBits i use recalbox, not Raspain, and i get same errors when trying to instal whatewer.

    • @A_Malefic
      @A_Malefic Před rokem

      @@BytesNBits how can i get all utills i need?

    • @BytesNBits
      @BytesNBits  Před rokem

      @@A_Malefic Have you logged into the console as root?
      wiki.recalbox.com/en/tutorials/system/access/root-access-terminal-cli
      You should get full access from there.

    • @A_Malefic
      @A_Malefic Před rokem

      @@BytesNBits of course, im using root, because sudo didnt find too

  • @boycefenn
    @boycefenn Před rokem

    I added that line to the rc.local with out the ampersand, now on bootup i get stuck at the running main loop screen and ctrl+c does not work. any suggestions?

    • @BytesNBits
      @BytesNBits  Před rokem +1

      You'll need to put the sd card into another computer and edit the rc.local file there.

    • @boycefenn
      @boycefenn Před rokem

      @@BytesNBits I ran into issues doing that on my windows computer... Didn't consider doing it on a Linux computer until I read your reply. 🤦Thnx for the help

  • @perstoopid2024
    @perstoopid2024 Před měsícem

    trying this with a pi 4, after running sudo ./fbcp-ili9341, the screen stays white and a gray line appears on one side. any fixes?
    i used this config cmake -DILI9486=ON -DGPIO_TFT_DATA_CONTROL=5 -DGPIO_TFT_RESET_PIN=6 -DSPI_BUS_CLOCK_DIVISOR=30 ..

    • @BytesNBits
      @BytesNBits  Před měsícem

      I think this video needs updating. The newer versions of the Pi OS miss part of the code the driver depends on. You could try installing an older version of the Pi OS. You'd need to use one from before the start of 2024.

    • @perstoopid2024
      @perstoopid2024 Před měsícem

      @@BytesNBits i used retropie from 2022 but i ran sudo apt update, could that have updated it so that it doesn't work? either way im gonna try reinstalling retropie later, thanks
      edit: didnt work, still trying to fix

  • @Benzimma
    @Benzimma Před rokem

    okay ive checked my connection twice went of gpio and did the install 5 times even tried on a new rasp-zero and Nothing on the screen when i sudo ./fbcp-ili9341 i have the same screen tft 3.2 and raspbery zero and nothing on the screen still please help! also nothing in folders to eddit >???

    • @BytesNBits
      @BytesNBits  Před rokem +1

      I'm not sure what to advise on this one. Have you been able to get anything on the screen with any other devices? I guess there are two possible causes. Either the code on the Pi is now out of date (the video is 2 years old and I haven't really played with this project since then) or the LCD panel has an issue.

    • @Benzimma
      @Benzimma Před rokem

      @@BytesNBits thanks for the reply the pi zero connectors are adjacent to each other and I wasn’t getting a firm connection on breadboard I tried the pin connectors and works like a charm! … trying to work on a 8bitdo NES controller ! (But the ps5, controller ) works on Bluetooth like butter! …. Thanks A Bunch for the reply .. I had to bus my brain on this one 🤯😭🥳… I’m looking forward to any other projects your doing! Love the channel im At School 🥹👌🏾

  • @dejanjankovic9765
    @dejanjankovic9765 Před rokem +1

    CMakeFiles/fbcp-ili9341.dir/depend.make:392: warning: NUL character seen; rest of line ignored
    i get this when i compile with make -j. Then an endless loop begins..

    • @BytesNBits
      @BytesNBits  Před rokem +1

      Hi. That's a strange one. I'd re download the library and try again. The Null character looks like some sort of file corruption.

    • @dejanjankovic9765
      @dejanjankovic9765 Před rokem

      @@BytesNBits i did just that and it worked! thanks :)
      All this stuff with data is very sensitive and requires the utmost patience.