Git Product home page Git Product logo

android-native-audio-builders's Introduction

Native library builder for Android

This repository covers various native library builds for Android, namely:

  • lv2 (serd, sord, lv2, sratom, lilv, mda-lv2)
  • eigen (well, not really; it's just copying headers)
  • guitarix

... as well as dependencies:

  • libogg, libvorbis, flac, libsndfile, fftw3
  • libffi, glib, mm-common, libsigc++, glibmm

To build those dependencies, we make full use of GStreamer/Cerbero build system - actually a fork of it - which provides comprehensive automated builds for all Android ABI. Unlike Microsoft/vcpkg packages are up to date well and tailored well for Linux, and unlike AOSP ndkports it can resolve complicated dependencies in many build systems (for example, basic Autotools deps).

Although note that our fork is rebased on Android-28 which contains iconv API in bionic libc.

We needed 28 to include certain pthread API for zita-*, but now that they are removed we may bring back the default API level by cerbero (not sure, it is more consistent to not have libiconv for every ABI).

Building for general developers

Run ./build-in-docker.sh to get a release binary zip on Linux.

Notes on pkg-config usage

The resulting binary, especially those on github release page, has *.pc files (for pkg-config) has path specification on the build machine and therefore they won't work as is on your machine.

You are supposed to rewrite those path specifications (like prefix, but not limited to this) with your local path to the specific Android ABI directory in the extracted directory of the (downloaded) archive. For example...

#!/bin/bash

PWD=`pwd`
PWDESC=${PWD//\//\\\/}

echo $PWDESC

for f in `find dependencies/dist/*/lib/pkgconfig -name *.pc` ; do
	sed -e "s/\/home\/runner\/work\/android-native-audio-builders\/android-native-audio-builders\/cerbero-artifacts\/cerbero\/build/$PWDESC\/dependencies/g" $f > $f.1;
	sed -e "s/\/home\/runner\/work\/android-native-audio-builders\/android-native-audio-builders/$PWDESC\/dependencies/g" $f.1 > $f.2 ;
done

Adding packages

You would often like to build more LV2 plugins with this script, and sometimes it's easier to just reuse the build scripts in this repo to resolve complicated set of dependencies like what Guitarix has (glibmm, libsndfile, fftw3).

The Makefile script is already quite complicated, but aap-guitarix build can be still regarded as a reference model to split LV2 core builds from the app build itself. The resulting build outputs can be packaged just by processing dist directory.

Tweak build settings

Ubuntu 20.04 is the expected build machine. We have a CI build based on that.

We do have build-in-docker.sh but it is totally untested nowadays. GitHub Actions workflows provides more precise setup. But note that it is based on their server settings, which already has some software setup.

On some Ubuntu desktop later than 18.04, libpng12 might cause serious package inconsistency and would result in inability to update anything. Try this to avoid such a problem: https://www.linuxuprising.com/2018/05/fix-libpng12-0-missing-in-ubuntu-1804.html

On some Linux desktop (maybe after Ubuntu 18.04) lv2 sample plugins fail to build for unknown reason. In Makefile there is a line that builds lv2 with some options. Add --no-plugins to avoid such build failures.

android-native-audio-builders's People

Contributors

atsushieno avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

android-native-audio-builders's Issues

x86_64 and arm64 glib binaries are invalid

It seems current libglib-2.0.so from cerbero output seems invalid, as it results in loading failure at lilv_lib_open() (which is dlopen()):

2021-05-24 02:33:35.460 5742-5742/org.androidaudioplugin.aap_fluidsynth E/lilv: lilv_lib_open(): Failed to open library /lv2/aap-fluidsynth.lv2/libaap-fluidsynth.so (dlopen failed: cannot locate symbol "__lttf2" referenced by "/data/app/~~SNgvVfr4MXPangBO32-P1w==/org.androidaudioplugin.aap_fluidsynth-kpQ7C6fRcPO6mUMqq7wn5g==/base.apk!/lib/x86_64/libglib-2.0.so"...)
2021-05-24 02:33:35.460 5742-5742/org.androidaudioplugin.aap_fluidsynth E/lilv: lilv_plugin_instantiate(): failed to open library: file:///lv2/aap-fluidsynth.lv2/libaap-fluidsynth.so in /lv2/aap-fluidsynth.lv2/
2021-05-24 02:33:38.458 5742-5742/org.androidaudioplugin.aap_fluidsynth A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 5742 (.aap_fluidsynth), pid 5742 (.aap_fluidsynth)

arm64 has been causing loading failure for some different message but would fall into the same kind of issue.

split builds for different cerbero package sets

Currently we build Cerbero depencencies for further libraries all at once. Now that guitarix dependencies are in (on aap-guitarix branch) it builds libffi, libz, gnustl, glib, mm-common, libsigc++, and glibmm just for guitarix. It makes everything hard to identify which is really required just for existing mda-lv2 (libsndfile, and inherently ogg, vorbis, and flac).

Cerbero build is however massive and we don't want to have multiple instances/checkouts of it everywhere. At the same time, Cerbero packages have dependencies and each build dependencies may overlap at some stage. Fortunately they don't now, but when we would like to build fluidsynth, glib will be overlapped (as an guitarix dep).

The latest Cerbero has a concept of "package" which might provide help to some solution.

CI builds failing due to insufficient storage space

I am running out of GitHub Actions storage. Since the build is taking too long time it has to be taken care by... how? cerbero itself takes long time to build things. Also, the build stops at Guitarix which does depend on almost all build artifacts that it is building (libsndfile, glibmm) and it would not be possible to set up different build task lines.

experiment and document how-to on prefab package

As of filing this issue, prefab package already builds and pushed as build artifact, but it is totally untested. Since it is not really doable to reference local aar, I still haven't really added it to our androidaudioplugin-lv2 build.gradle.

cerbero update resulted in breaking build changes

I wasn't really aware that the latest cerbero removed install option and therefore dist directory was kept empty, resulting in missing cerbero dependencies at all. Therefore r2 does not contain all of them.

To fix this issue, it seems that we need a new package description file (additional changes to cerbero) to bring them back.

So far I switch to r1 build until I fix this issue in this repo.

separate mda-lv2 into another archive

mda-lv2 is just a set of LV2 samples. They still have to build for Android, but it's not appropriate to have together with core LV2 support.

It should be investigated along with splitting out aap-lv2 repo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.