From 01d785d9a3407dc0389abee688f1a58a5e4f8923 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 7 Jul 2023 18:21:17 +0200 Subject: [PATCH] Increase attempts to start AudioRecord Making the shell app foreground (specific for Android 11) may take more than 300ms on some devices, so increase the number of attempts from 3 to 5 (separated by 100ms). Fixes #4147 Refs #3796 Refs 02f4ff7534649153d6f87b05a0757431a2d0ee5f --- server/src/main/java/com/genymobile/scrcpy/AudioCapture.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/AudioCapture.java b/server/src/main/java/com/genymobile/scrcpy/AudioCapture.java index 7b20cce4..5575ffb6 100644 --- a/server/src/main/java/com/genymobile/scrcpy/AudioCapture.java +++ b/server/src/main/java/com/genymobile/scrcpy/AudioCapture.java @@ -118,7 +118,7 @@ public final class AudioCapture { if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) { startWorkaroundAndroid11(); try { - tryStartRecording(3, 100); + tryStartRecording(5, 100); } finally { stopWorkaroundAndroid11(); }