Samsung "Professional Audio" for Android (Jack)

Started by utensil, October 17, 2014, 10:54:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

utensil

Samsung's apparently doing what google hasn't got around to and created a low latency sdk which also supports inter-app audio for android on their note 4 and note edge. Thumbjam, amplitude and a few other apps are already ported and they've created their own garageband like app called soundcamp.


http://www.musicalandroid.com/blog/screenshots-of-the-upcoming-samsung-daw-soundcamp

http://www.musicalandroid.com/blog/samsung-daw-and-low-latency-solution-more-news

I don't own those devices so I don't know if the above are immediately downloadable or will be made available upon android L release. either way, we might finally have another option for mobile music.

Elantric

#1
QuoteUnfortunately it will most likely be only on the note 4 (maybe 3) because soundcamp looks to run on android L (5.0) and in many cases the note 2 is barely given kit Kat (4.4). If you can get your note to (5.0) your might be able to run the apk.
Currently latency can be up to 250ms (that is a 1/8 note at 120bps). Android 5 is supposed to take latency and cut that number close to 30ms. That is why soundcamp (Samsung's garage band app) is now possible and why you need android L on your note.

utensil

#2
From what I can tell , amplitube and thumbjam are already available on samsungs App Store  compatible on kitkat (note 4 only) and can use (according to the developer of thumb jam) the samsung professional audio sdk so latency is apparently comparable to iOS. They can be used stand alone or within samsungs upcoming mobile daw soundcamp (note 4 only and android L update required).

While it's still a ways behind iOS, It would be a pretty decent jump, enough for me to switch off IOS which has the huge disadvantage of not allowing you to maintain a stable version base. Apple's insistence on forcing upgrades means that we are all subject to their update cycles as recently exampled with the IOS 8 release. I needed to restore my phone but had no choice but to update to IOS 8. I love apples hardware/software, but every time there is a major os release , I get nervous because if anything goes wrong with my software I am left waiting for developers to update apps. If I get a decent Daw, amp sim, Sampler and Synth I'll gladly jump ship.

If anyone has a note 4, the full amplitube is free under the Galaxy gift offering, would love to hear some latency comments

aliensporebomb

#3
Good point on the IOS front but I was as shocked as heck that at IOS 8 there was only one app that wasn't able to function (PPG Minimapper crashed at boot) and that got fixed pretty quick (downloaded the update yesterday and was playing with it until I drove my wife and friends nuts).  We'll see about tomorrow after IOS8.1 comes out.
My music projects online at http://www.aliensporebomb.com/

GK Devices:  Roland VG-99, Boss GP-10, Boss SY-1000.

utensil

#4
To my knowledge sample tank still won't play nice in audiobus in iOS 8 , works fine on its own but still it's impractical that the same device is unable to be used the same was as it was a few weeks ago even though I've purchased all the apps In use. I.e the overall system I purchased a few months ago is no longer available and there was no way to back it up.

Elantric

#5
Need to use your "musician hat" and avoid all Apple OS  updates. These arrive each year like clockwork and always break several apps and it takes months for third party devices to obtain Drivers or updates for compatibility. The sweet spot for effective and functional music computer /Ipad/IPhone is remain 9 months behind the latest OS.

utensil

#6
Quote from: Elantric on October 19, 2014, 05:45:36 PM
Need to use your "musician hat" and avoid all Apple OS  updates. These arrive each year like clockwork and always break several apps and it takes months for third party devices to obtain Drivers or updates for compatibility. The sweet spot for effective and functional music computer /Ipad/IPhone is remain 9 months behind the latest OS.

usually I avoid all updates until my go to apps are cleared but this time I had to restore my phone it was having weird problems with the speaker only working intermittently  (after all the other resets , my last option was to restore or rather update which did infact fix it) . Now I can't use sample tank within audiobus which was one of the apps I used for samples. Now I've switched to using music studio and thumb jam for samples.

Elantric

#7
More info on Samsung "Professional Audio" for Android

http://live.cnet.com/Event/Samsung_Unpacked_at_IFA_2014_live_blog?Page=1


http://www.synthtopia.com/content/2014/10/02/samsung-real-time-audiomidi-solution-for-android/

http://developer.samsung.com/develop#professional-audio

What Is Professional Audio?
Professional Audio allows you to create virtual instrument applications with Android. You can connect and share audio devices and synchronize low-latency shared devices.

Professional Audio improves the environment in which virtual instruments are created by adding high-performance audio processing logic. You can use Professional Audio to create applications without background knowledge in hardware and high-performance drivers. You need not worry about connecting devices between applications. Using the provided modules and a USB MIDI driver, you can create virtual instrument applications with ease.

Figure 1: Professional Audio
Figure 1: Professional Audio

Professional Audio provides the following features:
Musical Instrument Creation
API for creating professional instrument applications
Support for all functions of the JACK Audio Connection Kit
Plug-ins
Plug-ins for acoustic piano, steel guitar and a standard drum kit
Support for USB Audio devices
Support for Audio input
Usage of the real-time scheduler
It can make a connection between apps at the SDK level
It is easier to move to other apps and support its remote control
Musical Instrument Creation

Professional Audio provides an API for creating professional instrument applications using an SDK and NDK.

You can use the SDK to send MIDI notes, control audio/MIDI ports, access/use added plug-in information, and synchronize virtual instruments.

You can use the NDK to create new sound modules and process high-speed audio signals.

Figure 2: Musical Instrument Creation

Professional Audio supports all the JACK Audio Connection Kit functions. A separate low-latency audio environment is required for its use.

About JACK
JACK is a system for low-latency real-time processing of audio and MIDI signals. It allows multiple applications to be connected to an audio device and enables sharing between applications. You can place the client within the processor or on the JACK server. JACK can also perform diffused processing between networks (inter-network transmission is currently not supported by Professional Audio due to performance issues). JACK is compatible with a variety of operating systems including GNU/Linux, Solaris, FreeBSD, OS X and Windows. For more information, click on the link below.
http://jackaudio.org

Plug-ins

You can use the Professional Audio plug-ins to improve the framework functions. To create a piano application for example, you can use the piano provided by the synthesizer plug-in to send MIDI notes. You can create applications without expert knowledge in virtual instruments and audio signal processing.

The Professional Audio SDK includes acoustic piano, steel guitar and standard drum kit plug-ins.

A wave table synthesizer and a variety of effect plug-ins are available on the support website.


Figure 3: Piano

Restrictions
Professional Audio has the following restrictions:
Only devices with the Professional Audio Framework
Framework performance depends on device specifications
When Professional Audio operates in background mode, it may affect the performance of other applications


http://img-developer.samsung.com/onlinedocs/sms/professional-audio/index.html

Worth reading all comments here:
http://www.synthtopia.com/content/2014/10/02/samsung-real-time-audiomidi-solution-for-android/

QuoteThis is why an ecosystem (IOS) beats a hodgepodge (Android) every time.




.....


i read them. thumb jam is not coming to android. it's coming to the galaxy note 4, with a promise of two other devices soon.

its a drop in the ocean. i have apps that ran fine on an iPhone 3g and iPad 1 with near zero latency, years ago (nano studio, beatmaker. hell, auria ran on the iPad 1 – just). and what's available now : auria, cubasis, garageband, gadget, beatmaker, nano studio, the korg apps, the arturia apps, the propeller heads apps, the virsyn apps, the kymatica apps, the sugar bytes effects, xewton music studio, samplr, csgrain and cs spectral, all the yonac awesomeness, genome, oscillab, traktor, and on and on and on it goes. plus, you can link them all together with IAA and audio bus

it would great for everyone if samsung opened up this sdk to everyone and to other handset makers, but why would they?

and fwiw, caustic is awesome – one of the best feature sets and lowest cpu usage of anything – but why do you think the dev ported it to iOS? massively bigger market and near zero piracy which means more money.

Elantric

#8
http://www.kvraudio.com/forum/viewtopic.php?p=5911784

Postby essejlc; Wed Oct 22, 2014 5:28 am
Re: Linnstrument + Android
ThumbJam on the Samsung Galaxy Note 4 (and when they allow it, Note 3 and S5) using the new professional audio SDK from samsung (JACK in new clothing) will work just fine with Linnstrument. It supports channel per voice and I've tested it successfully with a Haken Continuum. The latency via MIDI is actually better than the touchscreen, because that is now the limiting factor on the Note 4 hardware, it seems. I'm hoping they can work on that some more....


But yeah, iOS totally rules this area (and will continue to for a long time) for mobile devices.

PS: I'm the dev of ThumbJam :)

Elantric

#9


http://www.ikmultimedia.com/forum/viewtopic.php?t=9129&sid=9b5e20a7c75e58a7c27e26ccb427e191

Amplitube LE included on Samsung Galaxy Note 4
Postby fatstoge » Fri Oct 24, 2014 3:49 pm

So I just got the new Galaxy Note 4 last night and one of the included "Samsung Gifts" was Amplitube LE with $40 or so worth of upgrades. Obviously I downloaded it right away. When opening the app a notification comes up for "Professional audio system" settings for the Samsung, which includes low latency. Also, when opening the app there is a splash page picture for a new iRig HD-A, an iRig HD for the Android?! It's probably a Note 4 exclusive but where can I get this iRig??? This is the one feature iOS had that I desperately wanted and now its soooo close! Does anyone have any info on this or where and when we can buy the new iRig? Thanks!


http://www.ikmultimedia.com/forum/viewtopic.php?f=31&t=553&start=30


IK Multimedia wrote>

"The iRig HD-A will be available in mid-November. This will allow for a better quality connection to your Android device via the micro USB port on select newer devices. "

Elantric

#10


The well known iOS app ThumbJam is available on Samsung's Galaxy Note 4!

Thanks to Samsung's new Professional Audio SDK, latency is much better than it used to be on Android devices so we decided to take the plunge. The new system allows for inter-app audio and MIDI, so you can record your performances as either audio or MIDI tracks in another app such as Samsung's Soundcamp, which was used to record everything seen and heard in this video.

At first, ThumbJam for Samsung Professional Audio will be available on the new Galaxy Note 4 and Note Edge, but later it should also be available on Note 3 and S5 devices.

Look for both apps exclusively on Samsung's Galaxy Apps store if you are browsing from a Note 4.





Elantric

#11
http://forum.xda-developers.com/note-4/general/galaxy-gifts-wait-amplitube-released-t2920983/post56335836#post56335836



http://www.ikmultimedia.com/forum/viewtopic.php?t=9129&sid=9b5e20a7c75e58a7c27e26ccb427e191

Amplitube LE included on Samsung Galaxy Note 4
Postby fatstoge » Fri Oct 24, 2014 3:49 pm

So I just got the new Galaxy Note 4 last night and one of the included "Samsung Gifts" was Amplitube LE with $40 or so worth of upgrades. Obviously I downloaded it right away. When opening the app a notification comes up for "Professional audio system" settings for the Samsung, which includes low latency. Also, when opening the app there is a splash page picture for a new iRig HD-A, an iRig HD for the Android?! It's probably a Note 4 exclusive but where can I get this iRig??? This is the one feature iOS had that I desperately wanted and now its soooo close! Does anyone have any info on this or where and when we can buy the new iRig? Thanks!

http://www.ikmultimedia.com/forum/viewtopic.php?f=31&t=553&start=30
http://www.synthtopia.com/content/2014/10/02/samsung-real-time-audiomidi-solution-for-android/

Elantric

#12
http://www.musicalandroid.com/blog/screenshots-of-the-upcoming-samsung-daw-soundcamp


Screenshots of the upcoming Samsung DAW Soundcamp
10/7/2014 4 Comments

Here are screenshots that will tempt anyone with a high end Samsung device!
To point out it is not available yet, but soon.
Looks great and to know that it is only the beginning...

























More details to emerge at:
Samsung DevCon NOVEMBER 11-13, 2014 MOSCONE WEST | SAN FRANCISCO, CA

http://samsungdevcon.com/

http://samsungdevcon.com/sessions

Heat Synthesizer is available at Samsung Apps and supports Soundcamp, the new realtime audio sequencer available for Samsung devices as part of the new Samsung Professional Audio system.

Samsung Professional Audio supports low latency playback and inter-app audio- & MIDI communication as well as support for a high variety of USB interfaces.

Soundcamp will be officially presented at the Samsung DevCon 2014:

http://samsungdevcon.com/soundcamp-and-samsung-professional-audio


Third party Apps shown above who are represented as supporting "Samsung Professional Audio for Android"

Guitarism
http://www.rhism.com/

ThumbJam
http://thumbjam.com/

Morphwiz
http://www.wizdommusic.com/products/morphwiz.html

Heat Synthesizer
http://heatvst.com/wp/2014/10/01/heat-synthesizer-supports-samsung-soundcamp/

https://play.google.com/store/apps/details?id=com.nilsschneider.heat.demo



IK Multimedia Amplitube for Android
http://www.ikmultimedia.com/forum/viewtopic.php?t=9129&sid=9b5e20a7c75e58a7c27e26ccb427e191

IK Multimedia Irig Mic for Android
http://www.ikmultimedia.com/products/irigmic/index.php?pp=irig-mic-aow-android



and dont forget

FL Mobile Studio for Android
http://www.image-line.com/flstudiomobile/

and

Caustic 3  for Android
http://www.singlecellsoftware.com/caustic




List of Supported  USB Audio Class Compliant Audio/MIDI Interfaces for Android

http://www.extreamsd.com/USBAudioRecorderPRO/


http://source.android.com/index.html

gumtown

WoW !!  :o
Suddenly the world of android became a better place..
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

mbenigni

Incredible how fast this turned around.  And just weeks after I doubled down on iOS with an iPhone 6.  Not that I have any regrets about that - just have to laugh at the timing.

It will be interesting to see what MS will do in order to keep up with Android and iOS.  It looks like Modern UI apps are being essentially swallowed back into the desktop environment with Windows 10.  With Windows RT (rightly) gone, the distinction between Modern UI apps and proper Windows apps - in terms of which API calls are available to which, etc. - will probably blur.  As for Windows Phone, I wonder if it will even survive to see another major revision.


Elantric

http://samsungdevcon.com/sessions#modal-7152

NOV12
3:00pm - 4:00pm
A new real-time solution for mobile music creation – Using the Soundcamp and Professional Audio SDK Mobile
From professionals to hobbyists, there are a huge number of people interested in producing their own music. In the past, this meant procuring studio time and specialized equipment, but today, almost every consumer carries a virtual studio, equipped with a sound board and a wide range of instruments, right within their mobile devices. With the talent and equipment in place, the only thing missing from the equation is Soundcamp powered by Samsung Professional Audio SDK 2.0 – an easy to use, full digital audio workstation that offers professional quality low-latency audio. Join us to experience the sights and sounds of mobile music creation with Soundcamp and Professional Audio SDK 2.0.

Speakers:
Taemin Cho
Haeseok Oh

Elantric

#16
QuoteIt will be interesting to see what MS will do in order to keep up with Android and iOS.

I doubt there is any interest within Microsoft Corp to officially compete and go head to head with other Live performance /music creation platforms.

Majority of the tricks, workarounds,code, low latency bi-directional audio drivers (ASIO) that allows Windows to actually function acceptably as a low latency Bi-Directional Audio Platform for Music Creation was developed by others ( Steinberg ASIO, Cakewalk), and tacked onto the default popular operating system in widest use.

http://en.wikipedia.org/wiki/Audio_Stream_Input/Output


Better support for Pro Audio is not even on Microsoft's agenda or roadmap
https://social.technet.microsoft.com/Forums/windows/en-US/70040af6-1d20-4c95-af83-86fe91739ee2/asio-and-windows-7-issues-recording?forum=w7itpromedia

http://blogs.msdn.com/b/matthew_van_eerde/archive/2013/09/26/getting-peak-meters-and-volume-settings-for-all-apps-and-audio-devices-on-the-system.aspx

https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?forum=windowspro-audiodevelopment


IMHO  - Its really the sheer effort of third party Audio Developers back in the early 1990's  ( like Steinberg and RME's ASIO efforts) that makes it possible to mention Microsoft as a Professional Audio Platform today   

http://www.rossbencina.com/code/iasio-thiscall-resolver

http://www.native-instruments.com/en/support/knowledge-base/show/580/how-do-i-make-the-correct-sound-card-settings-on-a-windows-pc/

mbenigni

#17
QuoteI doubt there is any interest within Microsoft Corp to officially compete and go head to head with other music platforms.
Agreed, but at random intervals they do pay lip service to the music tech sector.  I think the most likely outcome at this point is that the MS platforms (WinPhone, Modern UI) that don't support low-latency audio and real-time MIDI will fall away due to unrelated business concerns anyway, while Windows 10, etc. will evolve (devolve?) to leverage the legacy workaround code etc. you mention in your post.  Microsoft has tried to introduce their own technology (e.g. WDM) to replace ASIO etc. but they never seem to get any traction.  It'll probably be a hodgepodge for a long while, for better or worse.

Elantric

http://www.gizmag.com/ik-multimedia-irig-amplitube-android/34688/

iRig HD and AmpliTube begin Android invasion

By Paul Ridden

November 11, 2014


iRig HD and AmpliTube begin Android invasion
IK Multimedia has announced that its iRig HD guitar interface is breaking free of its iOS/Mac chains and moving into Android territory. Following hot on the heels of Samsung's Pro-Audio SDK 2.0 platform release, IK has now revealed the Android-friendly iRig HD-A and a special version of its AmpliTube virtual rig app.

