Firstly, let me clear up a misconception, right now although the scanner onData method returns a list of scans you will only ever get a single scan returned in that list and there is no caching waiting for additional scans to occur. Your application will receive scanned data immediately on scan with the default reader parameters.
If the delay is happening at step 1 I suspect this could be related to the configuration of your scanner. I suggest comparing with the performance of GitHub - Zebra/samples-emdkforandroid-6_6 at BarcodeSample1 which just writes the barcodes to the screen.
If the delay is happening at step 2, which API are you using to emit the audio? Perhaps there is a more immediate way to output audio.
So I ended up spending quite a bit of time working out what was going on and used the sample program to compare the scanning speed to my code and found the latency between scanning and the barcode data callback was not the issue. The real issue turns out to be really crappy audio performance on the zebra handheld units and this is either a software issue with your drivers or an issue with android lollipop itself. When we get a barcode scan we play our own sounds rather than relying on the scanner beep because we play different sounds depending on whether the scan was good or not (IE incorrect product for order or invoice etc), or whether the person using the device needs to do something special with that product (hot pick item etc).
To play the sounds which are in wave files, we have been using the android MediaPlayer class. On the CN51 devices that are using Android 6.0 marshmallow the sounds play immediately. On the zebra there is a noticable delay that actually varies somewhat between scans. I was able to verify that by adding my sound code to the barcode sample app and could see the barcode and count showing on the screen long before the sound played.
Googling around it seems I am not the only one who has had performance issues with MediaPlayer on android so perhaps this is something fixed in 6.0 so the CN51 works better, or maybe they just have much better audio drivers.
In an attempt to solve the problem I spent some time writing my own sound player based on the lower level AudioTrack class which plays decoded sound streams. I wrote some code to parse the wave files into the raw audio to play via the AudioTrack class and the latency is much, much better. However even using the AudioTrack class if I wire up a button on the screen to play a beep sound comparing the two devices the CN51 plays the sound almost instantly while the Zebra still has a noticeable delay.
c80f0f1006