Snes9x Sound

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
WedNESday
Posts: 1284
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Snes9x Sound

Post by WedNESday »

Can anyone please explain to me the following sound settings?

1. Frame Advance Mute
2. Anti-Resonance's sample decoding method
3. Fake Mute desync workaround
4. Hi Res

For optimum sound/graphics quality, should these be set or not?
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Snes9x Sound

Post by Bregalad »

WedNESday wrote:Can anyone please explain to me the following sound settings?

1. Frame Advance Mute
2. Anti-Resonance's sample decoding method
3. Fake Mute desync workaround
4. Hi Res

For optimum sound/graphics quality, should these be set or not?
I don't remember 1 and 3 (probably they only came up with a very recent update ?)
I'll try to explain 2 and 4 :
2) Anti-Resonance is the pseudonyme of a guy, it has nothing to do with the sample decoding method itself (like I originally trough). This is the guy who cracked/figured out how the correct sample decoding for the SNES works, and ticking that box would use a more accurate method to decode samples. Back then leaving that box unchecked make the wind in Chrono Trigger sound like sirens instead, and check it made wind noise. Now I guess they improved their methods, and I don't remember which one souds the more like the wind on the real hardware.

4) Hi-res is needed for games like Secret of Mana that uses 512 pixels horizontally I belive. If you disable it, SOM won't work. Why you want to do that I don't know.
Useless, lumbering half-wits don't scare us.
caitsith2
Posts: 74
Joined: Mon May 26, 2008 11:41 pm

Post by caitsith2 »

Number 1 and 3 are both used for Tool Assisted Speedruns.

Number 1 just mutes the sound when you are recording the movie input frame by frame, sometimes loading a state if you didn't like the end result of a given frame input.

Number 3 relates to some games that use registers from the APU as a source of randomness, which is a no go when it comes to consistent playback given a set of input, and a given game state. Fake mute here is that that the sound register involved is being reported back as a consistent value, even when it is different from the actual sound output.
WedNESday
Posts: 1284
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday »

Well I've moved onto ZSNES v1.50 now because on comparison between the two, ZSNES had superior audio. I don't use v1.51 because of it shows all 224 lines and the bottom one on some of the games really stands out and is very annoying. They said they'd fix this in the next version of ZSNES, but it hasn't been updated in almost two years.

But what do you guys think of bsnes in comparison to the big two?
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

But what do you guys think of bsnes in comparison to the big two?
BSNES is very accurate, but I can't get it to decent speed on my PC. Use it for developping, not for playing (like Nintendulator).
I trought that SNES9x had supperior audio but maybe that changed. "Noise" isn't played loud engough and this changes sound effects significanly in some games.
Useless, lumbering half-wits don't scare us.
WedNESday
Posts: 1284
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday »

Just how accurate is bsnes? (What is, and what isn't emulated...)

I've noticed a huge difference between the triforce intro in Zelda for the SNES between Snes9x + bsnes and ZSNES. Check it out.
Near
Founder of higan project
Posts: 1553
Joined: Mon Mar 27, 2006 5:23 pm

Post by Near »

I don't use v1.51 because of it shows all 224 lines and the bottom one on some of the games really stands out and is very annoying.
Line 224 should be there, the system does render it. In ~50% of games, the data there is valid, and in ~99% of games, it blends in fine. There's a bug in ZSNES where it shows the wrong data there, though. Noticeable in most games.

Nobody's ever complained that I render it.
But what do you guys think of bsnes in comparison to the big two?
It sucks. Very slow, no savestates, no netplay, no movie features, no SuperFX or SA-1 support; and its license is too restrictive due to a paranoid author.
I trought that SNES9x had supperior audio but maybe that changed. "Noise" isn't played loud engough and this changes sound effects significanly in some games.
You may prefer Snes9X' audio, especially with artificial enhancements such as cubic interpolation, but it's never been closer to the hardware. At first, I used anomie's core, which was Snes9X / OpenSPC + many improvements. But for the past year or two now, I use blargg's S-DSP emulator, which is cycle-based and bit-perfect sans a slight pulse when you mute channels. SNES audio volume is just really low in general.

ZSNES v2 will have the same S-DSP core.
(What is, and what isn't emulated...)
http://byuu.cinnamonpirate.com/bsnes/errata/
http://byuu.cinnamonpirate.com/articles/emulation/ -- read the "What does no hacks mean?" section, the rest is background noise.

Executive overview:

S-CPU is nearly perfect. The only noticeable differences are:
- CPU rev. 1 HDMA crashing bug not supported
- Auto-joypad polling delay not supported
- Reading mul / div registers early doesn't return partially computed data
No software could make use of these bugs, so they don't affect games, at least.

S-SMP is also nearly perfect, except the timer glitch before the mini-SNES is not supported, and the TEST register won't crash the system like it does on the real thing. Again, no games use that, as it's not a very useful effect to crash the system.

S-DSP is bit-perfect sans channel mute. I didn't do any of this work though, it was all blargg's research and code.

S-PPU is a hacked up piece of shit. It's a scanline renderer. Although it does emulate all known hardware features, as well as bugs and quirks that nobody else does: $2100 OAM reset, interlace sprite height glitch, etc. We get lucky in that few SNES games need cycle renderers, whereas many NES games do. No SNES emu goes beyond scanline yet.

Aside from the S-PPU, they all use the lowest possible level of timing, including even cycle-level bus hold delays. Every CPU and SMP opcode whose cycle-level timings could be verified by tests have been. CPU by myself and anomie, SMP by blargg.

You can think of bsnes as Nintendulator with NESticle's PPU renderer.

So really, we need to rewrite the S-PPU, add a half-dozen hardware glitches, and it'll be 99.99% as good as you can ever possibly get from emulation. Then we just need to make it all fast. Eg Snestopia. What do you say, Marty? ;)
I've noticed a huge difference between the triforce intro in Zelda for the SNES between Snes9x + bsnes and ZSNES. Check it out.
That's due to timing. For some reason, most people seem to think ZSNES is more accurate than Snes9X. In truth, it's just more stable. '9x has a lot of out-of-bounds memory errors that crash the thing (eg MMX3) due to overly-aggressive and dangerous optimizations (passing lots of raw pointers around and such.)

I always get my tests bit-perfect in my own emulator, and they're usually relatively close with every other emulator. But with ZSNES v1.51 and earlier, the results are off in center field. It's basically overclocked by ~20-30% in most cases, as that helps overall compatibility when timing is bad. And that's why those triforces swing together so quickly.

ZSNES v2 is supposed to address the timing issues with CPU+SMP, and use blargg's DSP, so it should be a lot better.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

You may prefer Snes9X' audio, especially with artificial enhancements such as cubic interpolation, but it's never been closer to the hardware. At first, I used anomie's core, which was Snes9X / OpenSPC + many improvements. But for the past year or two now, I use blargg's S-DSP emulator, which is cycle-based and bit-perfect sans a slight pulse when you mute channels. SNES audio volume is just really low in general.
Well, I bet blargg's algorithms are very accurate. Old algorithms weren't and Chrono Trigger's sound effect sounded all wrong.
It's also good there is an optionnal "better than hardware" like higher sample rate and better interpolation, as long as this is fully optionnal (like NES emulators that can disable the 8 sprites per line limit).

About the volume I was saying that when noise is output instead of samples, the volume is relatively to other chanels too low (as compared to the real console), significantly changins sound effects in Secret of Mana and Chrono Trigger.
It sucks. Very slow, no savestates, no netplay, no movie features, no SuperFX or SA-1 support; and its license is too restrictive due to a paranoid author.
You're probably not being objective here, and the emulator was meant to be accurate, not to be a good tool to play games with. If you want to play game you'd want a faster and more user friendly emulator like SNES9x or ZSNES.
Useless, lumbering half-wits don't scare us.
Near
Founder of higan project
Posts: 1553
Joined: Mon Mar 27, 2006 5:23 pm

Post by Near »

Well, I bet blargg's algorithms are very accurate.
Yes, as I said, they're bit-perfect. We can verify this thanks to the echo buffer write feature of the S-DSP.
About the volume I was saying that when noise is output instead of samples, the volume is relatively to other chanels too low (as compared to the real console), significantly changins sound effects in Secret of Mana and Chrono Trigger.
And yet, the results are 100% verified and 100% bit-perfect in emulation to what the real S-DSP outputs. Maybe your TV is doing something to the audio?

Code: Select all

    int feedback = (state.noise << 13) ^ (state.noise << 14);
    state.noise = (feedback & 0x4000) ^ (state.noise >> 1);
That's been known for a long time. Back in the '90s, emulators just used rand(), which did indeed sound horrendous by comparison.

If you still don't agree, you'll need to present some empirical evidence, such as a S/PDIF recording from Chrono Trigger, as well as the emulator output, in WAV / graph form.
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

byuu wrote:
About the volume I was saying that when noise is output instead of samples, the volume is relatively to other chanels too low (as compared to the real console), significantly changins sound effects in Secret of Mana and Chrono Trigger.
And yet, the results are 100% verified and 100% bit-perfect in emulation to what the real S-DSP outputs. Maybe your TV is doing something to the audio?
At the very least, give an example of the sound effect so one of us can record that from a SNES and compare with the emulator.
tomaitheous
Posts: 592
Joined: Thu Aug 28, 2008 1:17 am
Contact:

Post by tomaitheous »

You're probably not being objective here, and the emulator was meant to be accurate, not to be a good tool to play games with. If you want to play game you'd want a faster and more user friendly emulator like SNES9x or ZSNES.
Hehe. I'm sure byuu had a good laugh at your response. Do you know who byuu is?
User avatar
BMF54123
Posts: 410
Joined: Mon Aug 28, 2006 2:52 am
Contact:

Post by BMF54123 »

byuu wrote:Maybe your TV is doing something to the audio?
I think most people tend to forget (or are unaware) that TV speakers and audio circuitry are usually pretty terrible compared to PC speakers, and are optimized for ordinary TV viewing by default, so of course there are going to be audible differences between the two.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »


And yet, the results are 100% verified and 100% bit-perfect in emulation to what the real S-DSP outputs. Maybe your TV is doing something to the audio?
No, the problem I mention happens in SNES9x, NOT in emulators using Blargg's algorithm, which sounds exactly like real hardware I guess. Sorry for being confusing on that point.
Hehe. I'm sure byuu had a good laugh at your response. Do you know who byuu is?
Somewhat, that still not make him objective. I was under the impression he was between ZSNES and not behind BSNES for some reason (why would one insult his own software ?) This was probably hironical and I missed the point.
Useless, lumbering half-wits don't scare us.
Near
Founder of higan project
Posts: 1553
Joined: Mon Mar 27, 2006 5:23 pm

Post by Near »

No, the problem I mention happens in SNES9x, NOT in emulators using Blargg's algorithm, which sounds exactly like real hardware I guess. Sorry for being confusing on that point.
Oh okay, cool. Wouldn't know what that used for noise simulation.
I was under the impression he was between ZSNES and not behind BSNES for some reason (why would one insult his own software ?) This was probably hironical and I missed the point.
I believe WedNESday was asking for an overall comparison between emulators. And what I said was true for what most people care about. The vast majority notice CPU usage over minor accuracy things like Zelda's triforce effect timing.

In truth, we still have to compromise between speed and accuracy, as it's not a linear curve -- rather it's exponential. You lose speed more and more while gaining less and less. Take it too far past modern processing power, and the software loses its mass appeal. I've gotten my software so slow that five out of the seven PCs I have access to can't get 60fps with it: I haven't compromised at all. I have 100% compatibility, and yet I'm still sacrificing speed for accuracy.

Worse yet is I estimate it'd be within feasibility to roughly double the speed with no accuracy loss by optimizing things*. Much moreso with a few minor compromises. But that would make it a lot harder for me to fix bugs and improve upon the code later. See, I'm going for a strict-research platform, with the goal being to let other emulator authors add my findings to their emulators, but with appropriate speed optimizations. Still, it makes for a lousy, power-wasteful program for general gaming. So until the other emulators catch up -- I suppose it's fairly useful for playing, assuming you have the PC power for it.

(* I'm really stubborn about the way the code is modeled. It's much faster, for instance, to enslave the SMP to the CPU, yet I keep them separate anyway, because I feel that more closely reflects how the real hardware works. Speed loss with no accuracy gain, and I do that a lot. Long explanation for that here.)

And that's really the gist of it. Getting things accurate isn't that hard, getting them fast isn't, either. But getting both -- that takes the real talent.
User avatar
FitzRoy
Posts: 144
Joined: Wed Oct 22, 2008 9:27 pm
Contact:

Post by FitzRoy »

Bregalad wrote: You're probably not being objective here, and the emulator was meant to be accurate, not to be a good tool to play games with. If you want to play game you'd want a faster and more user friendly emulator like SNES9x or ZSNES.
First of all, anyone who works a few extra nights flipping burgers can afford a computer capable of running bsnes, and in ten years they'll be able to pick one off the curb capable of running bsnes. It means nothing today that Nesticle can get 60fps on a Pentium 166 and Nestopia can't, it is now a useless trait to be able to do that in exchange for more crashes, more bugs, more headaches. And the same thing happened to ZSNES, which is why they're rewriting almost the entire thing. And I still won't use it, because I still won't like the GUI, and I don't believe they will be willing to do what byuu had to do to get the kind of compatibility assurance he did.

I'd also point out that there is a dark side to savestates. They can become a dependency for people, and it's easy to accidentally overwrite days of progress. Sometimes when it happens, people will actually bother to register just to complain that it happened, as if we can somehow give them their life back.
Post Reply