#14670 closed defect (worksforme)

AUDIO: SDL: Can't initialize audio client. Crash upon running game.

Reported by: CerealMastery Owned by: sev-
Priority: high Component: Audio
Version: Keywords:
Cc: Game:

Description

This issue seems to only be affecting me, but I can't run games on any release of scummvm beyond 2.0.0 (have tried 2.6.0 ; 2.7.1. and latest 2.8.0. build).
Every time I run the program, the status window displays the message "WARNING: Could not open audio device: WASAPI can't initialize audio client: �Ʈ!". I can then use the main menu, but upon running a game the program immediately crashes. The log message is as follows:

[2023-10-18 19:54:31] ScummVM 2.6.0 (Jul 17 2022 00:04:49)
[2023-10-18 19:54:31] Vorbis FLAC MP3 RGB zLib MPEG2 FluidSynth Theora AAC A/52 FreeType2 FriBiDi JPEG PNG GIF taskbar TTS cloud (servers, local) TinyGL OpenGL (with shaders)
[2023-10-18 19:54:31] --- Log opened.
[2023-10-18 19:54:32] WARNING: Could not open audio device: WASAPI can't initialize audio client: ǰ�!
[2023-10-18 19:54:49] WARNING: Sound initialization failed. This may cause severe problems in some games!
[2023-10-18 19:54:49] WARNING: Sound mixer initialization failed!
[2023-10-18 19:54:49] WARNING: MIDI driver depends on sound mixer, switching to null MIDI driver!

The results are identical on any release. I have tried to tinkker with it myself, but don't really have the know-how to fix it.

Change History (8)

comment:1 by Arjak89, 13 months ago

I have also suddenly started having this problem. None of my games work as a result. I tried uninstalling and reinstalling ScummVM, uninstalling recent Windows 10 updates, editing my registry according to tips online, but nothing works.

comment:2 by tag2015, 13 months ago

Priority: normalhigh

Other users reported this issue, could you provide more information such as hardware specs and if you are using particular setups (controllers, bluetooth headphones/speakers, adapters... etc)

comment:3 by CerealMastery, 13 months ago

My machine is just a lenovo laptop (ideapad320s-14ikb) with an integrated gpu, intel core i3 and 16 gb ram, running Windows 10 version 22H2. I'm generally using a bluetooth headset, but I also tried using the speakers with the same result.

I should also mention that I did once manage to get a game running by installing a new version of scummvm in a different folder and starting the program from the end of the installation. After closing and starting it gain the same issues resumed though and I havent been able to replicate that again.

comment:4 by Thpwg, 13 months ago

This method has worked for me, so you should try it on your device:
https://stackoverflow.com/questions/46835811/ffplay-wasapi-cant-initialize-audio-client-ffmpeg-3-4-binaries/57036216#57036216

To solve the problem, it is better to set the "SDL_AUDIODRIVER" in user environment variables:
1.Press "Win+R" to open Run. Type "System Properties Advanced" and press OK button.
2.Press the "Environment Variables..." button.
3.In User variables section, press the "New..." button.
4.In front of "Variable name" type "SDL_AUDIODRIVER". In front of "Variable value" type "directsound" or "winmm".
6.Press OK buttons recursively.
7.Reopen the terminal and run ffplay.
8.Restarting ScummVM.

Last edited 13 months ago by Thpwg (previous) (diff)

comment:5 by Oromar99, 13 months ago

The solution setting the SDL_AUDIODRIVER variable worked. But it causes other effects. For example, the execution of other games under Dosbox (i.e.Darkseed), the sound stopped working after that set.

I have the same issue. My PC is running a Windows 10, no headphones...The only particularity is that I have the Oculus Audio Device installed, but not selected.

comment:6 by fusefib, 13 months ago

I advised in a forum thread to

  • remove the global variable from System Properties and;
  • just duplicate your ScummVM shortcut and, clicking Properties, change the Target to something like this, which should limit the scope of the set environmental variable to one session:
C:\Windows\System32\cmd.exe /c "SET SDL_AUDIODRIVER=directsound&& START /D ^"C:\Program Files\ScummVM\^" scummvm.exe --no-console"

Use the new shortcut as a workaround. Even if this works, consider checking a few things to identify the potential interference. Describe the in-use sound device and set-up better. Also, try running ScummVM normally with minimal background processes and see if that changes anything.

comment:7 by tag2015, 13 months ago

Summary: Can't initialize audio client. Crash upon running game.AUDIO: SDL: Can't initialize audio client. Crash upon running game.

comment:8 by sev-, 12 months ago

Owner: set to sev-
Resolution: worksforme
Status: newclosed

This is an SDL issue, we can offer only a workaround as outlined above. No code changes required at the ScummVM side, so closing this.

Note: See TracTickets for help on using tickets.