MPF Orange Pi 5

209 views
Skip to first unread message

Scott Miller

unread,
Mar 29, 2023, 2:00:21 PM3/29/23
to MPF Users
Has anybody run MPF on an Orange Pi 5?  My Cuphead table has been running great for several years but now the 10+ year old PC that runs MPF boots to BIOS about half the time.  I'm looking for a potential replacement down the road.

Brian Madden

unread,
Mar 29, 2023, 7:38:45 PM3/29/23
to MPF Users
I can't speak to that device specifically, but that that price point ($150), you might have more luck / easier experience just going with a "proper" Intel NUC ($250?) or something like that. Maybe a bit more expensive, but it will be more of an "it just works" experience versus who-knows-what driver support and tuning, etc. My general worldview is that the smaller cheaper single board computers can be worth if it you're taking a machine into production, since every dollar saved there will be saved on hundreds of machines, but for a one-off homebrew, just get a more real computer that's easier to get running and has better driver support, etc.

Also, not super important, but keep in mind that Python apps only use a single core, so the MPF game engine uses one core, and the MC will use a second core, so any more than 2 cores won't be used.

BTW cuphead looks awesome! Nice work.
Brian

Scott Miller

unread,
Mar 30, 2023, 7:55:08 AM3/30/23
to MPF Users
Thanks Brian!  CH is a fun table and the 2 1/2" flippers make it feel like an old EM but the power of those flippers make backhands through a spinner on the left lane possible with enough speed at the top to make it all the way across the arch.  I know that a modern pin producer won't take a chance on a 2 1/2" flipper table but with modern rectified powered coils, they are a viable option for designs.

It's also a fairly fast table and doesn't play like some of those low slope EM's where the ball feels like it is going through molasses.  The old school flipper gap makes it an unforgiving machine but hey it's five balls and just like on old EM's nudging is a big part of the play.  It's one of those machines where you play a game and think I can do better than that and play again and again. A score of more than 20,000 is pretty good and I've reached 65k on a few occasions in over a thousand plays but then again I'm not a great player.

Scott

Scott Miller

unread,
Mar 31, 2023, 6:00:02 PM3/31/23
to MPF Users
Screenshot from 2023-03-31 16-51-06.png
Message has been deleted

Scott Miller

unread,
Mar 31, 2023, 6:15:36 PM3/31/23
to MPF Users
This is running because jsm174 figured out all of the installation problems, man that guy is smart!

Brian Madden

unread,
Apr 2, 2023, 11:46:31 AM4/2/23
to MPF Users
Oh great! Are there any tips or other installation issues we should add or change in the docs?

Looking good!

Scott Miller

unread,
Apr 3, 2023, 9:53:05 AM4/3/23
to MPF Users
These are all of the steps worked out by jsm174, he gave me permission to post them here.  I followed them and the installation works but all of this is way beyond my knowledge base.

# Enable 3D Acceleration:

sudo add-apt-repository ppa:liujianfeng1994/panfork-mesa
sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia
sudo apt update
sudo apt dist-upgrade
sudo apt install mali-g610-firmware rockchip-multimedia-config


# Reboot

sudo reboot


# Install development tools

sudo apt-get -y install  build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget


# Install MPF dependencies

sudo apt-get -y install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libgstreamer1.0-dev libxine2-ffmpeg libsmpeg-dev libswscale-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libjpeg-dev libtiff5-dev libx11-dev libmtdev-dev libgl1-mesa-dev libgles2-mesa-dev pulseaudio lsb-release


# Download, compile, and install Python 3.9

wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz
tar -xf Python-3.9.1.tgz
cd Python-3.9.1
./configure --enable-optimizations
make -j 2
sudo make altinstall


# Install MPF

sudo pip3.9 install "mpf[all]" grpcio==1.36.0 grpcio-tools==1.36.0
sudo pip3.9 install "mpf-mc[all]"

........................................

