SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Jittery audio in games using SDL

Open TheMagicJesus opened this issue 2 years ago • 15 comments

Have experienced jittery audio in games that use SDL. The games are Wargroove and Super Hexagon. Thought it was an issue with Virtual Audio Cable but it might be Windows 7? no clue.

TheMagicJesus avatar May 30 '22 19:05 TheMagicJesus

Can you record it so I can hear what "jittery" means in this case? Even just like a voice memo on your phone while Super Hexagon is playing would be helpful.

Thanks!

icculus avatar May 30 '22 19:05 icculus

https://www.file.io/oLwQ/download/zdpq4tGaI1Q6 Sorry about the external site. Github doesn't like .MKVs. 2022-05-30 14-51-27.mkv shows off what it sounds like in previous versions and in the current version with a launch argument 2022-05-30 14-52-06.mkv shows off what it sounds like in the current version without a launch argument

Edit: https://www.file.io/PvGM/download/yq4aJHajWtRF File 2022-05-30 15-01-14.mkv shows off what might be the same issue but with Wargroove

TheMagicJesus avatar May 30 '22 20:05 TheMagicJesus

Linking the SupHex report, just in case https://github.com/TerryCavanagh/super-hexagon-neo-issues/issues/6

DirectSound works around it, so it's some interaction between VAC and WASAPI.

flibitijibibo avatar May 30 '22 20:05 flibitijibibo

I'm going to roll a Win7+VAC install later, but for now:

Launch the Control Panel:

image

Launch System:

image

Then Advanced System Settings:

image

Advanced tab, Environment Variables...

image

New System Variable:

image

Add SDL_AUDIODRIVER and directsound and click OK

image

Click OK to close out of all these windows and REBOOT and then SDL will use DirectSound instead of WASAPI for all games. Until we fix this better, this should get you up and going everywhere.

icculus avatar Jun 05 '22 13:06 icculus

No luck with the system variable fix. Either a mistake on my part to open this as a SDL issue or something else. image

TheMagicJesus avatar Jun 05 '22 14:06 TheMagicJesus

Looks right to me, might just need a reboot.

flibitijibibo avatar Jun 05 '22 14:06 flibitijibibo

reboot occurred but audio issues remained

TheMagicJesus avatar Jun 05 '22 14:06 TheMagicJesus

So the Super Hexagon command line that fixed this just forces that variable inside the game, as far as I know. Maybe Steam or whatever strips it out?

Anyhow, I'll know more when I do a Win7 install over here soon.

icculus avatar Jun 09 '22 19:06 icculus

I threw together a Win7 install last night in preparation to look into this issue; just making sure, this is the Virtual Audio Cable we're talking about, right?

https://vac.muzychenko.net/en/

icculus avatar Jul 29 '22 15:07 icculus

Yep, that's the one.

flibitijibibo avatar Jul 29 '22 15:07 flibitijibibo

I was using the VB Audio Cable from https://shop.vb-audio.com/en/12-win-apps, https://shop.vb-audio.com/en/ and Voicemeeter Potato from the same person. Unable to continue describing the error now as I have built a new PC and swapped OS

TheMagicJesus avatar Jul 29 '22 16:07 TheMagicJesus

(That's why I asked, VB Audio Cable is the first hit on Google for "Virtual Audio Cable")

@TheMagicJesus No worries, I'll try and reproduce the issue here if I can! Enjoy the new PC! :)

icculus avatar Jul 29 '22 16:07 icculus

Okay, so my results are:

  • With Super Hexagon, this segfaults inside the game (not SDL) as soon as the voice tries to say "Super Hexagon!" at the title screen. I don't have symbols, so I don't have more to say here and I don't think this is worth the Super Hexagon developers spending more time on.
  • Firefox won't play sound at all, but doesn't crash.
  • The original report was jittery audio in some games.

I'm willing to decide this is memory corruption, or whatever...a bug in the virtual audio cable or some quirk of Windows 7, but I don't think it's our bug and I don't think it's worth spending more time on, especially if the original reporter has moved on to a new system build-out and doesn't suffer this issue any more and no one else is triggering it.

If it pops up again from another report, we'll revisit, but for now, this is getting closed.

icculus avatar Jul 31 '22 04:07 icculus

So, good news - we have someone on Windows 7 with VAC on the system and it has this bug, so we can probably try investigating this again.

Bad news: It's actually the opposite backends having the issue, WASAPI is fine and DirectSound is not. I'll have @michaelarts post here with more information soon.

flibitijibibo avatar Sep 06 '22 14:09 flibitijibibo

Hey everyone!

The machine I'm experiencing this on is an HP EliteBook 8760w and I'm using all of the default audio hardware that came with it. Windows says the audio drivers are up to date. Here's a screenshot of the sound device info:

sounddevice

michaelarts avatar Sep 06 '22 14:09 michaelarts

(Saw this was still open while sorting through old milestones.)

I still think this is a Virtual Audio Cable bug, so for now I'm going to close this again. If it still presents when Virtual Audio Cable is uninstalled, or if the VAC people say "ah, we tried to debug this on our end and SDL is doing this stupid thing instead of a more correct behavior," (which is always possible!) we can revisit this.

icculus avatar Aug 07 '23 18:08 icculus