The officially official Devuan Forum!

You are not logged in.

#1 2019-07-16 04:01:26

spinlock
Member
Registered: 2016-11-30
Posts: 11  

Raspberry Pi VideoCore userland build/install (/opt/vc)

Doing this for the second time in 6 months, so I thought I'd better document it here.

The Raspbian images contain some userland libraries, code examples etc. for the VideoCore of the raspberry pi. They usually live in /opt/vc. Building the software from the official github repo directly on the raspberry pi, seems to be the cleanest way to install it on devuan. This worked on a rpi3 (running 32-bit), and most recently on a pi zero.

On a pi zero the build takes about 45 minutes (<10 minutes on the rpi3).

The required packages are:

$ sudo apt install build-essential pkg-config cmake

Building locally in a 128MB ramdisk works nicely (gpu_mem=32 initially, adjusted later):

$ mkdir /tmp/ramdisk
$ sudo mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk
$ cd /tmp/ramdisk

Fetch the code:

git clone https://github.com/raspberrypi/userland

Start the build:

$ cd userland
$ ./buildme

This should install everything in /opt/vc.

Change memory split in /boot/config.txt:

## memory shared with the GPU
gpu_mem=128

More to follow.

Last edited by spinlock (2019-07-17 13:19:12)

Offline

#2 2019-07-17 04:29:35

spinlock
Member
Registered: 2016-11-30
Posts: 11  

Re: Raspberry Pi VideoCore userland build/install (/opt/vc)

Add login username to /etc/group for audio, video:

...
audio:x:29:username
video:x:44:username
...

Create '/etc/udev/rules.d/10-local-rpi.rules', to set VC device group and permissions:

SUBSYSTEM=="vchiq", GROUP="video", MODE="0660"
SUBSYSTEM=="vc-sm", GROUP="video", MODE="0660"
SUBSYSTEM=="bcm2708_vcio", GROUP="video", MODE="0660"

Time to reboot:

$ sudo reboot

Last edited by spinlock (2019-07-17 13:17:53)

Offline

#3 2019-07-17 04:41:41

spinlock
Member
Registered: 2016-11-30
Posts: 11  

Re: Raspberry Pi VideoCore userland build/install (/opt/vc)

Testing.

Compile demos:

$ sudo apt install libfreetype6-dev

$ cd /opt/vc/src/hello_pi
$ sudo sh rebuild.sh

Set library path:

$ export LD_LIBRARY_PATH=/opt/vc/lib

Run e.g. tiger demo:

$ ./hello_tiger/hello_tiger.bin

Offline

Board footer