If read() returns 0, then there is no data. According to the documentation, it happens if the buffer is not a direct buffer: <https://developer.android.com/reference/android/media/AudioRecord#read(java.nio.ByteBuffer,%20int)> Refs #3812 <https://github.com/Genymobile/scrcpy/issues/3812>