Sound quality (Primary buffer?)
Moderator: ZSNES Mods
Sound quality (Primary buffer?)
Hi!
I use the latest Windows WIP of ZSnes on my system.
I can hear a "shhhhhhh" noise in games when it plays sounds and musique. The noise goes away when i check "Use primary buffer" but then there is a big lag between the game and the sound. I know Primary Buffer allows a big buffer, and this causes the lag.
I got that noise with 3 different ISA sound cards:
SoundBlaster 16
SoundBlaster 16 Value
AOpen Crystal AW35/37
I would have to double check but I think I don't have this noise in the DOS version.
Here are my System specs:
Celeron 300
128 Mb SDRAM
Windows 98
DirectX 8.1
Latest drivers for the sound card
Some kind of Intel Mother Board i think
Thank you!
I use the latest Windows WIP of ZSnes on my system.
I can hear a "shhhhhhh" noise in games when it plays sounds and musique. The noise goes away when i check "Use primary buffer" but then there is a big lag between the game and the sound. I know Primary Buffer allows a big buffer, and this causes the lag.
I got that noise with 3 different ISA sound cards:
SoundBlaster 16
SoundBlaster 16 Value
AOpen Crystal AW35/37
I would have to double check but I think I don't have this noise in the DOS version.
Here are my System specs:
Celeron 300
128 Mb SDRAM
Windows 98
DirectX 8.1
Latest drivers for the sound card
Some kind of Intel Mother Board i think
Thank you!
The pouiller the better
-
- Regular
- Posts: 271
- Joined: Tue Jun 14, 2005 8:35 pm
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
If you don't have any interpolation, enable gaussian.
Before a game is loaded.
Before a game is loaded.
皆黙って俺について来い!!
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Sound Config:
Sound enable, stereo, 32000, gaussian. I read the docs and used what's closer to the real snes. But I tried various configs but the only option that changes something is "Primary buffer"
Why ISA:
Because the only PCI Sound Card I have is already used
And they are easier to get working under pure DOS (if needed)
Interpolation:
Using interpolation, whichever, doesn't help.
Sound enable, stereo, 32000, gaussian. I read the docs and used what's closer to the real snes. But I tried various configs but the only option that changes something is "Primary buffer"
Why ISA:
Because the only PCI Sound Card I have is already used

And they are easier to get working under pure DOS (if needed)
Interpolation:
Using interpolation, whichever, doesn't help.
The pouiller the better
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
I'll try different versions when i have some time, thanks!
Tried with both sound buffering on and off. And the hissing is not steady. It gets louder as the game sounds get louder. As if it was of poor quality, like, 8 bits or something.
Haha, and if it doesn't work i'll buy a new PC, and a new life too cause life sucks with poor sound in ZSnes
Seriously, if everything else fails, i'll try with my SB128.
Oh, and could it be a setting in the BIOS?
Tried with both sound buffering on and off. And the hissing is not steady. It gets louder as the game sounds get louder. As if it was of poor quality, like, 8 bits or something.
Haha, and if it doesn't work i'll buy a new PC, and a new life too cause life sucks with poor sound in ZSnes


Oh, and could it be a setting in the BIOS?
The pouiller the better
-
- Rookie
- Posts: 16
- Joined: Thu Sep 09, 2004 11:46 pm
- Location: location, location
- Contact:
If i looked far enough in the sources, I see that ZSnes just uses the buffer size that DirectSound establishes.When creating a primary buffer, applications must set the dwBufferBytes member to zero. DirectSound will determine the best buffer size for the particular sound device in use. To determine the size of a created primary buffer, call IDirectSoundBuffer8::GetCaps.
Code: Select all
lpPrimaryBuffer->GetCaps(&dsbcaps);
SoundBufferSize=dsbcaps.dwBufferBytes;
Code: Select all
dsbd.dwBufferBytes = UsePrimaryBuffer ? 0 : SoundBufferSize;
EDIT:
Duh... Found the answer somewhere else on the same site. Hail MSDN.You cannot specify the size of the primary buffer, and you must accept the returned size after the buffer is created. A primary buffer is typically very small, so if your application writes directly to this kind of buffer, it must write blocks of data at short intervals to prevent the previously written data from being replayed.
I think I understand... It's not the DirectSoundBuffer size, but zsnes's that is big so there's no gap in the sound.
If i'm right, It would be nice to be able to set the size of the "big buffer" in the GUI or in the config file, so we could fine tune it.
And talking about gaps, "to prevent the previously written data from being replayed." When there is silence in the game, the last written data keeps on playing in loop.

EDIT:
The looping sound when there's silence in a game happens when not using primary buffer. So there are 2 annoyance at the same time...
Last edited by Baldho on Fri Oct 28, 2005 4:36 am, edited 1 time in total.
The pouiller the better
-
- Romhacking God
- Posts: 922
- Joined: Wed Jul 28, 2004 11:27 pm
- Contact:
I think we're getting away from the problem here.
The size of your DirectSound buffer should have little to do with the problem you described.
The size of the direct sound buffer simply dictates how often you need to write to(and how much data you can write to it) it to fill it up and prevent repeat.
I would recommend NOT using the primary DirectSound buffer. This seems to be a programming recommendation by many sources including MS. I can't remember which part of the documentation it's in though. The 'normal' way of doing things is to use secondary buffers and let DirectSound and your Sound card drivers control the primary buffer.
Assuming you use a large enough buffer and keep perfect track of things, you can seamlessly fill the buffer while it is playing while keeping sync and not adding any static or noise.
The size of your DirectSound buffer should have little to do with the problem you described.
The size of the direct sound buffer simply dictates how often you need to write to(and how much data you can write to it) it to fill it up and prevent repeat.
I would recommend NOT using the primary DirectSound buffer. This seems to be a programming recommendation by many sources including MS. I can't remember which part of the documentation it's in though. The 'normal' way of doing things is to use secondary buffers and let DirectSound and your Sound card drivers control the primary buffer.
Assuming you use a large enough buffer and keep perfect track of things, you can seamlessly fill the buffer while it is playing while keeping sync and not adding any static or noise.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
Nah, the size of the buffer doesn't fix the problem but using the primary buffer does...
The problem with primary buffer in ZSnes is that the sound lags to the game. I may be way wrong here, but i think it's zsnes' way to handle the primary buffer's small size. I haven't scatered the whole sources to figure that out yet.
The problem with primary buffer in ZSnes is that the sound lags to the game. I may be way wrong here, but i think it's zsnes' way to handle the primary buffer's small size. I haven't scatered the whole sources to figure that out yet.
The pouiller the better
-
- Romhacking God
- Posts: 922
- Joined: Wed Jul 28, 2004 11:27 pm
- Contact:
Why is this options present to begin with? It shouldn't be necessary as far as I know. Yes, I know it fixes the problem... but WHY? I don't have the time to take a good look at the code to see the differences.
Something is obviously not quite right. Can we at least assume that the actual ZSNES software sound bufer which is fed to DirectSound is always correct regardless of primary or secondary buffer use?
It would be helpful if we could determine where the problem occurs.
Something is obviously not quite right. Can we at least assume that the actual ZSNES software sound bufer which is fed to DirectSound is always correct regardless of primary or secondary buffer use?
It would be helpful if we could determine where the problem occurs.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
How can we tell... Nonetheless, I agree my own particular problem does not reside there and SecondaryBuffer should always be used.Something is obviously not quite right. Can we at least assume that the actual ZSNES software sound bufer which is fed to DirectSound is always correct regardless of primary or secondary buffer use?
I'm confused about if the problem is ZSnes related or not, because the hissing sound does not happen when using Snes9X.
It does not happen on my other computer running XP and a SB128, DX9. (The sound crackles on this one but it's another story...)
So in a nutshell:
Problem: Hissing noise, as if the sound was 8 Bit quality, and looping.
When: When not using primary buffer, regardless of the options used.
There's a version (DOS i think) that allows to set the sound to 8 Bit sample. I'll do some tests with it and compare.
The pouiller the better
Not to smack on your Sound card as it not only is a good one and will work properly but it might be a driver issue and not related to ZSnes in any way.
I own a PCI512/Live 4.1 card. It requires I use the PCI 512 drivers by default and by all accounts it should but thankfully I was able to use Audigy2 drivers to run it. I will tell you the PCI512 drivers that were last released were crap and the current Audigy2 drivers are far better in quality of audio.
By all accounts those sound card are no longer officially supported by Creative and minimal function drivers are provided by Microsoft for newer NT based opeerating systems like 2k/XP/2k3. My solution for you would be to do one of the following so listen carefully:
A) If you have Windows 98 Second Edition, you have WDM driver capabiltity. Go out and find yourself a cheep SB Live/Audigy or other newer sound card for the PCI slots.
B) Go to Creative's website and search under the Windows 2000 drivers, yes I know you have 98 but these are WDM drivers and if you have 98SE you can use them though it's not totally recommended and your DOS audio may no longer operate.
C) Think about investing in newer hardware even to ay a new PC altogether, and using an updated OS like 2k or XP. Good PC configurations for even a Pentium 3 and Athlon now run dirt cheep and you can easily nowadays build a good system of 1GHZ or better for way under 1000 dollars that is way better supported not only by Microsoft but the hardware manufacturers.
I own a PCI512/Live 4.1 card. It requires I use the PCI 512 drivers by default and by all accounts it should but thankfully I was able to use Audigy2 drivers to run it. I will tell you the PCI512 drivers that were last released were crap and the current Audigy2 drivers are far better in quality of audio.
By all accounts those sound card are no longer officially supported by Creative and minimal function drivers are provided by Microsoft for newer NT based opeerating systems like 2k/XP/2k3. My solution for you would be to do one of the following so listen carefully:
A) If you have Windows 98 Second Edition, you have WDM driver capabiltity. Go out and find yourself a cheep SB Live/Audigy or other newer sound card for the PCI slots.
B) Go to Creative's website and search under the Windows 2000 drivers, yes I know you have 98 but these are WDM drivers and if you have 98SE you can use them though it's not totally recommended and your DOS audio may no longer operate.
C) Think about investing in newer hardware even to ay a new PC altogether, and using an updated OS like 2k or XP. Good PC configurations for even a Pentium 3 and Athlon now run dirt cheep and you can easily nowadays build a good system of 1GHZ or better for way under 1000 dollars that is way better supported not only by Microsoft but the hardware manufacturers.
Like I said I tried with three different sound cards: 2 from creative and one from uhm... AOpen Crystal.
I'll try to find out a WDM driver for one of those three.
I'll try to keep things as cheap as possible as we are talking about a dedicated nes/snes machine plugged on my TV
I'll try to find out a WDM driver for one of those three.
I'll try to keep things as cheap as possible as we are talking about a dedicated nes/snes machine plugged on my TV

The pouiller the better
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
Creative's website...
http://www.creative.com
Most of the time.. the default drivers that come with Windows has basic acceleration (that's what your SB16 falls into).. you definately want to download the drivers from Creative to get the most you can get.
http://www.creative.com
Most of the time.. the default drivers that come with Windows has basic acceleration (that's what your SB16 falls into).. you definately want to download the drivers from Creative to get the most you can get.
I get the same "shhhhhhhh" noise under the DOS version, and no difference wether the "force 8 bit sound" is on or not.
Oh and it doesn't happend when playing a WAV file in windows (neither in Snes9X like I said earlier).
Edit:
Just one question... Can we assume, considering the noise happens even in Pure DOS, that it's not a Windows driver issue?
Oh and it doesn't happend when playing a WAV file in windows (neither in Snes9X like I said earlier).
Edit:
Just one question... Can we assume, considering the noise happens even in Pure DOS, that it's not a Windows driver issue?
The pouiller the better
Changed some settings in the BIOS and nothing changed.
I did some tests with my SB128 PCI. I took no chance and I downloaded the latest driver from creative's website.
No more hissing noise! But, I can hear some slight crackling, whatever the sound config.
I first thought it could just be that way. But I put my AW37 back in, enabled Primary buffer and the sound was flawless.
I also get that crackling sound with that sound card on my Athlon 1.3 GHz WinXP.
So, I get the best sound quality, and I would even say perfect, using my ISA soundcards and enabling Primary Buffer.
I did some tests with my SB128 PCI. I took no chance and I downloaded the latest driver from creative's website.
No more hissing noise! But, I can hear some slight crackling, whatever the sound config.
I first thought it could just be that way. But I put my AW37 back in, enabled Primary buffer and the sound was flawless.
I also get that crackling sound with that sound card on my Athlon 1.3 GHz WinXP.
So, I get the best sound quality, and I would even say perfect, using my ISA soundcards and enabling Primary Buffer.
The pouiller the better
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
I thought about this further..
http://support.microsoft.com/?kbid=242937
I've had this problem before.. where I got static from ZSNES when I installed WDM based audio drivers on Windows 98SE (WDM drivers don't use .vxd(s))... I'm thinking that it is related to this:
Try it and see if the situation changes...
http://support.microsoft.com/?kbid=242937
I've had this problem before.. where I got static from ZSNES when I installed WDM based audio drivers on Windows 98SE (WDM drivers don't use .vxd(s))... I'm thinking that it is related to this:
This leak seemed to cause static when I had a PCI sound card...M$ Article wrote:Calling the Multimedia API Programs that use PCI Audio Wave devices in full-duplex mode may elicit a system memory leak of 64 bytes each time an audio stream is created, or its properties are programmatically examined.
Try it and see if the situation changes...
It probably isn't a Windows issue if you hear it in pure DOS.. but it does sound like something is enabled in the background (possibly controllable from DOS sound card driver controls)Just one question... Can we assume, considering the noise happens even in Pure DOS, that it's not a Windows driver issue?
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
when i had wdm drivers for windows 98se my pc's performance droped by approx 50% - 70% (so i stuck with vxd drivers) but now i have a new pc with winxp and wdm works fine
the crackling you speak of might be to do with not having cd audio muted or the microphone muted (or both)
my old pc was a p2 400mhz geforce 4 mx 4000 128mb (yes i know that vc sucks but amazingly the lates winxp drivers fixed most major issues with it (i think it flashed my vc) the sound card was a sb128 4channel and boy did it kick butt to some other cards i tested.
i tryed a soundblaster live value soundcard but it crippld my pc by 85% - 98% (because it only had wdm drivers and i think my pci slots were the wrong revision because looking at the manual i think it stated revision 2.3 pci slot reccomended but will run on pci 2.1 this requirement was not listed on the box itself)
the crackling you speak of might be to do with not having cd audio muted or the microphone muted (or both)
my old pc was a p2 400mhz geforce 4 mx 4000 128mb (yes i know that vc sucks but amazingly the lates winxp drivers fixed most major issues with it (i think it flashed my vc) the sound card was a sb128 4channel and boy did it kick butt to some other cards i tested.
i tryed a soundblaster live value soundcard but it crippld my pc by 85% - 98% (because it only had wdm drivers and i think my pci slots were the wrong revision because looking at the manual i think it stated revision 2.3 pci slot reccomended but will run on pci 2.1 this requirement was not listed on the box itself)