scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Unable to start scrcpy, WASAPI can't find requested audio endpoint: Element not found.

Open SvlarSvlar opened this issue 1 year ago • 26 comments

  • [x] I have read the FAQ.
  • [x] I have searched in existing issues.

Environment

  • OS: Windows 10
  • scrcpy version: v2.0
  • installation method: Windows release
  • device model: Xiaomi M2004J19C
  • Android version: 11

Describe the bug Unable to start scrcpy, it seem like the screen did pop up for half second then close.

On errors, please provide the output of the console (and adb logcat if relevant). logcat.txt

Please paste terminal output in a code block.
`scrcpy -Vdebug
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
DEBUG: ADB device found:
DEBUG:     -->   (usb)          642c687f0410            device  M2004J19C
DEBUG: Device serial: 642c687f0410
DEBUG: Using server (portable): C:\Users\Admin\Desktop\scrcpy-win32-v2.0-18-gd7841664f\scrcpy-win32-v2.0-18-gd7841664f\scrcpy-server
C:\Users\Admin\Desktop\scrcpy-win32-v2.0-18-gd7841664f\scr...file pushed, 0 skipped. 109.9 MB/s (54255 bytes in 0.000s)
[server] INFO: Device: Xiaomi M2004J19C (Android 11)
[server] DEBUG: Using encoder: 'OMX.MTK.VIDEO.ENCODER.AVC'
[server] DEBUG: Using audio encoder: 'c2.android.opus.encoder'
DEBUG: Server connected
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
INFO: Renderer: direct3d
DEBUG: Trilinear filtering disabled (not an OpenGL renderer)
DEBUG: Using icon (portable): C:\Users\Admin\Desktop\scrcpy-win32-v2.0-18-gd7841664f\scrcpy-win32-v2.0-18-gd7841664f\icon.png
DEBUG: Demuxer 'video': starting thread
DEBUG: Demuxer 'audio': starting thread
INFO: Initial texture: 1080x2336
ERROR: Could not open audio device: WASAPI can't find requested audio endpoint: Element not found.
ERROR: Demuxer error
DEBUG: quit...
DEBUG: Receiver stopped
DEBUG: Demuxer 'video': end of[server] DEBUG: Controller stopped
 frames
WARN: Killing the server...
DEBUG: Server disconnected
DEBUG: Server terminated`

SvlarSvlar avatar Mar 29 '23 06:03 SvlarSvlar

https://github.com/Genymobile/scrcpy/issues/3856#issuecomment-1482911664

rom1v avatar Mar 29 '23 08:03 rom1v

Update, I have found the root cause for this, will need to turn off XIAOMI MIUI optimization in the phone setting developer option and restart, it works well after this. Thanks for the suggestion.

SvlarSvlar avatar Mar 29 '23 08:03 SvlarSvlar

will need to turn off XIAOMI MIUI optimization in the phone setting developer option and restart,

That may not be the cause for this:

ERROR: Could not open audio device: WASAPI can't find requested audio endpoint: Element not found.

(which is a client error)

rom1v avatar Mar 29 '23 08:03 rom1v

Opss, you are correct, it works for a while then stopped.

i have tried using scrcpy-win32-v2.0-18-gd7841664f set SDL_AUDIODRIVER=directsound run with scrcpy --audio-output-buffer=10

but now i got another error message Could not open audio device: DirectSoundCreate8: No audio device found (0x88780078)

SvlarSvlar avatar Mar 29 '23 08:03 SvlarSvlar

You could try with yet another driver: https://wiki.libsdl.org/SDL2/FAQUsingSDL#win32_1

The WASAPI issue will be fixed in the future version of SDL (which will be included in a future version of scrcpy).

rom1v avatar Mar 29 '23 08:03 rom1v

I have experienced the same this morning against the latest release of [scrcpy v2.0].

OS: Windows 10 Pro - 21H2 Scrcpy version: v2.0 Installation method: Windows release Device model: Samsung S23 Plus Android version: 13

Describe the bug Scrcpy opens for a fraction of a second and crashes presenting the error below. As a result, scrcpy is not usable. I have observed the same results using non-console mode

Error output: ERROR: Could not open audio device: WASAPI can't find requested audio endpoint: Element not found. ERROR: Demuxer error

Thanks team

moe7863 avatar Apr 13 '23 09:04 moe7863

Then read https://github.com/Genymobile/scrcpy/issues/3856#issuecomment-1482911664

rom1v avatar Apr 13 '23 09:04 rom1v

Then read #3856 (comment)

Sorted. Thank you :)

moe7863 avatar Apr 13 '23 09:04 moe7863

I have same problem at my office pc (Windows 10 pro 32 bits under domain) After some secs exit with error

could not open audio device: wasapi can't find requested audio endpoint: no se ha encontrado el elemento. error: demuxer error

At home pc is all ok Office pc has no audio device installed (and seem disabled at bios and cant change it)

Phone is Samsung A03

leo3487 avatar Aug 01 '23 10:08 leo3487

could not open audio device: wasapi can't find requested audio endpoint: no se ha encontrado el elemento. error: demuxer error

Which scrcpy version? Try the latest, currently v2.1.1 (which includes the latest SDL)

rom1v avatar Aug 01 '23 10:08 rom1v

I guess use same. Downloaded at office pc the 32 bit version less than 1 hour ago, from its github page https://github.com/Genymobile/scrcpy/releases/download/v2.1.1/scrcpy-win32-v2.1.1.zip

leo3487 avatar Aug 01 '23 10:08 leo3487

