Audio Crackling for bsnes Core

Howdy,

I’ve been using RetroArch so far to replay classics from the SNES, such as Super Mario World and Super Mario RPG, but I’ve noticed that if I use the bnes balanced core, the audio tends to crackle terribly sometimes. What options should I adjust to fix this?

Here’s information that’s probably relevant:

–I’m using a Windows 7 Toshiba Laptop 64-bit

–Retroarch v0.9.9 (I assume that it’s latest… got it off from Themaister’s Den and then updated through phoenix)

The audio works perfectly if I use the Snes9x core (although I’ve heard bnes is more accurate and my laptop handled everything else well enough)

That’s almost certainly a case of your performance dipping occasionally below 60 fps. What kind of CPU does your laptop have (make, model and clock speed)?

Here’s a shot from CPU-Z:

That looks like it should be okay, unless you’ve got overly aggressive power management or demanding background processes (antivirus, etc). You can try tweaking your audio latency and/or your monitor refresh rate, but if everything else is working, it likely won’t help. :confused:

When you’re running (and crackling), is your CPU at 100% utilization?

Here’s are my video and audio settings:

I tried moving audio latency and the refresh rate around a bit, but that didn’t seem to lead anywhere. Also, from the task manager, cpu usage is around 25%, which seams reasonable

Again, the Snes9x core seems to work fine (as an aside… if I try NES emulation through a Nestopia core, there’s also constant audio crackling).

Hmm. That 25% could indicate that it’s running at full utilization, actually. Since it sees hyperthreading as actual cores, 1 core fully taxed out of 2 physical cores + 2 hyperthreading cores = a reported 25% utilization. Can you try opening your Resource Monitor (from the task manager, go to the ‘performance’ tab and click the button for the ‘Resource Monitor’ at the bottom. Once there, go to the ‘CPU’ tab and it will give you a full breakdown of each core’s activity) to get a detailed readout?

That’s surprising about Nestopia, though, since it’s very lightweight (even runs on a raspberry pi…). You might also try using the Direct3D9 video driver, as it works better than OpenGL for some people. OTOH, problems with the video driver usually just cause frame drops/stutters, rather than audio crackling.

Try adding video_threaded = “true” to your retroarch.cfg file. I’ve found that usually gets rid of minor crackles.

Your processor should definitely be able to handle this without threaded video on. Its better than mine and mine does not have this issue. What about your graphics card and shaders. If you have a weak graphics solution and powerful shaders running it could drop fps. Also check in rgui (f1) during gameplay and go to your video settings. See if hard gpu sync is on and if it is, check if it is set to sync at 0 frames (the option right underneath it). If so that could also really be it, try setting it to 1 if so, this has shown to be a lot less taxing on my system. You generally want to use hard sync if possible though since it reduces input lag.

Also the reason you want to avoid threaded video is becuase it could cause increased input lag and some screen tearing even with v sync on. So try threaded video only as a last resort. Also if nothing else works, try using the d3d9 video backend. Also I noticed a weird glitch sometimes when messing with settings where video would slow down weirdly when it shouldn’t be, mainly when I turned threaded video on and then off. To fix it switch video backend (to d3d9 or SDL) load retroarch, and then quit and switch back to opengl. You might have to do this every time you toggle threaded video on or off. Maybe not though, it could just be my system. That’s about all I can think of for now. Hope it helps

I did some testing with Mega Man X2 in BSNES balanced recently. That game has a few parts that seem to be more resource intensive than SuperFX games; the title screen when he shoots a charged shot after pressing start and the stage select screen. Both of those crackled a lot with threaded video off and using hard sync frames 0. I found out switching to 64bit RetroArch was enough of a performance boost to fix that without having to turn on threaded video or sacrificing hard sync frames 0. This is on my i5 2500k running at stock 3.3ghz paired with a GTX 570.

I do still get minor crackles sometimes in the BSNES balanced core as well as Mednafen PSX. I barely have any background processes running, though I haven’t checked CPU utilization while running those cores. I have to use hard sync frames 1 for PSX or it will crackle all the time. I’ll probably try turning off hard sync for those two cores to see if I feel enough of a difference now that I can play without video stutters at 120hz thanks to the swap interval 2 option. Playing at 120hz might have enough of an input lag reduction by itself that hard sync off could be ok.

Yes, Mega Man X2 and X3 are the most demanding games bsnes can run; especially some wireframe scene, which I’d guess is the stage select screen. Check if the performance core is more cooperative (all profiles share the Cx4 emulation code, which is where most of the time is spent, but it’ll still do a little); if not, you may need to use snes9x.

(sorry, was eating supper)

Here’s the graphs:

Super Mario World runs fairly well, but Super Mario RPG and Yoshi’s Island (Super Mario World 2) have constant audio crackling.

That indeed sounds like a performance issue, then, as both of those games use special chips, which raise the requirements significantly. It’s odd, though, since that CPU should be fine, as timde9 said. I think your best bet is going to be the threaded video option, though it’s suboptimal…

Hmm, well I’m stupid. I was using a HQ2x bnes filter and when I took that away, Yoshi’s Island and Mario RPG ran perfectly. This also mostly fixed Nestopia (although if I just run Nestopia by itself and choose hqx with 4x, it still runs better than through RetroArch)

Would using a HQx shader (such as the .cg and .shader) perform better than a bnes filter (which are .filter)?

And like I said previously, using the Snes9x core, it had not issues regardless of what bnes filter I used. Using the bnes core, a simple 2x scale filter provided some crackling, while the HQx2 murdered the audio.

bsnes filters are cpu while shaders are gpu, so if you have a decent gpu then yes it would be much better to use shaders rather than bsnes filters.

Unless your GPU is horrible, shaders will always outperform CPU filters. CPU filters are dead. .filter is laaaaaaame.

Well, I tried several different cg shaders and something is definitively not working. The image is distorted a bit so it’s actually worse then just vanilla and there’s lag and audio crackling. Can Intel integrated graphics handle cg shaders?

the distorted image part shouldn’t be happening, but Intel graphics below HD 4000 level are definitely pretty terrible for shaders. Which ones are you trying?

Well, I can’t find what version the Intel HD Graphics is… , but I did find it’s specs on Intel’s website:

Also, regardless of the shader, the video still tends to become blurry and off a bit.

Vanilla:

A poor attempt at using hq2x.cg:

(it might be hard to tell from this image. but if I attempt to use something like hq4x or xBR, it looks the same and is barely close to what it should be)

Try turning off bilinear filtering. xBR expects point/nearest neighbor filtering, I know.

The HQ2x picture looks like it’s working to me, though it may benefit from nearest neighbor filtering, as well.

Yes, disabling bilinear filtering did the trick:

That’s running hq4x and it also works for Yoshi’s Island and Super Mario RPG without audio crackling (aside from when it first loads up).

So, would you still suggest using the .CG filter over bnes filters, even though I have integrated graphics? (that seems to be the case though)

Also, thank you for the help. I’m a noob to RetroArch