ERROR: Could not open audio device: WASAPI can't initialize audio client: CoInitialize has not been called on Windows 7
Environment
- OS: Windows 7 x86/x64
- scrcpy version: 2.0
- installation method: Windows release
- device model: Model independent error.
- Android version: 12
After starting scrcpy-console on Windows 7 x86 or Windows 7 x64 the following error is written to console and the client is closed: ERROR: Could not open audio device: WASAPI can't initialize audio client: CoInitialize has not been called. ERROR: Demuxer error WARN: Killing the server...
It seems to be an SDL2 error. The workaround to use other SDL2 audio driver like winmm or directsound does not work with srccpy since regardless of the buffer size you only get static/garbled audio. The solution could be to add CoInitialize() call to the client.
The workaround to use other SDL2 audio driver like winmm or directsound does not work with srccpy since regardless of the buffer size you only get static/garbled audio.
Even with the new option --audio-output-buffer=10 on the dev branch (not to be confused with --audio-buffer=)?
See https://github.com/Genymobile/scrcpy/issues/3793#issuecomment-1465713098
The workaround to use other SDL2 audio driver like winmm or directsound does not work with srccpy since regardless of the buffer size you only get static/garbled audio.
Even with the new option
--audio-output-buffer=10on the dev branch (not to be confused with--audio-buffer=)?See #3793 (comment)
Can you provide an x86 Windows binary so I can test it? I cannot test the x64 Windows version on Windows 7 at the moment.
Here is a x86 build for the current dev branch:
scrcpy-win32-v2.0-18-gd7841664f.zipSHA-256: 5cc35108118c94aa43e39c689dfa7701067c37e2b23662d83eb06ca1e60a8c45
Thanks, with this new version of scrcpy.exe the following workaround produces good quality audio (scrcpy-console.bat):
@echo off set SDL_AUDIODRIVER=directsound scrcpy.exe --audio-output-buffer=10
Are there any solutions for this "could not open audio device: WASAPI can't initialized audio client " Error ?
See https://github.com/Genymobile/scrcpy/issues/3856#issuecomment-1482911664
ERROR: Could not open audio device: WASAPI can't initialize audio client: CoInitialize has not been called.
So it's presumably fixed in SDL 2.28 (see https://github.com/libsdl-org/SDL/issues/7478).
SDL 2.28 RC1 has just been released, so let's try (branch sdl_2_27_1).
Please test this version and confirm that the WASAPI issue is fixed (or not):
scrcpy-win64-sdl228rc1.zipSHA-256: 0f73993c66e46b8956e2dd155e7497f880ee51976c04b11a6db8802c4c4aec55
Hi, I have tested the new binary and SDL version on Windows 7 x64. There are no more error messages and the audio works perfectly (presumably with WASAPI since I used scrcpy-console.bat from the new zip without any modifications).
Awesome, thank you for your test :+1:
not working on my andriod 13 iqoo z6
@vashviS What is the full output in the console when you run scrcpy?
@Falcosoft I didn't ask, but does it still work for you in the final scrcpy v2.1?
@vashviS What is the full output in the console when you run scrcpy?
scrcpy 2.0 https://github.com/Genymobile/scrcpy C:\Users\vashvi\Downloads\scrcpy-win64-v2.0-92-g7a41cb3e9... file pushed, 0 skipped. 48.7 MB/s (57927 bytes in 0.001s) [server] INFO: Device: vivo I2127 (Android 13) INFO: Renderer: direct3d INFO: Texture: 1080x2408 [server] INFO: newMaxSize = 1920 [server] INFO: Retrying with -m1920... [server] INFO: Retrying... [server] ERROR: Encoding error: java.lang.IllegalArgumentException: null INFO: Texture: 864x1920 INFO: Texture: 1920x864 ERROR: Could not open audio device: WASAPI can't find requested audio endpoint: Element not found. ERROR: Demuxer error WARN: Killing the server... Press any key to continue . . .
os windows 10 64bit
ERROR: Could not open audio device: WASAPI can't initialize audio client: CoInitialize has not been called.
So it's presumably fixed in SDL 2.28 (see libsdl-org/SDL#7478). SDL 2.28 RC1 has just been released, so let's try (branch
sdl_2_27_1).Please test this version and confirm that the WASAPI issue is fixed (or not):
scrcpy-win64-sdl228rc1.zipSHA-256: 0f73993c66e46b8956e2dd155e7497f880ee51976c04b11a6db8802c4c4aec55
did not worked just crashes after 10 sec
did not worked just crashes after 10 sec
Oh, so initially it worked, but then it failed?
Could you please try with audio only (and on scrcpy v2.1 please):
scrcpy --no-video
sure
@vashviS Btw, given the stack trace, it is a different issue as this one. You shoud open a new issue.
@Falcosoft I didn't ask, but does it still work for you in the final scrcpy v2.1?
Yes, it is also working in the final v2.1.