So I was trying to use libpd as a service and it seemed to be working (making expected noises, not crashing). But logcat was spitting out this exception 3-4 times per second: AudioWrapper: no input buffer available
I tracked it to this part of PdCore (at line 112):
I won't bog this down with my jumble of nascent code (mostly just trying to get libpd as a service up and running). But does anybody have an idea where this section of code is most likely called so I can start trying to track this down?
What device and Android version are you using? How did you configure your audio (sample rate, buffer size, etc.)?
At this point, I think the best solution is to just switch to the opensl branch of pd-for-android. That should take care of the warnings you're seeing.
Ah...
I am actually currently running from the master branch, here: https://github.com/libpd/pd-for-android/tree/master/PdCore
The above link was just the one that turned up when I googled that exception.
I had also assumed the master had incorporated the opensl which I read read about elsewhere. So, good to know. I'll get on that after answering your questions. Then I'll come back and let you know if I am error free.
Device is a Motorola Droid3 running 2.3.4.
And this is straight from the book: int sampleRate = AudioParameters.suggestSampleRate(); pdService.initAudio(sampleRate, 1, 2, 10.0f);
I'm throwing myself on the mercy of the court. Can anybody point me in the direction of help on switching to the opensl branch. Pretty new to git/github.
Clone a fresh copy of Pd for Android. Then, in your pd-for-android directory, say
git checkout opensl
git submodule init
git submodule update
In Eclipse, delete the old version and import the new one.
A day later and several hundred megabytes of SDK later (I hadn't gotten around to dl'ing 4.2 yet), we're done with the input error!
After trying most combinations from the samples, I seem to get the best latency with this:
pdService.initAudio(sampleRate, 0, 2, 8);
It looks like you're new here. If you want to get involved, click one of these buttons!