# Install QT6 dependencies
(Adapted from https://doc.qt.io/qt-6/linux-building.html and https://www.ics.com/blog/how-build-qt-640-source-ubuntu-linux)
sudo apt install cmake bison build-essential clang flex gperf libatspi2.0-dev libbluetooth-dev libclang-dev libcups2-dev libdrm-dev libegl1-mesa-dev libfontconfig1-dev libfreetype6-dev libgstreamer1.0-dev libhunspell-dev libnss3-dev libopengl-dev libpulse-dev libssl-dev libts-dev libx11-dev libx11-xcb-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libxkbfile-dev libxrandr-dev libxrender-dev libxshmfence-dev libxshmfence1 llvm llvm-dev ninja-build nodejs python-is-python3 python3

# Install QT 6.4.2  (Takes about 1-2 hours)
wget https://download.qt.io/official_releases/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz
tar xvf qt-everywhere-src-6.4.2.tar.xz
cd qt-everywhere-src-6.4.2
./configure -prefix /usr/local/Qt6
cmake --build . --parallel
sudo cmake --install .

# Upgrade PIP
sudo /usr/local/bin/python3.9 -m pip install --upgrade pip

# Prebuild PyQt6  (Required because PyQt6 is asking questions that can't be answered during pip3) (Takes about 1 hour)
sudo PATH=/usr/local/Qt6/bin:$PATH pip3.9 install PyQt6 --config-settings --confirm-license= --verbose

# Install MPF Monitor
sudo pip3.9 install "mpf-monitor[all]"

Craig Goodwin (GoodwinsPlace Retro Games)

unread,
Apr 8, 2023, 5:20:08 AM4/8/23
to MPF Users
This is amazing progress, I've just ordered an Orange Pi 16GB (possibly overkill on the RAM). 
Have these been run on a fresh Ubuntu Jammy Desktop install? 
I hope to boot off a M.2 SSD to keep things as speedy as possible, also not worried about having WiFi on board as once I have it running I'd rather not risk having items self update at the moment. 

Scott Miller

unread,
Apr 8, 2023, 11:45:45 PM4/8/23
to MPF Users
Yes this was on top of a fresh Armbian Ubuntu Jammy Desktop install.  I boot and run everything from the microSD card since none of this is too computationally intensive.
Message has been deleted

Craig Goodwin (GoodwinsPlace Retro Games)

unread,
Jan 19, 2024, 5:30:16 AMJan 19
to MPF Users
Any suggestions on how to update links on this? Had it running but SD card failed and need to rebuild.
QT6.4.2 seems to have moved on, I've installed a newer version (6.6.1) but then some of the MPF installs fail with pyproject.toml error looking for PyQt6-6.4.2.tar.gz
Keen to give the Orange Pi another go before moving to a mini PC. 

Craig Goodwin (GoodwinsPlace Retro Games)

unread,
Jan 19, 2024, 8:13:23 AMJan 19
to MPF Users
Think I've managed to sort with 6.6.1 and MPF 0.57 dev. 
I have something running which is a start :)

Scott Miller

unread,
Jan 22, 2024, 9:05:37 PMJan 22
to MPF Users
Did you get the opi 5 working?  What was your work around for QT 6.6.1?

tim kirby

unread,
Jan 24, 2024, 12:40:27 AMJan 24
to mpf-...@googlegroups.com
Can I ask what the opi5 is? Lol

--
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/be1a20b0-fbcb-4e5f-97d9-0037fd86bec5n%40googlegroups.com.

tim kirby

unread,
Jan 24, 2024, 12:40:28 AMJan 24
to mpf-...@googlegroups.com
As I recognise the qt 6.6.1 ...battled my way through many mismatches

On Tue, 23 Jan 2024, 12:35 pm Scott Miller, <themi...@gmail.com> wrote:
--

Scott Miller

unread,
Jan 24, 2024, 8:44:41 AMJan 24
to MPF Users
Ha, opi5 is the abbreviation as you figured out.  What mismatches were you working though?

My Cuphead game has been very stable since 2021 but for some reason it reset the high score and audit yaml's a few months ago.  I didn't think much of it until the game started crashing and looking through the log's error messages I saw that there was a "null" instead of an integer in the audit.yaml which was causing the error.  I replaced the null with a "0" and the table is stable again.

I'm planning on taking the pin to the Midwest Gaming Classic and Thomas (Cobrapin) said that this was a known mpf issue with the 0.56 version that I am running.  At any rate when I first made the opi5 set up I used a 128GB micro SD and before I try to upgrade I wanted a clone of the the drive.  I bought another 128GB Micro SD from the same manufacturer but Etcher says it is too small (apparently this is not uncommon for a drive to mot be the size stated even a name brand likeI used).  I've been working with jsm174 to figure out a way to shrink the .img without loosing the ability to boot and we still don't have a working method.  Should this fail I might end up doing a fresh install hence the interest in how you got qt to work.

Craig Goodwin (GoodwinsPlace Retro Games)

unread,
Jan 27, 2024, 5:11:32 AMJan 27
to MPF Users
Sorry all, been busy on a few things and only just seeing the comments. 
I changed from the QT version in the code to https://download.qt.io/official_releases/qt/6.6/6.6.1/single/qt-everywhere-src-6.6.1.tar.xz 
You need to change the link and then the references for the install of the tar.xz to get it to work.
I then used MPF 0.57 Dev version as it worked.

Been running a week or so now with this and it is fine, started building my MPF, been through the tutorial, built an attract mode, have it flipping, scoring and High score working. I've not connected to hardware yet. 

I have the 16GB version (probably overkill on ram) of the opi5 and it is running great, typing from it now. 

I stupidly installed it all on a 400GB SD card, so I can't flash across to the SSD I have without compressing, but might buy a bigger SSD in the future anyway to future proof the system, again storage will be overkill but I'd rather have higher spec and store backups than lower and struggle for space. 

Jason Millard

unread,
Jan 27, 2024, 9:44:10 AMJan 27
to MPF Users
We had a huge amount of challenges shrinking the drive, but we stuck with it and got it.

I think armbian makes a different partition layout which is why pishrink images fail to boot. 

Anyway, we found this awesome project, shrink-backup, which the developer then helped us out:
https://github.com/UnconnectedBedna/shrink-backup/issues/14

Until he merges the fixes, here are the steps.

- Boot OPI
- Shut down all mpf processes (if you had them autostart)
- Mount an NTFS drive big enough to store the backup
- Go to the terminal

curl https://gist.githubusercontent.com/UnconnectedBedna/8ef639c933a7616d65403025f03e65f9/raw/1c93094a1bc140bd04750e016598adb02fd95401/gistfile1.txt -o shrink-backup
sudo mv shrink-backup /usr/local/bin
sudo chmod +x /usr/local/bin/shrink-backup

cd /media/mpf/<whatever NTFS drive is>

sudo shrink-backup -a -l ./mpf_shrink.img

When you restore this image to a smaller drive, upon boot, it will automatically expand to the size of the card.

I plan on updating the gist, and I would like to include your changes. Would you mind putting your changes in the comments?

Jason Millard

unread,
Jan 27, 2024, 9:48:03 AMJan 27
to MPF Users
Forgot one step, you may need to install mtools so your armbian can write to NTFS drives:

sudo apt-get install mtools

Scott Miller

unread,
Jan 27, 2024, 9:55:57 AMJan 27
to MPF Users
Yes it took over a dozen hours over three days to get shrink-backup to work and jsm, deserves all the credit for sticking with this till it worked.  I made the same mistake when I set up my opi 5 of choosing a 128 GB card to start with which made backup images huge.  The shrink-backup reduced the .img size to 11 Gb!  If anyone is going the opi 5 route, do yourself a favor and choose a small microSD card
Reply all
Reply to author
Forward
0 new messages