English Amiga Board


Go Back   English Amiga Board > Support > support.FS-UAE

 
 
Thread Tools
Old 15 April 2013, 18:25   #1
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
Sync to refresh rate

I played around with cvt and xrandr and was able to force my TFT to display 1920x1080 at 50Hz. It seemed to work, at least my monitor didn't blew up.
Code:
xrandr --newmode "amiga"  141.50  1920 2032 2232 2544  1080 1083 1088 1114 -hsync +vsync
xrandr --addmode HDMI1 "amiga"
xrandr --output HDMI1 --mode amiga
I fired up fs-uae and got a little disappointed: It looked worse then a non-synced display at 60 Hz. There was a lag every ~5 seconds. The output of ctrl+f9:
Code:
average fps sys: 49.8 emu: 50.1
Fs-use seems to have problems syncing correctly if the refresh rate is slightly below 50Hz... Bug...?

I raised vrefresh a little bit using "cvt 1920 1080 51" leading to
Code:
xrandr --newmode "amiga" 141.75  1920 2032 2232 2544  1080 1083 1088 1114 -hsync +vsync
No more lag. Looks good so far.
Code:
average fps sys: 50.4 emu: 50.4
jbl007 is offline  
Old 16 April 2013, 20:10   #2
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Hi, it's great that vsync works for you. Nothing beats smooth scrolling Amiga graphics

I doubt your initial problem has anything to do with a bug in FS-UAE. FS-UAE does not assume that the display runs at exactly 50Hz. It simply uses OpenGL to wait until the next vblank to synchronize the emulation to the display, whether that is 49 times per second or 52... (it will affect emulation speed a bit, but not compatbility, as the Amiga itself does not know it is sped up or slown down a bit).

I suspect the problem is rather that the display mode was not "stable" somehow, and that you would see a similar problem with OpenGL apps syncing to vlank with that modeline...
FrodeSolheim is offline  
Old 16 April 2013, 21:54   #3
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
Quote:
Originally Posted by FrodeSolheim View Post
Hi, it's great that vsync works for you. Nothing beats smooth scrolling Amiga graphics
True!

Thanks for your reply. So you think this is some kind of hardware/driver problem?
I tested some other applications: glxgears, Unigine benchmarks, tuxracer. I didn't notice any sync related frame drops.
Tested fs-uae again with different video_sync_method options and also with low_latency_vsync. It did not change anything. Pressing ctrl-f10 shows EMU always exactly at 50.0 with 1 frame drop/(insert?) every ~5 sec. while SYS is at 49.7-49.8. I was able to get perfect EMU/SYS sync without frame drops using uae_gfx_refreshrate=49 in the config file, but there were audio buffer issues... Again I think fs-uae has problems with syncing if the requested frame rate is higher then the real refresh rate.

Frode, I don't wanna bother you with this because it works for me (@51Hz). But there might be other people running into this problem.
jbl007 is offline  
Old 17 April 2013, 16:52   #4
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Wait a sec.. new information here.. you're using uae_gfx_refreshrate in your config file... don't. This causes UAE (internally) to insert sleeps to extend the frame time, causing frames to be returned to FS-UAE too late to render (for some of the frames at least).

There's a reason the following is printed in the log file when uae_* is used:
Code:
WARNING: custom uae_* options used! Your warranty is now void! ;)
(not that there was any warranty before...)
So, don't use uae_gfx_refreshrate = 50 with your original screen mode, and it will probably work just fine

(Also, this shows why attaching FS-UAE.log.txt is always a good idea no matter the question )
FrodeSolheim is offline  
Old 17 April 2013, 20:49   #5
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
Quote:
Originally Posted by FrodeSolheim View Post
Wait a sec.. new information here.. you're using uae_gfx_refreshrate in your config file... don't.
Oh no, i did not. It was for testing only.

Quote:
(Also, this shows why attaching FS-UAE.log.txt is always a good idea no matter the question )
Yeah, you are right. Speaking of log files... I took a closer look again. FS-UAE seems to detect 49Hz. But why doesn't it fully sync even with --video_sync=full
Attached Files
File Type: txt FS-UAE.log.txt (38.0 KB, 259 views)
jbl007 is offline  
Old 17 April 2013, 21:05   #6
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Hmm... actually, I may have accidentically borked "video_sync = full" when implementing support for automatically enabling/disabling full vsync depending on the Amiga chipset rate... that is, video_sync = full may now in reality behave as video_sync = auto, and since 49 != 50, auto sync does not enable full sync.

I'll have to check whether this is correct, and preferrably fix video_sync = full. An even better idea may be to remove video_sync = full (it was really just intended for situations where refresh rate detection did not work correctly), and instead introduce an "assume_refresh_rate" option to manually specify what your display is running at.

Also, it is probably a good idea to allow a bit of slack (accept 49 as well as 50 for auto, and same with 59/60).
FrodeSolheim is offline  
Old 19 April 2013, 19:51   #7
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
jbl007: please try the new 2.2.2 version

http://fengestad.no/fs-uae/2013/04/1...2-2-2-released
FrodeSolheim is offline  
Old 19 April 2013, 22:12   #8
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
Works like a charm. Thanks Frode.

Code:
$ grep -e rate -e sync FS-UAE.log.txt | grep -v opengl
video_sync = auto
fs_emu_set_video_frame_rate: 50
g_fs_emu_video_sync_to_vblank = 1
g_fs_emu_video_allow_full_sync = 1
frame rate (50) does not equal screen refresh (0)
fs_ml_video_sync_enable(0)
detected refresh rate: 49
checking video sync mode
will sync video updates to vblank
detected refresh rate: 49
assuming refresh rate: 49 (20408 usec per frame)
GL_ARB_sync extension found
deciding video sync method
- using default sync method
wait_for_frame_no_netplay: new frame rate 50 (time: 20000)
fs_emu_set_video_frame_rate: 50
g_fs_emu_video_sync_to_vblank = 1
g_fs_emu_video_allow_full_sync = 1
frame rate (50) close enough to screen refresh (49)
fs_ml_video_sync_enable(1)
SERIAL: period=372, baud=9600, hsyncs=16, bits=8, PC=fc2234
However I had to almost double the audio_buffer_target_bytes (14336). With the default settings I get buffer underruns.

Edit: At 50.3Hz I can set the audio_buffer_target_bytes to down 512 without any underruns.
Edit2: But only if vsync is enabled.

Last edited by jbl007; 19 April 2013 at 22:39.
jbl007 is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Choose resolution based on the refresh rate of the Amiga's monitor Leandro Jardim request.UAE Wishlist 4 25 January 2014 09:18
force refresh rate to 100hz fil support.WinUAE 2 20 August 2011 17:37
auto refresh turrican3 request.UAE Wishlist 0 13 May 2007 13:30
memory refresh Fx1 Lee request.Old Rare Games 10 25 February 2004 23:41
Display refresh rate problem icreadence support.WinUAE 4 14 March 2003 19:38

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 08:28.

Top

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