mamedev / mame

MAME
https://www.mamedev.org/
Other
7.75k stars 1.95k forks source link

Namco ND-1 system audio error #12482

Open saetta06 opened 2 weeks ago

saetta06 commented 2 weeks ago

MAME version

0.266

System information

This happens in every system.

INI configuration details

No response

Emulated system/software

Namco ND-1

Incorrect behaviour

The Namco ND-1 system audio is pitched down in the emulator. You can hear how in this real machine the audio plays: https://youtu.be/ujHZEfVBeZM And you can hear in the Namco Museum PS2/GC/Xbox version that the music is pitched up correctly: https://youtu.be/p0UpDQl-bsg&t=47 . On Mame it sounds like this: https://www.youtube.com/watch?v=6-ir6xUTKW0 I hope the audio can be pitched up for the emulator, because it has caused a lot of misconceptions, and for the original versions of the Namco arcade games in Namco Classic Collection Vol. 1 and 2 sounds wrong since it's not pitched up. Namco ND-1 file name: namco/namcond1.cpp

Expected behaviour

The audio should play like this real machine:: https://youtu.be/ujHZEfVBeZM Or like the Namco Museum PS2/GC/Xbox version: https://youtu.be/p0UpDQl-bsg&t=47

Steps to reproduce

No response

Additional details

No response

jackson2k2 commented 2 weeks ago

I'm not particular about how the hardware in the Namco ND-1 is laid out, but here are four PCB references: https://www.youtube.com/watch?v=H7YXftTsj4Y (Volume 1) https://www.youtube.com/watch?v=2laNFj6Ag4E (Volume 1) https://www.youtube.com/watch?v=e64EwvXyoNE (Volume 2) https://www.youtube.com/watch?v=283PE7NewPI (Volume 2)

All the Volume 1 references I can find have the clock rate as is in MAME, whereas the on Volume 2 boards it does seem to be higher.

saetta06 commented 2 weeks ago

I'm not particular about how the hardware in the Namco ND-1 is laid out, but here are four PCB references: https://www.youtube.com/watch?v=H7YXftTsj4Y (Volume 1) https://www.youtube.com/watch?v=2laNFj6Ag4E (Volume 1) https://www.youtube.com/watch?v=e64EwvXyoNE (Volume 2) https://www.youtube.com/watch?v=283PE7NewPI (Volume 2)

All the Volume 1 references I can find have the clock rate as is in MAME, whereas the on Volume 2 boards it does seem to be higher.

I feel like vol. 1 should have the higher clock rate, because if you compare the OST of the original games to the original arcade releases, it's pitched wrong, very noticable in Mappy's special stage. However, you're right that the Vol. 1 cabinets have the MAME clock speed. I found another footage: https://www.youtube.com/watch?v=Q_3gDHiDrv0

I guess for authenticity, vol. 1 should keep the lower clock, but have the higher clock for vol. 2. IDK if that's possible to do, but in the worst scenario maybe the clock should be sped up for both since it seems like the original intention or something.

Another interesting bit i noticed in this video https://www.youtube.com/watch?v=Q_3gDHiDrv0 is Goro Robot's voice at 14:23. On Mame it's bugged and it loops back for an instant: https://www.youtube.com/watch?v=7AvbJ9rTYjE at 1:43 , which means the clock speed in Mame is slower for vol.1 as well!

Also interesting is this footage of Mappy Arrangement from one year ago with the higher clock speed! https://www.youtube.com/watch?v=zS_2CAeQSLQ . I have no idea where the author played this, but probably not a recent Mame since there's bugged graphics.

jackson2k2 commented 2 weeks ago

So all you have to do at the most basic is verify the clocks on a Volume 2 PCB. Here is an identification from the first discernible shot of a Volume 2 board I could find online.

image The XTAL values match what is known in MAME, so there is two scenarios:

  1. The sound emulation is incorrect (very likely wrong).
  2. The C352 was rewired on Volume 2 boards to directly take the 25.326MHz input instead of dividing 49.152MHz / 2. (most likely right).
saetta06 commented 2 weeks ago

Well let us know if that does solve the issue. After all isn't 25.326 faster than 49.152 / 2 ? that would seem like the problem.

b0x-Cub3d commented 1 week ago

I wouldn't compare MAME to OST when it comes to Namco's OST releases from the past since they tend to use "master recordings," it's better to compare more recent OST releases that were recorded from hardware or hardware recordings online.

saetta06 commented 1 week ago

I wouldn't compare MAME to OST when it comes to Namco's OST releases from the past since they tend to use "master recordings," it's better to compare more recent OST releases that were recorded from hardware or hardware recordings online.

I never did that. 've never seen Namco Classic Collection CD or whatever. I don't think that even exists. I was comparing it to the other game recordings...

b0x-Cub3d commented 1 week ago

My bad, but to give you more information on them here: https://vgmdb.net/album/7066 (NCV1 OST) https://vgmdb.net/album/7086 (NCV2 OST)

rb6502 commented 1 week ago

I've applied @jackson2k2 's suggested change and to my ears ncv2 matches the PCB reference now. If you can't compile your own MAME, 0.267 should be out in about a week with the change.

saetta06 commented 1 week ago

Oh I can't wait!!!! thank you so much!!!!!

philipjbennett commented 1 week ago

I’m a bit skeptical of this change. I’ll measure the clocks on my NCV1 and NCV2 PCBs and provide recordings of each.

saetta06 commented 1 week ago

@philipjbennett doesn't hurt to check, but why are you skeptical when the chip itself says the frequency, and applying said frequency makes it sound like the original PCB ?

rb6502 commented 1 week ago

Could be something else. I assume there's a reason the C352 has the clock divisor configurable in MAME, although it doesn't seem to be anything other than 288 anywhere. Someone with both actual PCBs and the ability to test is actually a big deal :-)

philipjbennett commented 1 week ago

Here's a digital recording from the NCV2 PCB, captured from the input to the DAC:

NCV2.wav.zip

'Speaker Out' was set to Mono.

The C352 clock is 24.576000MHz on both the NCV1 and NCV2 PCBs. NCV1 decided it no longer wants to work so I can't make any recordings from it.

jackson2k2 commented 1 week ago

This issue is suspect as I'd thought it would be: https://www.youtube.com/watch?v=g33n1BtWEeo https://youtu.be/bh5H1MfTdjI?si=S21zIKlKbI6qtsgV&t=1312 https://www.youtube.com/watch?v=4HELA-e02AI https://www.youtube.com/watch?v=vMsBtfa-A5M

Here are four recordings of Volume 2 boards I found where the clock uses the confirmed 49MHz / 2 signal as NCV1. I suppose the sound was intended to use that clock rate. Thanks to Phil for the contribution, and I would have like to taken the time to confirm from a real board with the supposed "problem" before any changes had gone through.

It's possible that we are seeing a manufacturing mistake that only appeared on late (or early?) boards. And also; what is the 25MHz oscillator used for in any other purpose?

saetta06 commented 1 week ago

okay, here's my.suggestion, since both clock speeds are valid since you could have either on a real machine, why not add it as an option to switch between the two? though I still prefer the 25 MHz version not gonna lie.

happppp commented 1 week ago

MAME prefers to be valid to what's on the PCB. @philipjbennett can you see where the 25.326MHz OSC goes to?

rb6502 commented 1 week ago

Change was reverted. I'd be curious to see a measurement from one of the boards with the different pitch to see if it's actually a defect or what, but the chances of that probably aren't good.

saetta06 commented 1 week ago

whatever the outcome is, i'm just gonna compile mame with the change from yesterday. though i'm interested to see whats going on with these boards, because clearly there were enough that they replicated the oscillator in the namco museum rerelease

