-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] OpenAL Soft #480
Comments
Is the resampling algorithm bad or what's the concrete issue? Proper resampling does not cause aliasing, nor does it "mute the top ends" as long as the target sample rate is above ~40kHz. |
This looks perfectly fine to me https://github.com/libsdl-org/SDL/blob/5968f3d828aaf28a28763fce794020fc8239a35a/build-scripts/gen_audio_resampler_filter.c |
Purely empirically, changing sndspeed from default 11025 to 44100, it should sound the same if high quality filtering is used. Reason being that the majority of Quake sounds are natively 11025 Hz. Instead it gets brighter which suggests aliasing from a lack of filtering. Further evidence that something is wrong is the snd_filteringquality having no effect between 1-5 unless sndspeed is at default 11025.
Agreed. The default setting down samples a small amount of Quake sounds that re natively in 22050Hz, thus muting the top octave. |
Yeah - QS has an internal resampler/lowpass filter after SFX mixing and before the music is mixed in, and it's only implemented for 11025 -> 44100 Hz resampling (so, ~5kHz lowpass). The goal was to emulate the sound of the original game running at the original's default rate of 11025 mixing, but be able to mix in the music before sending the sound to SDL. https://github.com/Novum/vkQuake/blob/master/Quake/snd_mix.c#L240 (The implementation is a bit weird/inefficient because sounds are loaded at 44100 with nearest filtering, mixed at 44100, then lowpass filtered to 5kHz at the end, before the music is mixed in. Ideally they'd be loaded at 11025 - that would require good-quality resampler than can downsample anything to 11025, mixed at 11025, and then up sampled to 44100 at the end for mixing in the music. AFAIK, the output would be the same as what we have now, though.)
This is true, but I would caution against changing the default mixing rate from 11025 because it'll make the game sound different than vanilla. (e.g. the Quake SFX mix can have a lot of clipping which is not as objectionable sounding at 11025Hz, but annoying at higher sample rates. Two other problems: the hard cutoff when the mixer stops a sound part way through (e.g. firing the nailgun does this a lot) is more annoying at sample rates >11025Hz, and some looping sounds sound OK at 11025Hz but they'll have audible glitches at the loop points if you upsample before looping.) So I guess the concrete issue is, if you change sndspeed from the default of 11025, the QS code falls back to a nearest resampler before mixing in the music. |
I'm pretty sure I don't want to implement OpenAL specifically, but there seems to be some questions open regarding sound, so I'll keep this open for now. |
Maybe a new cvar could be considered that removes that limitation, or emulation of original behavior, call it what you want. I think that would make some people happy that combine custom sounds with the stock ones also. |
Just for additional context, indeed increasing the Not sure if this plays a role specifically for this question, but still something interesting to bring up. I too am a big fan of the ability to do some high-quality Cubic filtering, which OpenAL Soft allows. I use DSOAL for all games that use DirectSound, specifically for that capability. |
SDL2 does high quality filtering, I already established that. |
Indeed. It's not fully used though. |
i figure people would argue for openal soft due to binaural hrtf |
Yes, I want OpenAL support so I can install OpenAL Soft and get HRTF. I use Linux, if that matters. |
Any chance of implementing this? The current audio capabilities inherited from QS have some issues.
Handling of mixed sample rates is not optimal. You can only configure it in two ways, to down-sample(default), which mutes the top end of
allEDIT:some sounds, or up-sample with very audible aliasing distortion.Makes surround audio over normal headphones possible, which is a pretty good fit for Quakes gameplay. Here's an example if you want to see what it's about: https://youtu.be/rc5a7dzRvbY?t=25
The text was updated successfully, but these errors were encountered: