Sound in 1-tic loop glitches out on openAL soft 1.21.0

Post bugs that have to do with sound and/or in-game music here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

Sound in 1-tic loop glitches out on openAL soft 1.21.0

Postby NicoTheGoat » Mon Nov 23, 2020 2:13 pm

After updating to OpenAL soft 1.21.0, sounds played in a short (1-10 tics) loop glitch out when moving.
Potentially related to viewtopic.php?f=104&t=62264 (though in this case HRTF doesn't affect anything).

Strangely, this affects sounds played on an item's owner in `Tick`, but not in `DoEffect`.



Attached pk3 contains an item that demonstrates this bug - spawn it with `summon TestItem` or `give TestItem`.
You do not have the required permissions to view the files attached to this post.
User avatar
NicoTheGoat
 
Joined: 29 Dec 2019
Discord: emmy#4389
Github ID: nicothegoat
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)

Re: Sound in 1-tic loop glitches out on openAL soft 1.21.0

Postby Chris » Tue Nov 24, 2020 1:11 pm

This has been bugging me for a while now. At first I thought there might've been an issue with GZDoom erroneously supplying bad listener properties (that 'valid' field gives me bad vibes), but tracing it all showed everything was good there. OpenAL was also getting good values, but ended up producing bad channel gains for panning. For a while I thought OpenAL Soft's asynchronous threading was invoking some dark magics causing havoc with memory.

But I finally managed to track it down to a over-lenient update check. When OpenAL Soft stops a sound source, it cuts it off from the internal mixing voice, so that the mixing voice can do one final run with the gain fading to 0 to avoid a hard cut (would otherwise potentially cause a click or pop), leaving the source to be free for the app to use how it wants in the mean time. What's happening here is if a source is stopped and started, the source is subsequently updated within a batched update, and the batch update is applied before the old voice did its final mix, that source update could be applied to the wrong voice, which in turn meant the source would be one frame behind the listener (which then got exacerbated by the manual rolloff fixup in GZDoom).

I pushed a fix for OpenAL Soft. I'm also thinking the manual rolloff fixup in GZDoom could be improved, which would help somewhat without OpenAL Soft's fix.
User avatar
Chris
 
Joined: 17 Jul 2003

Re: Sound in 1-tic loop glitches out on openAL soft 1.21.0

Postby SanyaWaffles » Tue Nov 24, 2020 7:12 pm

How would one go about updating OpenAL Soft? I presume this will be eventually put into a new release, but just if we wanted to test it I was curious if there was automated builds available.
User avatar
SanyaWaffles
Witnessing perfection...
 
Joined: 25 Apr 2013
Location: Eastern Ohio
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Sound in 1-tic loop glitches out on openAL soft 1.21.0

Postby Chris » Wed Nov 25, 2020 8:37 am

SanyaWaffles wrote:How would one go about updating OpenAL Soft? I presume this will be eventually put into a new release, but just if we wanted to test it I was curious if there was automated builds available.

For now, you'd have to get the source and build it. I don't have any automated builds set up, as I'm not familiar with doing that. I might be able to get AppVeyor to produce build artifacts that contain DLLs from pushed commits, but they don't seem to stick around long (6 months, it looks like).
User avatar
Chris
 
Joined: 17 Jul 2003

Re: Sound in 1-tic loop glitches out on openAL soft 1.21.0

Postby Chris » Wed Nov 25, 2020 9:17 am

Chris wrote:I'm also thinking the manual rolloff fixup in GZDoom could be improved, which would help somewhat without OpenAL Soft's fix.

And I did that: https://github.com/coelckers/gzdoom/pull/1243

If there's no objections, it should be ready to merge.
User avatar
Chris
 
Joined: 17 Jul 2003

Re: Sound in 1-tic loop glitches out on openAL soft 1.21.0

Postby Graf Zahl » Wed Nov 25, 2020 9:26 am

I have to take your word for it...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Audio/Music Bugs

Who is online

Users browsing this forum: No registered users and 0 guests