A guide for how I made RetroPie, RetroArch, and EmulationStation Work on the Rock64
#1
Thumbs Up 
So first off, while I'm a "professional computer guy", my expertise is Microsoft stuff, so before getting my raspberry pi 3 I had very little linux experience. The RPI3 has a lot of downloadable images that basically "just work" out of the box, but ROCK64 doesn't have that benefit yet. And with the more powerful hardware on this platform, I have been excited to figure this out... but to get it up and running I've had to learn quickly and do a lot of research. 

After banging my head against things, neglecting the family, angering the demon that is my wife, and having to start over again multiple times... I finally got RetroPie, RetroArch, and EmulationStation working. I figured I'd contrubute to the community with what steps I took, but I offer no support or guarantees. All I know is that now I'm "rock64ing" RP, RA, and ES Smile

I wanted to use the newest linux builds available from ayufan but ran into problems booting (no video), so I ended up going back a few versions. I'm eventually planning to try to find a way to upgrade to the newest build without having to redo everything (if you know how, feel free to let me know, I'm still learning all this).

I started with jessie using the 0.5.10 build from ayufan (jessie-minimal-rock64-0.5.10-118-arm64.img.xz). I was using a computer monitor and an HDMI-DVI converter to configure everything on jessie, but once it got it all working I tried it on my TV and got no display :Sad So I started over using stretch (stretch-minimal-rock64-0.5.10-118-arm64.img.xz). I'll post the details of both in case it helps anyone. And there's always a chance some of the steps I took were not necessary, but it worked out for me.

First off, as a relatively linux noob, here's my notes on some helpful linux commands that I had to learn and use in my trials: 
----------------------
To show version of installed package: apt-show-versions <package>

After a fresh OS install, run these to get everything updated:
  apt-get update
  apt-get upgrade
  apt-get dist-upgrade

To install newer/unstable versions of packages (such as gcc):
  echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list.d/unstable.list
  apt-get update
  apt-get install -t unstable gcc-5

To downgrade/install a specific version of packages: sudo apt-get install <package-name>=<package-version-number>

To open compressed log files: zcat logfile.gz

To show all versions available for a package: apt-cache madison <package>

To show what packages depend on a specific package: apt-cache rdepends packagename

To list all installed packages: apt list --installed

