Hello,
I am trying to build tvheadend on a Pi 4 running Ubuntu server 22.04 (Jammy) 64-bit arm64.
I am following the build script of Russel Tobin above... https://tvheadend.org/d/4492-manual-building-deb-packages-on-clean-ubuntu-or-other-debian-distros?r=44265#message-44265
My system details:
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"
I saved the build script in /usr/local/src/buildTVH.sh
I also made the symlinks:
sudo -i
ln -s /usr /opt/vc
ln -s /usr/bin/python3 /usr/bin/python
And additions to /boot/firmware/config.txt
gpu_mem=128
[pi4]
dtoverlay=vc4-fkms-v3d,cma-128
max_framebuffers=2
Then I run it like this:
cd /usr/local/src
./buildTVH.sh
This is the build script I am using... it's Russel Tobins script from above.
So far the only modification I made was @saen acros advice to add in:
--disable-libtheora_static --disable-libtheora
##!/bin/bash
#
# Name: build.sh
#
# Description: Build script for tvheadend on Ubuntu 20.04 32bit on Raspberry 4 with 4Gb or 8Gb
# Note: Only a couple of miniro changes as noted below to make this build on 64bit
# Usage:
# sudo -i
# ln -s /usr /opt/vc
# ln -s /usr/bin/python2 /usr/bin/python
# cd /usr/local/src
# ./build.sh
#
# Note: the "ln" about is because some raspberry userspace packages are compiled from source during build,
# the files are installed in their "proper" locations in /usr.
# But some third-party scripts expect e.g. /opt/vc/bin/vcgencmd;
# Thus the hack
# ln -s /usr /opt/vc
#
#
# Also the following needs to be put into /boot/firmware/config.txt
#
#gpu_mem=128
#[pi4]
#dtoverlay=vc4-fkms-v3d,cma-128
#max_framebuffers=2
BASE=$(dirname "$0")
if [ ! -x /usr/bin/python ] ; then
echo "/usr/bin/python must exist for this to compile"
exit 1
fi
if [ ! -d /opt/vc ] ; then
echo "/opt/vc must exist and be linked to /usr for tvheadend to compile"
exit 1
fi
(
if [ -d "$BASE/tvheadend" ]; then
cd "$BASE/tvheadend"
make distclean
git pull
else
apt-get update
apt install -y \
build-essential \
cmake \
pkg-config \
git \
ccache \
bzip2 \
wget \
gettext \
debhelper \
python3 \
python3-dev \
python3-pip \
python3-rpi.gpio \
python2-minimal \
python-rpi.gpio \
dvb-apps \
libraspberrypi-dev \
libraspberrypi-bin \
libraspberrypi0 \
libssl-dev \
libavahi-client-dev \
zlib1g-dev \
libavcodec-dev \
libavcodec-extra \
libavfilter-dev \
libavfilter-extra \
libavformat-dev \
libavutil-dev \
fdkacc \
libfdk-aac-dev \
libfdk-aac1 \
libswscale-dev \
libdvbcsa-dev \
libavresample-dev \
libiconv-hook-dev \
libkqueue-dev \
liburiparser-dev \
libcurl4-gnutls-dev \
libpcre2-dev \
libpcre3-dev \
libva-dev \
libva-drm2 \
libva-x11-2 \
libsystemd-dev \
libomxil-bellagio-dev \
libprotobuf-dev \
libtcmalloc-minimal4 \
libgoogle-perftools-dev
# The following my not existing Ubuntu 20.04 64bit (arm64) remove from above as required
# libkqueue-dev
# fdkacc
# libfdk-aac-dev
# libfdk-aac1
# Cant' find the following for armhf or arm64
#i965-va-driver-shaders
#
# Install rpi-userland libraries / binaries
#
snap install rpi-userland --edge
cd "$BASE"
git clone -v https://github.com/tvheadend/tvheadend.git tvheadend # --depth=5 (need version tag workaround else 0.0.0 version)
#git clone -b -v release/4.2 https://github.com/tvheadend/tvheadend.git
cd "$BASE/tvheadend"
fi
echo "AUTOBUILD_CONFIGURE_EXTRA=\"\${AUTOBUILD_CONFIGURE_EXTRA:-} --arch=armhf\"" > Autobuild/focal-armhf.sh
echo "DEBDIST=focal" >> Autobuild/focal-armhf.sh
echo "source Autobuild/debian.sh" >> Autobuild/focal-armhf.sh
echo "AUTOBUILD_CONFIGURE_EXTRA=\"\${AUTOBUILD_CONFIGURE_EXTRA:-} --arch=arm64\"" > Autobuild/focal-arm64.sh
echo "DEBDIST=focal" >> Autobuild/focal-arm64.sh
echo "source Autobuild/debian.sh" >> Autobuild/focal-arm64.sh
time (
AUTOBUILD_CONFIGURE_EXTRA=""
AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --disable-android --enable-pie --enable-avahi --enable-libsystemd_daemon --disable-bintray_cache --enable-libav --enable-libopus --enable-libtheora --enable-libvorbis --enable-libfdkaac --enable-omx --enable-mmal --enable-vaapi"
AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --disable-libvpx_static --disable-libvpx --disable-libtheora_static --disable-libtheora"
AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --enable-gtimer_check --enable-slow_memoryinfo --enable-cclang_threadsan --enable-gperftools --enable-ccdebug"
export AUTOBUILD_CONFIGURE_EXTRA
./Autobuild.sh -j$(nproc) -t focal-armhf
)
) 2>&1 | tee "$BASE/build.log"
The build fails and this is the output I get...
root@ubuntu:/usr/local/src# ./buildTVH.sh
Makefile:755: /support/.mk: No such file or directory
make: *** No rule to make target '/support/.mk'. Stop.
Already up to date.
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
Autobuild/focal-arm64.sh
Autobuild/focal-armhf.sh
nothing added to commit but untracked files present (use "git add" to track)
dpkg-buildpackage: info: source package tvheadend
dpkg-buildpackage: info: source version 4.3-2034~g8f8877430~focal
dpkg-buildpackage: info: source distribution focal
dpkg-buildpackage: info: source changed by Andreas Ă–man <andreas@tvheadend.org>
dpkg-source --before-build .
dpkg-buildpackage: info: host architecture arm64
debian/rules clean
dh clean --with-systemd
dh: warning: Compatibility levels before 10 are deprecated (level 7 in use)
dh_clean -O--with-systemd
rm -f debian/debhelper-build-stamp
rm -rf debian/.debhelper/
dh_clean: warning: Compatibility levels before 10 are deprecated (level 7 in use)
rm -f debian/tvheadend-dbg.debhelper.log debian/tvheadend.debhelper.log
rm -f -- debian/tvheadend.substvars debian/tvheadend-dbg.substvars debian/files
rm -fr -- debian/tvheadend/ debian/tmp/ debian/tvheadend-dbg/
find . \( \( \
\( -path .\*/.git -o -path .\*/.svn -o -path .\*/.bzr -o -path .\*/.hg -o -path .\*/CVS -o -path .\*/.pc -o -path .\*/_darcs \) -prune -o -type f -a \
\( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
-o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
-o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
-o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \
\) -exec rm -f {} + \) -o \
\( -type d -a -name autom4te.cache -prune -exec rm -rf {} + \) \)
debian/rules build
dh build --with-systemd
dh: warning: Compatibility levels before 10 are deprecated (level 7 in use)
dh_update_autotools_config -O--with-systemd
debian/rules override_dh_auto_configure
make[1]: Entering directory '/usr/local/src/tvheadend'
dh_auto_configure -- --disable-android --enable-pie --enable-avahi --enable-libsystemd_daemon --disable-bintray_cache --enable-libav --enable-libopus --enable-libtheora --enable-libvorbis --enable-libfdkaac --enable-omx --enable-mmal --enable-vaapi --disable-libvpx_static --disable-libvpx --disable-libtheora_static --disable-libtheora --enable-gtimer_check --enable-slow_memoryinfo --enable-cclang_threadsan --enable-gperftools --enable-ccdebug --arch=arm64 --jobs=4
dh_auto_configure: warning: Compatibility levels before 10 are deprecated (level 7 in use)
./configure --build=aarch64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libexecdir=\${prefix}/lib/tvheadend --disable-maintainer-mode --disable-dependency-tracking --disable-android --enable-pie --enable-avahi --enable-libsystemd_daemon --disable-bintray_cache --enable-libav --enable-libopus --enable-libtheora --enable-libvorbis --enable-libfdkaac --enable-omx --enable-mmal --enable-vaapi --disable-libvpx_static --disable-libvpx --disable-libtheora_static --disable-libtheora --enable-gtimer_check --enable-slow_memoryinfo --enable-cclang_threadsan --enable-gperftools --enable-ccdebug --arch=arm64 --jobs=4
Checking support/features
checking for cc execinfo.h ... ok
checking for cc -mmmx ... fail
checking for cc -msse2 ... fail
checking for cc -Wunused-result ... ok
checking for cc -fstack-protector ... ok
checking for cc -fstack-protector-strong ... ok
checking for cc -fstack-check ... ok
checking for cc -fPIE ... ok
checking for cc strlcat ... fail
checking for cc strlcpy ... fail
checking for cc fdatasync ... ok
checking for cc getloadavg ... ok
checking for cc atomic32 ... ok
checking for cc atomic64 ... ok
checking for cc atomic_time_t ... ok
checking for cc atomic_ptr ... ok
checking for cc bitops64 ... ok
checking for cc lockowner ... ok
checking for cc qsort_r ... ok
checking for cc stime ... fail
checking for cc gmtoff ... ok
checking for cc recvmmsg ... ok
checking for cc sendmmsg ... ok
checking for cc libiconv ... fail
^ using build-in glibc iconv routines
checking for cc ifnames ... ok
checking for cc cclang_threadsan ... fail
checking for py module gzip ... ok
checking for pkg-config ... ok
checking for xgettext ... ok
checking for msgmerge ... ok
checking for gzip ... ok
checking for bzip2 ... ok
checking for pkg openssl ... ok (detected 3.0.2)
checking for cc linux/dvb/version.h ... ok
checking for pkg zlib ... ok (detected 1.2.11)
checking for pkg libpcre2-8 ... ok (detected 10.39)
checking for pkg liburiparser ... ok (detected 0.9.6)
checking for pkg avahi-client ... ok (detected 0.8)
checking for cmake ... ok
checking for cc -lstdc++ ... ok
checking for cc bcm_host.h ... fail
checking for cc OMX_Core.h ... ok
checking for pkg libva >=0.38.0 ... fail (detected <none>)
ERROR: vaapi (Video Acceleration (VA) API for Linux) not found
dh_auto_configure: error: ./configure --build=aarch64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libexecdir=\${prefix}/lib/tvheadend --disable-maintainer-mode --disable-dependency-tracking --disable-android --enable-pie --enable-avahi --enable-libsystemd_daemon --disable-bintray_cache --enable-libav --enable-libopus --enable-libtheora --enable-libvorbis --enable-libfdkaac --enable-omx --enable-mmal --enable-vaapi --disable-libvpx_static --disable-libvpx --disable-libtheora_static --disable-libtheora --enable-gtimer_check --enable-slow_memoryinfo --enable-cclang_threadsan --enable-gperftools --enable-ccdebug --arch=arm64 --jobs=4 returned exit code 1
make[1]: *** [debian/rules:12: override_dh_auto_configure] Error 2
make[1]: Leaving directory '/usr/local/src/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
real 0m9.461s
user 0m4.974s
sys 0m4.806s
Can I please get some help about what I am doing wrong?
@saen acro above mentioned:
You configuration PASS need to make package
make -j$(nproc)
What's that about, do I need it and where do I put that?
What do these errors mean?
make: *** No rule to make target '/support/.mk'. Stop.
dh: warning: Compatibility levels before 10 are deprecated (level 7 in use)
For this error:
ERROR: vaapi (Video Acceleration (VA) API for Linux) not found
I tried..
sudo apt install dvb-apps libva-dev libva-drm1 libva-x11-1
It didn't find: libva-drm1 libva-x11-1
So I tried...
sudo apt install dvb-apps libva-drm2 libva-x11-2
That installed those three.
But I still get the same error.
For ARM OpenMax support I also did:
sudo apt install libomxil-bellagio-dev
And have included: --enable-omx in the build script.
Probably I am doing other things wrong too.
Any advice much appreciated.
Cheers,
Flex
<<