Error Creating AudioRecord when Android app is in the background

415 views
Skip to first unread message

Doug Chappelle

unread,
Aug 7, 2021, 7:57:29 AM8/7/21
to discuss-webrtc
I've created an Android client that uses WebRTC (M90) to communicate (audio/video) with other users in a room. I have implemented a foreground service so I don't loose audio/video when the app is in the background for any amount of time. However, a problem exists if the client joins an empty room and goes into the background, and then another participant joins the room. Video will be established successfully once the app re-enters the foreground but audio will not be successfully established. Audio is attempted to be establish while the app is still in the background and I see the following errors?...

E/IAudioFlinger: createRecord returned error -1 E/AudioRecord: createRecord_l(-143896099): AudioFlinger could not create record track, status: -1 E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -1. E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object. E/org.webrtc.Logging: WebRtcAudioRecordExternal: Init recording error: Cannot create AudioRecord
Reply all
Reply to author
Forward
0 new messages