Git Product home page Git Product logo

aap-lv2-fluidsynth's Introduction

aap-lv2-fluidsynth: Fluidsynth plugin for Audio Plugins For Android via LV2

This repository is for Fluidsynth plugin example for Audio Plugins For Android. It is powered by LV2 using aap-lv2.

The plugin application itself is not really featureful yet. The SoundFont file is fixed as FluidR3_GM.sf3 in the C++ code. It can be made customizible, but it does not happen yet.

Building

make should take care of the builds. See GitHub Actions script for further normative setup.

Building fluidsynth takes a while, but once native libraries are built and then automatically copied into app/src/main/jniLibs, then you don't have to build them again. Android Studio run/debug is usable (or ./gradlew *).

Hacking

In this repo, we build fluidsynth for Android without Oboe and OpenSLES, unlike the official build does (the official build script is written by atsushieno as well). It is simply because we only need synthesizer part without native audio access.

While Fluidsynth build is CMake based, it could not simply specified in build.gradle (it fails to compile). Therefore we use somewhat modified version of the build script from my fork (can be upstreamed but the related tasks are not done yet).

LV2 plugin implementation is quite simple (maybe too simple). There is no parameters exposed, and states to persistize. There are many rooms to improve.

Licensing notice

aap-lv2-fluidsynth codebase is distributed under the MIT license.

LV2 (repository for the headers) is under the ISC license.

fluidsynth is distributed under the LGPL v2.1 license.

app/src/main/assets/FluidR3Mono_GM.sf3 is a binary copy of the same file from fluidr3mono-gm-soundfont debian package and it is licensed under the MIT license.

The entire plugin application bundles androidaudioplugin-lv2 AAR module from aap-lv2, and androidaudioplugin AAR module, and is packaged into one application.

aap-lv2-fluidsynth's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

aap-lv2-fluidsynth's Issues

MainActivity is launched when it is invoked from aap-midi-device-service

This is from logcat output when aap-midi-device-service is being launched.

2021-06-15 02:44:23.089 538-12633/system_process E/ActivityManager: ANR in org.androidaudioplugin.aap_midi_device_service.app (org.androidaudioplugin.aap_midi_device_service.app/org.androidaudioplugin.midideviceservice.MainActivity)
    PID: 12599
    Reason: Input dispatching timed out (f01e1a3 org.androidaudioplugin.aap_midi_device_service.app/org.androidaudioplugin.midideviceservice.MainActivity (server) is not responding. Waited 5004ms for MotionEvent(deviceId=11, source=0x00001002, displayId=0, action=DOWN, actionButton=0x00000000, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, classification=NONE, edgeFlags=0x00000000, xPrecision=30.3, yPrecision=14.4, xCursorPosition=nan, yCursorPosition=nan, pointers=[0: (594.0, 1987.9)]), policyFlags=0x62000000)
    Parent: org.androidaudioplugin.aap_midi_device_service.app/org.androidaudioplugin.midideviceservice.MainActivity
    Load: 0.81 / 0.54 / 0.5

Apparently MainActivity should not be launched.

crasher: cannot locate symbol "__lttf2" referenced by 64bit libglib-2.0.so

Looks like it does not work on arm64 (which is most of the modern Android devices in 2021). It fails to load libglib-2.0.so.

2021-02-25 05:03:49.957 13651-13672/org.androidaudioplugin.aap_fluidsynth I/AAPHostNative: Instantiating aap-lv2 plugin lv2:https://github.com/atsushieno/aap-fluidsynth
2021-02-25 05:03:49.962 13651-13672/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/~~MEwsySZCK0HAV3bOoKEPWQ==/org.androidaudioplugin.aap_fluidsynth-DoRyBYTmj17hENKPFkRwUQ==/base.apk!/lib/arm64-v8a/libglib-2.0.so"...)
2021-02-25 05:03:49.962 13651-13672/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-02-25 05:03:49.962 13651-13672/org.androidaudioplugin.aap_fluidsynth A/libc: /media/atsushi/extssd0/sources/AAP/aap-lv2-fluidsynth/external/aap-lv2/androidaudioplugin-lv2/src/main/cpp/src/android-audio-plugin-lv2-bridge.cpp:830: AndroidAudioPlugin *aaplv2bridge::aap_lv2_plugin_new(AndroidAudioPluginFactory *, const char *, int, AndroidAudioPluginExtension **): assertion "instance" failed
2021-02-25 05:03:49.963 13651-13672/org.androidaudioplugin.aap_fluidsynth A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 13672 (Binder:13651_4), pid 13651 (.aap_fluidsynth)

MidiDeviceService does not generate audio outputs on repeated MidiReceiver instantiation

It is similar to atsushieno/aap-lv2#15 (also mentioned first here); with current build MIDI device service does not output the expected audio outputs. Anywhere before the audio output can be the cause.

This is most likely the problematic part:

b0f8bc0#diff-86b90baadcb1fc565571372866323ac3ccfc034e408d282c6981fdb6cd743ba6L175

Releasing app context on JNI somehow caused crash, so it was removed. But probably it is trying to reuse old JNI handler later on (which should not happen).

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.