Raspberry Pi 4 as host platform

294 views
Skip to first unread message

ID-Redacted

unread,
Aug 12, 2020, 10:37:04 AM8/12/20
to MPF Users
Hi All - I'm doing the feasibility study for my hardware selections for a custom pin.  I'm considering the following:
- RPI 4 w/ 4gb as primary host.
- Fadecandy via USB for lighting
- FAST Nano + 1616 for solenoid and solenoid related switches
- Arduino Mega2560 connected via RS232 for 60ish switch inputs.
- 27" monitor for backglass / video playback.


Will the RPI4 be able to run MPF well?  
Have people had success with the RPI4? 
Any general advice before I start down this path?

MythMaker

unread,
Aug 12, 2020, 11:18:52 AM8/12/20
to mpf-...@googlegroups.com
I have a PI4 on order I was going to give a try. If it doesn’t work out I have other uses for it.  I’ll give a report in a week or two on how it worked out.

--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/45c7e04c-cf9f-4c4c-ab4a-d360a491cc93o%40googlegroups.com.

jabdoa

unread,
Aug 12, 2020, 1:46:20 PM8/12/20
to MPF Users
We get this question a lot. Short: Once your code is finished yes with some effort. But you will have a very bad experience during development. Simply don't. See: https://docs.missionpinball.org/en/dev/hardware/computer/index.html.

Jan

MythMaker

unread,
Aug 12, 2020, 1:48:24 PM8/12/20
to mpf-...@googlegroups.com
I am using an HP mini pc for development. You can pick them up on eBay for about $150.  Best part is they are vesa mountable, so after you are done with dev you can simply mount it in the cabinet. 

If the PI doesn’t work out for production use, that is what we are going to do. 

On Wed, Aug 12, 2020 at 1:46 PM jabdoa <jan...@kantert.net> wrote:
We get this question a lot. Short: Once your code is finished yes with some effort. But you will have a very bad experience during development. Simply don't. See: https://docs.missionpinball.org/en/dev/hardware/computer/index.html.

Jan

--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.

Anthony van Winkle

unread,
Aug 18, 2020, 12:11:16 PM8/18/20
to MPF Users
I've spent the last few weeks optimizing my custom machine for improved performance (especially boot time), and have run half a dozen setups on different platforms. The short version: Raspberry Pi is way more trouble than it's worth—and it's not worth much.

The amount of workaround you have to go through to get things installed on a Pi, compared to a normal Linux distro, is a real headache, and the Pi performance is mostly adequate but video/graphics playback is real slow. Its custom GPU is lackluster and has very poor support for Kivy, so unless you're using a DMD your game is going to suffer. Mine runs on a tiny screen (1280x480) without video and the Pi 4B still can't keep up with basic slides.

If you're going to be producing hundreds of machines for sale and are concerned about margins, investing in the time necessary to optimize for a $35 system could be worth your while. But if you're just building a one-off machine for your own enjoyment, I highly recommend you spend an extra hundred bucks and get something that will serve you well. There are plenty of recommendations around the internet and all will serve you well. My machine ran on an Up Core for a long time when I started adding more video I upgraded to an Up Core Plus.

Speaking of building a one-off machine, what I noted above may also apply to the Arduino for switch controls rather than Fast boards. It's a tradeoff that may improve the margins of your machine at resale, but it adds a layer of complexity that seems like a lot of hassle. If your concern is just that they're out of stock, the Fast guys posted recently a photo of their new inventory getting put together so I'd reach out to them and ask about the 3208 and 0804 boards. You'll appreciate the reduced complexity in the long run :)

Welcome to the world of custom pinball!

ID-Redacted

unread,
Aug 18, 2020, 2:50:12 PM8/18/20
to MPF Users
I've settled on an HP Elitedesk miniature form factor PC as the host.  i5, 8gb ram, 256gb SSD.  Should be sufficient w/ linux installed.  Which linux flavor is best supported?

ID-Redacted

unread,
Aug 18, 2020, 2:52:53 PM8/18/20
to MPF Users
As for the switch controls on an Arduino, I've worked with them in the past for inputs.  I don't expect that to be the worst part of the project.  I'll just have a little driver to talk to the arduino via serial and have it post switch state at about 120hz.  One arduino mega can scan through 50 inputs in that time and post the results via serial.

ID-Redacted

unread,
Aug 18, 2020, 2:53:25 PM8/18/20
to MPF Users
I should also note that embedded systems programming is my field of work. :)

jabdoa