To manually mount a USB drive: 
  mkdir /media/usb1 (if it doesn't already exist)
  mount /dev/sda1 /media/usb1

To Unmount a USB Drive: umount /media/usb1

To get CPU detail: lscpu

To get status of services: service --status-all

To restart a service: service <service name> restart

To force-overwrite packages after apt-get error: sudo dpkg -i  --force-overwrite  /var/cache/apt/archives/<package file name>.deb

To download a package files only without installing: aptitude download <package_name> (note: had to install aptitude)

Force network adapter to get DHCP address: dhclient eth0 -v 

To NEVER ALLOW DROP TO COMMAND and auto-start emulation station, add this to the bottom of ~/.profile:
   [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec emulationstation
 (preferred method is to use retropie setup to tell ES to autorun in config)

To set the timezone: dpkg-reconfigure tzdata

To enable autologin: edit the file /lib/systemd/system/getty@.service and change the line
    ExecStart=-/sbin/agetty --noclear %I $TERM
  to
    ExecStart=-/sbin/agetty --noclear -a rock64 %I $TERM

Ways to build a debian package from source:
  checkinstall (had to add this package manually, but makes ANY INSTALLATION into a debian package and replaces the make command!)
  The next two are picky and require a true debian source package, needs to run from within the debian folder with a special file in it:
   dpkg-buildpackage -us -uc -b (this one seems to work the best)
   dpkg-deb --build <package name> 

 To add a root share after installing samba, add the below to the config /etc/samba/smb.conf (NOTE: retropie setup lets you do it without the console):
    [root]
    comment = root
    path = "/"
    writeable = yes
    guest ok = yes
    create mask = 0644
    directory mask = 0755
    force user = rock64
-------------


Now to the guts of the RP, RA, and ES installs:

For both jessie and stretch you'll need the most recent retropie source from github. Then use this pull request to make the necessary changes to the code to support a rock64 install:
https://github.com/RetroPie/RetroPie-Set...2205/files


ON JESSIE:
-----------------
First run the retropie-setup script after you've applied the pull request to source. This alone should allow you to run the retropie setup.

The release of jessie that I used has an older version of GCC and causes build errors when installing retroarch and emulationstation (unknown value 'native' for -march).
To build retroarch you'll need to upgrade GCC, so I added the unstable apt source (per my instructions above) and chose to install version 7.2.
To build emulationstation you'll need to upgrade G++, so I added the unstable apt source (per my instructions above) and chose to install version 7.2.

I attempt to install retroarch and emulationstation and after reviewing the logs find that they fail due to an attempt at overwriting existing libraries (because some are already included in the libmali-rk* packages). After the first failed installations I drop to console and apt-get remove the following:
 libsdl2-dev
 libmali-rk-utgard-2th-r7p0
 libmali-rk-dev
(don't reboot)

I then return to retropie-setup and attempt retroarch and emulationstation installations again. If I run into any failures again, I note the log file it refers to and I drop back to console and review the log and manually force the failing package to overwrite the existing one using the below command and try the install again:
  sudo dpkg -i  --force-overwrite  <full path to DEB file>

Eventually both RA and ES install successfully. But... ES doesn't start due to a segmentation fault. So, REINSTALL both libmali-rk* packages with force-overwrite. For example:
    sudo dpkg -i  --force-overwrite  /var/cache/apt/archives/libmali-rk-utgard-2th-r7p0_1.5-4ayufan12_arm64.deb
----------------------


ON STRETCH:
-----------------------
(for all below steps, whenever something doesn't install due to an overwrite, I use dpkg to force overwrite it, just like previously explained)
Ran all updates, upgrades, and dist-upgrades after the fresh image booted.
The first few times I tried this I ended up with the "unable to initialize SDL" errors and my attempts to fix it made things worse. This time I decided to be proactive and build a few packages first to try and get dependencies in place. I have no idea if this was absolutely necessary. But again, it worked.
   apt-get install xorg-dev
   apt-get build-dep xscreensaver vlc totem
I ignored any package warnings it throws at this point since I was just looking for some dependencies to get installed.
Now run the retropie-setup script after you apply the pull request from github.
Try and install Retroarch and Emulationstation. Any failures, review the listed log file and force overwrite the failing library manually using dpkg like I previously explained.
Eventually both will install, but emulationstation still returns unable to init SDL.
Did some testing and found that the libsdl2-dev package was actually on hold. I figured I'd remove and reinstall the libmali-rk-utgard package...
but it wouldn't let me due to a dependency issue. I installed aptitude to see what it recommended as a solution.
So first I let it install libmali-rk-midgard-4th-r13p0. Then I was able to successfully remove libmali-rk-utgard. 
Then I reinstalled the libmali-rk-utgard package using dpkg with overwrite.
Then I uninstalled and reinstalled libmali-dev.
------------

At this point, whether you're on jessie or stretch, you should be able to start ES and start installing your various emulators. Some will install just fine, and others will fail and you'll have to review logs and tend to the overwrites manually using the same methods we used during the install. I didn't test all the emulators but was able to get a good handful running without issues. Again, I can't make any promises or do much support on this, but I hope it helps some of you get up and rolling. If anyone has additions or runs into other required fixes, please post for the community benefit.

Good luck everyone, and happy rock64ing!
  Reply


Messages In This Thread
A guide for how I made RetroPie, RetroArch, and EmulationStation Work on the Rock64 - by Mrfixit2001 - 12-15-2017, 03:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginners Guide: Migrating to SSD rontant 18 39,647 01-19-2022, 09:30 AM
Last Post: Ellesar Dragon
Information Beginners Guide: Adding USB Storage, Linux Formatting and Permissions Ptheven 4 12,220 03-06-2021, 01:49 PM
Last Post: helpmerock
  Rock64 - Simple Bare-Metal Example krjdev 1 4,769 01-24-2021, 11:59 PM
Last Post: krjdev
  Step by step guide PXE diskless configuration. burglar_ot 13 35,628 11-01-2020, 11:26 PM
Last Post: michael.gruner
Information Manual: Howto cross-compile Upstream U-Boot for rock64 rock7 3 8,063 04-15-2020, 05:09 PM
Last Post: rock7
  Using the Movidius NCS with rock64 markjay 0 4,340 07-02-2018, 09:51 AM
Last Post: markjay
  Guide - XRDP - Debian Stretch / Ubuntu Xenial / OMV S3phi40T 3 13,958 05-05-2018, 06:08 AM
Last Post: S3phi40T
Information Guide - Raid Array (Raid 0) Ptheven 0 4,809 10-07-2017, 09:22 AM
Last Post: Ptheven
Information Guide - Setting up a NFS Share Ptheven 0 5,461 09-26-2017, 04:44 AM
Last Post: Ptheven
  Guide - Setting up a SMB(Windows) file server Ptheven 0 12,568 08-21-2017, 08:54 AM
Last Post: Ptheven

Forum Jump:


Users browsing this thread: 2 Guest(s)