scrcpy: Not work audio streaming on android 11

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: Windows 11
  • scrcpy version: scrcpy 2.0
  • installation method: Windows release…
  • device model: Redmi Note 8T
  • Android version: 11

Describe the bug The sound just doesn’t work. When you try to make it forcibly this happens

PS Programs\scrcpy-win64-v2.0> .\scrcpy-console.bat -d --require-audio
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
C:\Users\bropi\Programs\scrcpy-win64-v2.0\scrcpy-server: 1 file pushed, 0 skipped. 62.6 MB/s (52867 bytes in 0.001s)
[server] INFO: Device: Xiaomi Redmi Note 8T (Android 11)
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2336
[server] ERROR: Failed to start audio capture
[server] ERROR: On Android 11, it is only possible to capture in foreground, make sure that the device is unlocked when starting scrcpy.
WARN: Demuxer 'audio': stream explicitly disabled by the device
ERROR: Demuxer error
WARN: Killing the server... ```


Please do not post screenshots of your terminal, just post the content as text instead.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 24 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I implemented 3 attempts with 100ms before each, so that on most devices, it will work within 100ms (so the popup is not visible for too long), but on others it will still work: bc82e34

Here is a full build for win64:

Please tell me if it works for you.

Yep. Working on my phone. Thanks. I think we’ll wait for feedback from other users, and close this issue

After 5 hours of misunderstandings with Linux I finally installed it. Delay of 300 (units, seconds, whatever) is working

Yes, I noticed that yesterday 👍 It will be fixed by aa6846c (not merged yet).

I just saw all these branches. What a horror)

I implemented 3 attempts with 100ms before each, so that on most devices, it will work within 100ms (so the popup is not visible for too long), but on others it will still work: bc82e340d751da8fd1903f93ee00b455a7e6a904

Here is a full build for win64:

Please tell me if it works for you.

Alright, with a delay of 250 it seems to work fine every time. I haven’t tried any other values, though, but I might later.

EDIT: After a bunch of restarts I did manage to get it to fail. 300 might be better then.

Are you comfortable to build the app from sources? You could try to adjust the delay until you get a value which works for your device. I’m interested in that value 😃

It doesn’t look hard, I’m going to try it now