b0x-Cub3d commented 1 week ago

What re-release, just curious?

saetta06 commented 1 week ago

i did say it here earlier, namco museum for ps2/xbox/gamecube. even linked footage. it has pacman arrangement and digdug arrangement. it also has galaga arrangement which is from vol. 1 and it has indeed the 49 / 2 mhz clock audio while vol2 games there have the 25 mhz audio

b0x-Cub3d commented 1 week ago

Those weren't emulated, those were ports of the Arcade original iirc. The developers, mass.media, ported the Arrangement games on consoles which is probably why the music sounds different. They even ported Pac-Man Arrangement on GBA, so unless they got the music pitch right on the GBA version I would assume that they just guessed the chip clock for the C352.

saetta06 commented 1 week ago

my bad. also the gba version matches the GC/PS2/Xbox port audio. so the mass media port is basically referencing the revision with higher clock.

jackson2k2 commented 1 week ago

Remember: Ports are one thing, real hardware is another. We need real hardware verification, signal traces, and signal measurements.

saetta06 commented 1 week ago

im just saying that they did reference one of those versions, which is interesting.

Gurudumps commented 5 days ago

Lol! Listening to a bunch of clueless noobs who don't own actual hardware is bad. I just checked my board....


The 49.152MHz OSC is divided by 2 to drive the C352 (CLK IN on pin 39) The 49.152MHz OSC is divided by 3 to drive the H8/3002 The 49.152MHz OSC is divided by 4 to drive the 68000 The 25.326Mhz OSC is divided through a basic /2 circuit.... 74F74, clock in on pin 3 (CLK), pin 6 (BAR Q) output tied to pin 2 (D), final clock output 12.663MHz on pin 5 (Q) which connects to pin 42 (XIN) on the YGV608.


RB: You may want to add this above to the driver to avoid this problem again ;-)

saetta06 commented 5 days ago

but how do we explain why some machines use the different oscillator?

Gurudumps commented 5 days ago

We don't explain anything. The hardware is set in stone. The measurements were done on real hardware. The results were typed above. The end. The C352 is a custom re-badged microcontroller with internal ROM.

115 on my decap page https://gurudumps.otenko.com/decap

Unfortunately those decapping guys seem to have ventured too close to the flat part of the earth and have fallen off into the abyss. Make some noise, get the chip decapped and rom extracted and someone could emulate the actual micrcontroller and that may result in more accurate C352 audio across all games that use that chip. If more chips are needed I probably have 50 here on random junk boards.

saetta06 commented 5 days ago

cool. I was just curious about what was going on with these different PCBs. obviously having the right measurements is what matters

rb6502 commented 5 days ago

It's unlikely some boards are using the different oscillator and more likely that the videos themselves have the wrong pitch. A 44.1 kHz vs 48 kHz mixup in Handbrake or something. YouTubers get audio wrong all the time.

saetta06 commented 5 days ago

I'm sure it's not YouTube, as you can see from all footage here the machines have the same pitch, and I even compiled the program with the 25mhz oscillator and it sounds just like those videos. not to mention, the OFFICIAL ports of the game literally have that same pitch,and youtube didn't exist back then. so there's something up with some PCBs

rb6502 commented 5 days ago

Maybe the machines with the different pitch were all filmed by people who did the same wrong thing in Handbrake. And console ports don't count. Otherwise someone could wave 2600 Pac-Man at us and demand some real interesting changes to the arcade game.

saetta06 commented 5 days ago

idk why youre turning down the possibility of different PCBs so much when there's a lot of points supporting the argument. i'd be curious if someone else had another pcb that had the different pitch to analyze whats going on. i respect the choice of putting the current specs in mame but id just love to understand whats going on

jackson2k2 commented 5 days ago

The answer is simple: We have no one coming here, on this discussion, to confirm they have a PCB that sounds the other way.