Git Product home page Git Product logo

aap-lv2-sfizz's Introduction

aap-lv2-sfizz: sfizz plugin port to AAP using aap-lv2

This repository is an example port of sfizz LV2 plugin to Audio Plugins For Android, using aap-lv2.

Right now there is no way to specify SFZ file from the plugin at run time. It has to be specified at build time. Take it more like a proof of concept right now.

Building

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

Hacking

You can edit external/sfizz/lv2/sfizz.c to alter DEFAULT_SFZ_FILE to any other .sfz file. Note that since Android 11 you have quite limited access to local storage, so you should probably just put your sfz contents as assets. It will be automatically copied into local data storage area (as there is no alternative mechanism to load sfz and audio files by other means).

Our aap_metadata.xml is generated by aap-import-lv2-metadata tool but it is done manually. So every time sfizz submodule is updated, chances are that the metadata needs to be regenerated (or manually fixed). Run make update-metadata to regenerate it from the latest sources (though note that the resources may be relocated; they sometimes do).

app directory directly references sfizz's own CMakeLists.txt from build.gradle. Though note that sfizz itself is patched at build time (by make).

Licensing notice

aap-lv2-sfizz itself is distributed under the MIT license.

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

sfizz is distributed under the MIT license, but it has dependencies that are under the Apache License 2.0 etc. See the project repository for details. As of v0.1.6, AAP Sfizz does not depend on libsndfile anymore.

AAP Sfizz apk bundles sample external sfz from sfzinstruments/SplendidGrandPiano whose samples are Public Domain.

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

aap-lv2-sfizz's People

Contributors

atsushieno avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

aap-lv2-sfizz's Issues

freezes at startup with non-default sfz

It seems that if we specify some sfz (for example, Ixox Flute) sfizz freezes somewhere non-debuggable by lldb. It needs further investigation, but it so far blocks upgrading various bits (aap core, aap-lv2, sfizz itself).

Remove libsndfile dependency

Sfizz has some option to not depend on libsndfile (st_audiofile), which would make porting easier. If that works, then the big chain of dependencies can go away, which is a big win.

audio processing i.e. run() fails, around CC processing

There is almost no actual failure details around, but the latest import does not complete run(), especially around resync_cc. It was why I have implemented ResizePort support, but even after its working allocation it seems to crash. It does not seem to be an isolatable culprit - commenting it out did not work.

logcat almost only reports SEGV and lldb only catches ASanDie() (when ASAN is enabled, of course no details without it either).

No difference between sfizz 1.2.0, 1.1.1 and 1.1.0.

fails to resolve files from datadir

Current aap-lv2-sfizz fails to load sfz from files (datadir directory). It is because we resolve files from assets (serd/lilv), as well as passing the asset path as bundle_path to lilv_plugin_instantiate(). The asset path (/lv2/sfizz.lv2/) is not equivalent to datadir (/data/data/... etc.), therefore the resources have to be resolved from file for aap-sfizz case, while the remaining LV2 ports should be based on assets (e.g. aap-fluidsynth).

There should be some way to make it conditional.

MidiDeviceService instantiation fails if there is <plugin> entry for sfizz-multi in `aap_metadata.xml`

By default, if we use aap_metadata.xml which was generated from aap-lv2-metadata-importer, MIDI device instantiation fails with the error:

02:44:21.417  1891-1913  JavaBinder      org...n.samples.aap_sfizz  E  *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
                                                                       java.lang.AssertionError: Assertion failed
                                                                       	at org.androidaudioplugin.midideviceservice.AudioPluginMidiDeviceService.getPluginId(AudioPluginMidiDeviceService.kt:22)
                                                                       	at org.androidaudioplugin.midideviceservice.AudioPluginMidiDeviceService.getPluginId$default(AudioPluginMidiDeviceService.kt:17)
                                                                       	at org.androidaudioplugin.midideviceservice.AudioPluginMidiReceiver.onDeviceOpened(AudioPluginMidiReceiver.kt:37)
                                                                       	at org.androidaudioplugin.midideviceservice.AudioPluginMidiDeviceService.onDeviceStatusChanged(AudioPluginMidiDeviceService.kt:59)
                                                                       	at android.media.midi.MidiDeviceService$1.onDeviceStatusChanged(MidiDeviceService.java:60)

It seems to be due to some failure in plugin resolution by pluginId (sfizz vs. sfizz-multi).

process() crashes due to insufficient automation port size

(details TBD)

I need to a latest working LV2 SDK setup first but so far aap-sfizz crashes at process() (run() in sfizz LV2). It is due to insufficient atom buffer that sfizz_lv2_send_controller() fails to handle gracefully (it calls lv2_atom_forge_frame_time() which subsequently calls lv2_atom_forge_push() but returns non-OK, and thus skips lv2_atom_forge_pop() within the function, which causes inconsistent ATOM force stack.

It is for sure an inssue in sfizz but I'm not sure what is actually causing the insufficient buffer.

insufficient connect_port() invocation

The latest import of sfizz triggered process()-time failure for some reason.

It seems that our resetPorts() in android-audio-plugin-lv2-bridge.cpp is receiving 20 from lilv_plugin_get_num_ports(lilvPlugin) which should return 23. AudioPluginServiceImpl receives 23 prepareMemory requests and prepare() correctly passes them. Only resetPorts() at process() time gets 20 instead.

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.