The real-time audio processing necessary for musicians to connect the new instrument interface to a mobile device running Android and fire up virtual rig or recording software has been made possible thanks to Samsung's Professional Audio technology, which is reported to make latency issues on Android a thing of the past.

The iRig HD-A is the first digital guitar interface for Android. It's powered by the mobile device it's connected to and features 24-bit/48 kHz A/D conversion and onboard gain control.

The instrument is plugged into the 0.25-in Hi-Z input jack at one end of the interface, a compatible Samsung device is connected via the supplied OTG cable and headphones or speakers through a 3.5 mm audio jack. Then you're ready to rock. Almost. You'll naturally need some guitar processing software, and IK Multimedia is recommending its new AmpliTube for Samsung Professional Audio app.

AmpliTube is available in three flavors – full, free and LE. The latter includes five digital stomps, one amp head, a speaker cab and two microphones, and is being made available as part of a Galaxy Gifts app bundle.

Currently, the new digital interface for electric guitar or bass and guitar processing app are only supported by Samsung's very latest products, such as the Galaxy Note 4 and Note Edge. But as Samsung pushes its Professional Audio system (which includes a free music studio app called Samsung SoundCamp) to other mobile devices, the list of compatible devices will grow.

The iRig HD-A is available now for US$99.99, while the full version of the new AmpliTube app is priced at $19.99. Have a look at the promo video below for an idea of what's on offer.

