GZDoom - NoSound with DAC?

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
Azagthoth
Posts: 63
Joined: Wed Jan 20, 2021 4:06 pm

GZDoom - NoSound with DAC?

Post by Azagthoth »

Hello. This is a problem I've had with all versions of GZDoom that I've tried. I can't get sound to work with my UMC404HD. I don't have any issues with the DAC itself. It works with all other programs including Zandronum. What could be the reason for this error and how can I fix it? Thanks!

Code: Select all

GZDoom version: g4.8.0
Os: Windows 10 (NT 10.0) Build 19044

S_Init: Setting up sound.
I_InitSound: Initializing OpenAL
  Opened device OpenAL Soft on Speakers (3- UMC404HD 192k)
  Failed to setup context: Invalid Device
Sound init failed. Using nosound.
Edit:
I tried running it again from the command prompt with:

Code: Select all

set ALSOFT_LOGLEVEL=3
set ALSOFT_LOGFILE=openal-log.txt
Could it be an issue with having 4 channels instead of just 2? Or maybe AvgBytesPerSec or BlockAlign? Any ideas?

Code: Select all

[ALSOFT] (II) Initializing library v1.22.0-c1c63a27 master
[ALSOFT] (II) Supported backends: wasapi, dsound, winmm, null, wave
[ALSOFT] (II) Loading config C:\Users\***\AppData\Roaming\alsoft.ini...
[ALSOFT] (II) Got binary: D:\Games\Doom\GZDoom, gzdoom.exe
[ALSOFT] (II) Loading config D:\Games\Doom\GZDoom\alsoft.ini...
[ALSOFT] (II) Key disable-cpu-exts not found
[ALSOFT] (II) Vendor ID: "AuthenticAMD"
[ALSOFT] (II) Name: "AMD Ryzen 5 5600X 6-Core Processor"
[ALSOFT] (II) Extensions: +SSE +SSE2 +SSE3 +SSE4.1
[ALSOFT] (II) Key rt-prio not found
[ALSOFT] (II) Key rt-time-limit not found
[ALSOFT] (II) Key game_compat/reverse-x not found
[ALSOFT] (II) Key game_compat/reverse-y not found
[ALSOFT] (II) Key game_compat/reverse-z not found
[ALSOFT] (II) Key resampler not found
[ALSOFT] (II) Key trap-al-error not found
[ALSOFT] (II) Key trap-alc-error not found
[ALSOFT] (II) Key reverb/boost not found
[ALSOFT] (II) Key drivers not found
[ALSOFT] (II) Starting message thread
[ALSOFT] (II) Message thread initialization complete
[ALSOFT] (II) Starting message loop
[ALSOFT] (II) Initialized backend "wasapi"
[ALSOFT] (II) Added "wasapi" for playback
[ALSOFT] (II) Added "wasapi" for capture
[ALSOFT] (II) Key excludefx not found
[ALSOFT] (II) Key default-reverb not found
[ALSOFT] (II) Key eax/enable not found
[ALSOFT] (II) Got message "Open Device" (0x0000, this=000001e8960e6ce0, param=0000000000000000)
[ALSOFT] (II) Key frequency not found
[ALSOFT] (II) Key sources not found
[ALSOFT] (II) Key slots not found
[ALSOFT] (II) Key sends not found
[ALSOFT] (II) Created device 000001e8960e8850, "OpenAL Soft on Speakers (3- UMC404HD 192k)"
[ALSOFT] (II) ALC_MONO_SOURCES = 127
[ALSOFT] (II) ALC_STEREO_SOURCES = 1
[ALSOFT] (II) ALC_HRTF_SOFT = 2
[ALSOFT] (II) Key sources not found
[ALSOFT] (II) Key sends not found
[ALSOFT] (II) Key frequency not found
[ALSOFT] (II) Key sample-type not found
[ALSOFT] (II) Key channels not found
[ALSOFT] (II) Key ambi-format not found
[ALSOFT] (II) Key period_size not found
[ALSOFT] (II) Key periods not found
[ALSOFT] (II) Key hrtf not found
[ALSOFT] (II) Pre-reset: Stereo, Float32, 44100hz, 882 / 2646 buffer
[ALSOFT] (II) Got message "Reset Device" (0x0002, this=000001e8960e6ce0, param=0000000000000000)
[ALSOFT] (EE) Unhandled channel config: 4 -- 0x00000000
[ALSOFT] (II) Requesting playback format:
    FormatTag      = 0xfffe
    Channels       = 2
    SamplesPerSec  = 44100
    AvgBytesPerSec = 352800
    BlockAlign     = 8
    BitsPerSample  = 32
    Size           = 22
    Samples        = 32
    ChannelMask    = 0x3
    SubFormat      = {00000003-0000-0010-8000-00aa00389b71}
[ALSOFT] (II) Got playback format:
    FormatTag      = 0xfffe
    Channels       = 4
    SamplesPerSec  = 44100
    AvgBytesPerSec = 705600
    BlockAlign     = 16
    BitsPerSample  = 32
    Size           = 22
    Samples        = 32
    ChannelMask    = 0x0
    SubFormat      = {00000003-0000-0010-8000-00aa00389b71}
[ALSOFT] (EE) Unhandled extensible channels: 4 -- 0x00000000
[ALSOFT] (EE) Failed to initialize audio client: 0x80070057
[ALSOFT] (EE) Device error: 0x80070057
[ALSOFT] (WW) Error generated on device 000001e8960e8850, code 0xa001
[ALSOFT] (II) Freeing device 000001e8960e8850
[ALSOFT] (II) Got message "Close Device" (0x0005, this=000001e8960e6ce0, param=0000000000000000)
[ALSOFT] (II) Got message "Enumerate Playback" (0x0006, this=0000000000000000, param=0000000000000000)
[ALSOFT] (II) Got device "Speakers (3- UMC404HD 192k)", "{02234C1C-0F1C-4143-8136-D7453F4838DB}", "{0.0.0.00000000}.{02234c1c-0f1c-4143-8136-d7453f4838db}"
[ALSOFT] (II) Got device "ASUS VE276 (NVIDIA High Definition Audio)", "{EBEBF049-79C5-4961-9930-6A2614F76D16}", "{0.0.0.00000000}.{ebebf049-79c5-4961-9930-6a2614f76d16}"
Edit2:
I figured it out. I needed to add an alsoft.ini file with "drivers = winmm" to my GZDoom folder. Winmm was the only backend that worked. A little bit convoluted way of handling things, I must say. Why not have this option in-game instead? Or better yet, have it automatically pick the first one that works.
User avatar
Chris
Posts: 2897
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: GZDoom - NoSound with DAC?

Post by Chris »

For some reason the device is reporting 4 channels, but doesn't specify what those channels are (a channel mask of 0), so there's no indication of how to feed them. And unlike 1 or 2 channels that can typically be assumed to be mono or stereo for consumer systems, there are multiple configurations that 4 channel can be: quadraphonic (front-left, front-right, back-left, back-right), 3-1 (front-left, front-right, front-center, rear-center), and 3.1 (front-left, front-right, front-center, LFE), being common-ish.

If you can't configure the device to report a proper channel configuration, then I'll have to modify OpenAL to handle 'raw' channels with unspecified channel positions, which it then has to be conservative about (i.e. up to 2-channel stereo only and leaving extra channels silent, if not explicitly configured otherwise).

Edit:
Azagthoth wrote:I figured it out. I needed to add an alsoft.ini file with "drivers = winmm" to my GZDoom folder. Winmm was the only backend that worked. A little bit convoluted way of handling things, I must say. Why not have this option in-game instead? Or better yet, have it automatically pick the first one that works.
The problem is specific to the device, it doesn't know there will be a problem until it tries to open that particular device, at which point it's already selected the backend to use. The WinMM backend is particularly limited (only mono or stereo output, no headphone detection, higher latency, truncated device names), and should only be used as a last-ditch effort if neither WASAPI or DSound are working.
Azagthoth
Posts: 63
Joined: Wed Jan 20, 2021 4:06 pm

