OpenJK icon indicating copy to clipboard operation
OpenJK copied to clipboard

Both "High" and "Low" sound options quality is poor.

Open JokerOmega1 opened this issue 9 years ago • 49 comments

Quality on both High and Low sound options is poor, the scratchiness literally hurts the ears. EAX enhanced can help as an alternative but I'd really like to see the default direct sound feature be placed back in over the one currently in place.

Even the hidden very high setting at 44 is just as scratchy and poor!

JokerOmega1 avatar Jan 21 '16 21:01 JokerOmega1

Try adjusting s_sdlSpeed (44100?) - I expect the menus are adjusting the old s_khz cvar

Razish avatar Jan 21 '16 22:01 Razish

Razor is correct. s_sdlSpeed default value is 44100 or possibly 1 but I'm 100% positive the default value uses 44100 internally anyway.

ensiform avatar Jan 21 '16 23:01 ensiform

Yeah no matter whether I change from high to low it stays at 44100 (according to the console that is), and the result is scratchy audio, even when I use the console command s_khz cvar 44.

I can try the s_sdlSpeed command, but I am unsure as to what is the best value to set it too, I mean it would be useless setting to 44100 if that is the default value anyway which is causing the scratchy sound issue.

Edit: yeah, inputting "s_sdlSpeed 44100" did nothing.

JokerOmega1 avatar Jan 22 '16 20:01 JokerOmega1

What exactly sounds bad at 44? Everything?

It will say "SDL audio driver is " on startup what does it say for you?

There will be no return of the explicit dsound code itself as the sdl backend is internally loading and using dsound anyway and I don't believe this is the issue.

ensiform avatar Jan 22 '16 23:01 ensiform

Basically all the sound effects, just the overall sound in general sounds scratchy, and not to exaggerate here but listening to it for just a little while hurts my ears. I don't have this problem with the vanilla game's audio, in fact it sounds just fine on the high setting.

This is what is stated on my OpenJK SP console on startup at High setting: SDL Init (SLD_INIT_AUDIO) ... OK SDL audio driver is "xaudio2" SLD AudioSpec: Format: Audio S16LSB Freq: 44100 Sample: 1024 Channels: 2 Starting SDL audio callback. SDL audio Initialized.

JokerOmega1 avatar Jan 23 '16 03:01 JokerOmega1

On mine it says directsound.

Which Windows.

ensiform avatar Jan 23 '16 04:01 ensiform

Windows 7 x64

JokerOmega1 avatar Jan 23 '16 04:01 JokerOmega1

Windows 8 and 10 both have had this for me:

------- sound initialization -------
SDL_Init( SDL_INIT_AUDIO )... OK
SDL audio driver is "directsound".
SDL_AudioSpec:
  Format:   AUDIO_S16LSB
  Freq:     44100
  Samples:  1024
  Channels: 2
Starting SDL audio callback...
SDL audio initialized.

I'm using newest SDL2 code so that could be a factor however not 100% positive on that. As I never had issues previously other than the obvious sound issues that the engine itself has like with the repeater.

ensiform avatar Jan 23 '16 05:01 ensiform

Well geee that really is weird, I sure wish I could get OpenJK to do that too har har.

Really though, I'd like nothing more than to recommend OpenJK (in fact I already have under a mod that I have released that requires OpenJK to bypass the transform space for goul2), but this is just off putting. Don't get me wrong, I have nothing but appreciation for what you guys are doing... But there isn't really much I can do on my end to fix this, as far as I am aware of.

I am using "openjk-2016-01-11-4ad9ed4a-windows", if that helps at all.

JokerOmega1 avatar Jan 23 '16 05:01 JokerOmega1

Could you upload a recording so we know what you're hearing? I suspect Ensi is on the right track with the driver being different.

Razish avatar Jan 23 '16 07:01 Razish

I really don't think that is going to make much difference, given that I'd have to take the time to do a comparison with OpenJK and Vanilla JKA, plus difference of the sound transfer to the video as compared to the game itself.

It is basically like listening to a 64 kbps MP3.

If I could just get the directsound to activate as it should then I really don't think there would be a problem.

JokerOmega1 avatar Jan 23 '16 07:01 JokerOmega1

XAudio2 support was disabled for other reasons in 2.0.4, so you'll have to wait until its upgraded. Typically it would be possible to use the provided binary from the SDL site but with 2015 VS that doesn't work with older CRT versions correctly, and some of the SDL ABI changed in 2.0.4 as well I think.

One thing you can try is, to set SDL_AUDIODRIVER in your user environment variables for the system to the value of directsound to see if that affects anything.

ensiform avatar Jan 23 '16 16:01 ensiform

Hmmm I am not quite sure how to do that, otherwise if need be I can wait for the next OpenJK release, if that has the SDL upgrade of course.

You've been very helpful on this issue, so thank you.

JokerOmega1 avatar Jan 23 '16 22:01 JokerOmega1

Not sure when the upgrade will happen yet.

ensiform avatar Jan 24 '16 00:01 ensiform

How complicated would you say it is setting the SDL_AUDIODRIVER in the enviroment variables, is this something done in the game console or through the PC settings?

JokerOmega1 avatar Jan 24 '16 05:01 JokerOmega1

Through the system settings by going to the this pc's settings or w/e its called on 7 still. And under advanced system settings navigation pane and then environment variables.

You'd add a new variable under the user variables for called SDL_AUDIODRIVER with the value of directsound with no spaces or quotes

ensiform avatar Jan 24 '16 06:01 ensiform

Alternatively, just run the game from cmd.exe with SDL_AUDIODRIVER=directsound ./openjk.x86.exe +set fs_game "OpenJK"

