Namcot 163/MMC5/Konami VRC6 Audio Level test program

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Namcot 163/MMC5/Konami VRC6 Audio Level test program

Post by NewRisingSun »

I have finished my first "hot-plugging" program. It displays a white screen and beeps, expecting the user to exchange the RAM/Flash cartridge with an original Namco 163 Audio-equipped cartridge, then press A. It will play three 440 Hz tones: NES APU (gray screen), Namco 163 one channel (dark blue screen), Namco 163 eight channels (bright blue screen). I intend to acquire all ten of the games that use N163 Expansion Audio and record each one's output using the same hardware (Sharp Twin Famicom AN-505BK with clean audio mod; has nice APU vs. Expansion balance). That will provide a more precise measurement, using the exact same test tone rather than each game playing different music, of the relative volumes of the several games that use this expansion sound chip. This information then may help to update the Submapper proposal to reflect the relative expansion audio level of each game. Emulators can then let the user choose between original Famicom and GPM/AV Famicom APU vs. expansion sound levels.

The ROM has been successfully tested on real hardware, first by using an Everdrive N8 to upload the program to RAM, then exchanging the Everdrive with a Megami Tensei II cartridge and pressing A.
It sort-of works in most emulators, although most fail to honor the Sound Disable bit ($E000 bit 6), so they produce hanging notes when the screen goes black. Also, given the volume register value that I use, the one-channel and eight-channel test tone are just as loud; on emulators, the eight-channel tone is louder. Also on real hardware, the single-channel test tone sounds clean, while the eight-channel tone sounds "dirty", as expected.
Attachments
N163TEST.7z
(1.06 KiB) Downloaded 627 times
Last edited by NewRisingSun on Sun Aug 05, 2018 12:12 pm, edited 1 time in total.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Namcot 163 Audio Level test program

Post by rainwarrior »

Thanks for doing this. I'll give it a try later, though I only have 2 N163 carts. I think ideally we want to try a lot of N163 carts on the same hardware, since the relative mix across games is the most important information here.

I've been thinking NSFe could accomodate an optional chunk for N163 volume, and 2A03 square vs. equivalent is an easy enough thing to standardize the mix values on. Plus we could have Famitracker export an NSFe with a value that represents "FT standard mix" for it and people might stop complaining to me that NSFPlay doesn't match their Famitracker expectations. ;)

