Audio corruption

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Audio corruption

Postby Ian » Sat Feb 09, 2019 5:06 am

I know this has been talked about for years .. but most of the time I test with sound disabled it makes no sense unless you are hitting 60fps.

In debug mode, in visual studio the sound is perfect. Well it sounds as it should. But this is what the release build sounds like when compiled in visual studio 2017 ..

https://www.youtube.com/watch?v=mcinDcGD6GA

The audio is absolutely destroyed. I don't think the compiler is at fault here.. My best guess is there are some kind of illegal memory writes happening, and it's not an issue in debug mode due to extra memory padding. Could be that or some variable initialisation issue ..
Ian
 
Posts: 1582
Joined: Tue Feb 23, 2016 9:23 am

Re: Audio corruption

Postby model123 » Sat Feb 09, 2019 1:57 pm

Hello Developers

I load the project into Visual Studio 2017 community
Update the platform tool to v141
Building solutions or supermodel with release x64

The sound is not broken

Google Translation
model123
 
Posts: 58
Joined: Wed Mar 08, 2017 8:34 am

Re: Audio corruption

Postby Bart » Sat Feb 09, 2019 8:45 pm

Also works fine with gcc. Does MSVC support linking debug and release modules? We could probably zero in on the offending code through a process of elimination. My money is on either the archaic MPEG decoder or the SCSP code.

We could probably run it through an address sanitizer, too, but I'm not sure if a sufficiently new version of gcc is available for Windows and I no longer have access to Linux systems.
User avatar
Bart
Site Admin
 
Posts: 2265
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Audio corruption

Postby Ian » Sun Feb 10, 2019 5:39 am

Does MSVC support linking debug and release modules?

I'm not sure. But virtua fighter sounds fine, except a little extra reverb which probably shouldn't be there. I think its just the mp2 decoding
Ian
 
Posts: 1582
Joined: Tue Feb 23, 2016 9:23 am

Re: Audio corruption

Postby Bart » Sun Feb 10, 2019 1:57 pm

If there is a newer, GPL-compatible MPEG decoder we should probably swap it out (although it might not be too hard to identify the really gross parts of this one and fix them -- I think gcc produces a lot of compiler warnings that could be investigated). Does MAME have one? For years, they couldn't do MPEG music do to patent issues but I think the MPEG patents may have expired by now.
User avatar
Bart
Site Admin
 
Posts: 2265
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Audio corruption

Postby Ian » Sun Feb 10, 2019 5:34 pm

something like this ?
https://github.com/lieff/minimp3

Seems almost impossible to find any decent decoders that only decode mp2 for a possibly smaller implementation.

There is this one ..
https://keyj.emphy.de/kjmp2/

But at the bottom

Hi KeyJ, I tried using your library and it’s really simple to use and integrate.

But I’ve run into an issue regarding playback quality. On a sample sound I use, the decoder produces audible artifacts. This is visible both with the mp2play.exe and when decoding internally within my program.


and his reply

Coder: Yes, kjmp2 is very noisy – the SNR may be as low as 20 dB. I’m not sure whether this is strictly a result of its simplicity – it might just be that I have a bug somewhere or my fixed-point computations are sub-optimal. Also, there’s no noise shaping of any kind.


So probably not a good implementation to use
Ian
 
Posts: 1582
Joined: Tue Feb 23, 2016 9:23 am


Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 2 guests

cron