Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
SvlarSvlar opened this issue Mar 29, 2023 · 26 comments
Open
2 tasks done

Comments

@SvlarSvlar
Copy link

SvlarSvlar commented Mar 29, 2023

  • I have read the FAQ.
  • 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`
@rom1v
Copy link
Collaborator

rom1v commented Mar 29, 2023

#3856 (comment)

@SvlarSvlar
Copy link
Author

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.

@rom1v
Copy link
Collaborator

rom1v commented Mar 29, 2023

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)

@SvlarSvlar
Copy link
Author

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 SvlarSvlar reopened this Mar 29, 2023
@rom1v
Copy link
Collaborator

rom1v commented Mar 29, 2023

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).

@moe7863
Copy link

moe7863 commented Apr 13, 2023

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

@rom1v
Copy link
Collaborator

rom1v commented Apr 13, 2023

Then read #3856 (comment)

@moe7863
Copy link

moe7863 commented Apr 13, 2023

Then read #3856 (comment)

Sorted. Thank you :)

@leo3487
Copy link

leo3487 commented Aug 1, 2023

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

@rom1v
Copy link
Collaborator

rom1v commented Aug 1, 2023

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)

@leo3487
Copy link

leo3487 commented Aug 1, 2023

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

@rom1v
Copy link
Collaborator

rom1v commented Aug 1, 2023

Does it work if you use directsound instead of wasapi? #3856 (comment)

@leo3487
Copy link

leo3487 commented Aug 1, 2023

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

@rom1v
Copy link
Collaborator

rom1v commented Aug 1, 2023

starting scrcpy from CMD close within less than 1 sec

What is the console output?

@leo3487
Copy link

leo3487 commented Aug 1, 2023

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
Copy link

leo3487 commented Aug 1, 2023

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

@rom1v
Copy link
Collaborator

rom1v commented Aug 1, 2023

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

@leo3487
Copy link

leo3487 commented Aug 1, 2023

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
Copy link

leo3487 commented Aug 1, 2023

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?

@rom1v
Copy link
Collaborator

rom1v commented Aug 1, 2023

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

@leo3487
Copy link

leo3487 commented Aug 1, 2023

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

@rom1v
Copy link
Collaborator

rom1v commented Aug 1, 2023

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.

@SeasonChan
Copy link

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

@sky-gg
Copy link

sky-gg commented Dec 27, 2023

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

@nickoe
Copy link

nickoe commented Apr 18, 2024

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?

@rom1v
Copy link
Collaborator

rom1v commented Apr 18, 2024

Not automatically: #4800 (comment)
You must pass --no-audio-playback explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants