Sound delay via Bluetooth

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Sound delay via Bluetooth

Post by Ed the Bat »

I've recently found that, if the PC's sound device is Bluetooth-based, ZDoom actually plays its sounds late (my best estimate is one or two tenths of a second). All other programs are playing their sounds instantly, as desired. It's exclusively ZDoom and GZDoom sounds that are latent. Windows sound mixer even confirms that the sounds are being played late, not simply reaching the speakers slowly.

I tried adjusting sound options, such as buffer size and channel number, to no effect.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Sound delay via Bluetooth

Post by wildweasel »

I've been noticing this myself but I'd chalked it up to Bluetooth latency.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Sound delay via Bluetooth

Post by Ed the Bat »

Normally I would've thought so, too. But when it's literally only ZDoom, and nothing else on the machine (hell, I'm playing Wolfenstein: The New Order right now with no sound latency), there must be something else going on.
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Sound delay via Bluetooth

Post by Rachael »

Well going along with what Wildweasel said - have you tried downsampling the sound rate? Set the sound quality to 22khz or 11khz and see if that makes any difference.

By default ZDoom sets an extremely high quality and as you both pointed out it's not Bluetooth-aware.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Sound delay via Bluetooth

Post by Ed the Bat »

That actually made it worse. The lower I set the sample rate, the longer the latency seems to get.
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Sound delay via Bluetooth

Post by Rachael »

I wonder if this is a problem with FMOD or ZDoom, then. Have you tried the latest GZDoom devbuilds, and switch the sound backend to OpenAL?
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Sound delay via Bluetooth

Post by Ed the Bat »

I actually exclusively use GZDoom, but I did check ZDoom earlier to confirm the problem happens there, too. It also happens in Zandronum 3.0, incidentally.

But no, OpenAL seems to have the same problem.
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Sound delay via Bluetooth

Post by Rachael »

Try decreasing the number of channels. You will probably have to use the console for this (not sure) - the cvar is "snd_channels" - does it still happen if you set it to 8 or 16? Remember to restart ZDoom afterwards, to be sure.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Sound delay via Bluetooth

Post by Ed the Bat »

There's a menu slider for the number of channels. But setting it as low as 8 still didn't help the problem. And I always hit 'Restart Sound' after making changes to these options, to check if anything happens.
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Sound delay via Bluetooth

Post by Rachael »

Okay, last thing I will ask then - try lowering the buffer size. This I am pretty sure requires the console.
Use the "snd_buffersize" cvar (it defaults to 0, set it to 1000 or something and then tweak it)
You will have to use "snd_reset" for any change to take effect.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Sound delay via Bluetooth

Post by Ed the Bat »

There's an option for it under Sound Options >> FMOD Options. I set it to 256 (any lower and all sound becomes a cacophonous electronic howl), and didn't notice any improvement on the latency. Setting it up to 4096 made the latency a lot worse, but I believe that would still happen on any other sound hardware that I have.
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Sound delay via Bluetooth

Post by Rachael »

Well I don't know much about the audio code, but it seems like some sort of syncing module on ZDoom's end will be needed, then, if this issue is to be addressed - other than that I don't really know what else to say. You pretty much have me stumped. :P
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Sound delay via Bluetooth

Post by Ed the Bat »

Thanks for trying, anyway. It's all well above my head.
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Sound delay via Bluetooth

Post by Rachael »

You're welcome. :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Sound delay via Bluetooth

Post by Graf Zahl »

A few more things to ask:

- do you play with uncapped frame rate? If yes, what happens if you turn on vsync?
- fullscreen or windowed?
- only in-game or always?

That said, I have no idea.
Post Reply

Return to “Closed Bugs [GZDoom]”