Open tzumbrunnen opened 3 years ago
Due to legal reasons (mainly @radiorabe not having an MPEG-LA license and us not planning on getting one) we cannot distribute ocaml-fdkaac binaries atm.
What we can do is provide instructions on how you can build your own... I updated the usage section in the centos-rpm-ocaml-fdkaac repo to provide detailed instructions on how you can build you own RPM using fdk-aac from RPMfusion nonfree. I also updated the specfile so it builds a version of ocaml-fdkaac that should work with 1.4.3.
I usually run this in the quay.io/hairmare/centos8_rpmdev
container (see folded example below). Let me know if this works out for you or if you need any further assistance in getting fdk-aac working again.
```
$ docker run --rm -ti -v `pwd`:'/git' -v `pwd`/RPMS:/root/rpmbuild/RPMS quay.io/hairmare/centos8_rpmdev bash
[root@dd916d343ef4 git]# dnf install -y \
> http://download1.rpmfusion.org/free/el/updates/8/x86_64/r/rpmfusion-free-release-8-0.1.noarch.rpm \
> http://download1.rpmfusion.org/nonfree/el/updates/8/x86_64/r/rpmfusion-nonfree-release-8-0.1.noarch.rpm
Failed to set locale, defaulting to C.UTF-8
CentOS-8 - AppStream 3.5 MB/s | 5.8 MB 00:01
CentOS-8 - Base 3.1 MB/s | 2.2 MB 00:00
CentOS-8 - Extras 19 kB/s | 8.6 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 113 kB/s | 98 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 8.8 MB/s | 8.4 MB 00:00
rpmfusion-free-release-8-0.1.noarch.rpm 74 kB/s | 11 kB 00:00
rpmfusion-nonfree-release-8-0.1.noarch.rpm 218 kB/s | 11 kB 00:00
Dependencies resolved.
==============================================================================================================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================================================================================================
Installing:
rpmfusion-free-release noarch 8-0.1 @commandline 11 k
rpmfusion-nonfree-release noarch 8-0.1 @commandline 11 k
Transaction Summary
==============================================================================================================================================================================================================================================
Install 2 Packages
Total size: 22 k
Installed size: 7.6 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : rpmfusion-free-release-8-0.1.noarch 1/2
Installing : rpmfusion-nonfree-release-8-0.1.noarch 2/2
Verifying : rpmfusion-free-release-8-0.1.noarch 1/2
Verifying : rpmfusion-nonfree-release-8-0.1.noarch 2/2
Installed:
rpmfusion-free-release-8-0.1.noarch rpmfusion-nonfree-release-8-0.1.noarch
Complete!
[root@dd916d343ef4 git]#
[root@dd916d343ef4 git]# # the RaBe-LSD liquidsoap binaries are using an OCaml build chain based on a backport of fc33 ocaml
[root@dd916d343ef4 git]# curl -o /etc/yum.repos.d/ocaml.repo \
> "https://download.opensuse.org/repositories/home:/radiorabe:/liquidsoap:/ocaml/CentOS_8/home:radiorabe:liquidsoap:ocaml.repo"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 308 100 308 0 0 2905 0 --:--:-- --:--:-- --:--:-- 2905
[root@dd916d343ef4 git]#
[root@dd916d343ef4 git]# rpmdev-setuptree
[root@dd916d343ef4 git]#
[root@dd916d343ef4 git]# spectool -R -g ocaml-fdkaac.spec
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Getting https://github.com/savonet/ocaml-fdkaac/archive/0.3.2.tar.gz?#/ocaml-fdkaac-0.3.2.tar.gz to /root/rpmbuild/SOURCES/ocaml-fdkaac-0.3.2.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 127 100 127 0 0 535 0 --:--:-- --:--:-- --:--:-- 535
100 15369 0 15369 0 0 30017 0 --:--:-- --:--:-- --:--:-- 30017
[root@dd916d343ef4 git]#
[root@dd916d343ef4 git]# dnf builddep -y ocaml-fdkaac.spec
Failed to set locale, defaulting to C.UTF-8
OCaml 4.11 (CentOS_8) 617 kB/s | 224 kB 00:00
RPM Fusion for EL 8 - Free - Updates 323 kB/s | 258 kB 00:00
RPM Fusion for EL 8 - Nonfree - Updates 268 kB/s | 89 kB 00:00
Dependencies resolved.
==============================================================================================================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================================================================================================
Installing:
fdk-aac-devel x86_64 2.0.0-3.el8 rpmfusion-nonfree-updates 768 k
ocaml x86_64 4.11.1-0.1.2.rabe home_radiorabe_liquidsoap_ocaml 72 M
ocaml-dune-devel x86_64 2.7.1-0.1.2.rabe home_radiorabe_liquidsoap_ocaml 3.2 M
ocaml-findlib x86_64 1.8.1-0.1.2.rabe home_radiorabe_liquidsoap_ocaml 725 k
Installing dependencies:
fdk-aac x86_64 2.0.0-3.el8 rpmfusion-nonfree-updates 683 k
ocaml-compiler-libs x86_64 4.11.1-0.1.2.rabe home_radiorabe_liquidsoap_ocaml 13 M
ocaml-csexp x86_64 1.3.2-0.1.2.rabe home_radiorabe_liquidsoap_ocaml 47 k
ocaml-csexp-devel x86_64 1.3.2-0.1.2.rabe home_radiorabe_liquidsoap_ocaml 72 k
ocaml-dune x86_64 2.7.1-0.1.2.rabe home_radiorabe_liquidsoap_ocaml 3.8 M
ocaml-runtime x86_64 4.11.1-0.1.2.rabe home_radiorabe_liquidsoap_ocaml 2.8 M
Transaction Summary
==============================================================================================================================================================================================================================================
Install 10 Packages
Total download size: 97 M
Installed size: 361 M
Downloading Packages:
(1/10): ocaml-csexp-1.3.2-0.1.2.rabe.x86_64.rpm 156 kB/s | 47 kB 00:00
(2/10): ocaml-csexp-devel-1.3.2-0.1.2.rabe.x86_64.rpm 410 kB/s | 72 kB 00:00
(3/10): ocaml-dune-2.7.1-0.1.2.rabe.x86_64.rpm 2.9 MB/s | 3.8 MB 00:01
(4/10): ocaml-compiler-libs-4.11.1-0.1.2.rabe.x86_64.rpm 6.4 MB/s | 13 MB 00:02
(5/10): ocaml-findlib-1.8.1-0.1.2.rabe.x86_64.rpm 2.7 MB/s | 725 kB 00:00
(6/10): ocaml-dune-devel-2.7.1-0.1.2.rabe.x86_64.rpm 3.7 MB/s | 3.2 MB 00:00
(7/10): ocaml-runtime-4.11.1-0.1.2.rabe.x86_64.rpm 4.7 MB/s | 2.8 MB 00:00
(8/10): fdk-aac-2.0.0-3.el8.x86_64.rpm 1.3 MB/s | 683 kB 00:00
(9/10): fdk-aac-devel-2.0.0-3.el8.x86_64.rpm 2.4 MB/s | 768 kB 00:00
(10/10): ocaml-4.11.1-0.1.2.rabe.x86_64.rpm 12 MB/s | 72 MB 00:05
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 16 MB/s | 97 MB 00:05
warning: /var/cache/dnf/home_radiorabe_liquidsoap_ocaml-821585843ca20ba9/packages/ocaml-4.11.1-0.1.2.rabe.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID a62f73c5: NOKEY
OCaml 4.11 (CentOS_8) 12 kB/s | 1.1 kB 00:00
Importing GPG key 0xA62F73C5:
Userid : "home:radiorabe OBS Project
Thank you very much for your transparency and these helpful instructions. I tried to build the RPM's on my Build Server, with partial success. The RPM Build worked so far :
rw-r--r-- 1 root root 83744 Dec 6 11:21 ocaml-fdkaac-0.3.2-0.1.el8.x86_64.rpm
-rw-r--r-- 1 root root 50524 Dec 6 11:21 ocaml-fdkaac-devel-0.3.2-0.1.el8.x86_64.rpm
-rw-r--r-- 1 root root 9608 Dec 6 11:21 ocaml-fdkaac-debugsource-0.3.2-0.1.el8.x86_64.rpm
drwxr-xr-x 2 root root 214 Dec 6 11:21 .
-rw-r--r-- 1 root root 19184 Dec 6 11:21 ocaml-fdkaac-debuginfo-0.3.2-0.1.el8.x86_64.rpm
After installing the rpm's I tested the loading of the dynamic fdkaac encoder w/o success so far. I received the following message :
[liquidsoap@centos8 fdkaac]$ liquidsoap -v 'out(sine())'
2020/12/06 11:41:21 >>> LOG START
2020/12/06 11:41:21 [main:3] Liquidsoap 1.4.3
2020/12/06 11:41:21 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.2.3 sedlex=2.1 menhirLib=20200624 dtools=0.4.2 duppy=0.9.0 cry=0.6.5 mm=0.5.0 xmlplaylist=0.1.4 ogg=0.5.2 vorbis=0.7.1 opus=0.1.3 speex=0.2.1 mad=0.4.5 flac=0.1.7 flac.ogg=0.1.7 dynlink=[distributed with Ocaml] lame=0.3.4 theora=0.3.1 bjack=0.1.5 alsa=0.2.3 samplerate=0.1.4 taglib=0.3.6 ssl=0.5.9 magic=0.7.3 camomile=[unspecified] inotify=2.3 yojson=1.7.0 soundtouch=0.1.8 ladspa=0.1.5
2020/12/06 11:41:21 [dynamic.loader:3] Error while loading dynamic fdkaac encoder at /usr/lib64/ocaml/fdkaac
2020/12/06 11:41:21 [dynamic.loader:3] error loading shared library: Dynlink.Error (Dynlink.Not_a_bytecode_file "/usr/lib64/ocaml/fdkaac/fdkaac_loader.cmxs")
2020/12/06 11:41:21 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
I checked everything in /usr/lib64/ocaml/fdkaac and it looked good. Maybe I might missed something while building & installing the code. Do you have any ideas ?
Beside that, it just came to my mind that by using %ffmpeg
someone could get rid of this procedure. just as a last resort, worth to test and compare if we could achieve the same stream quality. As of the LS documentation the configuration would looks like this:
%ffmpeg(format="mpegts",
%audio(codec="libfdk_aac",samplerate=22050,b="32k",
afterburner=1,profile="aac_he_v2"))
I can reproduce that it's not working but I'm not sure why :(
dune is building a .cma
and there is a properly linked .cmxs
.
# ldd /usr/lib64/ocaml/fdkaac/fdkaac.cmxs
linux-vdso.so.1 (0x00007ffda23b4000)
libfdk-aac.so.2 => /usr/lib64/fdk-aac/libfdk-aac.so.2 (0x00007f6d61372000)
libc.so.6 => /lib64/libc.so.6 (0x00007f6d60fb0000)
libm.so.6 => /lib64/libm.so.6 (0x00007f6d60c2e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6d618c1000)
Liquidsoap is clearly trying to load something, but I'm not sure why it won't find the library. So far debugging with strace
and ldd
has not yielded any meaningful results.
The %ffmpeg
approach won't work right now because it isn't enabled in the build.
I've been working on bootrapping ffmpeg on OBS in preparation for inline ffmepg support for a while and finally got working packages built this weekend. It looks like %ffmpeg
support might be possible soonish.
The latest package now supports ffmpeg (and depends on rpmfusion's ffmepg packages), so you might wat to give the ffmepg approach a real try.
I would like to test the latest drop on Centos 8 with
%fdkaac
, unfortunately its not working sinceocaml-fdkaac
is missing. Beside that the old library from Nux Dextop Repos won't work (and disappeared). I tried to find a package on RPMFusionall, but failed. Are you planing to deliver a solution, i.e. a dedicated rpm package forocaml-fdkaac
?