Crackles on FCEUX emulator

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Crackles on FCEUX emulator
by on (#214077)
Hello there,
I'm new to the forum so please be gentle. I'm using the NES tracker, NTRQ on FCEUX emulator and I'm experiencing some sound issues. I get some tiny little crackles and pops that seem to be coming from the DPCM channel. I'm running it on a PC laptop with Windows 10 64bit. I've tried all sorts of settings such as reducing screen reseloution, reducing and increasing sample rate, Vsync, Hardware acceleration, etc. Has anybody experienced a similar problem and fixed it? Am I being completely stupid and missing something very obvious?
Cheers
Re: Crackles on FCEUX emulator
by on (#214078)
What version of FCEUX ?

Are you trying to record ?

Does it happen at the exact beginning of a sample ?
Re: Crackles on FCEUX emulator
by on (#214081)
I get this whenever I use vsync in FCEUX. I only really use FCEUX as a debugger so I've never needed to have vsync on for that, but normally for playing stuff i think vsync is pretty critical. :P
Re: Crackles on FCEUX emulator
by on (#214108)
dougeff wrote:
What version of FCEUX ?

Are you trying to record ?

Does it happen at the exact beginning of a sample ?



It's version 2.2.3. I do record with it but it still crackles even when I'm not. It doesn't seem to happen at any specific point of the sample. Seems quite random.
Re: Crackles on FCEUX emulator
by on (#214110)
Fceux audio tends to crackle when the computer is under enough load to not be able to run the emulation time consistently. It used to happen a lot on my older computers, but not so much now.
Re: Crackles on FCEUX emulator
by on (#214111)
I see. Anything I can do to reduce the load? Would running it on a different operating system help?
Re: Crackles on FCEUX emulator
by on (#214112)
Wouldn't surprise me if it did matter a bit.

As for windows, it's the usual:
-remove redundant background services and applications, if any, from autostart
-don't run too many applications at the same time, also including any browser tabs that might tax the cpu.
Re: Crackles on FCEUX emulator
by on (#214113)
The crackling issue I get is whenever vsync is used, not related to CPU at all, but I'm not sure if I have the same problem as OP. (Or perhaps they are symptoms of the same cause... some bad synchronization with audio?)
Re: Crackles on FCEUX emulator
by on (#214150)
Random comments from me in passing:

* I've seen/experienced this myself many times over the years, but I have it under control for the most part at this point
* What video card model you're using matters. AMD vs. nVidia vs. Intel all play a role. Different video cards' drivers implement Vsync differently (and some even override it to be disabled no matter what the application wants)
* Fullscreen vs. windowed also seems to matter (or at least it did when I was using Windows XP; not sure about 7 now -- people tell me it's less of a problem on 7 in general, but I've found plenty of games which behave differently in windowed vs. fullscreen on 7)
* The Sound Latency slider under Config -> Sound is also relevant -- if the buffer is too small crackling can happen. The behaviour of this seems to vary per soundcard too
* I still don't know what "Use Global Focus" does
* I also get brief crackling/desynced audio when the application loses and regains focus, but this is pretty common in a lot of emulators (IIRC, Mesen is one which doesn't do this, probably because of how Sour implemented everything)
* Hardware timers matter greatly when it comes to proper A/V sync and audio buffering in general. Windows is a notorious jerk about providing insights into what hardware timer it's using. There is a tool called DPC Latency Checker that can help see if you're having high latency which can cause crackling or oddities in audio especially.

In general, I DO NOT use FCEUX to play NES games. I use Nestopia or Mesen or BizHawk for that. Those three offer a better overall experience. Like rainwarrior, I primarily use FCEUX for debugging/development/hacking.

My settings, just for the record, for Windows 7 Ultimate SP1 x64 with an nVidia GTX1060 and on-board sound (Realtek ALC887 using Realtek driver version r281 (r282 has all sorts of systray problems)):

* I use windowed mode exclusively
* Config -> PPU -> New PPU (I'm unsure if this has relevancy; I assume New PPU takes up more CPU time emulation-wise but I'm out of my element)
* Config -> Video -> Windowed Settings -> Special filter: none
* Config -> Video -> Windowed Settings -> Sync method: Wait for VBlank
* Config -> Video -> Windowed Settings -> DirectDraw: No hardware acceleration
* Config -> Video -> Sound -> Buffering -> [x] Use Global Focus
* Config -> Video -> Sound -> Buffering -> Sound Latency -> 48 (see below)
* Config -> Timing -> [x] Set high-priority thread

You can't see the exact number for Sound Latency in the UI (sigh), you have to open up fceux.cfg in Notepad -- and it's a very wonky/unique file format -- but search for soundbuftime and look at the number right after.
Re: Crackles on FCEUX emulator
by on (#214158)
That's really helpful. Thank you. I'll check my specs, give it a go and report back. Thanks everyone for your help.