Setting up libMAD in SFOS on ARM
The first step forward to gain full¹ MPEG audio support is to build libMAD from scratch.
Building from latest upstream version (libmad-0.15.1b from the year 2004) does not work² due to ARMv4 assembler code.
So you have to look for a patched 'downstream' version: link
Three files are needed: libmad_0.15.1b-8.dsc, libmad_0.15.1b.orig.tar.gz and libmad_0.15.1b-8.diff.gz
Next step after downloading in a directory is (on a PC system with dpkg-Package):
dpkg-source -x libmad_0.15.1b-8.dsc
this will create a folder named 'libmad-0.15.1b'. Enter it ('cd libmad-0.15.1b') and apply the needed patches:
export QUILT_PATCHES=debian/patches
quilt push -a
touch NEWS AUTHORS ChangeLog
after that perform autoreconf -fi
on Jolla1 device, and then
./configure --prefix=/usr --disable-static CFLAGS="-mcpu=cortex-a15 -mtune=cortex-a15 -mfpu=neon-vfpv4" && make
and as root
make install
to be able to build a libMAD enabled gstreamer-plugin-ugly1.0 later, it is necessary (as root) to
cat > /usr/lib/pkgconfig/mad.pc << "EOF"
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: mad
Description: MPEG audio decoder
Requires:
Version: 0.15.1b
Libs: -L${libdir} -lmad
Cflags: -I${includedir}
EOF
now everything is installed on Jolla1 (for Jolla C: CFLAGS=" -mfpu=neon" as only cortex-a7 is available)
¹ layer 1, 2 and 3 and not just built-in layer 3 support
² unlike x86, ARM is not backwards compatible
Corrected a typo in the headline and retagged. :)
vattuvarg ( 2016-08-23 15:52:37 +0200 )edit@vattuvarg, you know askbot keeps a list of changes to a question, if we want to know what you changed then we can just look at that.
r0kk3rz ( 2016-08-23 18:42:16 +0200 )edit@r0kke3rz - A bit too used to informing new users, that's all.
vattuvarg ( 2016-08-23 19:29:08 +0200 )edit@Larswad maybe a codec candidate for next gstreamer-plugin-ugly1.0-1.4.5-1ubuntu3 update in warehouse...
lpr ( 2016-08-25 18:35:38 +0200 )editlpr, thanks for the heads up. I've kind of left the jolla boat, but maybe if it's not too hellish I might give it a shot. I built the earlier plug-ins using the jolla sdk virtual machine using the arm based sysroot. If I try to figure this post out, I can get the lib source on a regular Ubuntu box with dpkg then patch it using the provided instructions, then put it in the sdk VM and then build it there. Then after that try to build the ugly gstreamer plug-in by adding the dependency as described then build it. I suppose the libMAD itself needs to be built as an rpm, so I guess I need to create one of those too. Sounds kinda hellish.
Larswad ( 2016-08-25 19:11:41 +0200 )edit