Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aap-sfizz needs changes for Android #3

Closed
atsushieno opened this issue Jun 18, 2020 · 12 comments
Closed

aap-sfizz needs changes for Android #3

atsushieno opened this issue Jun 18, 2020 · 12 comments

Comments

@atsushieno
Copy link
Owner

aap-sfizz is in master now, but it lacks file loading support...kind of. It should load from assets instead of local files.

Since there is no UI to specify local sfz files and convert it into Atom sequence, it needs some extra steps to make it fully usable.

Possible solutions:

  • (1) support only a set of particular sfz files, load at instantiation time. sfz loader from assets is still needed.
  • (2) add UI support , perhaps using https://github.com/atsushieno/aria2web/ instead (but it does not support sfz).
@atsushieno
Copy link
Owner Author

This changeset I made to fluidsynth is a reference change. FluidSynth/fluidsynth@daa037b

@atsushieno
Copy link
Owner Author

It needs Worker extension implementation (as host).

@atsushieno
Copy link
Owner Author

Worker is implemented in af1ac0b. Now sfizz does not crash, but there seems to be some problem loading sfz:

2020-07-28 23:04:43.236 18416-18553/org.androidaudioplugin.aap_sfizz I/AAPHostNative: [sfizz] Number of voices changed to: -1089748792

@atsushieno
Copy link
Owner Author

It was just due to lame logging, not an actual issue. Needs more investigation on how it results in no sound.

@atsushieno
Copy link
Owner Author

There is an ongoing work in sfizz-assets branch. It successfully loads sfz file itself so far.

*.sfz files are just metadata that further link to other local file resources, which seem to be loaded by other code paths. Those loaders also have to be replaced.

@atsushieno
Copy link
Owner Author

SndfileHandle sndFile(file.string().c_str());

We will have to add support for Android asset to libsndfile.

@atsushieno
Copy link
Owner Author

I'm changing my mind; there are too many things that depends on local filesystems now: lbisndfile, sfizz/src/external/ghc filesystem, sfizz itself. It is now much easier if aap-sfizz just downloads sfz files from web and stores it in the app storage.

@atsushieno
Copy link
Owner Author

atsushieno commented Aug 8, 2020

Aaand sfizz has been changing the way how it uses SndFileHandle, which now aggregates most of the file loading part as createAudioReader() and createExplicitAudioReader() which is very comfortable for me to make necessary changes.

@atsushieno
Copy link
Owner Author

Converting filepath to AAsset fd via AAsset_openFileDescriptor() and passing it as fd to SndfileHandle.ctor() does not seem to work... it then fails to initialize sfinfo in the SndfileHandle and fails at getFileInformation() (if (channels != 1 && channels != 2) evaluates to false).

@atsushieno
Copy link
Owner Author

Back to this issue. Now FilePool.cpp needs some changes.

image

@atsushieno
Copy link
Owner Author

As a side step, I dumped assets effort so far and got sfizz working from aaphostsample (as of fad0ace). We need resource path settings in sfizz internals though.

@atsushieno
Copy link
Owner Author

These days sfizz port has been working with "copy sfz assets into local app storage (directory)" strategy. It coulod be an enhancement to existing app, but so far we don't "need" changes for Android anymore. Also, sfizz made libsndfile dependency optional, so chances are that we may be able to implement asset-based stream resolver.

aap-sfizz has moved to aap-lv2-sfizz repository, so I'm closing this anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant