Poor sound?

I’m up and running with my OSX environment deploying to an HTC Inspire / Desire HD. I really appreciate the work you’ve put into this, arturo.

I’ve yet to actually do anything of my own but the samples all run properly (once I remembered to NOT mount the phone as a drive so that the resources could actually be unpacked!). However, the Synth sample sounds horrible, as if the device just can’t keep up with playing the sound sample. Sticking in a framerate display shows a pretty steady 60fps though.

Any ideas?

yes, the problem is the gl thread is eating all the resources, you need to lower it’s priority and make the audio thread’s one higher. i’ll add some functions to do this from c++ but meanwhile you can just edit the java code:

in ofAndroidLib in the cc.openframeworks package edit the OFAndroid class and look for this lines:

  
public OFGLSurfaceView(Context context) {  
        super(context);  
  

and add:

android.os.Process.setThreadPriority(8)  

with that your are loering the gl priority. the higher the number the lower the priority so try till the sound works ok, the priorities go from -19 to 19. 8 has worked for me in a pretty intensive sound and graphics app

then in the OFAndroidSoundStream look for:

android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO);  

and change it to:

android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);  

Oh excellent, after reading up on audio in Android I was expecting the answer to be “yeah it sucks, sorry”.

Thanks.

that also : )

Whilst on the subject then… is ofSoundPlayer ever going to be implemented?

at some point, i haven’t really take a look but i think it should be relatively easy using the SoundPool

k, I wasn’t sure if there was going to be a move towards the ofxSynth stuff in 0.07 and ofSoundPlayer might have been deprecated.