unread,
Aug 18, 2020, 5:49:12 PM8/18/20
to MPF Users
I guess Ubuntu/Lubuntu/Xubuntu or Debian would work best. I would still stick with 18.04 as we still got some issue with the python version from 20.04. Might already work but there also might still be issue. LTS upgrades will happen soon which will be the point where we will make sure this is rock solid.

Jan

MythMaker

unread,
Aug 23, 2020, 2:03:00 PM8/23/20
to mpf-...@googlegroups.com
I finally got the PI4 running MPF. It wasn’t super easy.  Unfortunately now I have run into the wall of painful performance of the built in Kivy video player. I am getting about 5 FPS on video playback. 

As another user suggest omx player is working just fine. So it has to do with the way kivy is loading videos into the frame buffer. 

Unfortunately the only work around at this time appears to load omx player behind a transparent kivy window. 

I enjoy this kinda thing, and that is the only reason I am still even attempting to see if this will work. But I agree at the moment a PI is not reasonable if you are using any MC content. Maybe in a machine with class displays and no LCD. 

Brian

jabdoa

unread,
Aug 23, 2020, 2:20:33 PM8/23/20
to MPF Users
This is kind of related how well (or bad) gstreamer supports the RPi. I think there is also an OMX plugin for gstreamer. But as you already found there is an omx plugin for Kivy as well. This is why we do not generally recommend the RPi. The Broadcom SoC does not work too well out of the box on Linux. Kivy Pi kind of solved that for the RPi3. Recreating this for RPi4 is kind of hairy in my opinion.

Jan

ID-Redacted

unread,
Aug 23, 2020, 11:09:28 PM8/23/20
to MPF Users
A little update.  I got the HP Elitedesk yesterday and it looks pretty decent for performance.  I've shifted direction on the switch and solenoid control.  After reading about the Williams System 4 configuration I've decided to keep the original System 4 driver board and PSU. I've started decoding the setup commands for the 3 PIAs on the board.  Took traces with the logic analyzer last night.  So far I've managed to decode the register setup for PIA2.  Writing a python script to parse the traces, as doing it by hand is too slow.  I'll have an at mega 2560 controlling the driver board and interfacing to the PC over USB.  Will need to write a driver for MPF to talk to the mega.  It's good to be doing actual electronics again.

zacaj

unread,
Aug 23, 2020, 11:17:14 PM8/23/20
to MPF Users
If you need any help with that let me know.  I've written code for the original MPU to control the PIAs before.  Although really if you read the data sheet for the PIA it should become pretty clear what signals you need to send.  No need to reverse engineer the signals the original is using

jabdoa

unread,
Aug 24, 2020, 3:16:25 AM8/24/20
to MPF Users
@zacaj: Random question: Would it be possible to write some code for the MPU which acts as a bridge between MPF and the machine? Does the MPU has some serial which we can use? I imagine something similar to our Stern Spike bridge.

Jan

zacaj

unread,
Aug 24, 2020, 8:35:36 AM8/24/20
to MPF Users
I thought about this a while ago..  There's no easily accessible communications port on the williams MPU/driver board.  I figured the easiest way to do this would be to make a small daughterboard that plugs into the ROM socket.  Put a USB chip on there to communicate with the host, and then a bit of other logic to present that serial data as full bytes on the williams' memory bus.  I've got a rom set up for controlling all the hardware (solenoids, lamps, switches, displays), but I've never worked with USB hardware/coding/etc before so I never figured out where to start on that end of things

ID-Redacted

unread,
Aug 24, 2020, 8:53:30 AM8/24/20
to MPF Users
Zacaj - I have the spec sheets and will use them when I write the interface code.  Mostly I wanted to validate my assumptions on how they are setting up the PIAs registers.  I'm having a little adapter board made to take the 40 pin 3.96 header over to a 40pin IDE cable to make it easier.  I considered having a board made to mount the AT MEGA, but that gets quite a bit more expensive due to the size.

kaydeeH

unread,
Sep 29, 2020, 6:21:27 PM9/29/20
to MPF Users
Hi all, I'm a little late to this thread, but I wanted to get a clarification. We're considering a RPi 4 for a simple game with no UI (using the MyPinballs segment display board).  The only LCD display we'll use is a small 4" HDMI display tucked behind the coin box to handle the service mode functionality. I'm sure performance won't be a concern, but when people say it's tough to get running, is that with Raspbian, or Xubuntu? I'd prefer to go with Xubuntu based on the 18.04 image from Ubuntu for the Raspberry. The setup looks pretty straightforward. Am I being naive here?

I was originally considering an Up Board but I don't want to fuss with the I2C audio (though I could if I had to) and I can't get a good handle on which OS it supports that MPF will run on happily with the mini display for service mode. If there's a good OS choice for the Up Board then maybe I'll just stick with that. Thoughts?

