English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 03 May 2009, 23:31   #1
Gaula92
Registered User
 
Gaula92's Avatar
 
Join Date: Aug 2008
Location: Spain
Posts: 527
Scroll not totally smooth with sound on FullScreen: known problem?

Hello there

I have often said I have got perfect, smooth scroll in chipset games, but it seems it's not totally true: if I activate sound, whatever sound ouput I activate and whatever settings, scroll gets ocasionally jumpy. I mean, scroll smoothness somewhat jumps every few seconds---

Tried with different buffer lenghts and delays...no difference.

I've tried with vsync and without it; I've also tried different screen configs, and both custom 50Hz modes and 60Hz modes. There's no difference: activating sound causes imperfect screen refresh. I think it's a syncronization issue: some emulators are unable to sync graphics & sound properly.

No difference between old versions or new betas: the issue has been there forever, it seems. Even Linux & Osx versions have the same issue...

Fullscreen + Vsync makes it almost unnoticeable, but occasional jumps are still there (gianna sisters scroll demo, beast scroll demo, etc.)

Fullscreen only makes it very noticeable in games that refresh the screen in every frame (like those mentioned).

Do you know if it's fixable?

Thanks!

Last edited by Gaula92; 04 May 2009 at 00:40.
Gaula92 is offline  
Old 04 May 2009, 08:11   #2
gary
Junior Member
 
gary's Avatar
 
Join Date: Mar 2002
Location: Perth, Western Australia
Age: 50
Posts: 283
I can confirm that on my systems WinUAE and full screen + sound can achieve almost perfect 50hz scrolling with sound enabled, using full screen vsync and 100% emulated sound.

1. Standard video card with TV-OUT 720x576 - 50hz PAL display (Pentuim 4 2ghz)
2. ArcadeVGA video card at 352x288 50hz or 800x600 50hz RGB monitor in an acrade cabinet (Athon XP 1.8ghz)

If you look really carefully you may see a slight jump every 15 or so seconds in full frame games (Gianna sisters, Turrican, etc) - but it is only by a couple of columns of pixels so I don't mind it.

Be aware of other applications that you may have running in the background while running the emulator. I had a problem where the sound was slowing down occasionally (like playing a vinyl record and someone putting their finger on the turntable softly now and then) but it was due to another app that was checking for keyboard presses while WinUAE was running. If you're tying to troubleshoot problems try to test on a clean system without other non-operating system programs running at the same time.

Perhaps you should try changing the sample rate? I remember years ago I came across an emulator (not WinUAE) that couldn't achieve smooth PAL 50hz scrolling unless I set the output sample rate to 22050 hz.

Last edited by gary; 04 May 2009 at 08:18.
gary is offline  
Old 04 May 2009, 09:45   #3
Gaula92
Registered User
 
Gaula92's Avatar
 
Join Date: Aug 2008
Location: Spain
Posts: 527
Quote:
I can confirm that on my systems WinUAE and full screen + sound can achieve almost perfect 50hz scrolling with sound enabled, using full screen vsync and 100% emulated sound
@Gary: that's exactly what I've noticed, and in the same full frame games, too. You've got the same little but annoying (to me) issue.

My WinUAE test system is totally clear: it has NO processes stealing cpu cycles/capturing inputs. It's a minimal Windows without AV software/innececesary bloatware running in the background: only critical processes allowed there, no internet connection/resource provision...NOTHING.

I've noticed the following: I can archieve PERFECT scroll with sound if I select the "primary sound device", with fullscreen+vsync. That causes sound pitch anomalies, as it syncronizes sound to graphics and it seems we haven't got the EXACT refresh rate expected by the emulated Amiga.

I can also get PERFECT scroll if I select any other sound device, deactivate vsync (only fullscreen) and set the frame control to 61 or more. That causes gasps in sound however.

It seems the emulator can sync on sound or sync on graphics, but not both at the same time. It's however possible, as SnesGT, Kega Fusion or pSX emulator do it for other systems...Other experiences?
BTW: Is "100% accurate sound" related to sound sync somehow? What's the "ciaatod" setting for in the config files?

Last edited by Gaula92; 04 May 2009 at 09:54.
Gaula92 is offline  
Old 04 May 2009, 09:53   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
Quote:
Originally Posted by gaula88@hotmail View Post
It seems the emulator can sync on sound or sync on graphics, but not both at the same time. It's however possible, as SnesGT, Kega Fusion or pSX emulator do it for other systems...Other experiences?
Amiga sound hardware is synced to horizontal sync. Comparisons to other emulators or hardware is generally useless.

Quote:
BTW: Is "100% accurate sound" related to sound sync somehow?
No
Toni Wilen is online now  
Old 04 May 2009, 09:55   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
Something really important like hardware specs (full!) is missing..

EDIT: also enable onscreen leds and check SND%, does it stay stable or jump around?

Last edited by Toni Wilen; 04 May 2009 at 10:05.
Toni Wilen is online now  
Old 04 May 2009, 10:29   #6
Gaula92
Registered User
 
Gaula92's Avatar
 
Join Date: Aug 2008
Location: Spain
Posts: 527
Quote:
Originally Posted by Toni Wilen View Post
Something really important like hardware specs (full!) is missing..
I have two different host systems with different specs, for emulation testing:

Host system 1:
1.66Ghz Intel Atom
1GB DDR2 533Mhz RAM
Gma950 chipset with integrated graphics
Azalia ALC 888 sound chip (Realtek)
Latest DirectX and drivers
Windows XP Sp3

Host system 2 is similar, having a core2duo processor instead.
Both system are perfectly capable for the most demanding Amiga emulation, including AGA games, without JIT.

JIT is NEVER used in those tests.
NTSC modes are used for those tests.

As for emulated system specs, it's an Amiga 500 with ECS chipset:
68000 cpu
Match A500 speed
More Compatible
no FPU
ECS Agnus
NTSC
Chipset Extra: Generic
No chipset options set (Inmediate blitter, cycle-exact, etc)
Collision level: Sprites and Sprites Vs Playfield
Sound emulation: Emulated, 100% Accurate
Adv. Chipset: Compatible Settings
ROM: 1.3
2Mb chip RAM
8MB Fast RAM
Adf images of games are used, no HD Images
Graphics:
Primary screen controller
FullScreen mode: 1024x768, 16bpp, 60Hz (NTSC)
FullScreen + Vsync
Refresh: Every frame
FPS Adj is not active
Centering none
Line mode double
Sound output:
-Primary sound device: causes strange pich in sound (I am not talking about the high pitch caused by NTSC timing, but strange pitch; no gasps)
-If I select ASIO sound, the sound quality is GREAT, but it causes those annoying scroll jumps. No gasps in sound, no high CPU usage. ASIO doesn't allow perfect graphics sync for some reason. Every frequency was tested.
-Any other settings: similar results.
Sound: enabled, 100% accurate
Sound Buffer: 1 to max (no difference for this issue)
CHannel mode: Stereo
Frequency: 22050 to 48000 (no difference)
Filter: disabled
Interpolation: disabled
Graphics filter: none (disabled for those tests)
Miscelaneous: default settings except for On-screen leds, that are disabled.
Priority & Extensions: default settings for those tests.

WinUAE versions tested range from old versions to new betas.

Do you need any other specs, Toni?

Last edited by Gaula92; 04 May 2009 at 11:03.
Gaula92 is offline  
Old 04 May 2009, 11:15   #7
gary
Junior Member
 
gary's Avatar
 
Join Date: Mar 2002
Location: Perth, Western Australia
Age: 50
Posts: 283
Quote:
Originally Posted by gaula88@hotmail View Post
Sound: enabled, 100% accurate
Sound Buffer: 1 to max (no difference for this issue)
CHannel mode: Stereo
Frequency: 22050 to 48000 (no difference)
Priority & Extensions: default settings for those tests.
Try increasing the priority of WinUAE when active to see if that help with your varying sound pitch problem. In my case while watching the emulation status squares on the bottom of the screen the far-left square (to the left of the CPU % figure) occasionally dipped in to a negative number, and when it did which ever samples currently playing would slow down in pitch then return to normal after the figure returned back to a positive number. Perhaps it represents the sound buffer level.
gary is offline  
Old 04 May 2009, 11:23   #8
Gaula92
Registered User
 
Gaula92's Avatar
 
Join Date: Aug 2008
Location: Spain
Posts: 527
@gary: tried every priority available. It doesn't make a difference...anyway, sound is perfect in ASIO mode. Thanks for the idea, anyway!
Gaula92 is offline  
Old 04 May 2009, 12:52   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
Sound pitch changes if sound sync drifts too much. This seems to be some OS/driver/whatever issue because I don't see it on my PC. (ASIO is probably much more accurate than DS, does also other portaudio modes work better than DirectSound?)

Solution probably is something (too) simple but as usual, I can't fix any (even simple) problem if I can't duplicate it myself
Toni Wilen is online now  
Old 04 May 2009, 13:09   #10
Gaula92
Registered User
 
Gaula92's Avatar
 
Join Date: Aug 2008
Location: Spain
Posts: 527
Toni: yes. Other portaudio modes don't have that strange pitch effect I get with DirectSound.
ASIO sounds perfect here, but it causes scroll jumps once in a while, and that's what I am trying to fix. I would be happy to use ASIO: but while it fixes the sound part, it brokes the graphics part.

In other words: using ASIO seems to force sync on sound: that causes perfect sound but occasionally skippy graphics refresh. Are you sure using ASIO keeps the sync on VBlank?? I just don't get it. Maybe knowing a bit more about it can lend to a solution.

Quote:
Amiga sound hardware is synced to horizontal sync. Comparisons to other emulators or hardware is generally useless
Well, if emulated amiga's sound is synced to hsync, why does ASIO cause those little skips? What could be the cause? Why doesn't DS cause them?

EDIT: will inform about snd% asap: I am at work and they'll be kicking me if I dedicate so much time to Amiga here!

Last edited by Gaula92; 04 May 2009 at 13:23.
Gaula92 is offline  
Old 04 May 2009, 13:51   #11
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
If vsync enabled: sync source is vsync. sound pitch is adjusted if it gets too far out of sync with gfx (dsound only). Other sound modes either cause sound glitches (if sound data underflow) or small pause(s) ("too much" sound data, new data from Paula emulation but no space in buffer)

Problem with syncing gfx and sound 100% perfectly is that there is always small difference between gfx and sound. (number of sound samples per frame is always some fractional number and it can/will change "randomly"..)

I am not exactly sure how to solve this problem "correctly".. Perhaps I need to check some mediaplayer sources..

If vsync disabled: sync source is sound buffer level.
Toni Wilen is online now  
Old 04 May 2009, 14:17   #12
Gaula92
Registered User
 
Gaula92's Avatar
 
Join Date: Aug 2008
Location: Spain
Posts: 527
Well, maybe I can help you.
I am a perfecctionist when it comes to emulators, so I've talked to other authors about video and audio sync. Another great emulator is Genesis Plus for GameCube. I KNOW, Toni, that you told me comparisions with another emulators aren't usefull, but this one had the same problem we've got here: those little differences between audio and video. It was perfect video with audio gaps, or perfect audio with occasional frame skips. Here's how Eek-Eek fixed it, and now we've got a perfect emulator:


ME:
Quote:
Both intros: both have single-plane scroll. You must look at the whole screen, and pay some attention to movement smoothness: you will notice that, once in a while (3-4 seconds) there's a "jump", a "skip"...I don't know ho to describe it, but you sure get the idea.
I've tried 1.3.0 and scroll is PERFECT. I played Alisia Dragoon & Ristar for hours yesterday!! Occasional sound gaps are barely noticeable, even if I can notice them sometimes. Optional sync methods would be great! (or a mixtue of boths)
You can see the same artifact in the presentation of each planet in Ristar (the scrolling part), the Sonic tittle screen with scrolling planes, etc...
In general, every sequence with a perfect, smooth 60fps scrolling in the Genesis/MD is affected. I know the genesis games are plagued with slowdows, but I'm not talking about that. Having tried 1.3.0, I know for sure it's caused by the new sync method.
Eek-Eek:

Quote:
just to let you know,, I fixed it
After some timing measures, it appeared the Vertical Interrupt has an approximate period of 16715 microseconds, which is 802.32 audio samples played at 48Khz. We formerely uses a constant number of 800 samples per frame, which eventually lead to desynchronization issues as explained in previous posts.

My idea was to interpolate this number by using alternatively 800 or 808 samples per frame (DMA length must be a multiple of 32 bytes), depending on the current delta with theorical sample count and by keeping the frame sync with video (like in 1.3.0).
This way you ensure the frame is always completed in time for the next video AND audio frame and you achieve a constant 60 fps.


In 50Hz mode, the Video interrupt period is 19967 microseconds which is approx 958.42 audio samples. Same could be done as above using alternatively 952 or 960 samples but this time, default audio DMA (960 samples) is a little longer than the Video period, so you do not notice any frameskipping. The framerate is however not constant and will drop from 50 fps to 49 fps from time to time but this is not noticeable enough to be worth the same moficiation as in 60Hz modes...
I hope this information is somehow usefull for this issue, Toni. Genesis Plus for GC is an opensource project, too.
Gaula92 is offline  
Old 04 May 2009, 15:22   #13
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
I think this could fix the problem, at least partially. I knew it had to be something too simple

Will test later this week.
Toni Wilen is online now  
Old 04 May 2009, 16:05   #14
Gaula92
Registered User
 
Gaula92's Avatar
 
Join Date: Aug 2008
Location: Spain
Posts: 527
Great!! Thanks, Toni! We're just a few steps away from the perfect Classic Amiga emulator!

[Edit] As a racoon, I am verrrrry sensitive to occasional frame-desync, so count on me to test the solution! I can be hours looking at a scrolling scene to detect them!

Last edited by Gaula92; 04 May 2009 at 16:31.
Gaula92 is offline  
Old 04 May 2009, 19:44   #15
kirk
Zone Friend
 
Join Date: Oct 2006
Location: uk
Posts: 148
been reading this thread with massive interest, but im not as technically proficent as you lot !.

i always wondered why my emulated miggy stuff was not quite as smooth as real mig, but it was not so bad as to bother me too much.

im gonna dig out my real mig and compare latest winuae, but i do seem to recall that older winuaes were a bit worse than later winuaes in this aspect, i think ?

im gonna test the game 'monster business' (scrolling on this was quite jerky compared to the silky smooth scrolling on real mig) on old/new winuae.

ps, the last reply by toni has got me very excited indeed !
kirk is offline  
Old 04 May 2009, 22:15   #16
Gaula92
Registered User
 
Gaula92's Avatar
 
Join Date: Aug 2008
Location: Spain
Posts: 527
me too, captain Kirk!
Gaula92 is offline  
Old 05 May 2009, 01:17   #17
Supamax
Da Digger :)
 
Supamax's Avatar
 
Join Date: Nov 2008
Location: Monza, Italy
Posts: 2,822
VERY interesting!
Supamax is offline  
Old 05 May 2009, 07:12   #18
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
I think not everyone understand the point of this thread.

You already can have smooth scrolling. This fix/update only (possibly) removes random glitches and/or sound pitch changes.

This is not your standard "what is vsync"/"how to use vsync" thread and won't become one.
Toni Wilen is online now  
Old 05 May 2009, 09:36   #19
Gaula92
Registered User
 
Gaula92's Avatar
 
Join Date: Aug 2008
Location: Spain
Posts: 527
well, that's why I started this thread...
Gaula92 is offline  
Old 07 May 2009, 20:55   #20
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
http://files.winuae.net/beta/winuae.zip has some sound/vsync related "adjustments".. Please test
Toni Wilen is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
help me smooth scroll rusty71 support.WinUAE 7 21 November 2011 15:36
LCD and smooth scrolling (not a 50Hz or a vsync problem) aidenn support.Other 26 16 April 2010 18:20
E-UAE: are smooth and synced graphics & sound possible at the same time? Gaula92 support.OtherUAE 2 16 December 2008 21:14
Problem with 1.3 using Fullscreen mode Mangar support.WinUAE 1 03 August 2006 03:18
vsync+fullscreen+sound=crash (but only at startup?!) gary support.WinUAE 0 25 June 2004 05:17

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:05.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13822 seconds with 13 queries