Next Generation Emulation banner
1 - 5 of 5 Posts

·
Registered
Joined
·
59 Posts
Discussion Starter · #1 ·
VBA music sounds much better when "emulator synchronize" option turn on.

I think my code has broken the sound and video synchronization, because I force to turn off "emulator synchronize" option when "auto skip frame" turn on to squeeze CPU emulation speed.

Does anyone have any suggestion to fix this problem?
 
G

·
If my interpretation is correct, synchronization is needed to keep the audio and video in sync during gameplay. If you want smooth audio you should never turn off synchronization.
The emulation code takes a set amount of time to run. You either optimize it to make the code more efficient, or get a faster machine that can execute it fast enough to achieve smooth gameplay (100% all the time). Simple hacks like more intelligent frame skipping will not give you perfect results (because there are still frames that should have been displayed that get discarded).
I understand that you are trying to make a name of yourself by contributing to VBA's development, and I am not criticising that. However, I believe that the right direction for improvement should be in code efficiency speed-ups without sacraficing emulation accuracy. Being a mere VBA user, I would appreciate it if you can look into that instead.
 

·
Registered
Joined
·
59 Posts
Discussion Starter · #3 ·
PNaveS said:
If my interpretation is correct, synchronization is needed to keep the audio and video in sync during gameplay. If you want smooth audio you should never turn off synchronization.

.................

However, I believe that the right direction for improvement should be in code efficiency speed-ups without sacrificing emulation accuracy. Being a mere VBA user, I would appreciate it if you can look into that instead.
Thanks for your suggestion. I think the direction you pointed out is right.

But the question I want to find the answer is:

Why "emulator synchronize" option has such big performance impact on VBA core speed? Almost 25% CPU speed drop down when "emulator synchronize" turn on.

Lacks experience in emulator programming, I can't find the reason by tracing the code. So I hope someone has ideas about this question can give me some clues.
 

·
Premium Member
Joined
·
483 Posts
There are two ways VBA can synchronize, both based on the direct sound buffer postion: one is based on notifications from the direct sound system and the other is a busy loop until it seems safe to continue writing to the buffer.

#1 is the preferred way but your settings may be forcing you to use #2 (called Old Synchronization in the menu)
#2 is busy and takes a lot more cpu

GBA emulation is very heavy and VBA is not highly optimized for speed. I had always tried to focus on being accurate rather than fast. I also attempted to put useful features into the emulator and that's why most people like VBA.

There is nothing in the emulator that prevents other systems to be added up. I probably still have the code that added Genesis emulation to it, although I never released it. GP32 was also started, but lacked someone to really drive it.

Just some bit of information.
 

·
Registered
Joined
·
59 Posts
Discussion Starter · #5 ·
Forgotten said:
There are two ways VBA can synchronize, both based on the direct sound buffer postion: one is based on notifications from the direct sound system and the other is a busy loop until it seems safe to continue writing to the buffer.

#1 is the preferred way but your settings may be forcing you to use #2 (called Old Synchronization in the menu)
#2 is busy and takes a lot more cpu

GBA emulation is very heavy and VBA is not highly optimized for speed. I had always tried to focus on being accurate rather than fast. I also attempted to put useful features into the emulator and that's why most people like VBA.

There is nothing in the emulator that prevents other systems to be added up. I probably still have the code that added Genesis emulation to it, although I never released it. GP32 was also started, but lacked someone to really drive it.

Just some bit of information.
Thanks for your answer and clues. I think I still have a lot to learn.
 
1 - 5 of 5 Posts
Top