discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vertical refresh and tearing...


From: Lundberg, Johannes
Subject: Re: Vertical refresh and tearing...
Date: Wed, 5 Mar 2014 10:26:00 +0900

Hi Ivan

Thanks for the detailed explanation. I found a solution that works for me and I think the reason for tearing was in the Intel driver on FreeBSD.

By setting rendering mode to "sna", enable "swapbufferswait" and "triplebuffer" (I think that was the combination) I get no tearing. However, the rendering becomes jerky and framerate uneven. Hopefully this will be fixed when the development of the driver is completed.



--
Johannes Lundberg
BRILLIANTSERVICE CO., LTD.


On Wed, Mar 5, 2014 at 3:44 AM, Ivan Vučica <ivucica@gmail.com> wrote:
In theory, yes; depending on the X server, X driver and the implementation of the compositing window manager, possibly no.

If you are using OpenGL, see:
  http://www.opengl.org/wiki/Swap_Interval

Quoting the GLX-specific part:
> Use the GLX_EXT_swap_control extension to control swap interval. Check the GLX-specific extensions string
> via glXQueryExtensionsString() to verify that the extension is actually present.
>
> The extension provides glXSwapIntervalEXT(), which also directly specifies the swap interval. 
> glXSwapIntervalEXT(1) is used to enable vsync; glXSwapIntervalEXT(0) to disable vsync.

Also http://stackoverflow.com/a/2343456:
> In Linux, things are much simpler. If  GLX_SGI_swap_control is present in the string returned 
> by glGetString(GL_EXTENSIONS), then you can use glXSwapIntervalSGI(0) to disable vsync 
> or you can use  glXSwapIntervalSGI(1) to enable vsync (aka vertical synchronization).

In theory -- http://stackoverflow.com/a/8411491 -- it should be controllable by NSOpenGLCPSwapInterval:
> NSOpenGLCPSwapInterval
>
> Sets or gets the swap interval. The swap interval is represented as one long. If the swap 
> interval is set to 0 (the default), the flushBuffer method executes as soon as possible, without 
> regard to the vertical refresh rate of the monitor. If the swap interval is set to 1, the buffers
> are swapped only during the vertical retrace of the monitor. Available in Mac OS X v10.0 and later.
>
> Declared in NSOpenGL.h.

While I don't know if GNUstep respects that, this diff suggest that it does: http://cgit.freedesktop.org/gstreamer/gst-plugins-gl/diff/?id=d199451a6a4ea19d

@@ -562,15 +562,19 @@ gst_gl_window_send_message (GstGLWindow * window, GstGLWindowCB callback,
*/
NS_DURING {
if (glContext) {
- long swapInterval = 1;
- [[glView openGLContext] setValues:(const GLint *)&swapInterval forParameter:NSOpenGLCPSwapInterval];
+#ifdef GNUSTEP
+ const long swapInterval = 1;
+#else
+ const GLint swapInterval = 1;
+#endif
+ [[glView openGLContext] setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
}
} NS_HANDLER {
- g_debug ("your back-end does not implement NSOpenglContext::setValues");
+ g_debug ("your back-end does not implement NSOpenglContext::setValues\n");
}
NS_ENDHANDLER

Good luck!

On Thu Jan 09 2014 at 12:44:31 PM, Lundberg, Johannes <johannes@brilliantservice.co.jp> wrote:
Can't you as an application choose if you want to render synchronized with vertical refresh or not?

--
Johannes Lundberg
BRILLIANTSERVICE CO., LTD.


On Thu, Jan 9, 2014 at 9:25 PM, Luboš Doležel <lubos@dolezel.info> wrote:
I believe that vsync is typically controlled by X driver's settings. It is not application's responsibility to make such decisions.

Luboš


On Thu, 9 Jan 2014 21:07:46 +0900, Lundberg, Johannes wrote:
Hi

Yeah it is something I made myself and something I can not share. If
I have some time I could write a short program that would demonstrate
the tearing but I'm rather busy now so that is not so likely I think..
However, I think the person who wrote the backend should be able to
answer the question easy..

Actually it is almost oyasumi (bed time) :)

--Johannes Lundberg
BRILLIANTSERVICE CO., LTD.

On Thu, Jan 9, 2014 at 9:02 PM, a b  wrote:

I am new to this group so I will not attempt to answer your
question. I have a question
for you:

Is the application something you downloaded from the GNUstep
website? If so,
could you say which application it is so that others could look at
at in order to see
the effect you are observing?

If it is something you wrote, would you be able to share a short
example demo
which would allow others to determine what is causing the problem?

ohayo or konichiwa as the case may be (please excuse the spelling,
if incorrect)

-------------------------
From: johannes@brilliantservice.co.jp [1]

Date: Thu, 9 Jan 2014 20:25:04 +0900
Subject: Vertical refresh and tearing...
To: discuss-gnustep@gnu.org [2]


Hi

Currently it does not seem like rendering is synchronized with
vertical refresh. Both my OpenGL (NSOpenGLView) app and a app using
animated NSView has a lot of tearing (on FreeBSD with cairo
backend).

Has anyone similar experiences or insight in what would be required
to get rid of the tearing? Is it simply a matter of making
additions
to the code in the backend?

Best regards

--Johannes Lundberg

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。


もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、


複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。
---
CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of
this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email
in
error, please destroy the original message.
_______________________________________________ Discuss-gnustep
mailing list Discuss-gnustep@gnu.org [3]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep [4]
_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org [5]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep [6]

 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。
もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、
複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。
---
CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email in
error, please destroy the original message.

Links:
------
[1] mailto:johannes@brilliantservice.co.jp
[2] mailto:discuss-gnustep@gnu.org
[3] mailto:Discuss-gnustep@gnu.org
[4] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
[5] mailto:Discuss-gnustep@gnu.org
[6] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
[7] mailto:a_bright2@hotmail.com

--
Luboš Doležel


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。
もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、
複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。
---
CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email in
error, please destroy the original message._______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。
もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、
複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。
---
CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email in
error, please destroy the original message.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]