This is possibly a kernel bug, but we need to investigate to confirm.
This android-ndk group is not the best place for tracking or discussing bugs, so
can you please log a bug here:
Click New issue / developer bug report
Include the same text here and same systrace attachments.
If you can also include as much information as possible
about your test app and conditions so that it would be easy to reproduce, that will
make it easier to investigate.
Also include the adb bugreport, ideally captured
while audio is still playing, and the captured within a few 10s of seconds of hearing the underruns.
(there are some statistics in the bugreport that will be really helpful,
but the statistics roll over so we need to catch them right after the underrun).
Then please reply on this thread with the URL of the new issue,
and we'll continue the follow-up at the issue tracker instead of here.
Thanks