libretro / mame2003-plus-libretro

Updated 2018 version of MAME (0.78) for libretro. with added game support plus many fixes and improvements
Other
191 stars 109 forks source link

Audio in Pole Position II distinctly lower quality than Pole Position I #1823

Closed retrogamedesigner closed 2 months ago

retrogamedesigner commented 2 months ago

If I understand correctly, both games should benefit to from the updated sound drivers for various Namco titles. I've tested all versions of both games on a Windows PC, and I'm only hearing the improvement to the first Pole Position. Testing "poleposa" and "poleps2a" on a couple Linux x86_64 PCs, an arm Linux handheld, and an Android handheld, I notice the difference in sound quality between the first and second games as well.

arcadez2003 commented 2 months ago

Hmm maybe we need some more fixes then.....

0.89u5: Jarek Burczynski improved the Namco 54XX Noise Generator (Type A and B emulated, type C algo still unknown). Removed pp2_17.wav sample.

grant2258 commented 2 months ago

I remember doing this update years ago not sure what version we are at though

arcadez2003 commented 2 months ago

Yeah you and me both @grant2258 We're at around MAME80 im looking at MAME90 just now it doesn't seem like an awful lot of work but well i've said that before.

grant2258 commented 2 months ago

haha tooshay should be pretty easy as they say. I miss read that I though the comparison was before that update see that its two different games. On another subject it looks like you have added that sound code properly. The reset only happens when you reset the game like with f3 so I dont think it that, it more than likely going to be needing an updated on our end. I remember doing the ssv soundcore and it slowed things down too much, so im not so keen on touching soundcores anymore haha

grant2258 commented 2 months ago

Ive have to go pick someone up if you dont get to it ill have a peek tomorrow at least its not a bug in the code we have though. Managed to fix a few things for km hope the m8 is a clear run to largs I doubt it though.

arcadez2003 commented 2 months ago

Safe travels big yin

arcadez2003 commented 2 months ago

Right from a quick peek at the code.......

From what i can tell driver wise it's galaga.c and polepos.c which is just removing some samples to be replaced with a new and improved Namco54 soundcore after that a really small change in namcona sound c and h.

So in essence it could be done in a few hours it's just i'd hate to do it only to be told it's not made the sound better for Pole Position 2 etc etc but it's worth a try at anyrate for a classic game like this one

grant2258 commented 2 months ago

yea i played this one not sure if it was the first or second though as kid had a accelerator pedal and steering wheel in a stand up cabinet. Checked with google maps junction 16 seems to have a diversion see where I end up haha.

arcadez2003 commented 2 months ago

Alright i've done galaga.c gaplus.c and polepos.c drivers just need to do the namcona1.c driver and the two soundcores i think the code should just drop in here i'll doublecheck it tomorrow.

retrogamedesigner commented 2 months ago

Just wanted to say thank you to everyone for looking into these issues, as well as for being so responsive in addressing them. You all are the best.

arcadez2003 commented 2 months ago

Nae worries but keep in mind updating the Namco54 sound might not be the fix we need but fingers crossed

Right so then after looking more closely at the code namcona1 changes are not connected to Namco54 so having done the drivers last night all that remains is to backport the soundcore changes which all being well i should have done by the days end.

arcadez2003 commented 2 months ago

Right @retrogamedesigner the changes are in once we confirm the source will compile with the new code.. you can update to the latest build and hopefully the sound will now be better for Pole Position 2.

If not then there are some more fixes which could be backported for the Namco54 sound but that would also require we update the Namco52 sound and all related drivers, which wont be light in the graft dept so it might take a while until one of us has the time to work on it.

Regards

arcadez2003 commented 2 months ago

For my notes if further work should be required......

Bosconian 0.90u3: Derrick Renaud added proper filters to the Namco52 sample player of Bosconian, Galaga, Pole Position and Xevious. Adjusted relative effect volumes per schematics.

0.90u2: Derrick Renaud updated the Namco 54xx noise sound and added R/C values to Bosconian, Galaga, Pole Position and Xevious.

Galaga 0.90u3: Derrick Renaud added proper filters to the Namco52 sample player of Bosconian, Galaga, Pole Position and Xevious. Adjusted relative effect volumes per schematics.

0.90u2: Derrick Renaud updated the Namco 54xx noise sound and added the R/C values to Bosconian, Galaga, Pole Position and Xevious.

Pole Position 0.90u3: Derrick Renaud added proper filters to Pole Position engine sound and proper filters to the Namco52 sample player of Bosconian, Galaga, Pole Position and Xevious. Adjusted relative effect volumes per schematics.

14th January 2005: Derrick Renaud - Added proper filters to engine sound. Also i am working on adding the proper filtering to the speech (Namco 52XX voice effects) of Pole Position. The final sound comes out of pin 14 of the LM324. R/C components and a op-amp affect the filtering.

