Sound is delayed by a few seconds

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.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Sound is delayed by a few seconds

Re: Sound is delayed by a few seconds

by Mynameislol » Wed Jun 13, 2018 3:42 pm

Thank you! It solved everything. I've also learned a few things, thanks!

Re: Sound is delayed by a few seconds

by Chris » Wed Jun 13, 2018 1:53 pm

Mynameislol wrote:Strange, i havn't changed the perioid size at all, i don't even know how to change that, and i'm pretty sure i've disabled ambisonics output, as there's no option for it.
If you haven't specifically created/edited alsoft.ini, nor run alsoft-config.exe before, then something else probably tried to make it for you. However, you can just delete C:\Users\Mynameislol\AppData\Roaming\alsoft.ini to set everything back to defaults. Or alternatively, edit it (it's a plain text file) and remove everything besides the resampler and stereo-encoding options if you wish (the sample-type, channels, and frequency settings are detected from the system, there's no need to explicitly set them).
I don't have any use for HRTF as i'm using speakers, and i both produce music and master it, the 192khz is only to raise the noise floor.
The sample rate just controls the maximum representable frequency (half the sampling rate, as per the sampling theorem), it's the bit depth controls the noise floor (which is 32-bit float internally for the mix). In fact, using a 192khz sample rate for playback can actually create noise if you're not using high quality specialized equipment -- a DAC that can properly reconstruct analog signals from 192khz audio (if the DAC is internally just doing 44 or 48khz sample rates, the 192khz stream is being resampled down which is just going to create noise from lossy filters), and speakers that handle super high frequencies (speaker drivers have a limited response range and generate noise if trying to play outside that range, so the signal needs to be divided into specific frequency ranges that are fed to specific drivers to deal with each range). The standard high-definition sample rates are 44.1khz and 48khz, which cover the human hearing maximum frequency of 20khz and has a little wiggle room for reconstruction filters, so most hardware doesn't bother with components for the super-high frequencies you can't hear, let alone have quality parts for them.
So, the solution seems to be changing the period size?
The period size and period count. Along with the sample-type, channels, and frequency settings, you should just leave them at the defaults since OpenAL Soft will detect the settings from the system automatically and use reasonable defaults elsewhere, making sure they all stay correct relative to each other (e.g. the period size or count may be increased if the sample rate got increased, to ensure the intended timing/latency remain roughly consistent).

Re: Sound is delayed by a few seconds

by Mynameislol » Wed Jun 13, 2018 12:59 pm

Strange, i havn't changed the perioid size at all, i don't even know how to change that, and i'm pretty sure i've disabled ambisonics output, as there's no option for it.

I don't have any use for HRTF as i'm using speakers, and i both produce music and master it, the 192khz is only to raise the noise floor. CPU usage isn't a problem, i havn't had any issues with that.

So, the solution seems to be changing the period size?

Re: Sound is delayed by a few seconds

by Chris » Wed Jun 13, 2018 11:10 am

Mynameislol wrote:Got it!

Code: Select all

AL lib: (II) alc_initconfig: Supported backends: mmdevapi, dsound, winmm, null, wave
AL lib: (II) ReadALConfig: Loading config C:\Users\Mynameislol\AppData\Roaming\alsoft.ini...
AL lib: (II) LoadConfigFromFile: found 'sample-type' = 'float32'
AL lib: (II) LoadConfigFromFile: found 'channels' = 'ambi3'
AL lib: (II) LoadConfigFromFile: found 'frequency' = '48000'
AL lib: (II) LoadConfigFromFile: found 'period_size' = '8192'
AL lib: (II) LoadConfigFromFile: found 'periods' = '16'
AL lib: (II) LoadConfigFromFile: found 'resampler' = 'bsinc'
AL lib: (II) LoadConfigFromFile: found 'stereo-mode' = 'speakers'
AL lib: (II) LoadConfigFromFile: found 'stereo-encoding' = 'uhj'
AL lib: (II) LoadConfigFromFile: found 'ambi-format' = 'acn+sn3d'
AL lib: (II) LoadConfigFromFile: found 'decoder/hq-mode' = 'true'
This seems to be the problem. Any reason you've configured OpenAL Soft like this?

In particular, you're setting a sample rate of 48khz with a period size of 8192 and 16 periods. That means each period lasts for about 186 milliseconds, with 16 periods (for a total of 2.97 seconds). Something else of note is that you set the channel configuration to third-order ambisonics output. I'd be very surprised if that's how your device is configured, and I don't think any of the Windows backends will even support it anyway. I'd strongly suggest leaving the options at their default unless you know for sure what the option is doing and why you need it that way.

Also, your device seems to be configured for 192khz playback in Windows. Unless you're doing pre-mastering audio production work, this is serious overkill. And even if you are, it may be better to reconfigure the device to 48khz while playing games and the like. Such a high sample rate is putting a bigger strain on the CPU since it has to process 4x as many samples, and it prevents things like HRTF from working since the included datasets only support 44.1 and 48khz (and even if you made a 192khz dataset, the main mixing loop will see a 16x CPU increase to retain the same quality).

Re: Sound is delayed by a few seconds

by Mynameislol » Wed Jun 13, 2018 8:57 am

Got it!

Code: Select all

AL lib: (II) alc_initconfig: Supported backends: mmdevapi, dsound, winmm, null, wave
AL lib: (II) ReadALConfig: Loading config C:\Users\Mynameislol\AppData\Roaming\alsoft.ini...
AL lib: (II) LoadConfigFromFile: found 'sample-type' = 'float32'
AL lib: (II) LoadConfigFromFile: found 'channels' = 'ambi3'
AL lib: (II) LoadConfigFromFile: found 'frequency' = '48000'
AL lib: (II) LoadConfigFromFile: found 'period_size' = '8192'
AL lib: (II) LoadConfigFromFile: found 'periods' = '16'
AL lib: (II) LoadConfigFromFile: found 'resampler' = 'bsinc'
AL lib: (II) LoadConfigFromFile: found 'stereo-mode' = 'speakers'
AL lib: (II) LoadConfigFromFile: found 'stereo-encoding' = 'uhj'
AL lib: (II) LoadConfigFromFile: found 'ambi-format' = 'acn+sn3d'
AL lib: (II) LoadConfigFromFile: found 'decoder/hq-mode' = 'true'
AL lib: (II) GetConfigValue: Key disable-cpu-exts not found
AL lib: (II) FillCPUCaps: Detected max CPUID function: 0x16 (ext. 0x80000008)
AL lib: (II) FillCPUCaps: Vendor ID: ""
AL lib: (II) FillCPUCaps: Name: "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz"
AL lib: (II) FillCPUCaps: Extensions: +SSE +SSE2 +SSE3 +SSE4.1
AL lib: (II) GetConfigValue: Key rt-prio not found
AL lib: (II) GetConfigValue: Found resampler = "bsinc"
AL lib: (II) GetConfigValue: Key trap-al-error not found
AL lib: (II) GetConfigValue: Key trap-alc-error not found
AL lib: (II) GetConfigValue: Key reverb/boost not found
AL lib: (II) GetConfigValue: Key reverb/emulate-eax not found
AL lib: (II) GetConfigValue: Key drivers not found
AL lib: (II) ALCmmdevProxy_messageHandler: Starting message thread
AL lib: (II) ALCmmdevProxy_messageHandler: Message thread initialization complete
AL lib: (II) ALCmmdevProxy_messageHandler: Starting message loop
AL lib: (II) alc_initconfig: Initialized backend "mmdevapi"
AL lib: (II) alc_initconfig: Added "mmdevapi" for playback
AL lib: (II) alc_initconfig: Initialized backend "dsound"
AL lib: (II) alc_initconfig: Added "dsound" for capture
AL lib: (II) GetConfigValue: Key excludefx not found
AL lib: (II) GetConfigValue: Key default-reverb not found
AL lib: (II) GetConfigValue: Found channels = "ambi3"
AL lib: (EE) alcOpenDevice: Unsupported channels: ambi3
AL lib: (II) GetConfigValue: Found sample-type = "float32"
AL lib: (II) GetConfigValue: Found frequency = "48000"
AL lib: (II) GetConfigValue: Found periods = "16"
AL lib: (II) GetConfigValue: Found period_size = "8192"
AL lib: (II) GetConfigValue: Key sources not found
AL lib: (II) GetConfigValue: Key slots not found
AL lib: (II) GetConfigValue: Key sends not found
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1024 (lparam=0000012F3D5883E8, wparam=0000001F19EFF030)
AL lib: (II) alcOpenDevice: Created device 0000012F3D58F9D0, "OpenAL Soft on Högtalare (S16 USB DAC)"
AL lib: (II) GetConfigValue: Found frequency = "48000"
AL lib: (II) GetConfigValue: Key sends not found
AL lib: (II) GetConfigValue: Key hrtf not found
AL lib: (II) UpdateDeviceParams: Pre-reset: Stereo, *Float, *48000hz, 8192 update size x16
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1025 (lparam=0000012F3D5883E8, wparam=0000001F19EFEF90)
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 192000hz instead
AL lib: (II) UpdateDeviceParams: Post-reset: Stereo, Float, 192000hz, 7680 update size x68
AL lib: (II) GetConfigValue: Found stereo-mode = "speakers"
AL lib: (II) GetConfigValue: Key hrtf-mode not found
AL lib: (II) UpdateDeviceParams: HRTF disabled
AL lib: (II) GetConfigValue: Key cf_level not found
AL lib: (II) UpdateDeviceParams: BS2B disabled
AL lib: (II) GetConfigValue: Key layouts/stereo/type not found
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1026 (lparam=0000012F3D5883E8, wparam=0000001F19EFEF90)
AL lib: (II) alcCreateContext: Created context 0000012F3D588C60
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1029 (lparam=0000000000000000, wparam=0000001F19EFF120)
AL lib: (II) add_device: Got device "OpenAL Soft on Högtalare (S16 USB DAC)", "{0.0.0.00000000}.{da0c8ab2-e093-4947-a5ac-6741edc49169}"
AL lib: (II) add_device: Got device "OpenAL Soft on Hörlurar (Xbox Controller)", "{0.0.0.00000000}.{3744b5bf-eb53-48f7-8f90-339e004f342b}"
AL lib: (II) AllocLines: New reverb buffer length: 509440 samples (2.653333 sec)
AL lib: (II) FreeContext: 0000012F3D588C60
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1027 (lparam=0000012F3D5883E8, wparam=0000001F19EFD850)
AL lib: (II) FreeDevice: 0000012F3D58F9D0
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1028 (lparam=0000012F3D5883E8, wparam=0000001F19EFD7F0)

Re: Sound is delayed by a few seconds

by Gez » Mon Jun 11, 2018 5:46 pm

Mynameislol wrote:
Chris wrote:What settings and format are set for the device?

It would be helpful also if you can get a full log from OpenAL. If you're able to, try setting the environment variable ALSOFT_LOGLEVEL to 3 and ALSOFT_LOGFILE to a full path+filename (make sure it's a location you have write access to). After running and exiting GZDoom, there should be a log where you specified which contains useful information. Make sure to clear/delete those environment variables afterward, so it doesn't keep writing a logfile unnecessarily.
I don't think i'm supposed to try those commands in GZDoom, but i did anyway, and it said unknown command.

No idea what to do otherwise
Environment variables are in your OS, not in GZDoom. Here's a link and a video for Windows 10:

https://superuser.com/questions/949560/ ... windows-10
Spoiler:

Re: Sound is delayed by a few seconds

by Graf Zahl » Mon Jun 11, 2018 3:16 pm

How? I never experienced such a problem.

Re: Sound is delayed by a few seconds

by Mynameislol » Mon Jun 11, 2018 2:33 pm

So, still no ideas?

Re: Sound is delayed by a few seconds

by Mynameislol » Wed May 16, 2018 1:59 am

Chris wrote:What settings and format are set for the device?

It would be helpful also if you can get a full log from OpenAL. If you're able to, try setting the environment variable ALSOFT_LOGLEVEL to 3 and ALSOFT_LOGFILE to a full path+filename (make sure it's a location you have write access to). After running and exiting GZDoom, there should be a log where you specified which contains useful information. Make sure to clear/delete those environment variables afterward, so it doesn't keep writing a logfile unnecessarily.
I don't think i'm supposed to try those commands in GZDoom, but i did anyway, and it said unknown command.

No idea what to do otherwise

Re: Sound is delayed by a few seconds

by Chris » Tue May 15, 2018 5:50 pm

What settings and format are set for the device?

It would be helpful also if you can get a full log from OpenAL. If you're able to, try setting the environment variable ALSOFT_LOGLEVEL to 3 and ALSOFT_LOGFILE to a full path+filename (make sure it's a location you have write access to). After running and exiting GZDoom, there should be a log where you specified which contains useful information. Make sure to clear/delete those environment variables afterward, so it doesn't keep writing a logfile unnecessarily.

Re: Sound is delayed by a few seconds

by Mynameislol » Tue May 15, 2018 7:01 am

Chris wrote:Are there any device settings for low-latency playback? What settings and format are set for the device?
There are no such settings. It's always at low latency mode.

I have the same issue even with other sound cards on my computer

Re: Sound is delayed by a few seconds

by Chris » Mon May 14, 2018 4:04 pm

Are there any device settings for low-latency playback? What settings and format are set for the device?

Re: Sound is delayed by a few seconds

by Mynameislol » Mon May 14, 2018 10:42 am

_mental_ wrote:Is it Aune S16? I don’t think someone who can check has this $500+ device.
Yes, actually!

Re: Sound is delayed by a few seconds

by _mental_ » Wed May 09, 2018 9:07 am

Is it Aune S16? I don’t think someone who can check has this $500+ device.

Re: Sound is delayed by a few seconds

by Mynameislol » Wed May 09, 2018 8:52 am

Anybody?

Top