Audio Sync Option

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

gaijinx1
Hazed
Posts: 82
Joined: Mon Aug 02, 2004 9:23 pm
Location: In front of the monitor (USA)

Audio Sync Option

Post by gaijinx1 »

I noticed that most emulators have the option to sync the sound which makes the music and sound effects much better. Why doesn't Zsnes come with that option!?!? If it did, that would make Zsnes that much more
accurate.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

So you're saying you want an option to disable ZSNES' sound sync?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
snkcube
Hero of Time
Posts: 2646
Joined: Fri Jul 30, 2004 2:49 am
Location: In front of the monitor
Contact:

Post by snkcube »

What a strange request. :P
Try out CCleaner and other free software at Piriform
Image
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Re: Audio Sync Option

Post by Noxious Ninja »

Depends. Timing isn't perfect yet, so you could say the SPC700 and main CPU aren't "synced". Although, for most games, this is irrelevant, as it works just fine.
Last edited by Noxious Ninja on Wed Sep 29, 2004 7:39 am, edited 1 time in total.
[u][url=http://bash.org/?577451]#577451[/url][/u]
JFD62780
Rookie
Posts: 23
Joined: Sat Jul 31, 2004 4:40 am
Location: Tampa, FL, USA
Contact:

Post by JFD62780 »

I think he means he wants SNEeSe-style smooth sound effects. Hell, so do I, but I'm patient at the very least! :)
Until next post...
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

What technical reasons are there as to why it's difficult to sync the main CPU and sound CPU in the emulator?

If memory serves me, there was a problem getting a 100% accurate clock speed from both chips.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Can you say with any certainty how fast either chip runs? Exact number we're talking here.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Nach wrote:Can you say with any certainty how fast either chip runs? Exact number we're talking here.
Google gave me this:

Code: Select all

    * CPU: 16-bit Custom 65C816 running at 1.79, 2.68 or 3.58 MHz (changeable)
    * RAM: 1 Mbit (128 Kbyte)
->  * Memory Cycle Time: 279 ms
    * Picture Proccessor Unit: 16-bit
    * Video RAM: 0.5 Mbit (64 Kbyte)
    * Resolution: 256x224, 512 x 448 pixels max hi res and interlaced modes
    * Colours Available: 32,768 colours
    * Max colours on screen: 256 colours
    * Max sprite size: 64 x 64 pixels
    * Max sprites: 128 (32 per line)
    * Min/Max Cart Size: 2 Mbit - 48 Mbit
    * Audio RAM: 512 Kbit
    * Sound chip: 8-bit Sony SPC700
    * Sound channels: 8, uses compressed wave samples
->  * Controller Response: 16 ms
    * Pulse Code Modulator: 16-bit
    * Power Input: 120V AC, 60Hz, 17 Watts
    * Power Output: 10V DC, 850 mA (NTSC), 9V AC (PAL)
Does this help ?
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

Nach wrote:Can you say with any certainty how fast either chip runs? Exact number we're talking here.
I can say the speed no more accurate than the 3.58Mhz etc.. for CPU and 2.048Mhz for SPC700.

I assume the problem then is because that is not accurate enough to timing sensetive operations.

Based on the numbers given, you can calculate your cycle time for both chips. Ok, your cycle time will be slightly innaccurate compared to the real hardware, but why does that matter? The ratio between the two chips will be in sync.

I guess I do not understand the relationship between the two chips enough detail. You should be in sync none the less.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
Zuzma

Post by Zuzma »

I'm probably wrong on this since I don't know much about this stuff but there's more to the timing then the speed of the processors. Bus timing, DMA, HDMA, IRQs etc.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

zuzma wrote:I'm probably wrong on this since I don't know much about this stuff but there's more to the timing then the speed of the processors. Bus timing, DMA, HDMA, IRQs etc.
Right.. but the problem is the sound syncing with video. Offhand I don't think you can DMA data to the APU. It has it's own I/O ports for that. Same goes for HDMA. IRQ's should also be independent of the APU.

I understand your point though. There is definitely more to timing than just the clock speeds. I'm just trying to get someone to tell me exactly why it's a problem.

I'm not claiming I can do a better job or even as good of a job. I just would like to know for my own knowledge.

Maybe if Pagefault is feeling less grumpy and perusing the board, maybe he can shed some light on the subject. Maybe he needs to get back on that bong of his! :D
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
Zuzma

Post by Zuzma »

I wasn't exactly trying to help the orignal poster but you did get my point. Err and I really know nothing compared to you guys. :oops:
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

It is possible to H-DMA to the APU, the exact clock rates are known, and most emulator implementations use some assembly code that sync on a ratio of the 5A22 master clock, or even a ratio of 5A22 to SPC instructions, regardless of how many cycles they require to execute, as it the case with ZSNES. *Whew*
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

Ok.. thanks for the info. That confirms though that H-DMA can be ruled out as a sync problem.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

How is H-DMA not a sync problem? Since the 5A22 is stopped for H-DMA operation, since H-DMA setup consumes additional cycles and such, the effective 5A22 clock rate changes. Since communication depends on both clocks, that which affects one clock (DMA, H-DMA, $4000-$41FF accesses, fast/slow memory access, etc.) affects sync.

Step back for a moment to gaze upon the big picture.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

Why is the 5A22 being stopped and the others are not? That doesn't happen on the real hardware. No clocks are stopped correct?

Your effective clock rates should not change. Everything is virtual. Your clocks should always be constant. You don't increment a master cycle counter until you've done everything that is supposed to be done for that cycle. Everything else should be tied into the master counter and not be advancing either.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

DMA operations use both buses. Regardless of where it's executing from, the CPU must wait until at least one of the buses is free.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

I don't think we're quite on the same page. I'm missing something. Got any links to some good docs on the subject? Most ones I've looked through don't go into much detail on the subject matter we're talking about.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

I am on the "MKendora pointed this topic out on IRC, but doesn't want to get any more involved than suggesting that somebody else post known information" page.
flinx

Run the 65C816 faster but not the SPC700 because

Post by flinx »

Then games with slowdown wouldn't have it anymore but the sound effects and music will stay the proper pitch and tempo. Personally I'd like to use it in Jurassic Park. Inside buildings there is seems to be a true 3D engine rendering walls and the occasional countertop. However the framerate in the real SNES and ZSNES seems like about 6 per second. If I could double that while not speeding up the sound, that would kick ass. When I disable Auto Framerate it speeds up nicely but the sound suffers.

BTW, last night I found the hex address and value for infinite health for "Jurassic Park (U) (V1.1)", it's 7E02EB00 That was after trying the codes on websites. Then I googled for that exact address and it returns a single page: http://www.gscentral.com/codes.pl?dev=p ... es&game=jp
I believe only the first thee codes work for (V1.1), the others are the same as found on other sites.
Dmog
Lurker
Posts: 192
Joined: Tue Aug 31, 2004 6:03 pm

Re: Run the 65C816 faster but not the SPC700 because

Post by Dmog »

flinx wrote:Then games with slowdown wouldn't have it anymore but the sound effects and music will stay the proper pitch and tempo. Personally I'd like to use it in Jurassic Park. Inside buildings there is seems to be a true 3D engine rendering walls and the occasional countertop. However the framerate in the real SNES and ZSNES seems like about 6 per second. If I could double that while not speeding up the sound, that would kick ass. When I disable Auto Framerate it speeds up nicely but the sound suffers.
Bwahaha haha!! Awww... (wipe tear) Promote that guy!
That guy...has a vision... The emulation scene could use people like you son.
Reznor007
Lurker
Posts: 118
Joined: Fri Jul 30, 2004 8:11 am
Contact:

Re: Run the 65C816 faster but not the SPC700 because

Post by Reznor007 »

Dmog wrote:
flinx wrote:Then games with slowdown wouldn't have it anymore but the sound effects and music will stay the proper pitch and tempo. Personally I'd like to use it in Jurassic Park. Inside buildings there is seems to be a true 3D engine rendering walls and the occasional countertop. However the framerate in the real SNES and ZSNES seems like about 6 per second. If I could double that while not speeding up the sound, that would kick ass. When I disable Auto Framerate it speeds up nicely but the sound suffers.
Bwahaha haha!! Awww... (wipe tear) Promote that guy!
That guy...has a vision... The emulation scene could use people like you son.
As funny as that may sound, it does work in some games. In MAME you can run NeoGeo games(Metal Slug 2 for example) and overclock the main CPU to 2x speed. This removes the slowdowns that happen, and the audio stays at the right speed. You can only overclock stuff with cheats enabled, but it does work.
Dmog
Lurker
Posts: 192
Joined: Tue Aug 31, 2004 6:03 pm

Re: Run the 65C816 faster but not the SPC700 because

Post by Dmog »

Reznor007 wrote:
Dmog wrote:
flinx wrote:Then games with slowdown wouldn't have it anymore but the sound effects and music will stay the proper pitch and tempo. Personally I'd like to use it in Jurassic Park. Inside buildings there is seems to be a true 3D engine rendering walls and the occasional countertop. However the framerate in the real SNES and ZSNES seems like about 6 per second. If I could double that while not speeding up the sound, that would kick ass. When I disable Auto Framerate it speeds up nicely but the sound suffers.
Bwahaha haha!! Awww... (wipe tear) Promote that guy!
That guy...has a vision... The emulation scene could use people like you son.
As funny as that may sound, it does work in some games. In MAME you can run NeoGeo games(Metal Slug 2 for example) and overclock the main CPU to 2x speed. This removes the slowdowns that happen, and the audio stays at the right speed. You can only overclock stuff with cheats enabled, but it does work.
Yeah I know, heck, you can even do that in Z to some extend. Raise the % of execution to 150% and you'll experience less slowdowns (slowdowns that would actually occur on the Snes) Fwiu, this is supposed to be a quick way to "fix" some games that normally don't work because of the timing problems.

While we're on the subject of basterdized emulation: Why not emulate the Snes CPU at something like 3x the normal speed...and then implement hacks for every game that got broken as a result? So that no slowdowns will ever occur and all the kiddies will be happy.
gaijinx1
Hazed
Posts: 82
Joined: Mon Aug 02, 2004 9:23 pm
Location: In front of the monitor (USA)

Post by gaijinx1 »

What I meant to say is, is there any way to improve the timing on the SPC700 and the Snes CPU. I'm asking this because games like Earthbound suffer in sound, try out the moves Teleport A and Teleport B,
you'll see what I'm talking about. Repeated sound effects suffer, why?
Sony's PSP may have superior hardware, but like many other systems, it doesn't focus on quality in their games. The Nintendo DS will prevail in the gaming department!
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

gaijinx1 wrote:What I meant to say is, is there any way to improve the timing on the SPC700 and the Snes CPU. I'm asking this because games like Earthbound suffer in sound, try out the moves Teleport A and Teleport B,
you'll see what I'm talking about. Repeated sound effects suffer, why?
You can try SNEeSe. It's supposed to have better timing.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Post Reply