Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: RPi 2 and an SPI-based 4" LCD screen (and MAME)  (Read 4748 times)

0 Members and 1 Guest are viewing this topic.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
RPi 2 and an SPI-based 4" LCD screen (and MAME)
« on: January 24, 2016, 04:10:52 pm »
Has anyone actually gotten an SPI LCD screen to work at a framerate near to correct for MAME?
I have read everything from everywhere and it looks like anyone making a RPi project is using an HDMI based screen and so their framerates look perfect. (so does mine on my LCD monitor)

I have tried for days to get my 4" Waveshare SPI-based screen to run at a speed close to fast enough to run Galaga or Ms. Pacman and the best I can get is about 10-15 FPS.  (Mame says it's at 33-65%, but it doesn't look that way)
I have tried altering the module settings to run at 20FPS and matching that in Advance mame.
I have tried doubling and quadrupling the timing to the screen from 11 all the way to 44 and the MS from 250 to 125, the FPS hard coded from 10 to 60, the speed from 16mhz to 60mhz. (init=-1,0xb0,0x0,-1,0x11,-2,250)
I have tried vertical and mame not rotated. (0x36,0x88)
I have tried horizontal and rol. (0x36,0x28)
I have tried using fb0 and framebuffer coping it to fb1, with and without DMA, in the foreground and background.
I have tried the LCD manufacture's image, I have built a brand-new Raspian from the website and modified it to run the screen, both look the same.  (both running fbtft and flexfb, with and without the touchscreen and fbcp)

Nothing gets the framerate to anything usable in an mini arcade cabinet.

I thought it would be a piece of cake as there are thousands of these things available for sale everywhere..  Is it something I'm doing wrong.  It can't be that all these projects are using RPi2 and HDMI or RPi1 and composite out can it?

It has to be me. Please help.  :dunno

dgame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 620
  • Last login:November 04, 2023, 06:00:54 pm
  • I am no Jedi
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #1 on: January 24, 2016, 09:55:28 pm »
What resolution is the screen? I read somewhere on Adafruit that the 320x240 screens have better refresh rates than  480x320.

They set the HDMI output to 320x240 pixels, to exactly match the TFT resolution for the framebuffer copy.