Anthony van Winkle

unread,
Sep 29, 2020, 6:30:10 PM9/29/20
to MPF Users
Hey Kaydee-

Most Raspberry images should work, the main trouble with RPi setup is getting Kivy to work but if you're not using a UI, that should be easier. I recently setup an RPi with Arch Linux, but MPF is well vetted on Debian and Ubuntu. You should be fine with either.

As for the UP, I also didn't want to fuss with I2C audio so I got a little USB audio plug for cheap. Plugs into my usb hub, gives me a 3.5mm stereo jack. Easy peasy! And it'll run any flavor of linux or windows. I started with Debian on mine, then switched to Arch for super-optimized boot time. If you're fine with a regular 40-50s boot, Debian/Ubuntu is still a great choice.

-Anthony

kaydeeH

unread,
Sep 29, 2020, 6:40:12 PM9/29/20
to MPF Users
Hi Anthony, thanks for the reply, it's much appreciated. Fast boots with Arch would be ideal, but how much of a pain was it to get it running MPF? I can get around in Linux, but I'm not a Linux "native" so if it's overly complicated to get it all set up with the hardware and MPF, then it may not be a great option for me (unless someone has a great guide). Thanks!

kaydeeH

unread,
Sep 29, 2020, 6:46:30 PM9/29/20
to MPF Users
Anthony, could you also link to the USB sound device you used? Better to go with something known to work than having to experiment, right? :)

Anthony van Winkle

unread,
Sep 29, 2020, 7:55:24 PM9/29/20
to MPF Users
I'm working on a document outlining step-by-step how to setup Arch, but I won't lie, Arch is a real pain. It's speed comes from nothing being included, so it's a lot of step-by-step to get it up and running. Cold boot to game start in 20 seconds, though! But before that endeavor, I was more than happy with running Debian on the UP Core. The full desktop GUI made it much easier to debug and make tweaks to the game, and MPF installs exactly as the instructions on the website. I'd suggest using Debian/Ubuntu to get everything the way you want it, and then after a few months if you really want to get that extra edge, give Arch a try :)

I first ran my sound through this cute little dongle (https://www.adafruit.com/product/1475), then when I made a more formal PCB layout in my backbox I switched to a low-profile adaptor (https://www.aliexpress.com/item/32867955791.html). They both say unavailable now, but there are plenty of others out there. Actually, I picked up a few extra of the AdaFruit ones, I'd be happy to drop one in the mail for you.

kaydeeH

unread,
Sep 29, 2020, 8:09:10 PM9/29/20
to MPF Users
Thanks again for the advice! FWIW, I found this little guy on Amazon that looks to use the exact same chip as the low profile one you got on aliexpress. https://www.amazon.com/Comimark-Powered-PCM2704-Decoder-Computer/dp/B07WXQQ3ML I'll probably go ahead and give that a whirl with the Up Board and Ubuntu then try to shut down as many unneeded startup services as possible to minimize boot time. :)

jabdoa

unread,
Sep 30, 2020, 7:14:43 AM9/30/20
to MPF Users
Audio should not be better on the RPi4 than on the up.  The RPi is known for bad audio. So you need a solution on both boards. USB Audio probably work. Another way (also used in TNA) is a HDMI audio splitter. Should be within the same price range as USB audio.

Guess that also works with those fake HDMI dongles (which are usually used for bitcoin miners) in case you do not have a monitor connected. I use one of those dongles as I only got a DMD in my machine and it works great with an Intel NuC. Should also work on the up board or a RPi.

Jan

Todd Legere

unread,
Sep 21, 2021, 11:57:53 AM9/21/21
to MPF Users
Is there anything new to report on this front. rpi3/rpi4.  I have encountered the audio issues with the pi on my other audio pi project (like jukeboxes).

jabdoa

unread,
Sep 23, 2021, 12:59:04 PM9/23/21
to MPF Users
Still the same: RPi4 works fine as a production platform with some tuning. Never ever use it during development or for a one-off.

Jan

MythMaker

unread,
Sep 23, 2021, 1:05:14 PM9/23/21
to mpf-...@googlegroups.com
I was able to get everything to work on a RPi4 except for video backgrounds.  The way Kivy/MPF processes video it wasn't able to keep up.   There were some work arounds but in the end, I decided it wasn't worth it.



--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.

Todd Legere

unread,
Sep 24, 2021, 6:06:35 AM9/24/21
to MPF Users
Thanks for the feedback. My other hybrid pinball was an arduino and raspberry pi 3 setup. Had sound issues with pi but never used video in that setup.  No pi for my next project.
Reply all
Reply to author
Forward
0 new messages