+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: Linux client: Replace DGA mouse with either XInput2 or SDL

  1. #1
    *TheMagicianKing
    Guest

    Linux client: Replace DGA mouse with either XInput2 or SDL

    As DGA has aged to the point where the nvidia drivers cause the game to break when DGA is accessed, it implies that people have to return to the older XInput1. That XInput has a cursor limitation problem which was worked around in the quake3 code. Now because as we all know this presents a potential issue, I recommend replacing the DGA code with XInput2 code. XInput2 is the new method of handling events, which sends raw mouse data to its listeners.

    The alternative is of course implementing SDL and referring to the almost always up to date SDL system library, which will save all of us(including the windows user) quite a bit of in_mouse x agony.

  2. #2
    Senior Member Lam has a spectacular aura about Lam has a spectacular aura about Lam has a spectacular aura about Lam's Avatar
    Join Date
    Aug 2010
    Posts
    3,763
    Quote Originally Posted by TheMagicianKing View Post
    nvidia drivers cause the game to break when DGA is accessed
    Source?


    Quote Originally Posted by TheMagicianKing View Post
    The alternative is of course implementing SDL
    The developers have said explicitly that they won't go anywhere near SDL. Maybe now that SDL 2.0 was re-licensed and can be compiled in, they could change their mind?

  3. #3
    *TheMagicianKing
    Guest
    ftp://download.nvidia.com/XFree86/Li...EADME/faq.html
    Why do applications that use DGA graphics fail?

    The NVIDIA driver does not support the graphics component of the XFree86-DGA (Direct Graphics Access) extension. Applications can use the XDGASelectInput() function to acquire relative pointer motion, but graphics-related functions such as XDGASetMode() and XDGAOpenFramebuffer() will fail.

    The graphics component of XFree86-DGA is not supported because it requires a CPU mapping of framebuffer memory. As graphics cards ship with increasing quantities of video memory, the NVIDIA X driver has had to switch to a more dynamic memory mapping scheme that is incompatible with DGA. Furthermore, DGA does not cooperate with other graphics rendering libraries such as Xlib and OpenGL because it accesses GPU resources directly.

    NVIDIA recommends that applications use OpenGL or Xlib, rather than DGA, for graphics rendering. Using rendering libraries other than DGA will yield better performance and improve interoperability with other X applications.
    As such, I cannot play with in_dgamouse 1 on my machine.

    As for what the developers said, I assume they provided some arguments, so.... source? You don't want to compile in SDL, SDL works as an abstraction layer, meaning the version compatible with the system is found only on the system it is installed on. Ubuntu and Arch Linux do not necessarily ship the same binary version of SDL.

  4. #4
    Senior Member Lam has a spectacular aura about Lam has a spectacular aura about Lam has a spectacular aura about Lam's Avatar
    Join Date
    Aug 2010
    Posts
    3,763
    Quote Originally Posted by TheMagicianKing View Post
    Applications can use the XDGASelectInput() function to acquire relative pointer motion, but graphics-related functions such as XDGASetMode() and XDGAOpenFramebuffer() will fail.
    Translation for you:

    1. DGA mouse works and is fully supported with the nvidia driver.

    2. Actual DGA (2D framebuffer access) doesn't work, but QL doesn't care.

    3. QL uses OpenGL graphics and that also works (duh!)

    Quote Originally Posted by TheMagicianKing View Post
    As such, I cannot play with in_dgamouse 1 on my machine.
    Why?

    Quote Originally Posted by TheMagicianKing View Post
    the version compatible with the system is found only on the system it is installed on. Ubuntu and Arch Linux do not necessarily ship the same binary version of SDL.
    Those are exactly the reasons why you want to stay away from SDL - they break ABI and API compatibility every week and you can't distribute a stable binary that would link with system SDL. That's also why they were kind of forced to change the license to allow including with compiled commercial blobs. And the reason why Steam for Linux ships its own compiled version of SDL 2. And why QL would do the same.

  5. #5
    *TheMagicianKing
    Guest
    https://github.com/id-Software/Quake.../linux_glimp.c line 408 is causing it to break. It's a video call eventhough quake is only interested in the mouse. And again, DGA hasn't been maintained for almost a decade now, so whatever is happening in that code is most likely not worth fixing. XInput2 is reasonably new and is used by SDL as a replacement to DGA input.

    SDL's API has been (nearly) the same for 10 years. I can grab an old SDL game and it will work with the current version. The API of 2.0 is brand new however and that one is stabilized, so won't change in the foreseeable future either. Then, steam has the ever so important option to run on system libraries, yes it ships with its own set, but you can override that by setting STEAM_RUNTIME=0 and then it will fall back to my system libraries. Quite frankly, steam users are wondering why valve is even bothering to ship such an environment in the first place as STEAM_RUNTIME=0 is stable.

    Next up, supposed messups in the library... That is user responsibility. As a Linux user, one is expected to keep his own system in working order. It is not something Id should cover as while quakelive might be working, they remove or avoid a very important symptom telling the user his system is not in working order.
    Last edited by Sasparillo; 08-07-2013 at 04:03 PM.

  6. #6
    Senior Member Lorfa is a jewel in the rough Lorfa is a jewel in the rough Lorfa is a jewel in the rough Lorfa's Avatar
    Join Date
    Aug 2010
    Location
    Kepler-22b
    Posts
    8,891
    So you cannot use in_dgamouse 1 because of a crash? Or what happens? Is this just in Q3 or in QL too?

  7. #7
    *TheMagicianKing
    Guest
    Exactly, it crashes in both QL and Q3. Also, if Quake3 was using SDL 10 years ago linked against the system library, this problem wouldn't have existed.

  8. #8
    Senior Member Lam has a spectacular aura about Lam has a spectacular aura about Lam has a spectacular aura about Lam's Avatar
    Join Date
    Aug 2010
    Posts
    3,763
    Quote Originally Posted by TheMagicianKing View Post
    line 408 is causing it to break. It's a video call eventhough quake is only interested in the mouse.
    Maybe you're reading different code. For me, line 408 is:

    XF86DGADirectVideo(dpy, DefaultScreen(dpy), XF86DGADirectMouse);

    And what that means is "I'm not interested in any graphics functions, I only want direct mouse". Other possible flags that are NOT set are XF86DGADirectGraphics and XF86DGADirectKeyb.

    So again: what exactly is broken?

    Quote Originally Posted by TheMagicianKing View Post
    DGA hasn't been maintained for almost a decade now, so whatever is happening in that code is most likely not worth fixing.
    But what is there to fix? Under the hood, whether you're using DGA or X Input 2.0, you're reading the same data which is coming from the X drivers, nowadays it's evdev everywhere.

    Quote Originally Posted by TheMagicianKing View Post
    I can grab an old SDL game and it will work with the current version.
    2.0 is officially not backwards compatible with 1.2. There isn't even supposed to be a way for an old game to run with new SDL. But you can do it with magic?

    Quote Originally Posted by TheMagicianKing View Post
    The API of 2.0 is brand new however and that one is stabilized, so won't change in the foreseeable future either.
    You're clearly not following OSS development and don't know how often binary compatibility is broken between minor versions even if the authors thought they're making a backwards-compatible change.

    Quote Originally Posted by TheMagicianKing View Post
    steam users are wondering why valve is even bothering to ship such an environment in the first place as STEAM_RUNTIME=0 is stable.
    Hi, I'm an infrequent Steam user but STEAM_RUNTIME=0 isn't umm "stabl;e". Even simple stuff that should work doesn't, like it minimizes and you have no way to bring it back because there's no icon in system tray. No such problem with the runtime, it just works.


    I'm not even going to comment on my "responsibility" to keep system libraries compatible with a piece of proprietary software unmaintained for 4 years.

  9. #9
    *TheMagicianKing
    Guest
    Quote Originally Posted by Lam View Post
    Maybe you're reading different code. For me, line 408 is:

    XF86DGADirectVideo(dpy, DefaultScreen(dpy), XF86DGADirectMouse);
    That is the exact line causing the crash from nvidia. This is a video call.

    And what that means is "I'm not interested in any graphics functions, I only want direct mouse". Other possible flags that are NOT set are XF86DGADirectGraphics and XF86DGADirectKeyb.

    So again: what exactly is broken?
    Do I need to take a screenshot or something? That call crashes. It crashes hard. Whatever the arguments passed, it crashes. It is 10 year old code, it cannot even be expected to work. The X development team is trying to get rid of it.
    But what is there to fix? Under the hood, whether you're using DGA or X Input 2.0, you're reading the same data which is coming from the X drivers, nowadays it's evdev everywhere.
    Now I'm going back to my first post. Because DGA is crashing Quakelive, I have to fall back to XLib. It falls back to an event system that is constrained by the window it is in(pointer cannot leave the window and the movement there is truncated). XInput2 just like DGA allows raw movement, which means the data is not truncated.
    2.0 is officially not backwards compatible with 1.2. There isn't even supposed to be a way for an old game to run with new SDL. But you can do it with magic?
    SDL 2.0 and 1.2 are two different major versions. I wasn't trying to suggest that they were compatible. But every version of SDL 1.2, which is 0 until 13, which have existed for nearly 10 years, there should be no compatibility issues.
    You're clearly not following OSS development and don't know how often binary compatibility is broken between minor versions even if the authors thought they're making a backwards-compatible change.
    Such changes for one do not affect the event system. I have used SDL quite recently and it coded exactly the same as it did 10 years ago. Without fault. What can be affected and is more likely affected are the render functions that noone really uses:P

    Hi, I'm an infrequent Steam user but STEAM_RUNTIME=0 isn't umm "stabl;e". Even simple stuff that should work doesn't, like it minimizes and you have no way to bring it back because there's no icon in system tray. No such problem with the runtime, it just works.
    What distro are you running? Steam is stable for me and works perfectly on my own runtime. And I'm running Arch, which isn't even supported.
    I'm not even going to comment on my "responsibility" to keep system libraries compatible with a piece of proprietary software unmaintained for 4 years.
    Quakelive IS maintained. Lets put that up front. And I specifically said working order. That means that your libraries should always work with any application they are expected to work with, even if that doesn't include the hasn't been maintained for 4 years game. And if your SDL is broken for an app, how do you expect that app to work properly with lower level libraries?

    What I probably should point out to you is that the nvidia FAQ is referring DGA2 functions. Quake3 and Quakelive still use DGA1.
    Last edited by Sasparillo; 08-07-2013 at 04:04 PM.

  10. #10
    Senior Member Lam has a spectacular aura about Lam has a spectacular aura about Lam has a spectacular aura about Lam's Avatar
    Join Date
    Aug 2010
    Posts
    3,763
    Quote Originally Posted by TheMagicianKing View Post
    That is the exact line causing the crash from nvidia. This is a video call.
    You can repeat that 100 more times but it still won't be true.

    Quote Originally Posted by TheMagicianKing View Post
    Do I need to take a screenshot or something?
    Yes, please.

    Quote Originally Posted by TheMagicianKing View Post
    It is 10 year old code, it cannot even be expected to work.
    This is when I stopped reading.

    Quote Originally Posted by TheMagicianKing View Post
    What I probably should point out to you is that the nvidia FAQ is referring DGA2 functions. Quake3 and Quakelive still use DGA1.
    That's also false - not only Q3 and QL don't care about DGA version at all, but QL was compiled against DGA 2.0 headers. So who knows if it would even run on XFree86 4.3.

    After you fix your Xorg installation, you'll see for yourself that QL detects and uses DGA 2.0, it will be right there in the console.
    Last edited by Lam; 08-07-2013 at 10:20 AM.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts