BSNES audio static

Announce new emulators, discuss which games run best under each emulator, and much much more.

Moderator: General Mods

Jagasian
Rookie
Posts: 16
Joined: Fri Oct 15, 2004 3:10 pm

BSNES audio static

Post by Jagasian »

I am using bsnes v0.018 on my XPS M1710, and the audio has lots of static in it. Is this due to an audio buffer underrun? How do I get rid of the static?
Stifu
Regular
Posts: 245
Joined: Fri Dec 10, 2004 10:02 pm

Post by Stifu »

Can your computer run bsnes at full speed (>= 60 fps) ?
If not, games will not sound right.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

According to Dell specs, that's a Core Duo T2600 2.16 GHz. I find it hard to believe that the CDs are that much worse than the C2Ds.

I think it's possible that your sound card could be the problem. bsnes was really finicky with the latency settings on my sound card. I got crackling on everything above the "48 sample" setting.

I would recommend downloading the latest sound drivers from

http://support.dell.com/support/downloa ... WW1&osl=EN#

and try messing with the settings after that.
Last edited by FitzRoy on Sat Jan 06, 2007 11:38 pm, edited 1 time in total.
Jagasian
Rookie
Posts: 16
Joined: Fri Oct 15, 2004 3:10 pm

Post by Jagasian »

Yes it is capable of running at a solid 60 fps.

I found a way to recreate the problem. When I load a game for the very first time, there is no static and the audio sounds good. However, after I switch bsnes into fullscreen mode, the audio stutters during the switch. Once the switch to fullscreen is complete, the audio stops stuttering, but it then it has lots of static, even though the emulation is still running at a solid 60 fps.

The reason why I think that this is a bug is because of the following:

After bsnes's audio gets full of static, even if I load a different game in windowed mode, the audio is still full of static. Reseting the game also does not fix the problem. The only way to get rid of the static is to close bsnes and run it again.
byuu

Post by byuu »

Last time I ran a PGO optimized game in bsnes on a Core 1 Duo, I got ~130fps. With the recent IRQ changes, it would likely get 100fps now. The processor is more than sufficient.

Jagasian, if you have an onboard card, that's probably where the problem is. My onboard audio (AC'97) does the same thing, but my $10 SB16 PCI sounds great. I don't know why onboard chips have to suck so much. My audio code is ridiculously simple, it just sticks samples into a circular buffer, and causes the emulator to wait each time the playback position drops too far behind the current generated sample.

I'll see if I can add some latency settings in the next release for those having problems. But keep in mind, higher latency = less responsiveness to input.
Jagasian
Rookie
Posts: 16
Joined: Fri Oct 15, 2004 3:10 pm

Post by Jagasian »

Regarding the CPU(s), my version of the M1710 has a Core 2 Duo T7200 @ 2GHz.

Considering that no other application has manifested this issue and because of the symptoms described in my previous post, I am leaning towards this being either a bug in bsnes or in my laptop's audio drivers. I'll see if there is an updated driver.

Thanks for the quick replies. I'd love to get this issue resolved, as I am stickler for emulation accuracy.
paulguy
Zealot
Posts: 1076
Joined: Sat Jul 02, 2005 2:01 am
Contact:

Post by paulguy »

i just have problems when triple buffering is on but my computer s only a athlon 2500+ 2.0Ghz.
Jagasian
Rookie
Posts: 16
Joined: Fri Oct 15, 2004 3:10 pm

Post by Jagasian »

My system uses a built in SigmaTel High Definition Audio device, and it is using the latest drivers. I'm not an audio buff, but that sounds like a generic built in chipset.

I am using the lowest audio latency setting in Nestopia, with no problems. Also, why would the audio get full of static only when switching into fullscreen mode? Why would the static not go away when switched back into windowed mode, even if a different game is loaded?

Maybe when switching between window and fullscreen modes, bsnes could pause emulation, so that the audio could also be temporarily stopped. It might be a simple workaround for crappy audio systems?
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

Jagasian wrote: Considering that no other application has manifested this issue and because of the symptoms described in my previous post, I am leaning towards this being either a bug in bsnes or in my laptop's audio drivers. I'll see if there is an updated driver.
Trust me, I used to think the same thing, because bsnes was the only program that needed my sound card's lowest setting. But like byuu said, when there is an input for the program to worry about, you have to choose between sound latency and input latency. It sounds like byuu didn't want to make the same compromise as other authors. There used to be a special build of bsnes with this opposing buffering technique (i think it was .017 by kode54). It's not worth digging up because of the accuracy improvements since then, but it was more compatible with people sound cards.

I think a config file option would be a good idea, and I'm not entirely opposed to an audio section either. I just wouldn't want it getting filled with useless stuff to kill off aesthetically unpleasant empty space.
Jagasian
Rookie
Posts: 16
Joined: Fri Oct 15, 2004 3:10 pm

Post by Jagasian »

I just tried the experimental version of bsnes version 0.019, and I enabled audio logging. The interesting thing is that the static doesn't occur in the generated WAV file.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Jagasian wrote:I just tried the experimental version of bsnes version .19, and I enabled audio logging. The interesting thing is that the static doesn't occur in the generated WAV file.
That's perfectly normal.
Errors you hear due to bad sound cards in conjunction with a program running, or bad audio interface in a program won't affect perfectly normal sample perfect WAV files which will sound fine playing back in any audio player fully compatible with your setup.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
byuu

Post by byuu »

As always, if anyone believes the problem is with bsnes' audio subsystem, the code is open source. If anyone offers improvements, I'll add them in. If anyone wants to go out of their way and write a completely new audio driver, I can use that, too. It's very easy to derive from the "Audio" class in src/ui, you need only support ~3 functions to get sound working. I added this class just so that I could add in audio drivers people write in the future with ease, since I wasn't able to add Nach/Bisqwit's last Linux driver.

In the mean time, I've done the best I personally could.

I tried adding kode54's event handler code to DirectSound, and it caused a decent speed hit and crackling on my sound card. If I recall the discussion, most people had reported even more problems with that change, and we decided not to go with it in the end. I can always add that back if people think it will help.

I don't know why the sound breaks up going from fullscreen to windowed mode, logging events looking for problems reveals nothing. I'm not a perfect programmer and have things I need help with to fix.

The only thing I'm substantially good at is improving SNES CPU and PPU emulation in general.

What I really need is a high end audio driver that does automatic resampling in the background, so that I can run the video at a perfect 60hz and audio that automatically resamples to fit the current playback frequency. The audio would sound an infinitesimal bit worse with the resampling, but I think most wouldn't notice with a good enough resampling algorithm. It would be far less noticeable than the lost video frames/tearing I have now. But I'm nowhere near qualified to make such a driver.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

byuu wrote: I tried adding kode54's event handler code to DirectSound, and it caused a decent speed hit and crackling on my sound card. If I recall the discussion, most people had reported even more problems with that change, and we decided not to go with it in the end. I can always add that back if people think it will help.
You know, you're right. There were more bug reports from that in a few weeks than we have with the current one in a year. You know that latency slider in nestopia? Would something like have any chance of fixing jagasian's problem as a config file option?
Jagasian
Rookie
Posts: 16
Joined: Fri Oct 15, 2004 3:10 pm

Post by Jagasian »

FitzRoy wrote:
byuu wrote: I tried adding kode54's event handler code to DirectSound, and it caused a decent speed hit and crackling on my sound card. If I recall the discussion, most people had reported even more problems with that change, and we decided not to go with it in the end. I can always add that back if people think it will help.
You know, you're right. There were more bug reports from that in a few weeks than we have with the current one in a year. You know that latency slider in nestopia? Would something like have any chance of fixing jagasian's problem as a config file option?
On my current system, I am running Nestopia with the lowest latency setting via the slider. However, on other systems I have experienced the same kind of static that I am getting with bsnes and increasing the latency does fix the problem.

However, I don't think that bsnes should cater to buggy PC hardware if that takes development time from improving the accuracy of the core emulation.
kick
Trooper
Posts: 550
Joined: Wed Mar 01, 2006 8:47 pm

Post by kick »

Byuu wanted a very high-quality resampler,so here's one that does a damn good job.

Check it out:
http://www.lcscanada.com/audiomove/

The highest-quality resampling engine you'll ever find (comparable to the high-end commercial [pro] apps).Uses libsamplerate as its resampling engine (open-source)

About sound latency, 20ms (4 buffers x 240 samples at 48kHz,DirectSound) will work fine with >80% of the soundcards.
Others may need twice the latency,while some will sound great even with 10ms,so having a sound latency setting is a very good idea.

P.S. If you ever add sound resampling to bsnes,please add a preference in the .ini to turn this off,in case somebody has a pro soundcard or an X-Fi.
Last edited by kick on Mon Jan 08, 2007 7:48 am, edited 4 times in total.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

Open source != license compatible, just in case if things don't come quite the way you expect.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
tetsuo55
Regular
Posts: 307
Joined: Sat Mar 04, 2006 3:17 pm

Post by tetsuo55 »

Bsnes doenst crackle for me (except with tripple buffering) on both my onboard sound (nforce 2 Soundstorm) and my pro card (X-fi Platinum)

I believe i read somewhere that 20ms is the standard on windows pc's?
kick
Trooper
Posts: 550
Joined: Wed Mar 01, 2006 8:47 pm

Post by kick »

LOL,X-Fi platinum is not a pro card,it's just a high-end consumer card.
Something like the X-Fi Elite Pro can be considered pretty accurate,although you can get a much better pro card for that money.
Last edited by kick on Thu Jan 11, 2007 11:00 pm, edited 2 times in total.
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

Anything soundblaster shouldn't be considered for sound accuracy for anything.

its a platform for EAX, and despite what they'd like people to think, not much else.

EAX under vista doesn't work.
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
Clements
Randomness
Posts: 1172
Joined: Wed Jul 28, 2004 4:01 pm
Location: UK
Contact:

Post by Clements »

Clarification: EAX is hardware-accelerated with OpenAL under Vista, but not DirectSound. Apparently Creative are putting out X-Fi drivers that can wrap legacy EAX calls to OpenAL EAX to remedy the issue.
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

Clements wrote:Clarification: EAX is hardware-accelerated with OpenAL under Vista, but not DirectSound. Apparently Creative are putting out X-Fi drivers that can wrap legacy EAX calls to OpenAL EAX to remedy the issue.
it only took them till after RTM to realise that.
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
kick
Trooper
Posts: 550
Joined: Wed Mar 01, 2006 8:47 pm

Post by kick »

funkyass wrote:Anything soundblaster shouldn't be considered for sound accuracy for anything.
...although an Audigy2 with the right drivers (kX Project) can sound exceptionally good.Still prefer this combination over an X-Fi with bug-ridden drivers.
Creative drivers have always been a piece of shit.

The SoundStorm was pretty impressive for an onboard audio solution.Not bad at all when using the digital out,despite having only a 16-bit output.
Last edited by kick on Sun Jan 14, 2007 5:38 pm, edited 1 time in total.
tetsuo55
Regular
Posts: 307
Joined: Sat Mar 04, 2006 3:17 pm

Post by tetsuo55 »

an X-fi in audio creation mode outputs 1:1 sound giving you great sound quality and making it a pro card, the only difference between the platinum and the elite pro is the dac, the elite pro has a 8db higher S/N ratio on the dacs.

The rest is identical


EAX is only enabled in game mode and optionally enabable in entertainment mode, besides that, the card is THX certified
Que
saskatchewanite
Posts: 195
Joined: Wed Apr 26, 2006 8:22 pm

Post by Que »

tetsuo55 wrote:an X-fi in audio creation mode outputs 1:1 sound giving you great sound quality and making it a pro card, the only difference between the platinum and the elite pro is the dac, the elite pro has a 8db higher S/N ratio on the dacs.

The rest is identical


EAX is only enabled in game mode and optionally enabable in entertainment mode, besides that, the card is THX certified

8db of noise is alot. Big difference when using large speakers and high quality amplifiers. [/audiophile]
everything i say is a lie
the above line is true
Firon
Trooper
Posts: 361
Joined: Fri May 05, 2006 4:37 pm
Contact:

Post by Firon »

Not when your noise floor is already far too low to hear... It'd really only matter for recording.
Post Reply