Emulation on Pinephone UBPorts CE Running Arch Linux ARM Plasma Mobile
#1
A while ago, I decided I wanted to use Retroarch on Arch Linux Arm Plasma Mobile on my Pinephone UBPorts CE, with or without a physical controller. It was not easy and I could not find a consolidated set of instructions for my desired use case, so I thought I would post a little tutorial here for anyone else interested in doing something similar. By following these steps, you should have Retroarch and the necessary emulator cores to emulate Gameboy, Gameboy Color, Genesis, Super Nintendo, Playstation, and Nintendo 64.

My goal is to save people time and headache, and to hopefully find people who can push the envelope further. I have personally tested Gameboy, Gameboy Color, Genesis, Super Nintendo, Playstation, and Nintendo 64 with this configuration. I have not gotten Dreamcast to run yet, and Playstation and Nintendo 64 run very poorly. I am hoping others can advise how to improve the performance of those emulators. I do not have extensive knowledge of all of the configuration options for emulator cores, so maybe tweaking the configuration could make them playable. I am holding out hope for Super Mario 64 because I saw a video months ago on YouTube showcasing N64 emulation on the Pinephone. I don't know if it was taken down, but I can't find it anymore. The video showed Super Mario 64 being emulated on a Pinephone and it looked like a playable frame rate. I managed to get it to run, but it is not playable yet.

I welcome feedback to make this information more complete, useful, clear, etc.

The instructions to install Retroarch on Arch Linux that you will see below are derived from the following video. It may help if you get stuck or want more information:
https://www.youtube.com/watch?v=nI_MzwCjFuQ

The pastebin link shown below was found in the description of this video on Pine64's YouTube Channel:
https://www.youtube.com/watch?v=yILXtmc7Wrc

[Install Retroarch along with your desired emulator cores]
sudo pacman -S libretro
When prompted to select packages from the group, enter:
32 33 35 15 27 30
Which corresponds to 32) retroarch 33) retroarch-assets-glui 35) retroarch-assets-xmb 27) libretro-sameboy 15) libretro-genesis-plus-gx 30) libretro-snes9x

[Setup retroarch.cfg]
Replace the contents of ~/.config/retroarch/retroarch.cfg with this (found in the description of a video by Pine64 on Retro Gaming on the Pinephone):
https://pastebin.com/zNutfvxp
I don't know what all of the changes in this config file do compared to the default except for the menu interface. This configuration tells Retroarch to use the RGUI menu interface as opposed to the default Ozone menu interface. I can only assume this decision was made to improve performance as the RGUI menu interface looks simpler.

[On-Screen Controller Setup]
At this point, I recommend setting up the on-screen virtual controller button overlays as a backup in case you find yourself without a controller.
NOTE: When plugging usb c peripherals such as a controller into the Pinephone, the screen may dim. If your Pinephone's brightness is below a certain threshold, this may turn off the display entirely. Before plugging in your controller, or other peripherals, increase your brightness to around 50%.
Plug in your controller, usb c hub with keyboard, or connect via bluetooth with a virtual keyboard android app (Bluetooth Keyboard & Mouse), anything that will work to navigate the Retroarch interface.
Run Retroarch
Online Updater > Update Overlays
Settings > On-Screen Display > On-Screen Overlay > Overlay Preset > gamepads > psx > psx.cfg (or your gamepad overlay of choice)
From the On-Screen Overlay menu, ensure that Display Overlay is on, Hide Overlay in Menu is off, and Hide Overlay When Controller is Connected is on (or whatever you prefer)
NOTE: To actually use the on-screen overlay to navigate Retroarch and control your games, Plasma Mobile's Display Scale must be set to 100% instead of the default 200%. Open the Settings app in the plasma app drawer, go to Display, and change the scale to 100%

[Get N64 Emulator (mupen64plus-next)]
This one was tricky. I could not find any n64 cores in the libretro group in pacman. I ended up compiling it from source on the Pinephone. If you know of a better way, please let me know. You may need to install some packages if you have never compiled anything before. You will need make, git, and g++ at least.
NOTE: Compiling on the Pinephone will take time and can be paused or interrupted if the Pinephone goes into sleep mode. Keep it awake while compiling.
I think this should cover everything you need:
sudo pacman -S base-devel git
Once you have the necessary packages:
git clone https://github.com/libretro/mupen64plus-libretro-nx.git
cd mupen64plus-libretro-nx
git switch master (When I cloned the repo, it was on the develop branch which failed to compile. The master branch compiles at time of writing)
Using your preferred text editor (vim), change '0' to '1' for FORCE_GLES on line 2 of Makefile.
make all
sudo cp ./mupen64plus_next_libretro.so /usr/lib/libretro/

[Get Playstation Emulator (pcsx_rearmed)]
There are playstation cores in the libretro group in pacman, but for one reason or another they didn't work for me, so I compiled it from source on the Pinephone as well. If you know how to get the other cores working, please let me know. I may try troubleshooting them again later. You may need to install some packages if you have never compiled anything before. You will need make, git, and g++ at least.
NOTE: Compiling on the Pinephone will take time and can be paused or interrupted if the Pinephone goes into sleep mode. Keep it awake while compiling.
I think this should cover everything you need:
sudo pacman -S base-devel git
Once you have the necessary packages:
git clone https://git.libretro.com/libretro/pcsx_rearmed.git
cd pcsx_rearmed
make -f Makefile.libretro
sudo cp ./pcsx_rearmed_libretro.so /usr/lib/libretro/

[Miscellaneous]
It is usually helpful if not necessary to do the following on a fresh install:
Run Retroarch
Online Updater > Update Assets
Online Updater > Update Databases
Online Updater > Update GLSL Shaders

[Adding Roms]
Be sure you have updated your databases before this step. See [Miscellaneous].
Run Retroarch
Playlists > Import Content > Scan Directory
Navigate to the directory where you keep your roms. Retroarch will add them all to Playlists for you to easily select them to play later so you do not have to navigate to your roms directory each time.

[Play]
Run Retroarch
Playlists > Playlist of Choice > Game of Choice > Run > Core of Choice
Play!
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  LibreOffice usable with Arch Linux on the Pinephone? Peter Gamma 2 616 07-28-2024, 05:12 AM
Last Post: Peter Gamma
  Pinephone with KDE Plasma stuck at K logo after update Daniello 0 287 06-20-2024, 01:52 AM
Last Post: Daniello
  Pinephone error system-generators/ostree-system-generator failed with exit status 127 Daniello 3 674 06-15-2024, 03:38 AM
Last Post: Kevin Kofler
  stuck between phosh and plasma aular 0 618 02-27-2024, 05:55 PM
Last Post: aular
  Updating Arch Linux _radv_ 8 2,373 02-20-2024, 09:35 AM
Last Post: _radv_
  PinePhone AND/OR PinePhone Pro Arch Complete Install and Setup mikehenson 2 3,655 01-14-2024, 08:43 AM
Last Post: shifras
  How to install arch with FDE user641 3 1,561 01-11-2024, 10:18 PM
Last Post: Kevin Kofler
  Close running app ionmich 4 1,905 01-10-2024, 08:21 PM
Last Post: Kevin Kofler
  How to find software app, on Arch Phosh? general_lee 5 3,019 10-15-2023, 10:12 PM
Last Post: Kevin Kofler
  Arch auto mount usb example Lazy_one 2 3,501 10-06-2023, 09:36 AM
Last Post: luppivega

Forum Jump:


Users browsing this thread: 1 Guest(s)