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

Поделиться
HTML-код
  • Опубликовано: 2 май 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

Комментарии • 98

  • @beardedgitgaming6779
    @beardedgitgaming6779 10 месяцев назад +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

    • @BytesNBits
      @BytesNBits  10 месяцев назад

      Glad I could help

  • @GorkaLarrazabal
    @GorkaLarrazabal 2 года назад +1

    THANKS, THIS IS THE GREATEST EXPLANATION I HAVE SEEN.

  • @freddycisneros5634
    @freddycisneros5634 3 года назад +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.

  • @johnbillings5260
    @johnbillings5260 8 месяцев назад +3

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

    • @BytesNBits
      @BytesNBits  8 месяцев назад

      Yes. The adaptive driver really makes a differemce.

  • @Sodwmistis
    @Sodwmistis 5 месяцев назад +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.

    • @BytesNBits
      @BytesNBits  5 месяцев назад

      Glad it helped. Thanks.

  • @MarkMiller-wj3ym
    @MarkMiller-wj3ym 3 месяца назад

    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  3 месяца назад

      Great. I haven't tried that yet.

  • @criminalinfluencer071
    @criminalinfluencer071 4 месяца назад +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!

  • @SycoSpartan
    @SycoSpartan 29 дней назад

    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  29 дней назад

      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 24 дня назад

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

  • @KingALLO69
    @KingALLO69 Год назад

    Very great explanation! Thank you.

  • @RoamingAdhocrat
    @RoamingAdhocrat 2 года назад +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  2 года назад +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  2 года назад +1

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

  • @umutkayacan7659
    @umutkayacan7659 3 года назад

    A 45 min video? Nice!

  • @ritwikdube2798
    @ritwikdube2798 9 месяцев назад

    You are a legend

    • @BytesNBits
      @BytesNBits  9 месяцев назад

      If only more people would realise this ;)

  • @alanturner1184
    @alanturner1184 3 месяца назад

    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  3 месяца назад +1

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

  • @stephenelliott7071
    @stephenelliott7071 3 года назад +2

    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  3 года назад +3

      Hi Stephen. Thanks for the tip.

    • @stephenelliott7071
      @stephenelliott7071 3 года назад +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.

  • @duanefreeman3152
    @duanefreeman3152 8 месяцев назад

    Thank you so much friend I owe you my sanity!

    • @BytesNBits
      @BytesNBits  8 месяцев назад

      Glad I could help

    • @duanefreeman3152
      @duanefreeman3152 4 месяца назад

      @@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!

  • @dodzy
    @dodzy 2 года назад

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

    • @BytesNBits
      @BytesNBits  2 года назад +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.

  • @Fachher
    @Fachher 10 месяцев назад

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

    • @BytesNBits
      @BytesNBits  10 месяцев назад

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

  • @HitAndMissLab
    @HitAndMissLab 7 месяцев назад

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

    • @BytesNBits
      @BytesNBits  7 месяцев назад

      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.

  • @Ryan-cx2fn
    @Ryan-cx2fn Месяц назад

    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  Месяц назад

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

  • @ilyasseilyasse3093
    @ilyasseilyasse3093 2 года назад

    Great 💪💪✌️

  • @kiyoshinakamura8747
    @kiyoshinakamura8747 Год назад

    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  Год назад

      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.

  • @andersonand3720
    @andersonand3720 9 месяцев назад

    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  9 месяцев назад

      Dê uma olhada neste vídeo - ruclips.net/video/w1PQXpp6jC8/видео.html

  • @abreadofloaf9761
    @abreadofloaf9761 3 месяца назад

    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  3 месяца назад

      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.

  • @Ryan-cx2fn
    @Ryan-cx2fn 8 месяцев назад

    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  8 месяцев назад +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.

  • @thetrufflegouda
    @thetrufflegouda 4 месяца назад

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

    • @BytesNBits
      @BytesNBits  4 месяца назад

      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.

  • @RBIBIANO
    @RBIBIANO Год назад

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

    • @BytesNBits
      @BytesNBits  Год назад +1

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

    • @RBIBIANO
      @RBIBIANO Год назад

      @@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 Год назад

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

  • @mrpaulvoline1275
    @mrpaulvoline1275 5 месяцев назад

    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  5 месяцев назад +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.

  • @MistralKriss
    @MistralKriss 8 месяцев назад

    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  8 месяцев назад

      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 8 месяцев назад

      @@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 7 месяцев назад

      @@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

  • @aaronkahraman5896
    @aaronkahraman5896 Месяц назад

    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  Месяц назад

      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.

  • @ds2kx
    @ds2kx Год назад

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

    • @BytesNBits
      @BytesNBits  Год назад

      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 Год назад

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

    • @BytesNBits
      @BytesNBits  Год назад

      @@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.

  • @RichDMonte
    @RichDMonte 2 месяца назад

    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  2 месяца назад

      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.

  • @justicestorm1942
    @justicestorm1942 11 месяцев назад

    does this work on rpi 3 b+?

    • @BytesNBits
      @BytesNBits  11 месяцев назад

      Yes. It should work on any Pi.

  • @CHIKKOAJ
    @CHIKKOAJ 2 дня назад

    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  6 часов назад

      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.

  • @EvanLandry
    @EvanLandry 6 месяцев назад

    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  6 месяцев назад

      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 6 месяцев назад

      @@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  6 месяцев назад

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

  • @A_Malefic
    @A_Malefic Год назад

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

    • @BytesNBits
      @BytesNBits  Год назад

      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 Год назад

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

    • @A_Malefic
      @A_Malefic Год назад

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

    • @BytesNBits
      @BytesNBits  Год назад

      @@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 Год назад

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

  • @boycefenn
    @boycefenn Год назад

    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  Год назад +1

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

    • @boycefenn
      @boycefenn Год назад

      @@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 9 дней назад

    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  8 дней назад

      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 8 дней назад

      @@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 Год назад

    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  Год назад +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 Год назад

      @@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 Год назад +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  Год назад +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 Год назад

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