Does it work if you use directsound instead of wasapi? https://github.com/Genymobile/scrcpy/issues/3856#issuecomment-1482911664

rom1v avatar Aug 01 '23 12:08 rom1v

with set SDL_AUDIODRIVER=directsound starting scrcpy from CMD close within less than 1 sec starting from windows explorer, still same error, after some secs

leo3487 avatar Aug 01 '23 12:08 leo3487

starting scrcpy from CMD close within less than 1 sec

What is the console output?

rom1v avatar Aug 01 '23 12:08 rom1v

D:\scrcpy-win32-v2.1.1>scrcpy scrcpy 2.1.1 https://github.com/Genymobile/scrcpy INFO: ADB device found: INFO: --> (usb) R8MT701TGQT device SM_A035M D:\scrcpy-win32-v2.1.1\scrcpy-server: 1 file pushed, 0 skipped. 71.2 MB/s (56995 bytes in 0.001s) [server] INFO: Device: [samsung] samsung SM-A035M (Android 13) INFO: Renderer: direct3d INFO: Texture: 720x1600 ERROR: Could not open audio device: WASAPI can't find requested audio endpoint: No se ha encontrado el elemento. ERROR: Demuxer error

D:\scrcpy-win32-v2.1.1>

leo3487 avatar Aug 01 '23 12:08 leo3487

With scrcpy --audio-output-buffer=10 after some secs close and give error ERROR: Could not open audio device: WASAPI can't find requested audio endpoint: No se ha encontrado el elemento. ERROR: Demuxer error

leo3487 avatar Aug 01 '23 12:08 leo3487

And with set SDL_AUDIODRIVER=directsound just before scrcpy? (you should not get any WASAPI error message)

rom1v avatar Aug 01 '23 12:08 rom1v

D:\scrcpy-win32-v2.1.1>set SDL_AUDIODRIVER=directsound

D:\scrcpy-win32-v2.1.1>scrcpy scrcpy 2.1.1 https://github.com/Genymobile/scrcpy INFO: ADB device found: INFO: --> (usb) R8MT701TGQT device SM_A035M D:\scrcpy-win32-v2.1.1\scrcpy-server: 1 file pushed, 0 skipped. 70.9 MB/s (56995 bytes in 0.001s) [server] INFO: Device: [samsung] samsung SM-A035M (Android 13) INFO: Renderer: direct3d INFO: Texture: 720x1600 ERROR: Could not open audio device: DirectSoundCreate8: No audio device found (0x88780078) ERROR: Demuxer error WARN: Killing the server...

(no open and continue directly to error)

leo3487 avatar Aug 01 '23 12:08 leo3487

As error say, it try to find audio device, but as I said at my first post, it is not installed at this pc and seem disabled at bios There is a way yo start scrcpy without audio?

leo3487 avatar Aug 01 '23 12:08 leo3487

There is a way yo start scrcpy without audio?

Of course: scrcpy --no-audio.

https://github.com/Genymobile/scrcpy/blob/master/doc/audio.md#no-audio

rom1v avatar Aug 01 '23 12:08 rom1v

Ok. As I suposed, this was the problem scrcpy tried to find audio but this pc has no audio

Starting without audio now work ok For next version would be nice of scrcpy automatically detect if no audio device so take correct action to no fail

leo3487 avatar Aug 01 '23 12:08 leo3487

For next version would be nice of scrcpy automatically detect if no audio device so take correct action to no fail

There is a mechanism to disable audio if it could not be captured on the device (for all devices < Android 11 or with Android 11 when the screen is locked on start). But if audio playback fails on the computer, this is a fatal error (otherwise, audio would be captured and sent by the device, but the client would ignore it because it could not play audio). In that case, it must be disabled explicitly.

rom1v avatar Aug 01 '23 12:08 rom1v

fix解决

我使用的是一加手机和win7系统,我解决了这个问题。如果你们遇到类似的问题,你可以试试我的方法。 我使用最新版本:scrcpy-win64-v2.2

I'm using a OnePlus phone and Windows 7, and I fixed the problem. If you have similar problems, you can try my method. I'm using the latest version :scrcpy-win64-v2.2

start cmd启动命令如下:

scrcpy.exe --render-driver=software --no-audio

log日志:

D:\软件\scrcpy-win64-v2.2\scrcpy-win64-v2.2>scrcpy.exe --render-driver=software --no-audio --turn-screen-off scrcpy v2.2 https://github.com/Genymobile/scrcpy INFO: ADB device found: INFO: --> (usb) 3c6b7196 device PJA110 D:\软件\scrcpy-win64-v2.2\scrcpy-win...ped. 77.1 MB/s (64363 bytes in 0.001s) [server] INFO: Device: [OnePlus] OnePlus PJA110 (Android 13) INFO: Renderer: software INFO: Texture: 1240x2768 [server] INFO: Device screen turned off

SeasonChan avatar Nov 13 '23 02:11 SeasonChan

My computer does not have speakers. When I plug in 3.5mm headphones, the program no longer crashes. I suspect that the code is not compatible with this situation and directly throws an error, causing the program to interrupt. I hope it can be changed to a warning to be compatible with this situation. @rom1v

sky-gg avatar Dec 27 '23 03:12 sky-gg

Is it possible to not make this error fatal, such that we can continue to use the scrcpy even if audio hardware is disabled in windows?

nickoe avatar Apr 18 '24 08:04 nickoe

Not automatically: https://github.com/Genymobile/scrcpy/issues/4800#issuecomment-2028754860 You must pass --no-audio-playback explicitly.

rom1v avatar Apr 18 '24 09:04 rom1v