Orange Pi RV2: Setting Up a RISC-V Media Server with Ubuntu

Jarret B

Well-Known Member
Staff member
Joined
May 22, 2017
Messages
454
Reaction score
519
Credits
19,511
The Orange Pi RV2 is a Single Board Computer (SBC) that differs from the SBCs that have an ARM processor. This board uses a RISC-V (pronounced 'Risk-Five') processor, but we can get into that soon.

Before I get into the differences between RISC-V and ARM, we need to look at the specs of the SBC itself.

Orange Pi RV2 Specifications

The specs are for the RV2 board and consist of the following specifications:
  • Ky X1 8-core 64-bit RISC-V (RV64GCVB) @ 1.6 GHz
  • GPU
    • Integrated, listed in Ubuntu as PowerVR B-Series BXE-2-32
    • Vulkan 1.3
    • OpenGL ES 3.x/2.0/1.1 + Extensions
    • OpenCL 3.0
    • Android NN HAL
  • Video
    • 1 HDMI 2.0
    • 1 MIPI DSI 4 Lane
    • Supports up to 1920x1440@60 frames per second
  • Audio
    • 1 Audio 3.5mm jack
    • 1 HDMI audio output
  • NPU - Supports 2 TOPS
  • RAM/Storage
    • LPDDR4X RAM
    • eMMC sockets, optional solid-state chip add-on (on back of SBC)
    • M.2 M-KEY slot (2280): Supports NVMe SSD (PCIe 2.0 2 Lane)
    • MicroSD card slot
    • SPI - 16 MB default
  • USB
    • 3 USB 3.0
    • 1 USB 2.0
  • Ethernet (RTL8125BG)
    • 2 GB Ethernet LAN
  • Wi-Fi and Bluetooth (AP6256)
    • Wi-Fi 5 + Bluetooth 5.0/BLE
  • Power
    • Type-C power supply
    • 5Volts 5Amps
  • Buttons
    • 1 Boot
    • 1 Reset
    • 1 Power
Instruction Set Architecture (ISA)

The RISC processors are like the ARM processors, except that the ARM processor has proprietary Instruction Set Architecture (ISA). To make your own ARM processor, you must pay for the rights to create it using the same instruction set so it is compatible with the same software. RISC processors have an open-source ISA, so any company can make its own RISC-V processors.

Let me give an example. The newer processors, such as those labeled as 'x86_64', have the instruction set owned by both Intel and AMD. The instruction set controls how the processor handles the instructions given to it by the software. So, a processor made by Intel using the instruction set 'x86_64' can also run on an AMD chip that has the same instruction set, or a compatible one.

You cannot use software intended for an ARM or RISC processor to function on one that supports the 'x86_64' ISA.

Hardware Comparison

The RISC-V processors are not at the same level of speed as the ARM processors, and the RISC-V still can cost more than an ARM processor. The RV2 is 30% faster than an Arm Cortex-A55, but the Cortex-A55 is not the newest Cortex-A series processor. Looking on Amazon, the Orange Pi RV2 is about $42.00.

People hope that as time passes, RISC-V processors will catch up to the abilities of the current ARM chips and even surpass them.

For now, this is what some believe, but hopefully, because the chips are open-source, the progress may happen quickly. This is only a hope, and the future will tell.

Testing the RV2

Usually, I do not perform hardware tests to get a benchmark, and this case is no different.

How I will test the capabilities of the RV2 is to use it as a media server.

NOTE: There aren't too many services available yet for the RISC-V processor, so finding some way to use the SBC was not easy.

There is a media server that is supported in the Ubuntu repositories called Rygel. You can stream media on them over a network, but the Media Player on Roku devices could play it with no problems, but you cannot pause, fast forward or rewind the video. I could even play 4K media with HDR, and it played fine on my TV.

So, you need to go to the Orange Pi website and download the Ubuntu Desktop image at 'http://www.orangepi.org/html/hardWa...ollers/service-and-support/Orange-Pi-RV2.html'. There should be an icon for Ubuntu, when clicked will send you to 'https://drive.google.com/drive/folders/1QgQRX-wtvsTJnOoMBVct-g5HLWb7g6n-' where you have the option to download the Desktop (Orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63) or Server (Orangepirv2_1.0.0_ubuntu_noble_server_linux6.6.63). Of course, the versions may change or others be added after the article is written. Do note that this is version 24.04 and has Long-Term Support.

Download the file you want to use on the RV2. After you save the file and the download is done, you need to extract the '7z' file. After extraction, you should have an 'img' and 'sha' file.

If you want to check the checksum, you can use the following command from within the same folder as the 'img' and 'sha' files:

Code:
sha256sum --check Orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.img.sha

Change the filename of the 'sha' file if it is a different version. The resulting output should show that the file is 'OK'. If the file is not 'OK', then you need to delete it and re-download it, and then check it again after extraction.

You will need to 'burn' the image to an SD card using an app similar to Balena Etcher. Select your extracted file, the one with the 'img' extension. Select the SD card you are going to image it to, just remember that the program will erase any data on the card. Click on 'Flash!' to start the copying process.

Before booting up the Orange Pi, I used a 1 TB NVMe to place movies on it. I formatted the entire drive as EXT4 as one partition. I labeled the name as 'Movies' and physically mounted it on the underside of the SBC.

After booting from the SD card, I performed an update and upgrade to get the Operating System (OS) files updated to the newest version.

Before rebooting, you can install Rygel:

Code:
sudo apt install rygel -y

After rebooting, you need to mount the NVMe with the commands:

Code:
sudo mkdir -p /media/orangepi/Movies
mount /dev/nvme0n1p1 /media/orangepi/Movies

You can also set up file sharing in Settings under the option 'Sharing'. Enable the service and then set the shared folder to the file you just mounted at '/media/orangepi/Movies'.

You will need to edit the 'rygel.conf' in the folder '~/.config/' folder. The file is not too short, and the changes I made to my system are shown:

Code:
# Configuration file for Rygel

# General configuration options
[general]
# Set to 'false' if you don't want Rygel to run on IPv6 addresses
# Whether or not IPv6 is supported depends on how GUPnP was configured
ipv6=false

# Set it to 'false' if you want to disable transcoding support.
enable-transcoding=true

# Where video files should be saved if allow-upload is true.
# Defaults to @VIDEOS@, the standard videos folder (typically ${HOME}/Videos).
video-upload-folder=/media/orangepi/Movies

# Where music files should be saved if allow-upload is true
# Defaults to @MUSIC@, the standard music folder (typically ${HOME}/Music).
music-upload-folder=@MUSIC@

# Where picture files should be saved if allow-upload is true
# Defaults to @PICTURES@, the standard picture folder (typically ${HOME}/Pictures).
picture-upload-folder=@PICTURES@

# Default media engine to load. If not specified, the engine directory is
# searched recursively and the first engine found is loaded.
media-engine=librygel-media-engine-gst.so

# List of network interfaces to attach rygel to. You can also use network IP or
# even ESSID for wireless networks on Linux. Leave it blank for dynamic
# configuration.
interface=

# The port to run HTTP server on. 0 means dynamic.
port=0

# Comma-separated list of domain:level pairs to specify log level thresholds for
# individual domains. domain could be either 'rygel', name of a plugin or '*'
# for all domains. Allowed levels are:
#
# 1=critical
# 2=error
# 3=warning
# 4=message/info
# 5=debug
log-level=*:4

# Allow upload of media files?
allow-upload=false

# Allow deletion of media folders and files?
allow-deletion=false

# Semicolon-separated list of device user-agents (or parts thereof) that need
# a downgrade in the UPnP device versions
# WARNING /!\: Only change this setting when told to do so or when you know
# what you're doing. If you find that adding your device makes it
# working with Rygel, please file a bug at
# https://gitlab.gnome.org/GNOME/rygel/issues/new/?issuable_template=IOP
# so we can include it in future releases.
#force-downgrade-for=Allegro-Software-WebClient;SEC_HHP;SEC HHP;Mediabolic-IMHTTP/1;TwoPlayer;Reciva;FDSSDP;Portable SDK for UPnP devices;Darwin

# Access controll fall-back policy if no access control provider could be
# found. Default is to true which will allow any peer to access anything.
acl-fallback-policy=true

# If set to true, Rygel will disable various features that improve compatibility
# with many clients, but break standard conformance
strict-dlna=false
upnp-enabled=true


# Plugin specific sections
#
# Some options are generic and some are specific to each plugin.
# The generic ones are:
#
# * enabled: As the name suggests, to enable or disable the plugin.
# * title: The title of the plugin to advertise to UPnP clients. This can
# contain the following automatically substituted keywords:
# * @REALNAME@: The real name of the user as returned by
# g_get_real_name() function of glib library.
# * @USERNAME@: The user name of the user as returned by
# g_get_user_name() function of glib library.
# * @HOSTNAME@: The host name of the machine rygel is running on, as
# returned by g_get_host_name() function of glib library.
#

# Options related to the used media backend.
# The options shown in this configuration file are specific to GStreamer.
[GstMediaEngine]

# List of active transcoders. To disable one, remove from list.
transcoders=mp3;lpcm;mp2ts;wmv;aac;avc

# Options that apply to the renderer framework in general
[Renderer]

# Default showtime in seconds to use for images in playlists if dlna:lifetime
# is not set. DLNA wants something between 5 and 15 seconds.
image-timeout=15

[Tracker3]
enabled=false
only-export-from=@MUSIC@;@VIDEOS@;@PICTURES@
share-pictures=true
share-videos=true
share-music=true
strict-sharing=false
title=@REALNAME@'s media on @PRETTY_HOSTNAME@

[Tracker]
enabled=false
only-export-from=@MUSIC@;@VIDEOS@;@PICTURES@
share-pictures=true
share-videos=true
share-music=true
strict-sharing=false
title=@REALNAME@'s media on @PRETTY_HOSTNAME@

[LMS]
enabled=false
title=@REALNAME@'s media on @PRETTY_HOSTNAME@

[MediaExport]
enabled=true
title=@REALNAME@'s media on @PRETTY_HOSTNAME@
# List of URIs to export. Following variables are automatically substituted by
# the appropriate XDG standard media folders by Rygel for you.
#
# * @MUSIC@: The standard music folder (typically ${HOME}/Music).
# * @VIDEOS@: The standard videos folder (typically ${HOME}/Videos).
# * @PICTURES@: The standard pictures folder (typically ${HOME}/Pictures).
#
uris=@MUSIC@;@VIDEOS@;@PICTURES@;/media/orangepi/Movies;
extract-metadata=true
monitor-changes=true
monitor-grace-timeout=5
virtual-folders=true

[Playbin]
enabled=true
title=Audio/Video playback on @PRETTY_HOSTNAME@
#audio-sink=autoaudiosink
#video-sink=fakesink

[GstLaunch]
enabled=false
launch-items=audiotestsrc;videotestsrc;videotestoverlay
audiotestsrc-title=Audiotestsrc
audiotestsrc-mime=audio/x-wav
audiotestsrc-launch=audiotestsrc ! wavenc
videotestsrc-title=Videotestsrc
videotestsrc-mime=video/mpeg
videotestsrc-launch=videotestsrc ! video/x-raw,width=640,height=480 ! avenc_mpeg2video ! mpegtsmux
videotestoverlay-title=Videotestsrc with timeoverlay 2
videotestoverlay-mime=video/mpeg
videotestoverlay-launch=videotestsrc ! video/x-raw,width=640,height=480 ! timeoverlay ! avenc_mpeg2video ! mpegtsmux

[Test]
enabled=false

[ExampleServerPluginVala]
enabled=false

[ExampleServerPluginC]
enabled=false

[ExampleRendererPluginVala]
enabled=false

[ExampleRendererPluginC]
enabled=false

[MPRIS]
enabled=false

[External]
enabled=false

[Ruih]
enabled=false
title=Rygel Remote UI Server

The three lines I changed are in bold and towards the beginning of the configuration file. The big thing is the shared folder location for the 'Movies' folder. If your folder location is different, then make the change. If you use your Home folders, such as 'Pictures', 'Music' and 'Videos', you can leave the default parameters of @pictures@, @Music@ and @videos@.

You simply need to run the 'rygel' to start the service. The service should load and then show a lot of information passing on the screen, but should pause when it creates a list of shared files with the output of 'Harvesting of file://media/orangepi/Movies done in ##.####'. The '#' will represent the time to generate a list of files from the shares.

You can start your Roku and go to the Media Player. Once started, you’ll see an icon with the label of your Orange Pi RV2 Hostname. Select this, and you should be able to select the type of files you want to view (pictures, audio or video). You should then get a file listing, from which you can choose which file to view from the Orange Pi RV2 Media Server.

If you need to change anything in the settings or you need to change the media files, you can press CTRL+C in the terminal where you started 'rygel'. After the service stops, use the following command to stop the service:

Code:
rygel -s

If the service is not completely stopped, then you cannot restart it from a terminal.

Conclusion

This is a very basic use for the RV2, but it shows you some basics of setting up the board, in this case, with Ubuntu.

Even though Rygel is a basic media server, the SBC had no issues streaming the media. Even at 4K with HDR, there were no issues of the video and audio playing smoothly.

This is one of those boards that can have a million uses, and the limit is only your imagination.
 




Follow Linux.org

Staff online

Members online


Latest posts

Top