0.90u2: Derrick Renaud updated the Namco 54XX noise sound and added the R/C values to Bosconian, Galaga, Pole Position and Xevious.

Xevious 0.93: Derrick Renaud swapped Namco 54XX filters on Port A & C. Fixes Xevious sound.

0.90u3: Derrick Renaud added proper filters to the Namco52 sample player of Bosconian, Galaga, Pole Position and Xevious. Adjusted relative effect volumes per schematics.

0.90u2: Derrick Renaud updated the Namco 54XX noise sound and added the R/C values to Bosconian, Galaga, Pole Position and Xevious.

arcadez2003 commented 2 months ago

@retrogamedesigner Also if you dont mind can you test the following games to make sure they've not got worse soundwise after this update thanks.......

Bosconian Galaga Pole Position Xevious

retrogamedesigner commented 2 months ago

No problem. I'll test those before I update the core, then I'll retest after for comparison.

retrogamedesigner commented 2 months ago

That took longer than I intended - I got a little obsessive. I felt like a musician listening to countless takes of a song for the subtle differences, or like many people feel at an optometrist's office. From what I can tell, there was no change to any of the versions of Pole Position 1 or 2. Speaking of those games, I noticed that polepos.zip also shared the lower quality audio of polepos2.zip, polps2a.zip, and poleps2b.zip using build 081f2fc and the older cbfdd3c build of the core. Yes, poleposa.zip and polepos1.zip sounded better than polepos.zip on both builds of the core.

Bosconian, Galaga, and Xevious (all versions of them) all experienced a regression to lower quality audio after the update. I didn't test any others that also use the galaga.c "sourcefile."

arcadez2003 commented 2 months ago

Oh my this hasn't went well but fear not im updating to use the Namco52 and 54 soundcores from MAME91 this will be the last roll of the dice TBH

grant2258 commented 2 months ago

Ill looked at the other soundcore we would need to update the core to the fbneo version or the one that's fixed in mame. The fbneo probably has a re-trigger call already add thats all I can think of. I tend to work from mame so havent compared the two. But they are doing it a different way from the mame fix in the issue.

As far as polepos goes ill update the roms as its the japan sound in the main set. The sets should fit in nicely anyway.

There would be need to be more detail on what sounds are lower and near in mind sometimes your comparing the new sound calls to samples that where there before. That is the case in xevious 100%.

arcadez2003 commented 2 months ago

Sure i was thinking new sound handling vs the older samples might bring up a few things have got worse complaints anyway i've updated to MAME91 just waiting to see if the code slips in here with no build issues.

This really is the last roll of the dice as not long after these commits they added a new CPU to handle the Namco sound and switched the games over to discrete and well im not prepared to take that on ha ha.

grant2258 commented 2 months ago

ok ive updated the romsets as well and added a few ones that weren't there. Ill put a pull req in

arcadez2003 commented 2 months ago

The build is fucked im rolling back to eliminate all of todays commits, this is why i need to stick with small commits as without my dev setup i cant like the ole days check the code will compile firstly and then test games afterwards

I should really call it day here TBH.

arcadez2003 commented 2 months ago

ok ive updated the romsets as well and added a few ones that weren't there. Ill put a pull req in

Aye im rolling back after im done i can merge your commit

grant2258 commented 2 months ago

leave it ill sort the compile fixes m8

grant2258 commented 2 months ago

@retrogamedesigner can you test on mame current. Im guessing your meaning lack of tone in polepos2 whats happening is a filter is on check on mame current both polepos and polepos are filtered there. Is what you mean by lower quality?

retrogamedesigner commented 2 months ago

Yes, on the current MAME core both Pole Position 1 and 2 sound identical to me (other than the engine sounds, which I suspect were slightly different from each other on the original arcade hardware). The most obvious difference I was hearing on the 2003plus core between the first and second game was the sound when the "brakes" are used. On the current core, those sound exactly the same.

arcadez2003 commented 2 months ago

@grant2258 were you able to get those namco sound changes to compile without the need to update streams.c.?? im still interested as to wether the sound improves after using those changes but i would need to study whatelse would be affected by the diffs to the filter and stream code before even thinking about doin a retake.

grant2258 commented 2 months ago

@arcadez2003 just done the update myself seems to be fine with xevious and galaga and pole_pos. @retrogamedesigner Ive debugged this issue polepos2 seems to be causing some issues with the braking sample being activated with the high rpm. Simple rename the sample and play without it for a better experience with polepos2.

This even happens with the 095 test core I have and I have no idea when it was fixed. Ive also update the romsets apart for a few bootlegs to the latest mame sets. Ill add the bootlegs not done at some point.

https://github.com/libretro/mame2003-plus-libretro/pull/1832 (pending merge) romsets already done in https://github.com/libretro/mame2003-plus-libretro/pull/1827

edit Xevious and galaga seem fine to me for this update.

@retrogamedesigner i never had the sample when it was the old code. It seems mame also make the braking sound in high rpm. So it might be ok now since i dont have a comparison on the old code.

arcadez2003 commented 2 months ago

From reading the WIP they first switch to using an actual CPU to handle much of the 54 sound and the samples are then removed before a few builds later they switch to discrete sounds, after that the rest of the sound is also handled via said CPU.

0.112u1: Replaced implementation of Namco 54xx sound chip with new MB8844 CPU core running the original embedded ROM code. Removed old sound core. Pole Position and Bosconian no longer require samples as a result [Nicola Salmora, Ernesto Corvi, Guru]. Added MB88xx (256000 Hz) CPU4 with 1k rom 54xx.bin. Replaced Namco 54XX and Samples sound with 3x DAC sound.

0.112u2: Replaced 3x DAC sound with Discrete.

0.131u3: Aaron Giles changed the Namco 52xx and 53xx devices to run the actual MCU instead of simulating the behavior. Hooked them up properly in Pole Position. Added mirrors to Pole Position memory maps. Replaced audio Namco 52XX with 3x MB8843 (1536000 Hz) CPU4/5/6. Changed MB8844 CPU7 clock speed to 1536000 Hz.

So im thinking we've taken it as far as we can as the above would be a ton of work :)

arcadez2003 commented 2 months ago

@grant2258 the build is failing on a few platforms related to the streams.c changes by looks, it's complaing about maths redefines sometimes sticking #include above the driver.h call can sometimes sort this

grant2258 commented 2 months ago

naw its something else ill sort it m8.

arcadez2003 commented 2 months ago

Alrighty bigman i know you'll get it anyway time to stick on my Gammon steaks

grant2258 commented 2 months ago

ok thats it sorted its picky about where variables being declared at the start of a function.

mahoneyt944 commented 2 months ago

Is the sound good now?

arcadez2003 commented 2 months ago

Waiting to hear back from @retrogamedesigner then we'll know either way

retrogamedesigner commented 2 months ago

Sounds the same to me as before. The brake sounds are very shrill, like a high-pitched whistle, in Pole Position 2. I'm not sure if there's a low-pass filter or something that's only being used on PP1, but the sound effect for the brakes is very different and much richer sounding (more low frequencies to the sound) compared with PP2.

mahoneyt944 commented 2 months ago

Is it improved when using current mame?

retrogamedesigner commented 2 months ago

Oh, yeah. On current mame, both PP1 and PP2 sound identical to each other. I think they both sound great, as I would expect, on current mame. To compare the cores, what I hear when playing PP1 on mame2003plus is comparable (though I'd say not identical) to both games on current mame.

retrogamedesigner commented 2 months ago

Just to clarify, I updated the core to bd371b5 before testing. I used the same files to test on 2003plus and current.

grant2258 commented 2 months ago

@retrogamedesigner the only thing thats different to me is the pitch which might suggest you need another sample for polepos2 for your personal taste.

I personally use this sample for my testing(ill post below. You could rip the appropriate sample from mame current for each game they could be different pitches causing the issue but im happy enough with the sample I tested with. This is the only sample that is used in the game now. I notice a big improvement in the rpm sounds, I think you focusing on the brake sounds which the updates dont help with as its an external sample.

polepos.zip

arcadez2003 commented 2 months ago

Oh, yeah. On current mame, both PP1 and PP2 sound identical to each other. I think they both sound great, as I would expect, on current mame. To compare the cores, what I hear when playing PP1 on mame2003plus is comparable (though I'd say not identical) to both games on current mame.

In current MAME they're using the correct dumps of the MCU's that handle the sound and they created new CPU cores to run them they then switched to use discrete sound with dac interfacing, what we have is basically a simulation of the sound mcu's with sound samples.

It's chalk and cheese really.

But if there have been no significant improvements for Bosconian Galaga the Pole Position games and xevious it might be as well to just roll back to what we had previously.?? as some of the changes to the filtering and stream core files might negantively have affected other games.

grant2258 commented 2 months ago

@arcadez2003 its nothing to do with the filters the brakes only sample used in the game. I get the impression the focus is on the brake sounds only. There are only 3 or 4 drivers using rc filter so any issue will show up.

The sample will be needed to be grabbed from mame on each game none. Feel free to revert but I notice rpm improvement. I use alt sample for the brakes its use sound better than the standard one that comes with mame samples. The stream wont cause any issues nothing major changed apart from the filter2. None of the games sound worse to me. Im not sure if retrogame is saying the other games are still worse its not the case for me.

@retrogamedesigner I sampled polepos2 from mame I prefer my other sample though. I just updated this with both samples. samples.zip

mahoneyt944 commented 2 months ago

@grant2258 is current mame using a brake sample? Or are they emulating it now?

grant2258 commented 2 months ago

@mahoneyt944 arcadez already posted the info above https://github.com/libretro/mame2003-plus-libretro/issues/1823#issuecomment-2295293774

Its works better with the new sample so its just a case of doing separate samples for polepos and polepos2 but ill wait for @retrogamedesigner feedback. My only concern is the other other games are lower quality after the latest update galaga and xevious. Thats not something im finding on my end and im not sure if he is just referring to the brakes in his comments which are vaid to using the reference polepos sample.

simple test is load polepos2 keep on low gear and accelerate and compare skidding samples the alt one in the zip i like a little more. The mame sample taken is obviously closer to what they are looking for. The original sample sequels like a banshee on polepos2.

arcadez2003 commented 2 months ago

@grant2258 Yeah that idea had occurred to me also, as you said we could create a seperate sample call for polepos2 with the sample volume lowered to the preferred level maybe 20 would do it.??

grant2258 commented 2 months ago

Well @retrogamedesigner is happy with polepos the way it is more or less but it isint perfect and we are using samples.

Here my take on it somone sampled pp arcade machine to get this sample and its saved at 22050. This makes it sound very similar I think the brake screech is a bit high but is livable for pp1.

Now we come to pp2 and its sending different data here

https://github.com/libretro/mame2003-plus-libretro/blob/bd371b5c7052e985e37c0f1c9893bdc856683c23/src/sound/namco54.c#L632-L646

so the solution is boot mame into service move and play the pp2 brake sample and record it. Now I know this is the issue because polepos1 sounds like pp2 did and pp2 sounds fine now.

So just a different sample interface for pp2 in the machine init with the new sample. Like I said before its the other games that where degraded at a earlier point they all sound fine to me. Ive been know to miss things right in front of me though.

retrogamedesigner commented 2 months ago

Hope I'm not causing confusion or interrupting too much. In my opinion, Namco games such as Galaga, Xevious, etc. sounded better before I opened this issue. To be specific, explosions in Galaga and Xevious sound distorted/crackling and other sounds tend to be a bit too bright and chirpy for my taste. I have a couple systems held back at cbfdd3c for that reason - those games sound much closer to current MAME on that build.

If it's possible to roll back the general changes to the Namco sound drivers (or whatever the specific updates were to investigate this issue) and still look into the samples and how those are handled, I'd say that seems like the way to go.

I tested out the samples @grant2258 posted, preferring the one taken using current MAME. Definitely better overall, and the difference from the first game to the second is slightly less obvious, but still there. For now, I've got my frontends using current MAME for PP1 & 2, but if there is a way to get the samples/audio for both games to match each other on 2003plus, that would be ideal for me.

grant2258 commented 2 months ago

@retrogamedesigner ill look into polepos im pretty sure I can make it better. The namco update can be reverted most of the changes can just be copied over without changes. There is no bother here if its worse it has to go ill look ill look into it more at the weekend. PP1 and PP2 brakes sound way too fast for both for me but im sure I can fix it to let both use the new sample and be a little more close.

@arcadez2003 or @mahoneyt944 can you revert the namco update. Ill add this back when if/ive galaga and xevious on my branch and its not worse, it could be as simple as a volume change but its easy enough to add back will just need to do more testing and ill probably have to use headphones because its sounds fine on a bluetooth soundbar apart from being a little low on the volume compared to the rest of the sounds.

ps the new polepos roms are fine to keep there seperate from the sound update.

33ac7ce4c84e0ed8902d76bbeea5403dc3790a7c 2f6b79b8cd71925226309e22c2e4c0d9a042dc90 354384a08e3cb6d96374bdc83f67e109d335fd84

are the commits that need reverted cheers

arcadez2003 commented 2 months ago

Well as magnus used to say "i've started so i'll finish" im rounding up the code now

arcadez2003 commented 2 months ago

Alrighty @grant2258 it's all done just as well you mentioned your extra Pole Position romsets as i'd forgot about em Also for the record guys my mappy changes were not part of the big Namco update and might as well rollback gaplus.c to use the galaga samples once again as it'll save users filling up the boards with "this game has missing sounds now" before someone tells em they need gaplus.c samples

grant2258 commented 2 months ago

Well I didn't expect any issues to be honest but im pretty sure it will be volume tweaks and such but like you said people might just get confused whats going on always best to revert and fix in our own time, else you just dump it because you dont have the time.

Ill do this the easy way, ill check mame at that update and see if i hear any issues think the old binaries are still available. I appreciate you doing that nooded off earlier been driving what feels like half of scotland today. Sometimes these unpleasing sound changes are actually how the stuff works but ill compare to mame current for a rough idea of what they should sound like. I can help you set up msys2 if you want development to compile and test cores. Just an offer not a request. All you do is compile RA then this core.