Quote
A 320x240 pixel PiTFT display (2.8" resistive, 2.8" capacitive, 2.2" HAT). For gaming we won’t be using the touchscreen features, but still need to distinguish among the various models. The 3.5" PiTFT (480x320) is not recommended for this project — more pixels means slower refresh.
https://learn.adafruit.com/running-opengl-based-games-and-emulators-on-adafruit-pitft-displays

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #2 on: January 25, 2016, 01:12:14 am »
It's a 4" Waveshare at 480x320, so that's probably what it is (156k versus 76k pixels).   It makes sense, I just wish it wasn't true.

Can anyone confirm that their 320x240 SPI screen works at a full speed, so I don't waste another $50.  I was trying not to get a 5" HDMI because a 4" fits perfectly in my project.


It's a $20 Japaneses coin bank.
« Last Edit: January 25, 2016, 04:38:31 pm by MacGyver »

vwalbridge

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2082
  • Last login:July 31, 2021, 12:21:09 pm
  • Don't half-ass two things, whole-ass one thing.
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #3 on: January 25, 2016, 08:17:10 am »
I never had to worry about any of the things you are describing with my Coleco tabletop. Plays games just fine on the screen I got. However, I used Windows. See Micro Donkey Kong link in my signature to see what screen I used.
If you can read this, it means Photobucket's money grab ruined my signature photos.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #4 on: January 25, 2016, 12:12:02 pm »
Found 4.3 inch HDMI LCD screen from eBay...

That's what I figured.   I looked at your build before, it was one of the one's that inspired me to try to make one myself.

I just didn't realize how bad of a performance hit the SPI interface would have on a 480x320 screen.  I wonder if I could find a HDMI to raw LCD controller interface for the 4" and switch it over?  I wonder if I should keep throwing good money after bad or just cut my losses and try to find a ready-made 4" HDMI LCD.  Could a Pi even output at such a low res on the HDMI port?

Any ideas?  Or a source for a 4" HDMI ready Pi compatible screen?

vwalbridge

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2082
  • Last login:July 31, 2021, 12:21:09 pm
  • Don't half-ass two things, whole-ass one thing.
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #5 on: January 25, 2016, 12:17:40 pm »
Sorry, can't help you out with the Pi. I've never used one.

However, this was the exact screen I used:

HDMI input LCD controller board 4.3inch 480X272 AT043TN24 lcd Remotel control
If you can read this, it means Photobucket's money grab ruined my signature photos.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #6 on: January 25, 2016, 04:37:39 pm »
Thanks for the link, I searched for 2 hours and never even saw that one.  I was torn between the one you posted and a 5" SPI powered but HDMI driven one.  I picked the 5" because I could only find 1 guy that got his Pi to output at that low of a resolution and was worried that I wouldn't be up to the task with getting Raspian to work at 480x272 on HDMI.  It must be nice to use windows :P

It was also only $27 for the 5", wish me luck in about 2 weeks (when it gets here).  If I lose the entire "Marquee" I might be able to get a 5" in there. We'll see.

dgame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 620
  • Last login:November 04, 2023, 06:00:54 pm
  • I am no Jedi
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #7 on: January 27, 2016, 03:59:43 pm »
I just got a 3.2" 320x240 SPI screen. I already had the Pi 2 although this is my first time actually using the Pi 2. So I am downloading NOOBS now and eventually I should be able to test MAME on the little TFT.


geeteoh

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 44
  • Last login:May 30, 2017, 09:28:59 pm
  • Connecting with the 80s
    • forum.arcadecontrols.com/index.php/topic,146453.0.html
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #9 on: February 07, 2016, 03:05:23 am »
The cupcade by adafruit uses a 2.8 inch 320 by 240 SPI display. I have one using their microSD image. I don't know the refresh rate, but it works great with advmame. Mine is in vertical mode. Games are clear and great color. Should fit your cabinet. But the image uses a RP model B.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #10 on: February 08, 2016, 05:26:26 pm »
Even running pure kernel based FB drivers with DMA and clocking mine at 60mhz makes it only 80% usable.  In the end it looks like SPI based screens need to be 320x240 or less to work at full speed.

I haven't given up yet, well I did sort of, I ordered an HDMI-based 5", but I think if I can overclock the SPI I might be able to push more data to the old SPI screen. (i don't really think it's going to work, so anyone thinking of using a 480x320 SPI-based screen, save your money, go lower res or HDMI)


acme64

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:September 14, 2016, 12:36:26 am
  • I want to build my own arcade controls!
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #11 on: February 11, 2016, 10:23:57 am »
what if you don't run at native resolution? does the LCD scale?

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #12 on: February 11, 2016, 03:01:32 pm »
No, at least not on the factory Raspian image or a new Rasipian using native FB with DMA.  It just displays in the middle as a tiny moving image, and the framerate still sucks even when the only thing moving is a tiny screen.  If I send a smaller res, it just white stripes the dead area.  My 5" HDMI works perfect and at full speed.

dgame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 620
  • Last login:November 04, 2023, 06:00:54 pm
  • I am no Jedi
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #13 on: March 10, 2016, 10:27:37 am »
Okay,  I finally got MAME to run on the 3.2" 320x240 TFT and my initial results are similar to MacGyver.
I tested with the circus ROM and on the HDMI output it is 100%. However on the TFT circus throttles from 80% to, even over, 100%.

I did not do any tweaking yet. Just got it to show on the TFT.

I broke my first TFT touch screen and my replacement came yesterday.
The first TFT screen is cracked but still works. The cracks make the touch surface useless though.
If anyone has a Raspberry Pi and wants to experiment with MAME on the TFT PM me and I can send you the cracked screen for free.

The 3.2" 320x240 TFT screen can be purchased new ($12.45 shipped from in US) from here: http://www.banggood.com/3_2-Inch-TFT-LCD-Display-Module-Touch-Screen-For-Raspberry-Pi-B-B-A-p-1011516.html



Even if we can't make it run MAME 100% it still could be a nice touch screen for projects. Could make a sweet mini jukebox or media player. You can also use the HDMI output at the same time.




MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
Re: RPi 2 and an SPI-based 4" LCD screen (and MAME)
« Reply #14 on: March 10, 2016, 04:03:23 pm »
Duhjoker said he was able to get good speeds with a non stock FB (framebuffer) copy driver named rpi-fbcp, I haven't tried it as I don't use the SPI based screen anymore, but you might want to give it a whirl.

If it does work out better please report back; there might be hope yet.