Product pages: iRig HD-A, AmpliTube

http://www.ikmultimedia.com/news/?item_id=5010




Elantric



Available on Samsung Galaxy Apps at https://apps.samsung.com/appquery/app...

Get iRig HD-A at http://www.ikmultimedia.com/irighda

AmpliTube turns your Android device that supports Samsung Professional Audio technology — like the Samsung Galaxy Note 4 and Galaxy Note Edge, and soon to be available on the Galaxy S5, Galaxy Note 3 and other devices — into the ultimate mobile guitar and bass multi-effects processor, offering up digital versions of some of the most coveted amplifiers and stompbox effects of all time.

Use the iRig HD-A, iRig or iRig Stomp audio interface adapters to connect your guitar, bass or keyboard to your mobile device and you'll be ready to rock! You can also use the iRig Mic to process vocals and acoustic instruments with this powerful mobile suite.

AmpliTube gives you incredibly realistic amp tones and effects in a mobile app from the leaders in analog gear modeling software for professional recording studios.

musicman65

Quote from: Elantric on November 12, 2014, 10:27:32 AM


Available on Samsung Galaxy Apps at https://apps.samsung.com/appquery/app...

Get iRig HD-A at http://www.ikmultimedia.com/irighda

AmpliTube turns your Android device that supports Samsung Professional Audio technology — like the Samsung Galaxy Note 4 and Galaxy Note Edge, and soon to be available on the Galaxy S5, Galaxy Note 3 and other devices — into the ultimate mobile guitar and bass multi-effects processor, offering up digital versions of some of the most coveted amplifiers and stompbox effects of all time.

Use the iRig HD-A, iRig or iRig Stomp audio interface adapters to connect your guitar, bass or keyboard to your mobile device and you'll be ready to rock! You can also use the iRig Mic to process vocals and acoustic instruments with this powerful mobile suite.

AmpliTube gives you incredibly realistic amp tones and effects in a mobile app from the leaders in analog gear modeling software for professional recording studios.

and so it begins....better late than never. Hopefully a secondary open vendor solution will follow from the community.

Elantric

http://www.musicalandroid.com/articles/audio-output-latency-on-android-by-planet-hcom


Audio Output Latency on Android, by planet-h.com
2/5/2015 0 Comments


This is the first article in a series where developers talk about different issues regarding making applications for Android. To start with andreas the developer of G-Stomper Studio, VA-Beast and G-Stomper Rhythm will talk about latency as this is something that concerns many music makers that use Android.
If you are not a programmer do not be scared to read it as it is also understandable for non-programmers!

So thank you so much Andreas for taking the time to write and share with us all!
_______________________________________________________________________________________________________
Latency in audio applications is probably one of the most discussed and also one of the most annoying issues on the Android platform. Understanding and handling latency the right way can be a mighty jungle, especially if you're a "normal" developer, and not a scientist.

This article is focused on output latency on Android devices, not input or round-trip latency. Hopefully someday I'll be able to write about input latency as well, but so far input and round-trip was no issue in my applications. So the term latency in this article is always meant as output latency. Also please forgive me when I forget some scientific details. It is neither my goal nor am I able to write a scientific paper about latency on Android. What you read is my personal experience with the different aspects of output latency on the Android platform.

