project reality header
Go Back   Project Reality Forums > PR:BF2 Mod Forums > PR:BF2 General Discussion
27 Jul 2021, 00:00:00 (PRT)
Register Developer Blogs Project Reality Members List Search Today's Posts Mark Forums Read
PR:BF2 General Discussion General discussion of the Project Reality: BF2 modification.

Reply
 
Thread Tools Display Modes
Old 2016-12-24, 01:06   #1
WeeGeez
Supporting Member

WeeGeez's Avatar
Default [XP] Bypass Directsound resampling

Hi all,
A question foa sound team;

I realize PR game sounds are directX, not directsound but... with the introduction of mumble running as a separate program which now adds to final mix, I'm curious if this changed anything?

To clarify, when two or more programs play sound under xp simultaneously or if volume slider in soundvol32 is changed at all from max in certain circumstances, this kicks in the kmixer and the Directsound resamples (obliterates) everything. similar story with win 7 hence the wasapi feature

Now normally BF2 engine sounds are 48khz and are rendered inside DirectX positional audio, bit-perfect provided the kmixer isn't active and coupled directly to the sound card 'pin', which may be SPDIF or DAC.

With mumble running, it's not clear how PR, directX and DS interact. It needs to be active at all time to relay voices of 'significant others'.

I have SPDIF on my beloved xfi hooked up to external 16bit successive approximation architecture dac sans digital filter. It would be a shame if direct sound was indeed re sampling anything.
WeeGeez is offline Reply With Quote
Old 2016-12-24, 10:14   #2
fpspromotion

fpspromotion's Avatar
Default Re: [XP] Bypass Directsound resampling

https://www.realitymod.com/forum/f10...t-reality.html
fpspromotion is offline Reply With Quote
Old 2016-12-24, 20:16   #3
Jaymz
Retired PR Developer
Supporting Member

Jaymz's Avatar
Default Re: [XP] Bypass Directsound resampling

Quote:
Originally Posted by WeeGeez View Post
Now normally BF2 engine sounds are 48khz and are rendered inside DirectX positional audio, bit-perfect provided the kmixer isn't active and coupled directly to the sound card 'pin', which may be SPDIF or DAC.
So what BF2 outputs is 48khz? Are you sure? The sound files themselves are 44.1khz.

More modern games are 48khz I'm aware.

Quote:
Originally Posted by fpspromotion View Post
That links suggests setting Windows default format to 96khz. This would upsample everything which is not good...

"Clear the battlefield and let me see, All the profit from our victory." - Greg Lake
Jaymz is offline Reply With Quote
Old 2016-12-30, 04:44   #4
WeeGeez
Supporting Member

WeeGeez's Avatar
Default Re: [XP] Bypass Directsound resampling

Jaymz I checked, bf2 audio is 48khz.
I concur that to re sample to 96, will bring no advantages as that link suggests.

Fyi, here is the information my concern is based on;
Quote:
Contrary to popular belief, the kmixer of Windows 2000 and XP doesn't modify the sound and is thus bitperfect if these four conditions are met:

# The PCM/wave volume slider of the mixer (sndvol32.exe) must be set at its maximum.
# The player must be compiled for the same architecture that the OS was compiled for
# Applications other than the player mustn't play sounds, otherwise the two output streams will be potentially sample rate converted and mixed.
# Applications which are using the soundcard for recording have to use the same sample rate as concurrently running applications which are playing sounds - the soundcard has only one clock generator and hence this limitation arises.
Source
same applies in win 7.

So when mumble is active with sound, the directsound resampler becomes active, and that is bollocks considering the time spent field recording real world military gear.

I might make this a suggestion in the right forum, it's slipped in with the introduction with mumble and I think it would be worthwhile to look in to a way around the resampler - it really is optimised for efficiency which compromises the sound hence the emphasis on kernal streaming and more recently WASAPI in windows 7.

btw
I have other rather interesting suggestions / technical recommendations for the Squad sound team. I did ask on the forum but no reply there.

A case of who to ask.......
WeeGeez is offline Reply With Quote
Old 2016-12-30, 18:46   #5
Jaymz
Retired PR Developer
Supporting Member

Jaymz's Avatar
Default Re: [XP] Bypass Directsound resampling

Quote:
Originally Posted by WeeGeez View Post
Jaymz I checked, bf2 audio is 48khz.
What is your source for this? The sound files themselves are 44.1khz.

"Clear the battlefield and let me see, All the profit from our victory." - Greg Lake
Jaymz is offline Reply With Quote
Old 2017-01-08, 20:57   #6
WeeGeez
Supporting Member

WeeGeez's Avatar
Default Re: [XP] Bypass Directsound resampling

Can you give an example?
I don't have it installed right now but when I checked BF2 files in an audio editor it said 48khz.

I don't think this difference matters, my point is, if two programs are running conjointly, even in windows 7, the lousy resampler kicks in. It's optimised for speed not quality.

Who's the sound dev on here?
WeeGeez is offline Reply With Quote
Old 2017-01-08, 22:19   #7
Jaymz
Retired PR Developer
Supporting Member

Jaymz's Avatar
Default Re: [XP] Bypass Directsound resampling

Quote:
Originally Posted by WeeGeez View Post
Can you give an example?
I don't have it installed right now but when I checked BF2 files in an audio editor it said 48khz.
Look at any of the .wav or .ogg files in the PR folder. All 44.1khz , with some 22.05khz. I recall, from when I was a sound dev, that BF2 wouldn't play sounds that weren't one of those two sample rates. What BF2 actually outputs, I don't know for certain. But it would be odd if it were 48khz with 44.1khz source sounds.

Quote:
Originally Posted by WeeGeez View Post
I don't think this difference matters, my point is, if two programs are running conjointly, even in windows 7, the lousy resampler kicks in. It's optimised for speed not quality.
I'm curious, does it matter if the windows default format is the same as the games native sample rate? Would it resample something that's already 48khz...to 48khz? Or would it only resample the program that doesn't match?

"Clear the battlefield and let me see, All the profit from our victory." - Greg Lake
Jaymz is offline Reply With Quote
Old 2017-01-09, 03:16   #8
WeeGeez
Supporting Member

WeeGeez's Avatar
Default Re: [XP] Bypass Directsound resampling

If PR is 44.1 and mumble is 48 then windows 'corrects' that, usually to 48.
If mumble is 44.1 then I really don't know.
In any case sound card must supports final rate.

If the sound device is AC97, its restricted to 48khz, so resampler will be activated if data is not 48.
AC97 is old. Newer Intel 'HDAudiuo' and ATI/nvidia HDMI is more flexible.

Best way to test bit perfect is with spdif output to a reciever that either indicates sample rate or decodes DD/DTS data and use a encoded file.

I really have no idea if windows resamples if both streams are the same rate (in any windows), that is the fundamental question here, I might ask a more suitable elsewhere and report back.

Do you know what rate mumble is?


Cheap computer build / fast track upgrade for slow computer for PR > Guide
WeeGeez is offline Reply With Quote
Old 2017-01-09, 14:56   #9
Jaymz
Retired PR Developer
Supporting Member

Jaymz's Avatar
Default Re: [XP] Bypass Directsound resampling

Quote:
Originally Posted by WeeGeez View Post
If PR is 44.1 and mumble is 48 then windows 'corrects' that, usually to 48.
If mumble is 44.1 then I really don't know.
In any case sound card must supports final rate.

If the sound device is AC97, its restricted to 48khz, so resampler will be activated if data is not 48.
AC97 is old. Newer Intel 'HDAudiuo' and ATI/nvidia HDMI is more flexible.

Best way to test bit perfect is with spdif output to a reciever that either indicates sample rate or decodes DD/DTS data and use a encoded file.

I really have no idea if windows resamples if both streams are the same rate (in any windows), that is the fundamental question here, I might ask a more suitable elsewhere and report back.

Do you know what rate mumble is?
Mumble is 48khz.

https://wiki.mumble.info/wiki/FAQ/English

An interesting quote,

Quote:
The two most CPU intensive tasks Mumble performs are resampling and echo cancellation. The first of the two, resampling, is entirely avoidable on most audio hardware in existence today. Mumble operates on a native 48Khz sampling rate and if your audio device is configured to take/provide exactly that sample rate no resampling needs to be performed by Mumble.

"Clear the battlefield and let me see, All the profit from our victory." - Greg Lake
Jaymz is offline Reply With Quote
Old 2017-01-09, 22:41   #10
WeeGeez
Supporting Member

WeeGeez's Avatar
Default Re: [XP] Bypass Directsound resampling



In that case on Windows 7 in Speaker Properties, I'd set that to 16/44. 24bit is only useful you live in a anechoic chamber.

Unsure if PR sound will be re sampled if 44 is set.

XP? Unlikely to be a way around the directsound SRC that will definitely occur in this scenario unfortunately.

I mean even if mumble was 44, I've yet to discover how windows handles two concurrent streams if output supports 44.


Cheap computer build / fast track upgrade for slow computer for PR > Guide
WeeGeez is offline Reply With Quote
Reply


Tags
bypass, directsound, resampling
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:38.