Vsync issues with Linux?

About Monkey 2 Forums Monkey 2 Programming Help Vsync issues with Linux?

This topic contains 9 replies, has 4 voices, and was last updated by  jondecker76 8 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #13570

    jondecker76
    Participant

    I have Monkey2 running on Ubuntu 17.10

    The only issue I’m seeing is that all of the bananas run so fast that it’s not even usable.  The spacechimp banana reports a near 4000 FPS.  Pretty much every single example runs crazy fast like this.

    Is there a way to force vsync?

    This is on a Lenovo thinkpad P70 laptop

    #13573

    nerobot
    Participant

    Look at Window::SwapInterval property.

    Try to set it to 1.

    #13575

    jondecker76
    Participant

    thanks for the reply

    The spacechimps example already has SwapInterval set to 1, and everything still runs ungoverned. Maybe I’ll do a bug report

    #13578

    Hezkore
    Participant

    What HZ does your screen update at?

    #13581

    jondecker76
    Participant

    xrandr reports everything should be around 60hz, so I’m not sure why this is happening

    #13617

    Mark Sibly
    Keymaster

    As far as I can work out, the problem is that vsync support is purely down to the graphics driver, and not all drivers support it. On my cheap and cheerful linux+ATI setup, SwapInterval=1 works fine – which I find mildly surprising because I’m sure I didn’t used to work…

    I think this may be because I was running the prorietary ATI ‘fglrx’ (?) driver in the past, but have recently switched to the official ‘open source’ one, which seems to work really well these days. You might want to try this if possible, but if SwapInterval=1 doesn’t work all you can really do is use a timer instead – see spacechimps for a timer demo.

    Can anyone shed any more light on this? SwapInterval=1 ultimately results in a single call to glxSwapIntervalEXT, so I’m not sure what else I can do to make it work.

    #13618

    Hezkore
    Participant

    I have a bunch of Ati cards and they all work with SwapInterval, so for me there’s no issue.
    But isn’t there a way to get any error messages from things like glxSwapIntervalEXT?
    Maybe something like GetLastError() in the Windows API.

    Maybe that’s something Monkey2 needs btw, a global error/warning stack?
    If an error or warning occurred somewhere it gets throw into a stack and the user can go through that if he wants.

    Mark Sibly

    …see spacechimps for a timer demo.

    jondecker76

    The spacechimps example already has SwapInterval set to 1, and everything still runs ungoverned

    Even with a timer it runs too fast?
    That’s even weirder…

    #13620

    jondecker76
    Participant

    I’m on Nvidia with proprietary drivers, I could try the opensource one to see if there is a difference.

    With a timer, everything does work properly, it’s the just vsync that doesn’t work.

    #13622

    Mark Sibly
    Keymaster
    #13642

    jondecker76
    Participant

    I gave it a try Mark, no go. I tried setting it in the local shell and even through /etc/environment. I tried setting to both 0 and 1 with the same results. I’ll keep poking around and let you know if I find anything fruitful

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.