Output Latency, what is it?

In short, output latency is the time from the moment you press a button or a piano key until you hear the sound from the speakers. And, output latency in audio applications is something we all want to get rid of.

The complete output latency in a musical application, which includes live playing, is a combination of the following 3 main factors:

1. Control Input Latency (e.g. display reaction time)
2. Application Latency (everything that happens in the app layer)
3. Audio System Latency (everything that happens in the system layer)

Control Input Latency (e.g. display reaction time)

The Control Input latency is the time from the moment you touch the screen (or an external MIDI Keyboard) until the audio system gets notified by the Android OS to do something. It is influenced by various factors, which strongly depend on your device and Android version. It can vary from a few milliseconds up to 300ms or even more. The Control Input Latency is under full control of the Android OS and the underlying hardware. There's no way to optimize or measure it from inside an app. But can get rid of a good part of it by using a MIDI controller/keyboard. The reaction time of an external MIDI keyboard is usually around 30-40ms faster than the on screen controls. This may surprise you, but the undisputed king regarding display reaction time is still the Google/Samsung Galaxy Nexus (2011).

Audio Output Latency (everything after the Control Input Latency)

The Audio Output Latency is the time from the moment when an application starts to play a sound until you hear it from the speakers. The Audio Output Latency is hardware, operating system and app dependent. A good part of it can be optimized from inside the app (as long as the hardware and operating system allows it). The Audio Output Latency can vary from ~35ms up to over 250ms. Sure, there are apps that report latencies down to 10ms, but this is not the complete thing (more about this later).

Application Latency (everything that happens in the app layer)

"Application Latency" is not an official term. I call it that way that way because it happens in the main application, the audio app. Meant is the time from the moment when an application starts to play a sound (technically when it starts to fill an audio buffer) until it is passed (enqueued) to the underlying audio system (AudioTrack or OpenSLES). This part is under direct control of the audio application. It depends on the defined audio system main buffer size and the app internal buffering.

AudioTrack is the out of the box system, which guarantees to run stable on every Android device.
It is not thought to be used in real time audio applications, but since it's the one and only ready-to-use system, it is used in most audio apps. AudioTrack has a device dependent minBufferSize which can be obtained by invoking AudioTrack.getMinBufferSize(). In short, AudioTrack has the full control over the minBufferSize as well as over the way the buffers are handled (once a buffer is passed to the AudioTrack system). The lowest ever reported minBufferSize by AudioTrack comes from the Google/Samsung Galaxy Nexus (2011) and corresponds to an application latency of 39ms at a sample rate of 44100Hz. More likely on modern non-Nexus devices are minBufferSizes around 80ms. Using smaller buffers with AudioTrack than the reported minBufferSize usually results in an initialization error.

The native OpenSLES system on the other hand allows more control. The buffer size as well as the way the buffers are handled is under responsibility of the app developer. OpenSLES allows smaller buffers than AudioTrack, of course only as long as a device can handle it. The smallest well working OpenSLES buffer size in the G-Stomper environment corresponds to an application latency of 10ms on Android 5.x and 20ms on Android 4.4 (both with a Nexus 9).

The application latency can be calculated with a simple formula:

AUDIO_SYSTEM_MAINBUFFER_LATENCY_MS
= audioTrackByteBufferSize * 1000 / sampleRateHz / bytesPerSample / numChannels

APP_INTERNAL_BUFFER_LATENCY_MS
= internalFloatBufferSize * 1000 / sampleRateHz

Now take the max of these two values and have the Application Latency.
On the Android platform, this value can vary from ~10ms up to ~200ms.

Audio System Latency (everything that happens in the system layer)

One of the biggest mistakes regarding output latency is the fact that most apps on report only the Application Latency. This looks of course nice (e.g. Nexus 7 2013/AudioTrack: 40ms), but it is only half the truth.

