Sound delay via Bluetooth
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.
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.
- 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
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.
I tried adjusting sound options, such as buffer size and channel number, to no effect.
- 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
I've been noticing this myself but I'd chalked it up to Bluetooth latency.
- 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
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.
Re: Sound delay via Bluetooth
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.
By default ZDoom sets an extremely high quality and as you both pointed out it's not Bluetooth-aware.
- 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
That actually made it worse. The lower I set the sample rate, the longer the latency seems to get.
Re: Sound delay via Bluetooth
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?
- 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
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.
But no, OpenAL seems to have the same problem.
Re: Sound delay via Bluetooth
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.
- 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
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.
Re: Sound delay via Bluetooth
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.
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.
- 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
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.
Re: Sound delay via Bluetooth
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.
- 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
Thanks for trying, anyway. It's all well above my head.
Re: Sound delay via Bluetooth
You're welcome.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Sound delay via Bluetooth
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.
- 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.