Razish avatar Jan 24 '16 10:01 Razish

The environment variables method worked in the sense that the game started directsound instead of xaudio2, which was nice, only it made no difference when it came to the sound quality.

It just must be the way it has been coded into OpenJK, I mean in the vanilla game you can clearly tell a difference between low and high sound quality, with high sounding just fine, yet with OpenJK low and high options sound just the same in quality.

I think the main difference is the EAX sound option, in the vanilla game the EAX option sounded alright but was overall buggy with initiating sound effects and such. With OpenJK the EAX option seems to be fixed in the sense that sound effects now initiate as they should and the sound is great quality, except with this version there seems to be issues with imbalance in sound effects volume, for example on Korriban the background torches drown out every other sound, making even voices difficult to hear (and that is with sound effects bellow half and voices on full).

Here is my summation:

Vanilla JKA:

  • Low sound option is how it sounds, low sound quality.
  • High sound option is as it sounds, high sound quality and works just fine.
  • EAX sound option is buggy, with sound effects failing to play at certain times.

OpenJK:

  • Low sound option sounds scratchy.
  • High sound option sounds exactly like low sound option.
  • EAX sound option has great audio quality but terrible imbalance in audio volume.

Eh I can't help but feel disappointed, I was happy with vanilla JKA's high sound option, but I had issues with the game's ghoul2 transform limitation (crucial for single player model mods). OpenJK fixed the ghoul2 transform limitation, but now I have issues with sound.

JokerOmega1 avatar Jan 25 '16 08:01 JokerOmega1

We've already told you the sound options in OpenJK do nothing in the menu. We can't ship modified menus to change this. They point to a dead, unused cvar. Nobody else has reported experiencing sound issues though so it'll need to be further investigated, and no changes were made to the sound code itself (ie the mixer, and channels and other actual pieces to the JKA sound). The only changes made were where it directly invokes WinAPI directsound through the SDL wrapper or not. This same change applies to all tech3 and tech4 engines which use SDL including ioquake3, etlegacy, unvanquished, and more. OpenAL (EAX) support is still trash, that has not changed but eventually it will with ALsoft instead and no more actual EAX.

ensiform avatar Jan 25 '16 16:01 ensiform

You've already told me?! Not that I can see, and if you have then you haven't made it at all clear.

All I can tell you is that the sound quality is nowhere near as good as vanilla JKA on my end. Hell I am not even sure how I am supposed to change the sound options in OpenJK if it isn't done through the menu, perhaps there's a console command that resets the OpenJK sound option, perhaps you could share that, or do I have to delete the OpenJK config and create a new one?

JokerOmega1 avatar Jan 26 '16 11:01 JokerOmega1

Wasn't it mentioned earlier that s_khz is the old cvar? It is unused therefore the option for sound quality does nothing which is fine so long as the other methods available do change quality. And I'm not convinced its the sound quality causing issue considering it now defaults to the equivalent of the highest s_khz.

ensiform avatar Jan 26 '16 11:01 ensiform

Indeed, s_khz was the cvar used by basejka (and consequently the menus) measured in kHz We now use s_sdlSpeed measured in hz, but the menus have not been updated because we legally can't ship OpenJK with modified menus, nor are we at an official release stage/1.0

I'm baffled that using 44.1 kHz with the same sound backend/driver that everyone else is using results in scratchy sound but nothing else exhibits this problem, including the original game. I think the fact it defaulted to another sound backend is at-least hinting to the problem. Are you 100% sure you've installed your _chipset_ drivers for onboard audio? (or if you have a dedicated sound card, the driver for that)

Another thing to try is a test build of ioquake3 assuming you have Quake 3 assets.

The reason we're/I'm not suspecting OpenJK specifically is simply because it works so well for many people on many versions of every major OS, and we've already noticed a discrepancy with your sound drivers.

Razish avatar Jan 26 '16 13:01 Razish

I agree with @JokerOmega1 that with 44khz, the audio does sound more scratchy. It was noticeable for me in vanilla JKA as well, when I set s_khz from 22 (high quality) to 44 (not accessible except via the console).

IIRC, I had an onboard audio chip.

xycaleth avatar Jan 26 '16 19:01 xycaleth

I have an on board audio chip as well and don't really notice an issue per-se.

ensiform avatar Jan 26 '16 19:01 ensiform

@JokerOmega1 Does OpenJK sound better if you set s_sdlSpeed to 22050, and then run /snd_restart? This should be equivalent to the 'high quality' sound setting.

xycaleth avatar Jan 26 '16 19:01 xycaleth

22 would be lower than the highest setting in JKA ( the original default value )

ensiform avatar Jan 26 '16 19:01 ensiform

Setting the sound quality to 'high' through the menu sets s_khz to 22. Low quality is 11. There was never an option to set it to 44 through the menus.

xycaleth avatar Jan 26 '16 19:01 xycaleth

I'm running around on a map right now with directsound, and the sdl equiv of 44 and it sounds okay but there is a tiny pop and I'm not sure if that's the game or my speakers/motherboard.

ensiform avatar Jan 26 '16 19:01 ensiform

Oh wow, thanks xycaleth that did the trick, setting s_sdlSpeed to 22050 and then hitting /snd_restart fixed the scratchy sound.

JokerOmega1 avatar Jan 27 '16 04:01 JokerOmega1

BTW, don't you think it'd be better if s_sdl* cvars were renamed back to match vanillas so there's compatibility with original menus in this regard?

For example, they did this in ET Legacy and I think it was a good change.

adanski avatar Jan 28 '16 10:01 adanski