96000HZ audio impliementation code submission.

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

kode54 wrote:over all the placebo.
CRAAAAWLING IIIIIIN MY SKIIIN
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Bahamut_ZERO_Clue

Post by Bahamut_ZERO_Clue »

I'm actually speechless at the level of maturity you guys are actually asserting here. It really shows how much you really care about helping out, teamwork, and letting others contribute to your project. Real good guys. Real good. I actually wonder if you act like arrogant bastards in real life towards your friends, spouses, and family? I would certainly hope not, but usually I'm wrong and people like you actually do.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

I don't think anyone wanted to be intentionally mean.. though after hearing the music, you've got to realize the reaction everyone gave.

If you've seen the NTSC filter thread, there's quite a bit of feedback. I've not tested the build myself, but judging from the screenshot.. I definately see a reason why pagefault and others were interested in it.

In any case, perhaps you may want to rethink doing this specifically.. unless that's an actual tangible benefit that I'm not aware of.. maybe there is something much more nifty you can add (I can't think of anything off the top of my head).

The only time I hear an actual difference is the rain in Zozo with 44Khz (and maybe a couple other sounds)
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Bahamut_ZERO_Clue

Post by Bahamut_ZERO_Clue »

I'm hopeful it was just mild hazing but I'm no fan of anyone who bullys anyone else.

I'm not rethinking the idea as I have a 96khz audio chipset. Yeah the White Noise Generation technique used by some Sqauresoft games is really not decerable unless you start comparing everything to 32khz.

I'm waiting to get new sources from the new repository once it gets up and running, hopefully within the next few days. I didn't think to check the dspproc.asm for this. I had assumed it was all handled mostly by the DirectSound WaveOut-to-PCM code used in the winlink.cpp file. Great... more asm to deal with. I really got to brush up on my asm skills.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

I think you're better of waiting until pagefault works on the DirectSound code... if I recall correctly, some threading was to be done to decrease the chances of static (bad audio) on older cards... but I wouldn't too excited waiting for it.

It's hard to imagine that a big portion of the code is still in ASM.. but it is amazing...
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

Hay cool, I have a 96KHz sound card too. Well, actually, it's supposed to be 192/24, but who really cares?

You're welcome to perform your own blind testing, assuming you have some material which has genuine high frequency content, and you have a sound system capable of reproducing it properly. Don't forget the gold plated optical cables.
Aerdan
Winter Knight
Posts: 467
Joined: Mon Aug 16, 2004 10:16 pm
Contact:

Post by Aerdan »

At this point, I think you really should quit trying. You don't gain anything by having 96kHz sound, since the original hardware mainly only did 32kHz + Gaussian interpolation, and most games assume you're using 32kHz, which makes things sound like ass if you use anything else.
Yoyo
New Member
Posts: 6
Joined: Sun Feb 12, 2006 11:20 am

Post by Yoyo »

Hello,Guys.Already a good example there,the Gens32 Surreal,which can max support 192MH sample rate.Why not give it a try,and then decide to do or not.

Here's a website link:http://gens32.emubase.de
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

Yoyo wrote:Hello,Guys.Already a good example there,the Gens32 Surreal,which can max support 192MH sample rate.Why not give it a try,and then decide to do or not.

Here's a website link:http://gens32.emubase.de
This might be important for the emulation of SEGA consoles, but the SNES uses samples with a fixed frequency. Anything that plays them at a lower/higher one is removing/adding data.

:roll:
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Jipcy
Veteran
Posts: 768
Joined: Thu Feb 03, 2005 8:18 pm
Contact:

Post by Jipcy »

kode54 wrote:gold plated optical cables.
Haha.
[url=http://zsnes-docs.sf.net]Official ZSNES Docs[/url] | [url=http://zsnes-docs.sf.net/nsrt]NSRT Guide[/url] | [url=http://endoftransmission.net/phpBB3/viewtopic.php?t=394]Using a Wiimote w/ emulators[/url]
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Deathlike2 wrote:I don't think anyone wanted to be intentionally mean..
I sure did want to be.
It really shows how much you really care about helping out, teamwork, and letting others contribute to your project.
I don't care about someone who doesn't even test his code before sending a patch. You're a filth among coders. Begone.
I actually wonder if you act like arrogant bastards in real life towards your friends, spouses, and family? I would certainly hope not, but usually I'm wrong and people like you actually do.
Indeed you're wrong, I'm a 100% arrogant egoist bastard and don't hesitate to say something's shit when it's shit.
The point where you're wrong (twice) is that my friends, gf and family aren't packs of retards, so I have no use of arrogance with them. I keep it for your kind.

PS: I'm not locking this, but I won't reply anymore, so feel free to waste your time.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Reznor007
Lurker
Posts: 118
Joined: Fri Jul 30, 2004 8:11 am
Contact:

Post by Reznor007 »

There actually is a valid reason for adding this. On almost all PC soundcards audio is resampled from whatever it's native form is to 48KHz for output. On alot of chipsets the resampling isn't very good. Since some cards have a native 96KHz output you can get a clean output from SNES games by using 3x the original sampling frequency instead of an uneven 1.5x(to 48KHz). 44.1KHz output is even more worthless for SNES. I believe some sound cards do have a native 32KHz output, and that would be ideal, but most don't.

It falls under the same category as supprting 1600x1200 resolution. It's there to make sure LCD's don't look like crap from their own internal resampling. Audio has the same problem.
SteveSnake
Rookie
Posts: 11
Joined: Thu Mar 02, 2006 8:41 pm

Post by SteveSnake »

creaothceann wrote:This might be important for the emulation of SEGA consoles
No, it isn't ;)
Bahamut_ZERO_Clue

Post by Bahamut_ZERO_Clue »

Yes and most S/PDIF output on 96khz or higher audio cards and chipsets is at a pre-set level and can't be changed. My own system's S/PDIF and native speaker output has settings for 44.1khz, 48khz, and 96khz but everything below 96khz is upmixed and sometimes it can sound really bad.
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

my audigy does just fine.
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

creaothceann wrote:
Yoyo wrote:Hello,Guys.Already a good example there,the Gens32 Surreal,which can max support 192MH sample rate.Why not give it a try,and then decide to do or not.

Here's a website link:http://gens32.emubase.de
This might be important for the emulation of SEGA consoles, but the SNES uses samples with a fixed frequency. Anything that plays them at a lower/higher one is removing/adding data.

:roll:
Actually, that FM chip should also be producing output at a fixed sample rate, relative to its emulated clock rate. In this case, almost exactly the NTSC colorburst rate, and producing a sample every 72 clocks, or about 49716Hz. This is exactly what Gens does when "YM2612 High Quality" mode is enabled, and presumably what Kega is doing when "SuperHQ" is enabled, as the resulting behavior is consistent.

Downsampling that to 48000Hz or even 44100Hz with a proper filter is unlikely to cause noticeable distortion, while upsampling to 96000Hz is unlikely to benefit anyone. 192KHz is just plain silly.

Now I'm getting off-topic again.

A decent sound card should be able to switch its output to match the playback signal, even S/PDIF. If not, there's Windows' own software resampling, which most single-stream sound solutions rely on nowadays. Open the Control Panel, then Sounds and Audio Devices, select the Audio tab, then click Advanced... under Sound playback. Check the Performance tab and set Sample rate conversion quality to Best. Assuming you're not stuck with poor quality hardware resampling, in which case your hardware probably can't push out 96/24 anyway.
byuu

Post by byuu »

If a card supports 96khz natively and can't resample from 32khz without adding noise, you need to throw that card in the trash.
123 -> 111222333.

Here, why not add support for 2.84mhz frequencies while you're at it?
http://en.wikipedia.org/wiki/SACD
There is no evidence that human beings are sensitive to audio frequencies above 20 kHz, and most people over the age of 35 are unable to hear sounds above 15–16 kHz at 72 dB.
Reznor007
Lurker
Posts: 118
Joined: Fri Jul 30, 2004 8:11 am
Contact:

Post by Reznor007 »

byuu wrote:If a card supports 96khz natively and can't resample from 32khz without adding noise, you need to throw that card in the trash.
123 -> 111222333.

Here, why not add support for 2.84mhz frequencies while you're at it?
http://en.wikipedia.org/wiki/SACD
There is no evidence that human beings are sensitive to audio frequencies above 20 kHz, and most people over the age of 35 are unable to hear sounds above 15–16 kHz at 72 dB.
SACD is completely different. The 2.84MHz sampling frequency only uses 1 bit per sample. It's DSD, not PCM.
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

Bahamut_ZERO_939 wrote:I'm actually speechless at the level of maturity you guys are actually asserting here. It really shows how much you really care about helping out, teamwork, and letting others contribute to your project. Real good guys. Real good. I actually wonder if you act like arrogant bastards in real life towards your friends, spouses, and family? I would certainly hope not, but usually I'm wrong and people like you actually do.
Actually, I'm more inclined to agree with Bahamut ZERO.

In fact, personal example.

Tonight, we were on calls (as you may (or not) have known, I take surveys over the phone), and one of the projects was near completion and/or needed to get done in a couple days. We were calling until it was breaktime (which for my row, was 9:15PM.) Now, normally, we don't call people after 9, but tonight was an exception. I ended up calling someone who was like "Why are you guys calling me at 9PM" and I was like "It's not my fault we're open this late."

So we went at it for a minute or so, then he wanted to speak to the supervisor. After break, she yelled at me for it, and I may be losing my job.

So, yeah.

End of my off topic rant. Carry on.
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

i'm more inclined to say that adding an audo filter that really doesn't do anything is dumb. a respectable soundcard from 5 years ago will handle everything just fine.
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

adventure_of_link wrote:
Bahamut_ZERO_939 wrote:I'm actually speechless at the level of maturity you guys are actually asserting here. It really shows how much you really care about helping out, teamwork, and letting others contribute to your project. Real good guys. Real good. I actually wonder if you act like arrogant bastards in real life towards your friends, spouses, and family? I would certainly hope not, but usually I'm wrong and people like you actually do.
Actually, I'm more inclined to agree with Bahamut ZERO.

In fact, personal example.

Tonight, we were on calls (as you may (or not) have known, I take surveys over the phone), and one of the projects was near completion and/or needed to get done in a couple days. We were calling until it was breaktime (which for my row, was 9:15PM.) Now, normally, we don't call people after 9, but tonight was an exception. I ended up calling someone who was like "Why are you guys calling me at 9PM" and I was like "It's not my fault we're open this late."

So we went at it for a minute or so, then he wanted to speak to the supervisor. After break, she yelled at me for it, and I may be losing my job.

So, yeah.

End of my off topic rant. Carry on.
I feel sorry for that, but I don't hate people that gives surveys.. I just hate that fact that you people do get lumped into telemarketers (the evil breed)... shit happens though.. and good luck to you.
sweener2001 wrote:i'm more inclined to say that adding an audo filter that really doesn't do anything is dumb. a respectable soundcard from 5 years ago will handle everything just fine.
I guess, onboard sound is crap too, but that problem never really gets addressed. Anyone with an Audigy 2 care to comment though? (cause I think that's what Bahamut uses).. I honestly think there's some setting is wrong or terrible speakers are being used because modern sound cards really should have no problem playing back audio at the requested settings (unless the sound card doesn't support said settings).
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

SteveSnake wrote:
creaothceann wrote:This might be important for the emulation of SEGA consoles
No, it isn't ;)
kode54 wrote:Actually, that FM chip should also be producing output at a fixed sample rate, relative to its emulated clock rate. In this case, almost exactly the NTSC colorburst rate, and producing a sample every 72 clocks, or about 49716Hz. This is exactly what Gens does when "YM2612 High Quality" mode is enabled, and presumably what Kega is doing when "SuperHQ" is enabled, as the resulting behavior is consistent.

Downsampling that to 48000Hz or even 44100Hz with a proper filter is unlikely to cause noticeable distortion, while upsampling to 96000Hz is unlikely to benefit anyone. 192KHz is just plain silly.
Thanks, I was wondering about that. :)
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Reznor007
Lurker
Posts: 118
Joined: Fri Jul 30, 2004 8:11 am
Contact:

Post by Reznor007 »

It's partly a Windows thing, and partly hardware. On Windows if your target device doesn't support the sampling rate you are outputting it goes through kmixer to do a software resample, and that has been proven to not be a great resampler. Creative's stuff only supports 48KHz and 96KHz(and 96 only if you disable any EAX/other DSP stuff). If you have it set to output 96KHz then audio will be resampled through kmixer.

Just do a search for kmixer and bit perfect on google and you'll find hundreds of topics.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

I found this while googling:
http://www.hydrogenaudio.org/forums/lof ... 11725.html

Can you say, ugh?

Apparently there are methods to workaround this problem.. I guess rewriting the Directsound portion of the code would be a good way to resolve it... adding the 96KHz option is probably not a real solution in any stretch of the imagination. I almost thought it was a problem on onboard audio solutions, but now that I read this, Creative is just another terrible company (I already felt that before, but this info reinforces it).
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Truth Unknown
Regular
Posts: 271
Joined: Tue Jun 14, 2005 8:35 pm

Post by Truth Unknown »

I'm not sure if it's really 96kHz at 24-bit on my SoundBlaster Live 24-bit sound card, but there is a clairity difference between 48KHz and 96KHz settings.

At first you think it sounds fine as-is on 48KHz but switching to 96KHz, music sounds more expanded.

Oh, I tested this using DVD audio from a regular DVD Movie.

Anyway, it all depends if the audio source can be played at the Sample-rate.
Post Reply