Please help test some new android audio code!

For Android specific issues

Please help test some new android audio code!

Postby jules » Fri Mar 09, 2012 1:30 pm

I've just added an OpenSLES audio device for android, in the hope of getting better latency than the java classes can manage.. But neither of my two devices or the emulator seems to be capable of supplying any kind of audio input to test!

If anyone's got a device that does handle audio (its OS needs to support API level 10 or greater), I'd really appreciate hearing if it works for you! I've tested playback, and that seems to perform better than the java audio, but I'd be really keen to find out:

a) if audio input works at all!
b) if it does, and you run the juce demo latency test, what kind of numbers are you getting for a given buffer size..?

Thanks!
User avatar
jules
Fearless Leader
 
Posts: 17192
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Please help test some new android audio code!

Postby jfitzpat » Sat Mar 10, 2012 12:54 am

Well, I have an Asus Eeee Transformer TF101 here running 3.2.1 (api 13). Audio appears to work. Building today's tip without re-running introjucer on the JuceDemo project I get Latency results of:

19699 Samples (446.7 mS)
Reports Input 8192, output 16384
So correct is -4877 (-110.59 mS)

I then rebuilt the Introjucer the required -LD libs looks like it has changed to me (__android_log... perhaps?). Set the min SDK to 10, and saved. This did pass the JUCE_ANDROID_API define on the command line (10).

That did cause an "Android OpenSL" device to appear. It appears to record and play, but Latency Test always reports "Couldn't detect the test signal". The sound 'sounds' the same. Interestingly, switching to Android Audio doesn't make a difference. Still no latency test results, though record and playback work.

I don't have time to dig any deeper today, but let me know if there is something else you would like me to test.
User avatar
jfitzpat
JUCE UberWeenie
 
Posts: 251
Joined: Tue Jan 10, 2012 6:29 am
Location: Glendale, California

Re: Please help test some new android audio code!

Postby jfitzpat » Sat Mar 10, 2012 1:00 am

I just futzed with volume up and down and did get to two readings with the new device:

21746 Samples (493.1 mS)

And

20756 Samples (470.7 mS)

It reports that the input and output latency are 0, so the corrected remains unchanged.

NOTE, I'm only sporadically getting readings, so I may well be measuring an echo or something.
User avatar
jfitzpat
JUCE UberWeenie
 
Posts: 251
Joined: Tue Jan 10, 2012 6:29 am
Location: Glendale, California

Re: Please help test some new android audio code!

Postby jfitzpat » Sat Mar 10, 2012 1:06 am

OK, using a high tech plastic cup next to the built in speaker, cranked full, I can consistently get readings.

Android Audio comes in consistently at about 420-440 mS, OpenSL is consistently about 50-60 mS faster (358 mS was the best measured time).

Hope that helps.
User avatar
jfitzpat
JUCE UberWeenie
 
Posts: 251
Joined: Tue Jan 10, 2012 6:29 am
Location: Glendale, California

Re: Please help test some new android audio code!

Postby jules » Sun Mar 11, 2012 4:06 pm

Thanks! Very interesting.

Very frustrating too, as looking at the OpenSL API, there seems to be no way at all to actually determine what these latency figures are going to be. Unbelievable that whoever designed the API would just completely fail to add such a basic and essential piece of information..
User avatar
jules
Fearless Leader
 
Posts: 17192
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Please help test some new android audio code!

Postby peteatjuce » Mon Mar 12, 2012 12:35 pm

HI Jules,

FWIW, I did mail the man in charge to suggest some changes in this area ... but never heard back. :)

Best wishes,

Pete
User avatar
peteatjuce
JUCE UberWeenie
 
Posts: 418
Joined: Wed Mar 07, 2007 9:42 am

Re: Please help test some new android audio code!

Postby peteatjuce » Mon Mar 12, 2012 12:52 pm

I must say - that is pretty terrible latency. :(
User avatar
peteatjuce
JUCE UberWeenie
 
Posts: 418
Joined: Wed Mar 07, 2007 9:42 am

Re: Please help test some new android audio code!

Postby jules » Wed Mar 14, 2012 12:08 pm

FYI: I've updated the class now, am attempting to use the AudioTrack classes to guess a vaguely realistic latency..
User avatar
jules
Fearless Leader
 
Posts: 17192
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Please help test some new android audio code!

Postby peteatjuce » Wed Mar 14, 2012 12:29 pm

Hi Jules,

FWIW, if you look at the libvlc project code (open-source video playback), you'll see that they try to use OpenES, but fall-back to pushing data to AudioTrack on earlier platforms... which might be a sensible approach?
In Mixtikl, we're not bothering with pre-Android 2.3, so that isn't a specific issue for me. :)

http://www.videolan.org/vlc/download-sources.html

HTH!

Pete
User avatar
peteatjuce
JUCE UberWeenie
 
Posts: 418
Joined: Wed Mar 07, 2007 9:42 am

Re: Please help test some new android audio code!

Postby jules » Wed Mar 14, 2012 12:34 pm

FWIW, if you look at the libvlc project code (open-source video playback), you'll see that they try to use OpenES, but fall-back to pushing data to AudioTrack on earlier platforms... which might be a sensible approach?


Yeah, that's what my stuff does too.
User avatar
jules
Fearless Leader
 
Posts: 17192
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Please help test some new android audio code!

Postby peteatjuce » Wed Mar 14, 2012 1:57 pm

Cool 8)
User avatar
peteatjuce
JUCE UberWeenie
 
Posts: 418
Joined: Wed Mar 07, 2007 9:42 am

Re: Please help test some new android audio code!

Postby X-Ryl669 » Thu Mar 15, 2012 4:00 pm

Jules, do you actually have an Android device ?
X-Ryl669
X-Ryl669
JUCE UberWeenie
 
Posts: 1124
Joined: Sun Apr 24, 2005 5:30 pm

Re: Please help test some new android audio code!

Postby jules » Thu Mar 15, 2012 4:55 pm

X-Ryl669 wrote:Jules, do you actually have an Android device ?


Yes, a kindle fire (and my girlfriend has an old android phone too). The kindle's ok, but has no audio input.
User avatar
jules
Fearless Leader
 
Posts: 17192
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK


Return to Android

Who is online

Users browsing this forum: No registered users and 0 guests