(The other expansions don't seem to need it. 5B / VRC7 only had one game. FDS mixing wasn't part of the game. VRC6 had 3 games but I think they had a standardized mix, even though there's a lot of variance in the part tolerance.)
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Namcot 163 Audio Level test program

Post by NewRisingSun »

I think I should expand the program to play both APU and Namco 163 at all fifteen volume levels. Right now, the APU plays at maximum amplitude while the Namco 163 plays at minimum amplitude, which might not provide sufficient information when taking into account the NES APU's nonlinear mixer.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Namcot 163 Audio Level test program

Post by NewRisingSun »

And here it is, all 15 volume levels for APU, N163 single channel, and N163 eight simultaneous channels. As before, the N163 waveform is one 32 sample/16 byte waveform consisting of 8 bytes $FF and 8 bytes $00.

When recording the output, it must be kept in mind that at the maximum volume, the N163 becomes much louder than the NES, up to eight times, depending on the particular mixing resistor on the game's circuit board.
Attachments
N163TESTv2.7z
(1.1 KiB) Downloaded 603 times
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Namcot 163 Audio Level test program

Post by lidnariq »

When you catalog the cart volumes, would you be willing to open and read, or measure the resistance across, the AUDIO FROM 2A03 and AUDIO TO MODULATOR pins ?

It really ought to be the case that the resistor there should be the only thing that determines the loudness of the mix, but what data we have is inconsistent.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Namcot 163 Audio Level test program

Post by NewRisingSun »

Is a simple $20 Ohmmeter sufficient for that task, or is something fancier required to do it correctly?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Namcot 163 Audio Level test program

Post by lidnariq »

A $20 ohmmeter is more than sufficient.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Namcot 163 Audio Level test program

Post by NewRisingSun »

I have now gathered all Namco 163 games except for Mappy Kids, which continues to be only available from overseas sellers. Since having to collect the package at the customs office is a long enough drive for me to want to avoid that at all costs, I would appreciate if a European-Union-based seller (or donor/lender) could offer for sale/provide me with a copy, so I can start making those test recordings from all games using the same console and setup.

I can already say that there must be several revisions of the audio circuit used on different runs of the same game. Sangokushi: Chuugen no Hasha is listed as having a 4.7k resistor, while I measure a whopping 32.82k on my cart. Other carts measure the same resistance as in that wiki article, so it's not my testing method being wrong. For that reason, I consider the proposed method of measuring relative audio levels between NES and N163 for all cartridges using that test program to be the more reliable choice.

I also have a hunch that later games seem to have their mixing resistors adjusted for the HVC-CPU-GPM console mainboard with its (relatively) louder expansion sound. The in-game expansion audio from Namco Classic II (1992) is almost inaudible against the RP2A03 on my AN-505BK Twin Famicom, and is just barely audible on a YouTube video recorded from (I think) an AV Famicom.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Namcot 163 Audio Level test program

Post by rainwarrior »

Yeah, I've long thought the resistor values weren't useful data (at least not by themselves). I don't think all versions of the N163 have equivalent output to begin with. Measuring the output volume relative to a single source is good.

Also, every time I've gotten measurements from two different carts of the same game there's been a significant difference anyway, and that's not even getting into carts that had multiple runs with different parts.
Last edited by rainwarrior on Wed Jul 11, 2018 12:12 pm, edited 1 time in total.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Namcot 163 Audio Level test program

Post by lidnariq »

NewRisingSun wrote:32.82k
You can be confident that these are standard E24 5% resistors, so that's "just" 33k.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Namcot 163/MMC5/Konami VRC6 Audio Level test program

Post by NewRisingSun »

As announced, I have recorded the expansion audio output of all ten Namco games that use the N163's expansion audio capabilities.
Carts-N163.jpg
I have also recorded two MMC5 games and one VRC6 game.
Carts-Other.jpg
The test ROMs used for this purpose are attached. To be specific, I used the Everdrive N8 (60 pin edition) to load the test ROM into the CPU memory of my Sharp AN-505-BK Twin Famicom, then hot-swapped the Everdrive N8 with the cartridge to be tested. The output was recorded from the Audio Out socket to a computer's rear Line In with Audacity at 96 kHz, 16 bit. No normalization or level adjustment was done to the resulting audio files; all were recorded at the same input gain settings (which I have noted so I can repeat the procedure in the future).

The Twin Famicom has had the low-pass-filtering C205 capacitor removed for crisp(er) audio. A different console may have a different APU<->Expansion Audio balance, so it's the APU/ExpAudio ratio of the several cartridges relative to each other that is informative. Subjectively, all cartridges' balances sound great to my ears, with the exception of Namco Classic II, which has too quiet expansion audio, and which for some reason also low-pass filters the incoming APU audio.

All four test ROMs play a $02/$22 sample waveform on the APU's DAC waiting for a press of button A to be done once the cartridges have been swapped. Then they share the same one APU square wave channel playing at all fifteen non-zero volume levels, followed by:
  • The N163 test ROM then plays fifteen volume levels using an FF 00 waveform, first while enabling only one channel, then with all eight channels enabled and all playing the same waveform simultaneously at the same volume. Since the N163 plays the channels sequentially, there should be no waveform clash. The test ROM makes use of the $E000 registers to disable all sound channels in the pauses in-between, which most emulators don't replicate properly.
  • The VRC6 test ROMs (VRC6TEST for mapper 24, VRC6TESA for Mapper 26) then play fifteen volume levels of a single square wave, then fifteen volume levels of a single saw wave with the lower two bits of the six-bit "accum rate" register forced to 11b.
  • The MMC5 test ROM then plays fifteen volume levels of a single square wave, then the same $02/$22 sample sequence on the MMC5's DAC.
The N163 test recordings can also serve to test the emulator output once the volume-specific submappers to mapper #19 have been finalized.

I was asked to measure the resistance of the Audio In/Out pins with an Ohmmeter. Result:

Code: Select all

4.670 kOhm	Final Lap		
4.648 kOhm	Megami Tensei II
4.660 kOhm	Namco Classic 2		
4.68 kOhm	 Sangokushi 2

9.86 kOhm 	Erika to Satoru no Yume Boken
9.99 kOhm	 Yokai Dōchūki		
10.00 kOhm	King of Kings		
10.02 kOhm	Mappy Kids		

32.82 kOhm	Sangokushi 1			
22.37 kOhm	Rolling Thunder
Make of these what you will.

Here are the recordings (207 MiB .7z file with .flac files inside). All recordings close with a sample of in-game audio. Notice how annoying the eight-channel N163 games sound. This is already mentioned in the wiki, but I was still taken aback when I heard it on real hardware.

I can repeat the procedure if a mistake is pointed out, or should I purchase/receive additional VRC6 and MMC5 cartridges. I would also be curious about the relative balance of the Sunsoft 5B, but am not willing to spend $300 or more to satisfy that curiosity.

I have not had the time to actually analyze these recordings.

Edit: Updated N163TEST to initialize the N163 as soon as you press the A button; previously it was only initialized after the APU square wave. Also made the code run at $E000 to not rely on PRG register initialization.
Attachments
ExpAudio_testroms.7z
(2.23 KiB) Downloaded 586 times
Last edited by NewRisingSun on Mon Aug 06, 2018 8:50 pm, edited 2 times in total.
Great Hierophant
Posts: 780
Joined: Tue Nov 23, 2004 9:35 pm

Re: Namcot 163/MMC5/Konami VRC6 Audio Level test program

Post by Great Hierophant »

I think that some of the later games like Namco Classic II and Gimmick! and Uchuu Keibitai SDF may be meant for GPM and AV Famicoms, not the HVC or Twin Famicoms. Most of the games that use expansion audio were released or in development prior to the adoption of the GPM-02 Famicoms in 1989.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Namcot 163/MMC5/Konami VRC6 Audio Level test program

Post by rainwarrior »

Great Hierophant wrote:I think that some of the later games like Namco Classic II and Gimmick! and Uchuu Keibitai SDF may be meant for GPM and AV Famicoms, not the HVC or Twin Famicoms. Most of the games that use expansion audio were released or in development prior to the adoption of the GPM-02 Famicoms in 1989.
It's still good data anyway, for the N163 carts. We can still deduce their amplitude relative to each other from this, which we can combine with other sources to extrapolate/estimate what they would have been like on other Famicom models.

MMC5 and VRC6 aren't really a problem in this respect, as I don't think there's ever been any mention of variation in levels from game to game like N163, just variation due to the tolerances of the components involved. 5B and VRC7 only have one game anyway. FDS doesn't very by game, obviously, so it's been easier to get data on too.

(Uchuu Keibitai SDF isn't in those recordings, BTW. Did you mean Shin 4 Nin Uchi Mahjong?)
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Namcot 163/MMC5/Konami VRC6 Audio Level test program

Post by NewRisingSun »

Analysis results. I used Audacity's "Contrast" function between the loudest APU and the loudest N163 single-channel square wave. The plugin measures RMS dB differences.

Code: Select all

Game                            Loudest APU     Loudest N163    dB difference
Namco Classic II                -21.8           -19.8           2.0
Final Lap                       -24.5           -11.8           12.7
Sangokushi II: Haō no Tairiku   -24.7           -11.8           12.9
Megami Tensei II                -24.6           -11.6           13.0
Rolling Thunder                 -28.1           -11.2           16.9
King of Kings                   -27.6           -9.6            18.0
Mappy Kids                      -27.8           -9.2            18.6
Erika to Satoru no Yume Bōken   -28             -9.2            18.8
Yōkai Dōchū-ki                  -28.1           -9.2            18.9
Sangokushi: Chūgen no Hasha     -30.2           -10.7           19.5
Great Hierophant
Posts: 780
Joined: Tue Nov 23, 2004 9:35 pm

Re: Namcot 163/MMC5/Konami VRC6 Audio Level test program

Post by Great Hierophant »

rainwarrior wrote: It's still good data anyway, for the N163 carts. We can still deduce their amplitude relative to each other from this, which we can combine with other sources to extrapolate/estimate what they would have been like on other Famicom models.

MMC5 and VRC6 aren't really a problem in this respect, as I don't think there's ever been any mention of variation in levels from game to game like N163, just variation due to the tolerances of the components involved. 5B and VRC7 only have one game anyway. FDS doesn't very by game, obviously, so it's been easier to get data on too.

(Uchuu Keibitai SDF isn't in those recordings, BTW. Did you mean Shin 4 Nin Uchi Mahjong?)
I was using Uchuu Keibitai SDF as an example of quiet games even though it was not among the games NRS recorded. I would not trust the EverDrive's handling of any expansion audio levels in an HVC or a Twin, they'll sound too quiet.

When you look at all the FDS titles, most of which were released in 1986, 87 or 88, the mixing preference must be fore the earlier systems because they were the only systems developers had to work wtih.

While there is generally a linear relationship between the measured resistance of a cartridge and its relative volume level, the results are not always predictable :
Clipboard01.png
Post Reply