oboe
oboe copied to clipboard
Very high latency when more than 2 audio channels are used
Android version(s): 9/10 Android device(s): Pixel 3a, Samsung Galaxy s10 Oboe version: 1.4.2 App name used for testing: Hello Oboe
Short description On some devices the latency is very high when more than 2 channels are used.
Steps to reproduce
- launch the sample app Hello Oboe on a device connected to a multichannel audio interface (in my case Pioneer WeGo4 or Reloop BeatPad2).
- Latency is around 5 ms
- Select “Channel count” : 4
Expected behavior
- Latency is a bit higher but not too much
Actual behavior
- Latency is around 150 ms, sometime 200 ms.
Any additional context
- I observe the same behaviour in my app. With 2 channels, I can set a buffer size of 192 frames. But with 4 channels any buffer smaller than 2000 frames trigger underruns.
- Moto G5 (android 8.1) does not have that problem. The latency is the same when selecting 4 channels.
Thanks for letting us know about this. It sounds like on some devices when requesting a stream with 2 or less channels a low latency stream is provided, otherwise a normal (100+ ms latency) stream is provided.
What's the latency on the Moto G5 when using 4 channels? I ask because it might be that the device is not providing a low latency stream for any channel counts.
@philburk Do you know what the performance mode policy is for streams with >2 channels?
With Hello Oboe app running on Moto G5, I get 22 ms latency in 2 and 4 channels configuration.
In our app, Moto G5 runs in PerformanceMode::LowLatency mode with 2 and 4 channels. I set the buffer size to 256 frames for both 2 and 4 channels configuration and it runs fine.
Note : the moto G5 runs android 8.1.
I don't have an S10 to test on but I do have an S9 running Android 10 and a Pioneer DDJ-WEGO3. I tried reproducing this issue on that hardware and I found that that I cannot get a low latency stream. Even with 2 channels the latency remains at around 80ms. Changing to 4 channels didn't affect this. Neither did switching to a Pixel USB headset adapter. It appears the S9 just doesn't support low latency streams over USB audio devices.
I have filed an issue with Samsung (b/168790057) so will close this here and update when there is any progress.
Pixel 3a on RQ1A with 4 channels on Vantec USB interface got 1920 framesPerBurst at 96000 Hz. PerfMode=NONE
Pixel 4a 5G on S master with 4 channels on Vantec USB interface got 252 framesPerBurst at 96000 Hz. Performance mode is LOW_LATENCY but the measured round-trip latency is 93 msec. For stereo the latency is 19 msec at 48000 Hz.
Pixel 6 on T with 4 channels doesn't use MMAP and ends up with a burst of 960 and a tap to tone latency of 114ms. @philburk can add more than 2 channels to AAudio?