15 April 2013, 18:25 | #1 |
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 Code:
average fps sys: 49.8 emu: 50.1 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 Code:
average fps sys: 50.4 emu: 50.4 |
16 April 2013, 20:10 | #2 |
FS-UAE Developer
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... |
16 April 2013, 21:54 | #3 | |
Registered User
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
|
Quote:
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. |
|
17 April 2013, 16:52 | #4 |
FS-UAE Developer
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...) (Also, this shows why attaching FS-UAE.log.txt is always a good idea no matter the question ) |
17 April 2013, 20:49 | #5 | ||
Registered User
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
|
Quote:
Quote:
|
||
17 April 2013, 21:05 | #6 |
FS-UAE Developer
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). |
19 April 2013, 19:51 | #7 |
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
|
19 April 2013, 22:12 | #8 |
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 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. |
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 |
|
|