When using AAudio on Android, it becomes practically unusable while screen recording

FMOD Version: 20302 (144646)
Android Version: 14

Reproduction Steps:

  1. Start screen recording, capturing the entire screen and device audio.
  2. Open the target game/application that uses FMOD.
  3. The audio becomes extremely choppy, and the target application also becomes very laggy. The log continuously reports AAudio related errors.
10-06 23:33:20.964: I/fmod(21701): FMOD_OS_Init                             : Detected CPU family: 4, features: 0x7F, cores: 8.
10-06 23:33:20.965: D/debug info(21701): [Fmodex::debud] manufacturer: Google
10-06 23:33:20.965: D/debug info(21701): [Fmodex::debud] brand: google
10-06 23:33:20.965: I/fmod(21701): SystemI::init                            : Initialize version=20302 (144646), maxchannels=32, flags=0x00000000
10-06 23:33:20.965: I/fmod(21701): SystemI::setOutputInternal               : Setting output to 'FMOD AAudio Output'
10-06 23:33:20.966: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:33:20.966: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:33:20.966: I/AudioStreamBuilder(21701): device =      0, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:33:20.966: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:33:20.966: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:33:20.983: D/TrafficStats(21733): tagSocket(95) with statsTag=0xffffffff, statsUid=-1
10-06 23:33:21.009: D/AudioStreamInternal_Client(21701): configureDataInformation() original HW burst = 96, minMicros = 2000 => SW burst = 96
10-06 23:33:21.009: D/AAudioStream(21701): setState(s#1) from 0 to 2
10-06 23:33:21.009: D/AAudioFlowGraph(21701): configure() source format = 0x00000005, channels = 2, sample rate = 48000, sink format = 0x00000005, channels = 2, sample rate = 48000, useMonoBlend = 0, audioBalance = 0.000000, useVolumeRamps 0
10-06 23:33:21.009: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#1 ----------------
10-06 23:33:21.047: D/AAudio(21701): AAudioStream_close(s#1) called ---------------
10-06 23:33:21.047: D/AudioStreamInternal_Client(21701): release_l(): mServiceStreamHandle = 0x00000025
10-06 23:33:21.047: D/AAudioStream(21701): setState(s#1) from 2 to 11
10-06 23:33:21.084: W/libc(21733): Access denied finding property "ro.vendor.meizu.product.model"
10-06 23:33:21.101: I/ContentCaptureHelper(21701): Setting logging level to OFF
10-06 23:33:21.110: D/Cocos2dxActivity(21701): onWindowFocusChanged() hasFocus=true
10-06 23:33:21.151: D/AAudioStream(21701): setState(s#1) from 11 to 11
10-06 23:33:21.151: D/AAudioStream(21701): setState(s#1) from 11 to 12
10-06 23:33:21.151: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee262ad70 called
10-06 23:33:21.151: D/AAudioStream(21701): ~AudioStream(s#1) mPlayerBase strongCount = 2
10-06 23:33:21.151: D/AAudio(21701): AAudioStream_close(s#1) returned 0 ---------
10-06 23:33:21.161: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:33:21.161: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:33:21.161: I/AudioStreamBuilder(21701): device =      3, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:33:21.162: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:33:21.162: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:33:21.198: D/AudioStreamInternal_Client(21701): configureDataInformation() original HW burst = 96, minMicros = 2000 => SW burst = 96
10-06 23:33:21.198: D/AAudioStream(21701): setState(s#2) from 0 to 2
10-06 23:33:21.198: D/AAudioFlowGraph(21701): configure() source format = 0x00000005, channels = 2, sample rate = 48000, sink format = 0x00000005, channels = 2, sample rate = 48000, useMonoBlend = 0, audioBalance = 0.000000, useVolumeRamps 0
10-06 23:33:21.209: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#2 ----------------
10-06 23:33:21.237: D/AAudio(21701): AAudioStream_close(s#2) called ---------------
10-06 23:33:21.237: D/AudioStreamInternal_Client(21701): release_l(): mServiceStreamHandle = 0x00000027
10-06 23:33:21.237: D/AAudioStream(21701): setState(s#2) from 2 to 11
10-06 23:33:21.340: D/AAudioStream(21701): setState(s#2) from 11 to 11
10-06 23:33:21.340: D/AAudioStream(21701): setState(s#2) from 11 to 12
10-06 23:33:21.340: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee2632630 called
10-06 23:33:21.340: D/AAudioStream(21701): ~AudioStream(s#2) mPlayerBase strongCount = 2
10-06 23:33:21.340: D/AAudio(21701): AAudioStream_close(s#2) returned 0 ---------
10-06 23:33:21.350: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:33:21.350: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:33:21.350: I/AudioStreamBuilder(21701): device =     18, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:33:21.350: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:33:21.350: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:33:21.358: D/TrafficStats(21733): tagSocket(95) with statsTag=0xffffffff, statsUid=-1
10-06 23:33:21.361: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee2634e70 called
10-06 23:33:21.361: D/AAudioStream(21701): ~AudioStream(s#3) mPlayerBase strongCount = 1
10-06 23:33:21.361: D/AudioStreamTrack(21701): open(), request notificationFrames = 0, frameCount = 0
10-06 23:33:21.361: W/AudioTrack(21701): createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by client, not shared buffer and transfer = TRANSFER_SYNC
10-06 23:33:21.363: E/AudioTrack(21701): createTrack_l(0): AudioFlinger could not create track, status: -1 output 0
10-06 23:33:21.363: W/AudioTrack(21701): removeAudioDeviceCallback removing different callback!
10-06 23:33:21.363: E/AudioStreamTrack(21701): release_l() removeAudioDeviceCallback returned -38
10-06 23:33:21.363: D/AAudioStream(21701): setState(s#4) from 0 to 11
10-06 23:33:21.363: D/AudioTrack(21701): gather(): no metrics gathered, track status=-1
10-06 23:33:21.363: D/AAudioStream(21701): setState(s#4) from 11 to 12
10-06 23:33:21.363: E/AudioStreamTrack(21701): open(), initCheck() returned -1
10-06 23:33:21.363: D/AAudioStream(21701): ~AudioStream(s#4) mPlayerBase strongCount = 1
10-06 23:33:21.363: I/AAudio(21701): AAudioStreamBuilder_openStream() returns -896 = AAUDIO_ERROR_INTERNAL for s#0 ----------------
10-06 23:33:21.363: W/fmod(21701): AAudio_GetDriverInfoInternal             : Cannot open stream with id 18. Result = 0xFFFFFC80.
10-06 23:33:21.363: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:33:21.363: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:33:21.363: I/AudioStreamBuilder(21701): device =      4, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:33:21.363: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:33:21.363: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:33:21.383: I/AppActivity(21701): getNetIp:2407:b9c0:1:1a8:5054:ff:fea9:9a69
10-06 23:33:21.392: D/AudioStreamInternal_Client(21701): configureDataInformation() original HW burst = 96, minMicros = 2000 => SW burst = 96
10-06 23:33:21.392: D/AAudioStream(21701): setState(s#5) from 0 to 2
10-06 23:33:21.392: D/AAudioFlowGraph(21701): configure() source format = 0x00000005, channels = 2, sample rate = 48000, sink format = 0x00000005, channels = 2, sample rate = 48000, useMonoBlend = 0, audioBalance = 0.000000, useVolumeRamps 0
10-06 23:33:21.395: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#5 ----------------
10-06 23:33:21.456: D/AAudio(21701): AAudioStream_close(s#5) called ---------------
10-06 23:33:21.456: D/AudioStreamInternal_Client(21701): release_l(): mServiceStreamHandle = 0x00000029
10-06 23:33:21.456: D/AAudioStream(21701): setState(s#5) from 2 to 11
10-06 23:33:21.560: D/AAudioStream(21701): setState(s#5) from 11 to 11
10-06 23:33:21.560: D/AAudioStream(21701): setState(s#5) from 11 to 12
10-06 23:33:21.560: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee2634e70 called
10-06 23:33:21.560: D/AAudioStream(21701): ~AudioStream(s#5) mPlayerBase strongCount = 2
10-06 23:33:21.560: D/AAudio(21701): AAudioStream_close(s#5) returned 0 ---------
10-06 23:33:21.570: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:33:21.570: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:33:21.570: I/AudioStreamBuilder(21701): device =  65793, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:33:21.570: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:33:21.570: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:33:21.593: D/AudioStreamInternal_Client(21701): configureDataInformation() original HW burst = 96, minMicros = 2000 => SW burst = 96
10-06 23:33:21.593: D/AAudioStream(21701): setState(s#6) from 0 to 2
10-06 23:33:21.593: D/AAudioFlowGraph(21701): configure() source format = 0x00000005, channels = 2, sample rate = 48000, sink format = 0x00000005, channels = 2, sample rate = 48000, useMonoBlend = 0, audioBalance = 0.000000, useVolumeRamps 0
10-06 23:33:21.596: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#6 ----------------
10-06 23:33:21.596: E/fmod(21701): AAudio_GetDriverInfoInternal             : AAudio_GetDriverInfoInternal
10-06 23:33:21.607: D/AAudio(21701): AAudioStream_close(s#6) called ---------------
10-06 23:33:21.607: D/AudioStreamInternal_Client(21701): release_l(): mServiceStreamHandle = 0x0000002B
10-06 23:33:21.607: D/AAudioStream(21701): setState(s#6) from 2 to 11
10-06 23:33:21.709: D/AAudioStream(21701): setState(s#6) from 11 to 11
10-06 23:33:21.709: D/AAudioStream(21701): setState(s#6) from 11 to 12
10-06 23:33:21.709: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee2636ca0 called
10-06 23:33:21.709: D/AAudioStream(21701): ~AudioStream(s#6) mPlayerBase strongCount = 2
10-06 23:33:21.709: D/AAudio(21701): AAudioStream_close(s#6) returned 0 ---------
10-06 23:33:21.722: I/fmod(21701): FMOD::supportsLowLatency                 : Low latency = true, Pro Audio = true, Bluetooth On = false, Acceptable Block Size = true (480)
10-06 23:33:21.722: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:33:21.722: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:33:21.722: I/AudioStreamBuilder(21701): device =      0, sessionId = -1, perfMode = 12, callback: ON with frames = 0
10-06 23:33:21.722: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:33:21.723: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:33:21.753: D/AudioStreamInternal_Client(21701): configureDataInformation() original HW burst = 96, minMicros = 2000 => SW burst = 96
10-06 23:33:21.753: D/AAudioStream(21701): setState(s#7) from 0 to 2
10-06 23:33:21.753: D/AAudioFlowGraph(21701): configure() source format = 0x00000005, channels = 2, sample rate = 48000, sink format = 0x00000005, channels = 2, sample rate = 48000, useMonoBlend = 0, audioBalance = 0.000000, useVolumeRamps 0
10-06 23:33:21.755: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#7 ----------------
10-06 23:33:21.765: D/AAudio(21701): AAudioStream_close(s#7) called ---------------
10-06 23:33:21.765: D/AudioStreamInternal_Client(21701): release_l(): mServiceStreamHandle = 0x0000002D
10-06 23:33:21.765: D/AAudioStream(21701): setState(s#7) from 2 to 11
10-06 23:33:21.873: D/AAudioStream(21701): setState(s#7) from 11 to 11
10-06 23:33:21.873: D/AAudioStream(21701): setState(s#7) from 11 to 12
10-06 23:33:21.873: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee2634e70 called
10-06 23:33:21.873: D/AAudioStream(21701): ~AudioStream(s#7) mPlayerBase strongCount = 2
10-06 23:33:21.873: D/AAudio(21701): AAudioStream_close(s#7) returned 0 ---------
10-06 23:33:21.883: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:33:21.883: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:33:21.883: I/AudioStreamBuilder(21701): device =      0, sessionId = -1, perfMode = 12, callback: ON with frames = 0
10-06 23:33:21.883: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:33:21.884: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:33:21.912: D/AudioStreamInternal_Client(21701): configureDataInformation() original HW burst = 96, minMicros = 2000 => SW burst = 96
10-06 23:33:21.912: D/AAudioStream(21701): setState(s#8) from 0 to 2
10-06 23:33:21.912: D/AAudioFlowGraph(21701): configure() source format = 0x00000005, channels = 2, sample rate = 48000, sink format = 0x00000005, channels = 2, sample rate = 48000, useMonoBlend = 0, audioBalance = 0.000000, useVolumeRamps 0
10-06 23:33:21.914: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#8 ----------------
10-06 23:33:21.914: W/fmod(21701): AAudio_InitInternal                      : Could not set driver at index [0]. Defaulting to driver with id: 3.
10-06 23:33:21.914: I/fmod(21701): AAudio_Init                              : Sample rate: HW = 48000, SW = 24000  Block size: HW = 96, SW = 256.
10-06 23:33:21.914: I/fmod(21701): SystemI::init                            : Output requires a sample rate of 48000Hz, resampling will occur.
10-06 23:33:21.915: I/fmod(21701): Thread::initThread                       : Init FMOD stream thread. Affinity: 0x4000000000000003, Priority: 0xFFFF7FFB, Stack Size: 98304, Semaphore: No, Sleep Time: 10, Looping: Yes.
10-06 23:33:21.915: I/fmod(21701): SystemI::DSPCodecPoolRegister            : register codec pool for pool type 0
10-06 23:33:21.915: D/AAudio(21701): AAudioStream_requestStart(s#8) called --------------
10-06 23:33:21.915: D/AAudioStream(21701): setState(s#8) from 2 to 3
10-06 23:33:21.962: E/SurfaceSyncGroup(21701): Failed to receive transaction ready in 1000ms. Marking SurfaceSyncGroup(wmsSync-VRI[AppActivity]#1) as ready
10-06 23:33:21.962: E/SurfaceSyncGroup(21701): Failed to receive transaction ready in 1000ms. Marking SurfaceSyncGroup(VRI[AppActivity]#2) as ready
10-06 23:33:21.995: D/AAudio(21701): AAudioStream_requestStart(s#8) returned 0 ---------
10-06 23:33:21.995: I/fmod(21701): Thread::initThread                       : Init FMOD mixer thread. Affinity: 0x4000000000000001, Priority: 0xFFFF7FFA, Stack Size: 81920, Semaphore: Yes, Sleep Time: 0, Looping: Yes.
10-06 23:34:05.331: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:34:05.331: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:34:05.331: I/AudioStreamBuilder(21701): device =      4, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:34:05.331: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:34:05.331: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:34:05.354: D/AudioStreamInternal_Client(21701): configureDataInformation() original HW burst = 96, minMicros = 2000 => SW burst = 96
10-06 23:34:05.354: D/IsochronousClockModel(21701): setFramesPerBurst() - mFramesPerBurst = 96 - mBurstPeriodNanos = 2000000
10-06 23:34:05.354: D/AAudioStream(21701): setState(s#37) from 0 to 2
10-06 23:34:05.354: D/AAudioFlowGraph(21701): configure() source format = 0x00000005, channels = 2, sample rate = 48000, sink format = 0x00000005, channels = 2, sample rate = 48000, useMonoBlend = 0, audioBalance = 0.000000, useVolumeRamps 0
10-06 23:34:05.358: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#37 ----------------
10-06 23:34:05.512: D/AAudio(21701): AAudioStream_close(s#37) called ---------------
10-06 23:34:05.512: D/AudioStreamInternal_Client(21701): release_l(): mServiceStreamHandle = 0x00000002
10-06 23:34:05.513: D/AAudioStream(21701): setState(s#37) from 2 to 11
10-06 23:34:05.623: D/AAudioStream(21701): setState(s#37) from 11 to 11
10-06 23:34:05.623: D/AAudioStream(21701): setState(s#37) from 11 to 12
10-06 23:34:05.623: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee2645e20 called
10-06 23:34:05.623: D/AAudioStream(21701): ~AudioStream(s#37) mPlayerBase strongCount = 2
10-06 23:34:05.623: D/AAudio(21701): AAudioStream_close(s#37) returned 0 ---------
10-06 23:34:05.633: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:34:05.633: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:34:05.633: I/AudioStreamBuilder(21701): device = -1275068307, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:34:05.633: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:34:05.633: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:34:05.633: D/AAudioStreamParameters(21701): deviceId out of range = -1275068307
10-06 23:34:05.633: I/AAudio(21701): AAudioStreamBuilder_openStream() returns -882 = AAUDIO_ERROR_OUT_OF_RANGE for s#0 ----------------
10-06 23:34:05.633: W/fmod(21701): AAudio_GetDriverInfoInternal             : Cannot open stream with id -1275068307. Result = 0xFFFFFC8E.
10-06 23:34:07.670: I/fmod(21701): AAudio_DeviceListChanged                 : Output device list changed
10-06 23:34:07.671: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:34:07.671: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:34:07.671: I/AudioStreamBuilder(21701): device =      0, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:34:07.671: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:34:07.671: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:34:07.683: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee2645e20 called
10-06 23:34:07.683: D/AAudioStream(21701): ~AudioStream(s#38) mPlayerBase strongCount = 1
10-06 23:34:07.683: D/AudioStreamTrack(21701): open(), request notificationFrames = 0, frameCount = 0
10-06 23:34:07.683: W/AudioTrack(21701): createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by client, not shared buffer and transfer = TRANSFER_SYNC
10-06 23:34:07.697: D/AudioStreamTrack(21701): open() flags changed from 0x00000104 to 0x00000100
10-06 23:34:07.697: D/AudioStreamTrack(21701): open() perfMode changed from 12 to 10
10-06 23:34:07.697: D/AAudioStream(21701): setState(s#39) from 0 to 2
10-06 23:34:07.705: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#39 ----------------
10-06 23:34:07.716: D/AAudio(21701): AAudioStream_close(s#39) called ---------------
10-06 23:34:07.716: D/AAudioStream(21701): setState(s#39) from 2 to 11
10-06 23:34:07.717: D/AAudioStream(21701): setState(s#39) from 11 to 12
10-06 23:34:07.717: D/AAudioStream(21701): ~AudioStream(s#39) mPlayerBase strongCount = 2
10-06 23:34:07.717: D/AAudio(21701): AAudioStream_close(s#39) returned 0 ---------
10-06 23:34:07.727: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:34:07.728: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:34:07.728: I/AudioStreamBuilder(21701): device =      3, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:34:07.728: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:34:07.728: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:34:07.740: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee2645e20 called
10-06 23:34:07.740: D/AAudioStream(21701): ~AudioStream(s#40) mPlayerBase strongCount = 1
10-06 23:34:07.740: D/AudioStreamTrack(21701): open(), request notificationFrames = 0, frameCount = 0
10-06 23:34:07.740: W/AudioTrack(21701): createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by client, not shared buffer and transfer = TRANSFER_SYNC
10-06 23:34:07.752: D/AudioStreamTrack(21701): open() flags changed from 0x00000104 to 0x00000100
10-06 23:34:07.752: D/AudioStreamTrack(21701): open() perfMode changed from 12 to 10
10-06 23:34:07.752: D/AAudioStream(21701): setState(s#41) from 0 to 2
10-06 23:34:07.756: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#41 ----------------
10-06 23:34:07.766: D/AAudio(21701): AAudioStream_close(s#41) called ---------------
10-06 23:34:07.766: D/AAudioStream(21701): setState(s#41) from 2 to 11
10-06 23:34:07.767: D/AAudioStream(21701): setState(s#41) from 11 to 12
10-06 23:34:07.767: D/AAudioStream(21701): ~AudioStream(s#41) mPlayerBase strongCount = 2
10-06 23:34:07.767: D/AAudio(21701): AAudioStream_close(s#41) returned 0 ---------
10-06 23:34:07.777: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:34:07.777: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:34:07.777: I/AudioStreamBuilder(21701): device =     49, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:34:07.777: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:34:07.777: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:34:07.797: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee263c730 called
10-06 23:34:07.797: D/AAudioStream(21701): ~AudioStream(s#42) mPlayerBase strongCount = 1
10-06 23:34:07.797: D/AudioStreamTrack(21701): open(), request notificationFrames = 0, frameCount = 0
10-06 23:34:07.797: W/AudioTrack(21701): createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by client, not shared buffer and transfer = TRANSFER_SYNC
10-06 23:34:12.386: D/MidasComm<Log>(21701): auto flush
10-06 23:34:13.998: E/AudioSystem-JNI(21701): Command failed for android_media_AudioSystem_error_callback: -32
10-06 23:34:13.998: W/AudioSystem(21701): AudioFlinger server died!
10-06 23:34:13.998: W/AAudioBinderClient(21701): AAudio service binderDied()!
10-06 23:34:13.998: W/AudioTrack(21701): restoreTrack_l(37): dead IAudioTrack, PCM, creating a new one from obtainBuffer()
10-06 23:34:13.998: W/AudioTrack(21701): restoreTrack_l(36): dead IAudioTrack, PCM, creating a new one from obtainBuffer()
10-06 23:34:13.998: I/BpBinder(21701): onLastStrongRef automatically unlinking death recipients: 
10-06 23:34:13.999: D/AudioSystem(21701): getService: waiting for media.audio_flinger
10-06 23:34:13.999: E/AudioTrack(21701): createTrack_l(0): AudioFlinger could not create track, status: -32 output 0
10-06 23:34:14.000: W/AudioTrack(21701): removeAudioDeviceCallback removing different callback!
10-06 23:34:14.000: E/AudioStreamTrack(21701): release_l() removeAudioDeviceCallback returned -38
10-06 23:34:14.000: D/AAudioStream(21701): setState(s#43) from 0 to 11
10-06 23:34:14.000: D/AudioTrack(21701): gather(): no metrics gathered, track status=-32
10-06 23:34:14.000: D/AAudioStream(21701): setState(s#43) from 11 to 12
10-06 23:34:14.000: E/AudioStreamTrack(21701): open(), initCheck() returned -32
10-06 23:34:14.000: D/AAudioStream(21701): ~AudioStream(s#43) mPlayerBase strongCount = 1
10-06 23:34:14.000: I/AAudio(21701): AAudioStreamBuilder_openStream() returns -881 = AAUDIO_ERROR_NO_SERVICE for s#0 ----------------
10-06 23:34:14.000: W/fmod(21701): AAudio_GetDriverInfoInternal             : Cannot open stream with id 49. Result = 0xFFFFFC8F.
10-06 23:34:14.000: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:34:14.000: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:34:14.000: I/AudioStreamBuilder(21701): device =     18, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:34:14.000: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:34:14.000: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:34:15.000: D/AudioSystem(21701): getService: waiting for media.audio_flinger
10-06 23:34:16.030: I/AudioTrack(21701): createTrack_l(37): AUDIO_OUTPUT_FLAG_FAST successful; frameCount 7680 -> 7680
10-06 23:34:16.037: D/AudioStreamLegacy(21701): onAudioDeviceUpdate(deviceId = 3)
10-06 23:34:16.037: D/AudioTrack(21701): releaseBuffer is no-op due to IAudioTrack sequence mismatch 2 != 3
10-06 23:34:16.037: W/fmod(21701): OutputRingBuffer::read                   : Buffer starvation detected, requested 2048 bytes, 0 / 16384 bytes available.
10-06 23:34:16.038: D/AudioTrack(21701): releaseBuffer is no-op due to IAudioTrack sequence mismatch 3 != 4
10-06 23:34:16.038: D/AudioTrack(21701): stop(36): called with 381922 frames delivered
10-06 23:34:16.043: D/AudioStreamInternal_Client(21701): ~AudioStreamInternal() 0xb400006ee263c730 called
10-06 23:34:16.043: D/AAudioStream(21701): ~AudioStream(s#44) mPlayerBase strongCount = 1
10-06 23:34:16.043: D/AudioStreamTrack(21701): open(), request notificationFrames = 0, frameCount = 0
10-06 23:34:16.043: W/AudioTrack(21701): createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by client, not shared buffer and transfer = TRANSFER_SYNC
10-06 23:34:16.054: E/AudioTrack(21701): createTrack_l(0): AudioFlinger could not create track, status: -1 output 0
10-06 23:34:16.054: W/AudioTrack(21701): removeAudioDeviceCallback removing different callback!
10-06 23:34:16.054: E/AudioStreamTrack(21701): release_l() removeAudioDeviceCallback returned -38
10-06 23:34:16.054: D/AAudioStream(21701): setState(s#45) from 0 to 11
10-06 23:34:16.054: D/AudioTrack(21701): gather(): no metrics gathered, track status=-1
10-06 23:34:16.054: D/AAudioStream(21701): setState(s#45) from 11 to 12
10-06 23:34:16.054: E/AudioStreamTrack(21701): open(), initCheck() returned -1
10-06 23:34:16.054: D/AAudioStream(21701): ~AudioStream(s#45) mPlayerBase strongCount = 1
10-06 23:34:16.054: I/AAudio(21701): AAudioStreamBuilder_openStream() returns -896 = AAUDIO_ERROR_INTERNAL for s#0 ----------------
10-06 23:34:16.055: W/fmod(21701): AAudio_GetDriverInfoInternal             : Cannot open stream with id 18. Result = 0xFFFFFC80.
10-06 23:34:16.055: I/AAudio(21701): AAudioStreamBuilder_openStream() called ----------------------------------------
10-06 23:34:16.055: I/AudioStreamBuilder(21701): rate   =      0, channels  = 0, channelMask = 0, format   = 0, sharing = SH, dir = OUTPUT
10-06 23:34:16.055: I/AudioStreamBuilder(21701): device =      4, sessionId = -1, perfMode = 12, callback: OFF with frames = 0
10-06 23:34:16.055: I/AudioStreamBuilder(21701): usage  =     14, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
10-06 23:34:16.055: I/AudioStreamBuilder(21701): privacy sensitive = false, opPackageName = (null), attributionTag = (null)
10-06 23:34:16.097: D/AudioStreamInternal_Client(21701): configureDataInformation() original HW burst = 96, minMicros = 2000 => SW burst = 96
10-06 23:34:16.097: D/IsochronousClockModel(21701): setFramesPerBurst() - mFramesPerBurst = 96 - mBurstPeriodNanos = 2000000
10-06 23:34:16.097: D/AAudioStream(21701): setState(s#46) from 0 to 2
10-06 23:34:16.097: D/AAudioFlowGraph(21701): configure() source format = 0x00000005, channels = 2, sample rate = 48000, sink format = 0x00000005, channels = 2, sample rate = 48000, useMonoBlend = 0, audioBalance = 0.000000, useVolumeRamps 0
10-06 23:34:16.098: I/AAudio(21701): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#46 ----------------
10-06 23:34:16.108: D/AAudio(21701): AAudioStream_close(s#46) called ---------------
10-06 23:34:16.108: D/AudioStreamInternal_Client(21701): release_l(): mServiceStreamHandle = 0x00000002
10-06 23:34:16.108: D/AAudioStream(21701): setState(s#46) from 2 to 11
10-06 23:34:16.221: D/AAudioStream(21701): setState(s#46) from 11 to 11
10-06 23:34:16.221: D/AAudioStream(21701): setState(s#46) from 11 to 12
---------

Using OpenSL ES, there is no problem at all.

I saw this error, might be related to AAUDIO_SHARING_MODE_EXCLUSIVE?

W/AudioTrack(16767): createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by client, not shared buffer and transfer = TRANSFER_SYNC

Hi,

Thank you for bringing this issue to our attention.

Unfortunately, I could not reproduce it using our core API example: play_sound. Would it be possible to test if you can reproduce the issue in our examples? The examples are included in the Android engine download here: fmodstudioapi20302android\api\core\examples\androidstudio\cmake\play_sound

Could I grab any more information about the app you are testing?

Thank you for confirming this.

I have received this log without recording the screen so I am unsure if it’s related to the issue.

I forgot to mention that the reproduction steps require playing a long mp3 audio file, which I’m using the stream loading mode.

Additionally, the issue can also be reproduced by starting screen recording while a long audio file is playing.

Thank you for the additional information. Unfortunately, I am still unable to reproduce the issue in both the studio and core API. Would it be possible to get a copy of your app uploaded to your profile to test on my side?

Our project is a game, and due to its complexity, it’s not feasible to isolate the issue in a separate example.

I have reproduced the problem using the play_sound example with the following conditions:
The targetSdkVersion needs to be set to 28 or higher (I used 30), otherwise audio recording is not possible and the issue cannot be reproduced.
Modifications were made to play_sound.cpp to force AAudio output and set sound1 to FMOD_LOOP_NORMAL.

Reproduce step:

  • Run the modified play_sound example.
  • Start screen recording with audio capture enabled.
  • Switch back to the demo app and click button A to start looped playback.
  • After a few seconds, the audio will become interrupted and switch from the speaker to the earpiece.
  • This interruption will repeat every few seconds.

The log shows that the output device is constantly attempting to switch, and the application’s main thread also freezes for several seconds at a time.

Thank you for the detailed reproduction steps, I have been able to reproduce the error. I will pass it onto our development team to investigate further.

Thank you!

Any updates on this issue?

Hi, sorry for the late response.

The fix is currently in development and will be included in the upcoming release, version 2.03.05.