Re: GZDoom - NoSound with DAC?

Post by Azagthoth »

Chris wrote:For some reason the device is reporting 4 channels, but doesn't specify what those channels are
That doesn't surprise me. This is Behringer we're talking about. :)
Chris wrote:If you can't configure the device to report a proper channel configuration, then I'll have to modify OpenAL to handle 'raw' channels with unspecified channel positions, which it then has to be conservative about (i.e. up to 2-channel stereo only and leaving extra channels silent, if not explicitly configured otherwise).
Yeah, that could work. I believe the other 2 output channels are for the headphone jack but I'm not sure.
Chris wrote:The WinMM backend is particularly limited (only mono or stereo output, no headphone detection, higher latency, truncated device names), and should only be used as a last-ditch effort if neither WASAPI or DSound are working.
I see. I didn't notice a particularly high latency with WinMM but ill take your word for it. Anyway, I think I can live with this solution for the time being.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48514
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GZDoom - NoSound with DAC?

Post by Graf Zahl »

@Chris: You really should consider adding an option in OpenAL that allows an application to set a lower speaker configuration than what the hardware reports.
Do you remember my problems a few months back? Currently it is impossible without the OpenAL config app to change the speaker configuration from the maximum the sound hardware reports, and I doubt that all users with a 5.1 capable chipset actually have 5.1 speakers attached to it. Most computers I know run on cheap stereo speakers. and would get corrupted sound as result - and there's no way in GZDoom to change this. :(
User avatar
Chris
Posts: 2897
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: GZDoom - NoSound with DAC?

Post by Chris »

Graf Zahl wrote:@Chris: You really should consider adding an option in OpenAL that allows an application to set a lower speaker configuration than what the hardware reports.
There is now: https://openal-soft.org/openal-extensio ... t_mode.txt (added in 1.22.0)
When calling alcCreateContext, you can include something like ALC_OUTPUT_MODE_SOFT, ALC_STEREO_BASIC_SOFT in the attribute list to request plain stereo output. Then afterward you can query

Code: Select all

ALCint mode;
alcGetIntegerv(Device, ALC_OUTPUT_MODE_SOFT, 1, &mode);
to check what's set, in case the system doesn't support the requested mode or something's preventing it from being used. I'm not sure how to best properly set up a menu option for this though, since the menu doesn't seem capable of providing feedback (e.g. the user sets 7.1, but the system doesn't accept it and falls back to 5.1, how would the menu convey the device isn't using 7.1 as set and is using 5.1 instead?). I'm also not sure how to handle the menu's text strings these days, since they seem to be in a separate file that's edited outside of the repository. I was going to ask about that, because I've been working adding some features for audio playback.

It won't help in this case, though, because the system is reporting a configuration that OpenAL doesn't know what to do with (it's just saying there's 4 channels, without indicating what those channels are, and I didn't know that was a thing WASAPI could/would do). Even if GZDoom did have an option to set an output mode, it would fail because WASAPI wouldn't accept the requested mode, and OpenAL wouldn't know how to interpret what the device is set to. I do have a fix for this that I just pushed to OpenAL Soft's Git repo, so it will now be able to set stereo or mono output automatically (and a requested mode will work as long as there's enough channels; the user is responsible for requesting an appropriate mode for their device and having the speakers connected properly, since OpenAL can't verify what speakers are used by what channels). I do plan to have a 1.22.1 release very soon, I'm just hoping to hear back about a couple other issues being fixed.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48514
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GZDoom - NoSound with DAC?

Post by Graf Zahl »

Nice. I'll add an option when I find some time to work on GZDoom again.

Return to “Technical Issues”