Score:1

Install Rpi-Userland on arm64 Pi 4 running Ubuntu Pi 22.04 server

ru flag

I am trying to build tvheadend on Ubuntu Pi 22.04.

ubuntu@ubuntu:~/build/tvheadend/master$ uname -a
Linux ubuntu 5.15.0-1015-raspi #17-Ubuntu SMP PREEMPT Mon Sep 12 13:14:51 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@ubuntu:~/build/tvheadend/master$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

But at the end I am getting errors:

...
.....
.......
Markdown: docs/wizard/network.md
Markdown: docs/wizard/status.md
CC              src/docs.o
CC              tvheadend
/usr/bin/ld: cannot find -lprofiler: No such file or directory
/usr/bin/ld: cannot find -ltcmalloc: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:712: /usr/local/src/tvheadend/build.linux/tvheadend] Error 1
make[3]: Leaving directory '/usr/local/src/tvheadend'
make[2]: *** [Makefile:110: ffmpeg_all] Error 2

When I search for these files it looks like I don't have them:

ubuntu@ubuntu:~$ ls -l /usr/lib | grep profiler
ubuntu@ubuntu:~$ ls -l /usr/lib | grep malloc  
ubuntu@ubuntu:~$ ls -l /opt/vc/lib | grep profiler
ubuntu@ubuntu:~$ ls -l /opt/vc/lib | grep malloc  
ubuntu@ubuntu:~$

My understanding is they are rpi-userland files/utilities and I need them in 64-bit for my Pi 4 (arm64). There is a method to install an rpiuserland with the snap command, but that doesn't work for me:

ubuntu@ubuntu:~$ sudo snap install rpi-userland --edge
error: snap "rpi-userland" is not available on edge for this architecture (arm64) but exists on
       other architectures (amd64, armhf).

I have searched around and I tried building an rpi-userland using this script but it didn't work on my system: https://gist.github.com/satmandu/c462ab301cbe09bd6e7cf4db7f626727

Looks like there is a raspberrypi-userland source package in Jammy here... https://launchpad.net/ubuntu/jammy/+source/raspberrypi-userland
But I don't know what to do with it??

Does anyone know how to install the rpi-userland files on arm64 Ubuntu Pi server 22.04?

Any help much appreciated!

Flex

Score:0
ru flag

It turns out those errors had nothing to do with rpi-userland files they were both part of Google's gperftools profiler.

My options were to build tvheadend with the --disable-gperftools build option or else to install the support for them:

# sudo apt install gperftools libgoogle-perftools-dev

Installing rpi-userland on Ubuntu 22.04 64-bit running on a Pi 4
As mentioned above the SNAP command does not currently work to install rpi-userland in this environment.

Furthermore currently rpi-userland is just not supported on any 64-bit OS running on a Pi 4.

You can download and cross compile the 32-bit rpi-userland sources on your 64-bit system. This github page has a script build_arm64_rpi_userland.sh that does that. It generates a .deb file which you can then install like this:

# sudo dpkg -i /home/ubuntu/workdir/output/rpiuserland_54fd97a_arm64.deb

Initially I had some problems and needed to run these commands:

# sudo apt --fix-broken install

• Then tried again...

# sudo apt install libgcc1-armhf-cross
# sudo apt install libc6-armhf-cross
# sudo apt install libstdc++6-armhf-cross
# sudo dpkg -i rpiuserland_54fd97a_arm64.deb

The catch is that you don't get full rpi-userland functionality, some of the libraries work but not all. For instance there is no mmal support.

ubuntu@ubuntu:~$ dpkg -L rpiuserland | grep mmal 
/opt/vc/lib/pkgconfig/mmal.pc 
/opt/vc/src/hello_pi/hello_mmal_encode 
/opt/vc/src/hello_pi/hello_mmal_encode/Makefile 
/opt/vc/src/hello_pi/hello_mmal_encode/mmal_encode.c 

ubuntu@ubuntu:~$ dpkg -L rpiuserland | grep bcm 
/opt/vc/include/bcm_host.h 
/opt/vc/lib/libbcm_host.so 
/opt/vc/lib/pkgconfig/bcm_host.pc

ubuntu@ubuntu:~$ ls -l /opt/vc/lib/ | grep mmal 
ubuntu@ubuntu:~$ 

For instance, none of these mmal libraries are available in /opt/vc/lib

libmmal_components.so
libmmal_core.so
libmmal.so
libmmal_util.so
libmmal_vc_client.so

In my case I was trying to build tvheadend with mmal support but the build still failed with: ERROR: mmal not found This was because the mmal stuff never got ported to the 64-bit kernel and AFAIK has been deprecated.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.