The moment a buffer is passed to AudioTrack for example does actually only mean that the buffer was enqueued to the AudioTrack internal buffer queue. But you never know exactly how much time will pass before the buffer will actually come out as a sound from the speakers. The time from the moment when a buffer is passed to the audio system until you actually hear it from the speakers, is what I call the "Audio System Latency".

The Audio System Latency comes in addition to the Application Latency and strongly depends on the audio system internal buffer pipeline (buffer queue, resampling, D/A conversion, etc.). Regarding low latency, this is the most significant part of the latency chain, which reveals the obvious problem of AudioTrack. With AudioTrack, you don't have any control over its internal buffer pipeline, and there's no way to force a buffer to pass it more quickly. What you can do is to prepare the buffers as final as possible, e.g. do the resampling in the audio application and pass the buffers always at the systems native sample rate. Unfortunately this does not change the latency, but it avoids glitches due to Android internal resampling.

I've measured Audio System Latencies of over two times more than the Application Latency. In other words, if the Application Latency is 80ms, it can easily be that the full output latency is more than 240ms, which is ridiculous for a real time application.

What did Samsung in their Professional Audio SDK to achieve such low latencies?

I'm no scientist, but it's quite obvious that they reduced the audio pipeline (application to speaker) to a minimum, and they did a very good job with impressive results. Unfortunately the SDK is for Samsung devices only, but it's for sure a great pioneer work, and maybe it'll motivate others to catch up. There's a nice video presentation of the Samsung Professional Audio SDK on YouTube:

For (supported) Samsung devices, it's definitely a good thing to consider the integration of their SDK.

What can you do as an app developer to get a faster audio pipeline?

Go native! Using the native OpenSLES reduces the Audio System Latency significantly. Even if you work with the same buffer size as with AudioTrack, you'll notice a big difference, especially on newer Android versions.

Using OpenSLES does not implicitly mean "low latency", but it definitely allows lower latencies than AudioTrack, because all audio buffers are written directly to the audio hardware, without the AudioTrack API and Dalvik/ART runtime overhead. This means the audio pipeline is shorter and therefore faster.

"The Audio Programming Blog" provides good tutorials regarding the OpenSLES integration:
https://audioprograming.wordpress.com/2012/03/03/android-audio-streaming-with-opensl-es-and-the-ndk/
https://audioprograming.wordpress.com/2012/10/29/lock-free-audio-io-with-opensl-es-on-android/

Also helpful is this article on GitHub:
https://github.com/igorski/MWEngine/wiki/Understanding-Android-audio-towards-achieving-low-latency-response

The "Google I/O 2013 - High Performance Audio" presentation gives a good overview about low latency audio on Android in general.


Will the G-Stomper apps get OpenSLES support?

Yes, definitely. Actually, OpenSLES is already integrated as an experimental additional audio system. In the current version 4.0.4, it is exclusively available for Nexus devices. The upcoming version 4.0.5 will introduce the OpenSLES to all 1ghz Quad-Core (or faster) devices running on Android 4.2 (or higher). The default will still be AudioTrack, but users with supported devices will get a notification and will be able to manually switch to OpenSLES in the G-Stomper setup (Setup dialog / Audio / Audio System / OpenSL).

How can the full output latency get measured?

Unfortunately there's no proper way to automatically calculate the full output latency (Control Input Latency + Application Latency + Audio System Latency) from inside an app. The only way to get real numbers is to measure it.

There's an article on android.com, which shows a way to measure the full audio output latency (Application Latency + Audio System Latency) in use of an oscilloscope and the device's LED indicator:
https://source.android.com/devices/audio/testing_circuit.html.
But honestly, by far not everyone has that equipment.

Here's a simple way to measure full output latency:

The only things you need are a microphone, a PC with a graphical audio editor installed, and an Android device. While recording on the PC, hold the microphone close to the screen, and tap some button or piano key on the Android screen, which is supposed to play in a sound. Be sure to tap the screen hard enough, so that the tap is audible. The microphone will record both, the physical finger tap and the audio output. Then, in the audio editor on the PC, measure the gap between the two peaks (finger tap and audio output).

Be sure to make more than one recording and take the average of the measured times. Especially the display reaction time may vary over multiple taps.

There might also be a quite significant difference between the head phone jack (with an external speaker connected) and the device internal speakers. Using the device internal speakers may result in higher latencies because of the post processing, which is usually done for internal (low quality) speakers.

