OrangePi SBC - RISC-V

Orange Pi RV2 Single Board Computer Running Linux: Building a Program

This is a new series of articles focusing on RISC-V single board computers running Linux. One set of articles will focus on the Orange Pi RV2, a cost-effective RISC-V development board with Ky X1 8-core RISC-V AI CPU, providing 2TOPS CPU fusion of general-purpose computing power to support rapid deployment of AI model algorithms.

The Orange Pi RV2 is a low cost RISC-V single board computer designed to be an affordable option for those interested in exploring RISC-V technology. We write a lot about open source software. But open source hardware is just as exciting. I’m testing the 4GB RAM model which is available for around £37. Impressive considering the feature set of the board.

Options for installing software are a bit more limited with the RV2 compared with ARM-based single board computers. For example, there is currently no support from Flatpak for RISC-V. In this situation, there will be more instances where you’ll need to build source code for yourself. In this article, I’m going to build fooyin, an impressive open source music player.

My first attempt at building fooyin failed. The machine hung building the source code about 2/3rd in. It appears the machine ran out of RAM.

One thing to note that no swap is configured by default with Ubuntu 24.04. Let’s create a 1GB swap file

This command allocates a 1GB swap file.

$ sudo fallocate -l 1G /var/swap

I need to set the permissions so only the root user can change the swap file.

$ sudo chmod 600 /var/swap

mkswap sets up a Linux swap area. Type:

$ sudo mkswap /var/swap

I can proceed and enable the swap file.

$ sudo swapon /var/swap

Make the change persistent with the command:

$ sudo bash -c "echo /var/swap none swap defaults 0 0 >> /etc/fstab"

Build fooyin

First, install the program’s dependencies.

sudo apt install \
g++ git cmake pkg-config ninja-build libglu1-mesa-dev libxkbcommon-dev zlib1g-dev \
libasound2-dev libtag1-dev libicu-dev \
qt6-base-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools \
libavcodec-dev libavformat-dev libavutil-dev libavdevice-dev libswresample-dev \
libsndfile1-dev libopenmpt-dev libgme-dev libarchive-dev libebur128-dev

The project also says to install libpipewire-0.3-dev but I omitted this as it caused a dependency issue. It didn’t affect the build.

Clone the project’s GitHub repository:

$ git clone --recurse-submodules https://github.com/fooyin/fooyin.git

Clone repository

Change into the newly created directory:

$ cd fooyin

$ cmake -S . -G Ninja -B build

Write build files

$ cmake --build build

Time to build fooyin

It took 51 minutes 33 seconds to build the program on the RV2. To put this figure into context, a slightly overclocked Raspberry Pi 5 takes 10 minutes 39 seconds to build the same source code. And as the Raspberry Pi 5 is ARM-based, I just use the Flatpak that’s available avoiding building the program altogether.

The final step is to install the program. Issue the command:

$ cmake --install

Start fooyin from Activities in the usual way.

OrangePi RV2 playing music with fooyin


All articles in the series:

Orange Pi RV2
IntroductionIntroduction to the series and interrogation of the RV2
BenchmarksBenchmarking the Orange PI Single Board Computers
PowerI compare the RV2's power consumption to other machines
orangepi-configA utility to configure this single board computer
Building a programI build fooyin on the RV2. fooyin is a great open source music player
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Please read our Comment FAQ before posting.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments