Audio channels

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 channels

Postby Ian » Wed Jan 30, 2019 10:57 am

Mostly just thoughts since really I've never looked at the audio emulation. Currently it's a giant black box
But in the audio in sega rally 2 has some serious issues lol
The issue is, two separate tracks have been encoded in the left/right audio, and the system is choosing to just mirror one channel to the other.
Where would we even look to find out how its selecting this? There must be some register or something somewhere
Ian
 
Posts: 1647
Joined: Tue Feb 23, 2016 9:23 am

Re: Audio channels

Postby Bart » Wed Jan 30, 2019 4:14 pm

Audio emulation is held together with duct tape and glue :) For MPEG music, the DSB code is where you'll want to look, specifically CDSB2 for Sega Rally 2. The DSB classes actually perform their own mixing and re-sampling, so if the setting for channel selection is discovered, it should be pretty straightforward to fix. R. Belmont originally reverse engineered the DSB far enough to allow music to be played. You'll see a big switch statement that handles commands written by the DSB's processor (a Z80 for DSB1 and 68K for DSB2) to some hardware port. There is little rhyme or reason to how the commands appear structured and the assumption is that they form some sort of state machine. This state machine is where you'll want to poke around. It's pretty easy to break some obscure thing in a game (pay attention to things like volume fades). There are definitely un-handled or maybe even mis-handled commands. I suspect that for the offending music tracks (title + last stage) in srally2, some command is first sent that configures the channels. You'll definitely want to look at what happens during transitions from stereo tracks to the broken ones as well as the reverse transition. If there's a sound test menu, I'd start there.
User avatar
Bart
Site Admin
 
Posts: 2347
Joined: Thu Sep 01, 2011 2:13 pm
Location: Santa Clara, California

Re: Audio channels

Postby Ian » Wed Jan 30, 2019 5:19 pm

Does mame have audio code for this we can look at / borrow ?

Edit, this looks like it ..

https://github.com/mamedev/mame/blob/ma ... 0.cpp#L232

I think
Last edited by Ian on Wed Jan 30, 2019 5:40 pm, edited 1 time in total.
Ian
 
Posts: 1647
Joined: Tue Feb 23, 2016 9:23 am

Re: Audio channels

Postby Bart » Wed Jan 30, 2019 5:28 pm

I haven't looked at MAME in ages. Does it support DSB board emulation or do they have an MPEG decoder we can replace the current one with? If so, it's worth a look. As far as the underlying audio buffering code in the Src/OSD directory, it's actually pretty good.
User avatar
Bart
Site Admin
 
Posts: 2347
Joined: Thu Sep 01, 2011 2:13 pm
Location: Santa Clara, California

Re: Audio channels

Postby Ian » Wed Jan 30, 2019 5:41 pm

Ian
 
Posts: 1647
Joined: Tue Feb 23, 2016 9:23 am

Re: Audio channels

Postby Bart » Wed Jan 30, 2019 11:41 pm

Yes but for the 68K-based DSB2, which I don't see. I wonder if the DSB1 was used in something besides Model 3 because on Model 3, only Scud Race uses it and I don't recall any broken stereo.
User avatar
Bart
Site Admin
 
Posts: 2347
Joined: Thu Sep 01, 2011 2:13 pm
Location: Santa Clara, California

Re: Audio channels

Postby Spindizzi » Thu Jan 31, 2019 12:43 am

hi,
I know the soundboard part needs to be rewritten, but the solution I made years ago, works not so badly
http://www.supermodel3.com/Forum/viewtopic.php?f=7&t=1282

I can push it, if Bart agrees
Spindizzi
 
Posts: 142
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Audio channels

Postby Bart » Thu Jan 31, 2019 11:42 pm

Oh! I completely forgot about that. Email me the changed file. The link in that thread isn't working for me.
User avatar
Bart
Site Admin
 
Posts: 2347
Joined: Thu Sep 01, 2011 2:13 pm
Location: Santa Clara, California


Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 2 guests