This is definitely not the most scientific and also not the most precise approach, but it's precise enough to give you an idea of the real output latency. You'll be surprised by the results.

Elantric

http://www.androidauthority.com/android-6-0-marshmallow-audio-latency-670727/

Android Marshmallow edges closer to "Pro Audio" with lower audio latency

by: ROB TRIGGS
FEBRUARY 3, 2016
958
106852
chromecast audio review aa (6 of 7)

Despite a number of smartphone manufacturers offering improved audio hardware in their latest smartphones, Android's software latency has historically been very poor, preventing many professional audio applications from making their way to the hugely popular mobile platform. However, the folks over at Superpowered have gone back to have a look at Android Marshmallow's round trip audio latency and there appear to have been a number of improvements.

ADVERTISING

inRead invented by Teads
Before we go any further, round-trip audio latency is very important for real time applications, as users don't want to have to contend with a noticeable delay when recording, editing or playing back content. Round-trip refers to the time it takes for audio to enter the system, be put into software for processing, and then put back out from a speaker or headphone jack. Human delay perception ends at under 20ms (milliseconds), so the latency of any real time system should be below this figure, with 10ms being the target that is perceived as instantaneous.

You won't be using Android for live music effects unless latency reaches less than 20ms.
Shutterstock
You won't be using Android for live music effects unless latency reaches less than 20ms.
Previous testing on Android KitKat and Lollipop devices revealed round-trip latency figures in the hundreds of milliseconds, resulting in a very noticeable delay and making the operating system useless for real-time applications. Even the best Android devices struggled to go lower than 40ms. However, Google has made some major improvements with Android 6.0 Marshmallow, allowing for figures in the sub-20ms range. The Nexus 6P clocks in at 18ms, while the Nexus 9 manages 15ms.


Google appears to have made two notable changes with Marshmallow: a smaller ring buffer size and a new professional audio flag feature. The buffer size has been chopped in half to 128 samples. A buffer stores a selection of samples before these are all sent off into the system together and a smaller buffer means that the whole system updates much more frequently. Buffers and batch processing are often more efficient than sample by sample transfers and processing, so there are trade-offs to find the ideal buffer size.

This smaller buffer saving halves the latency throughout the ALSA (Advanced Linux Sound Architecture) and AudioFlinger sections for both input and output paths, making a noticeable difference to the round-trip times. The graphics below show the audio paths and times recorded with the Nexus 9 tablet.

Android 5.0 Lollipop Audio Path Latency
Android 6.0 Marshmallow Audio Path Latency
Android Marshmallow (API 23) also introduces a new FEATURE_AUDIO_PRO flag for developers to look for to reduce the audio output buffer size for the lowest possible latency. A look through Google's documentation states that devices using this flag must offer 20ms or less round-trip latency and should aim for 10ms. USB audio class devices are also supported through USB host mode, so low latency USB add-ons are now also a practical possibility.

As an added bonus, Android now also supports MIDI as part of the Professional Audio package. Although, this hasn't been implemented into the native layer. This flag marks a major effort to differentiate Android devices that are capable of professional audio applications, and is a major improvement over the FEATURE_AUDIO_LOW_LATENCY flag from the Gingerbread days, which offers at best a 50ms round-trip.

If you're interested, Superpowered offers a very detailed explanation of how this all breaks down, including a look at the slightly different latency results when using built-in and external hardware. Android still has a number of issues, but the situation is gradually improving for real-time professional audio.

Previously we have seen that Google's Nexus devices have been the better performers when it comes to audio latency and this latest testing hasn't yet shown if these improvements can and have been applied to other Marshmallow powered devices. Google states that only the Nexus 5X, 6P and 9 are "Pro Audio" Nexus devices, so there are probably some hardware requirements in addition to Marshmallow's software improvements.

CS4272 Codec 24bit   RELATED: THE GREAT AUDIO MYTH: WHY YOU DON'T NEED THAT 32-BIT DAC   22
Samsung, which offers its own Audio SDK to tap into low latency audio, will be releasing a Samsung Professional Audio SDK 3.0 with its upcoming Galaxy S7 flagship smartphone, which will hopefully match these Nexus results. We will just have to wait and see if other manufacturers support these improved features. Still, there are promising signs that Android may eventually be useful as a real-time audio platform.

Rhcole

"...may eventually be useful" is why I just got an iPad Pro.