ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.57k stars 596 forks source link

[Counter Strike 1.6] V-sync off makes mouse wheel to stop working #2055

Open ghost opened 10 years ago

ghost commented 10 years ago

EDIT (Aug 30, 2016): Created a little repo of Xorg (for Arch Linux) that will patch xorg-server to fix this issue and will create all related packages. https://github.com/amarildojr/xorg

Packages created:

xorg-server-1.18.4-1-x86_64.pkg.tar.xz xorg-server-common-1.18.4-1-x86_64.pkg.tar.xz xorg-server-devel-1.18.4-1-x86_64.pkg.tar.xz xorg-server-xdmx-1.18.4-1-x86_64.pkg.tar.xz xorg-server-xephyr-1.18.4-1-x86_64.pkg.tar.xz xorg-server-xnest-1.18.4-1-x86_64.pkg.tar.xz xorg-server-xvfb-1.18.4-1-x86_64.pkg.tar.xz xorg-server-xwayland-1.18.4-1-x86_64.pkg.tar.xz

Feel free to contribute to it in regards to patching things for other distros.


(Original thread) I've been playing CS since 2003 and I've always jumped with MWHEELDOWN, I even still have my Logitech MX310 from 2003 and it works perfectly on every other game I try (I can prove it). But since a few months ago or even less I can't use the mouse wheel anymore, there's something wrong with the game in regards to using it, be it to jump or scroll through the command line or any wheel operation.

I'm using Arch Linux. NVIDIA-337.12. Kernel 3.14.3. Logitech MX310. Any specs you need, just let me know.

ghost commented 10 years ago

Well, I either play with v-sync off and not use the mouse wheel anymore on ANY operation, or I play with v-sync on and have my skill cut down to less than 10% what it is.

Thank you X developers for ruining the game for Linux users.

ghost commented 10 years ago

https://github.com/ValveSoftware/halflife/issues/1466

ghost commented 10 years ago

Any comments, @johnv-valve ?

jpleau commented 9 years ago

The issue is still present, a commit on xorg side is causing this. (I'm the person who reported issue ValveSoftware/halflife#1466)

http://cgit.freedesktop.org/xorg/xserver/commit/?id=9bf46610a9d20962854016032de4567974e87957

Reverting it on my own xorg build fixed it, but it is not ideal.

It only happens with GoldSrc games.

People at Valve, do you have any idea what could cause this ?

I have posted a bug on xorg/fdo, here's some data I included:

xscope data with the commit not reverted (bug happens): https://bugs.freedesktop.org/attachment.cgi?id=93813

xscope data with the commit reverted (bug is fixed): https://bugs.freedesktop.org/attachment.cgi?id=93814

jpleau commented 9 years ago

Still a bug with Xorg 1.16 (the patch still applies, with fuzz, and still fixes the issue)

joan31 commented 8 years ago

@jpleau I have the same problem with counter strike and v sync and mouse. Do you have a solution please ? My distrib is ArchLinux. Thank you so much.

nomnombtc commented 8 years ago

Hello,

I can confirm this issue too. Could someone from valve please look into it again, because it seems to only affect Counterstrike 1.6, I have no mousewheel problem in other applications.

Recompiling xorg-server with this patch (which reverts the commit referenced above): https://gist.github.com/jpleau/8908623 fixes the problem here.

My System: slackware64-current, kernel 3.18.14 xorg-server-1.16.4, radeon 5850 / amd-catalyst-omega-14.12(fglrx).

jpleau commented 8 years ago

@SupKurtJ

Yes the problem is still happening even with xorg 1.17.

I had reported the bug last year to the xorg dev but could not get much info:

https://bugs.freedesktop.org/show_bug.cgi?id=74713

I only get this issue with GoldSRC games though, so it may be something weird happening in this particular game engine.

joan31 commented 8 years ago

@nomnombtc I can confirm this issue with GoldSRC games.

I'm playing with CS1.6, Day of Defeat and Half-Life, and I have the same problem.

Ok so actualy, the only solution is recompil xorg-server with modification in io.c file or downgrade to xorg-server 1.14.

dr-dim commented 8 years ago

The workaround I use instead of recompiling xorg is using the following binds in my usercfg:

bind "MWHEELDOWN" "invprev;wait;wait;wait" bind "MWHEELUP" "invnext;wait;wait;wait"

somehow that helps to smooth out my mouse wheel. Note that all input stalls while the game is waiting for 3 frames, so if you're using it for bhopping / silent walking or other crazy stuff you probably need another solution.

joan31 commented 8 years ago

Hello @dr-dim Your solution doesn't work for me. But thank you for your help. :)

jpleau commented 8 years ago

I did bisect xorg and found the one commit that caused the issue. So it was working before.

I'd say it's a combination of both valve and xorg, but since it doesn't happen anywhere else, I'd lean towards Valve needing to fix that.

Unfortunately, GoldSrc is very old, Linux support was probably added very quickly to it. I highly doubt we're going to see this one fixed :)

ghost commented 8 years ago

@jpleau I did revert Xorg to 1.14., 1.13, 1.12.... nothing fixed it for me.

ghost commented 8 years ago

Nothing yet. --'

nomnombtc commented 8 years ago

Not sure if this got fixed in Xorg, or it is because I switched to the opensource driver "radeon". But the issue is gone here, works fine now :)

My System: slackware64-current, with Xorg 1.18.2, Mesa 11.1.2, Kernel 4.4.6

ghost commented 8 years ago

@nomnombtc I will test this soon. Are you on Arch as well?

I just re-installed my system and will download Steam and CS tonight.

jpleau commented 8 years ago

Still an issue here, Xorg 1.18.2, nvidia proprietary drivers, kernel 4.5.0 (debian sid)

ghost commented 8 years ago

I can confirm that this still happens. What a poor job from Xorg developers.

xorg-server 1.18.1-3 mesa 11.1.2-1

dnlglsn commented 8 years ago

I would love if this was fixed. I still play TFC and am waiting for this to get fixed before upgrading from 13.10.

JoshuaMurphynz commented 8 years ago

Are you on ubuntu 13.10? On 7 Apr 2016 5:08 a.m., "Daniel Gleason" notifications@github.com wrote:

I would love if this was fixed. I still play TFC and am waiting for this to get fixed before upgrading from 13.10.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/ValveSoftware/steam-for-linux/issues/3302#issuecomment-206468134

dnlglsn commented 8 years ago

Yes, xubuntu 13.10 to be specific.

JoshuaMurphynz commented 8 years ago

Isn't that incredibly outdated and unsupported? On 7 Apr 2016 8:38 a.m., "Daniel Gleason" notifications@github.com wrote:

Yes, xubuntu 13.10 to be specific.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/ValveSoftware/steam-for-linux/issues/3302#issuecomment-206554116

dnlglsn commented 8 years ago

Yes, but the issue was never resolved, which is why I'm sticking to 13.10 until it gets fixed.

jpleau commented 8 years ago

If you are ready to get your hands dirty, you could upgrade your distro, and patch xorg yourself.

That is what I do on Debian Sid.

The patch itself is the one I posted on the xorg bug page

Basically you just revert this commit: https://cgit.freedesktop.org/xorg/xserver/commit/?id=9bf46610a9d20962854016032de4567974e87957

dnlglsn commented 8 years ago

Do you have a tutorial on how to do that? Specifically, recompiling xorg. I know how to revert commits, but don't know exactly what I need to recompile. Also, will automatic updates break the reversion each time there is a system update?

Thanks.

On Wed, Apr 6, 2016 at 2:23 PM, Jason Pleau notifications@github.com wrote:

If you are ready to get your hands dirty, you could upgrade your distro, and patch xorg yourself.

That is what I do on Debian Sid.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/ValveSoftware/steam-for-linux/issues/3302#issuecomment-206576323

jpleau commented 8 years ago

You can fetch the xorg packaging here: http://anonscm.debian.org/cgit/pkg-xorg/xserver/xorg-server.git/

Ubuntu branches are in there.

Then you can revert the commit there directly in git, then rebuild all the .debs: https://wiki.debian.org/BuildingTutorial Maybe Ubuntu has ubuntu-specific instructions, I'm not certain.

Sorry I don't have any specific tutorial for all this :/

jpleau commented 8 years ago

Well, it's clear that Valve doesn't care at all about this (looks like they gave up on Linux anyway.)

So we have to take the matters in our own hands, and sadly it's either patch it yourself (which DOES work, I'm playing right now, or bump my bug that I posted above on Xorg and convince them to apply the patch or better, fix the actual problem.

Tele42 commented 8 years ago

As a side note, downgrading xorg-server for input testing makes no sense at all. It would make more sense to downgrade xf86-input-evdev or switch to using xf86-input-keyboard and xf86-input-mouse to try an older input stack.

jpleau commented 8 years ago

@Tele42 Of course, but on some distributions all those packages are "locked" together with a version number.

ie: https://packages.debian.org/sid/xserver-xorg-input-evdev (it requires xserver-xorg-core same version as itself)

ghost commented 7 years ago

Created a little repo of Xorg that will patch xorg-server to fix this issue and will create all related packages. https://github.com/amarildojr/xorg

I'll test your patch today, @jpleau

ghost commented 7 years ago

@jpleau 's fix is confirmed working for me on latest Xorg. Thank you very much :)

dnlglsn commented 7 years ago

@amarildojr , I feel like a total newb, but how do I apply this patch and compile your fork of xorg?

ghost commented 7 years ago

It's very simple. You only need to download the zip [1], extract it somewhere, "cd" into the extracted directory, and do "makepkg -s". I edited the PKGBUILD so it will automatically download the patch and apply it, everything is automated :) After building all the packages (now patched), you install the created packages with the following command:

sudo pacman -U $(ls | grep .pkg.tar.xz)

Or a shorter version, with the same funcionality:

sudo pacman -U $(ls *.pkg.tar.xz)

Then you only need to restart X, which can be achieved by loggin out and then back in (you don't have to restart).

[1] https://github.com/amarildojr/xorg/archive/master.zip

This is, of course, if you're using Arch. I have no idea how to patch things in other distributions as it's much harder to do it in them (this includes Debian, Ubuntu, and specially openSUSE).

Tele42 commented 7 years ago

As a side note, you can limit ls with a pattern. In this case: ls *.pkg.tar.xz

ghost commented 7 years ago

As a side note you can limit ls with a pattern. In this case: ls *.pkg.tar.xz

The results are virtually the same as with "grep .pkg.tar.xz" AFAIK.

EDIT: But the command is shorter. Thanks, I'll be using it from now on.

jpleau commented 7 years ago

Thanks @amarildojr for your Arch packages

I'll try to get a repository online for those who use Debian distros, with xorg packages included my patch

They will work for Debian stable, Debian unstable and the latest ubuntu (16.04).

In fact I already have them available for Debian unstable, this is what I am using myself: http://debian.jpleau.ca/pool/main/x/xorg-server/, all you have to do is add my repo in your sources.list: deb https://debian.jpleau.ca unstable main and add my key:

wget http://debian.jpleau.ca/gpg_packages.key
sudo apt-key add gpg_packages.key
sudo apt update
sudo apt upgrade

And you'll have the patched xorg to play those games with vsync off without the mouse issue.

Of course when debian developers upgrade their xorg version, you'll have to wait for me to keep my own packages up to date. I am usually fast on this though.

ghost commented 7 years ago

Very nice, I had no idea you had a repo :) If I ever go back to Debian, I'll make sure to use it.

And you'll have the patched xorg to play those games with vsync on without the mouse issue

I suppose you meant with V-Sync off. At least here, the problem is not present with V-Sync on; it's when I turn it off that the problem appears.

Cheers

dnlglsn commented 7 years ago

@jpleau I would love to upgrade to Xubuntu 16.04. I've stuck with 13.10 all these years because of this bug. I enjoy playing TFC too much to upgrade. Thanks for all your help and I look forward to your Ubuntu repo.

ghost commented 7 years ago

@SuperSumo I think his Debian Sid packages work on Ubuntu 16.04 with no problems, but I'm not sure. You can use a LiveCD to check it out: boot the LiveCD of 16.04, then install his packages, logout then login, and see if it works :D

dnlglsn commented 7 years ago

@amarildojr I would have to install Steam + TFC and get my NVidia Optimus setup working before being able to test it out though, which is a big feat on a live CD. I'm currently using Bumblebee to get the Optimus stuff working. I've heard the latest NVidia drivers can automatically switch with the latest versions of the kernel but I haven't tried them because I haven't upgraded.

ghost commented 7 years ago

Fair enough, I can understand your hesitation.

I'd grab a spare hard drive and test it though, because you'd be getting new software with Xorg fixed :)

Veal-Uneasily4 commented 5 years ago

Thanks @amarildojr for your Arch packages

I'll try to get a repository online for those who use Debian distros, with xorg packages included my patch

They will work for Debian stable, Debian unstable and the latest ubuntu (16.04).

In fact I already have them available for Debian unstable, this is what I am using myself: http://debian.jpleau.ca/pool/main/x/xorg-server/, all you have to do is add my repo in your sources.list: deb https://debian.jpleau.ca unstable main and add my key:

wget http://debian.jpleau.ca/gpg_packages.key
sudo apt-key add gpg_packages.key
sudo apt update
sudo apt upgrade

And you'll have the patched xorg to play those games with vsync off without the mouse issue.

Of course when debian developers upgrade their xorg version, you'll have to wait for me to keep my own packages up to date. I am usually fast on this though.

I think I installed it correctly, but the problem is not solved :/

jpleau commented 5 years ago

@gil5587 I haven't updated the repository in a long time (I don't really play goldsrc anymore)

Your best bet is to compile Xorg yourself with the patch that was posted above.

Or to ask Valve to do something about it

joan31 commented 4 years ago

Hi, This issue still not fixed.

I'm on Arch Linux. kernel 5.6.12 xorg 1.20.8-2 mesa 20.0.6-2

V-sync off makes mouse wheel to stop working, and I have to click several times to shoot. I think all this troubles are connected and affects all goldsrc games (half-life, counter-strike, day of defeat, etc...).

ghost commented 3 years ago

Forget it. It's a bug introduced by the Mesa/Xorg developers, and VALVe won't fix it. Could they fix it? Yes. Can we expect them to? No.

@VALVe close this issue and admit laziness and defeat.

damage220 commented 2 years ago

The bug is still present. Whenever I scroll mouse wheel, the game occasionally switches my weapon or disregards the event. It makes it painful to play this game on linux since I do duck jump. For that reason I have to always switch to windows, which is a bit annoying. However, there is partial workaround. I noticed that the bug occurs when you bind only MOUSE4 and MOUSE5 in the game preferences. If you then double click on "Jump" action and scroll the wheel down, the game will bind an alias MWHEELDOWN. So in order to fix (at least for gaming) the bug you have to bind both options.

Bug is present No bug while playing (mouse wheel is still laggy when selecting map, etc.)

The final userconfig.cfg.

bind "MWHEELUP" "+duck"
bind "MOUSE4" "+duck"
bind "CTRL" "+duck"
bind "MWHEELDOWN" "+jump"
bind "MOUSE5" "+jump"
bind "SPACE" "+jump"

Tested on Arch Linux, X.Org version: 1.20.13.

joan31 commented 2 years ago

20210804000719_1

"MWHEELUP" = "MOUSE4" "MWHEELDOWN" = "MOUSE5"

So you have to set both to Next and Previous Weapon like the screenshot, and this workaround fix this bug.

I'm on Arch Linux too.

Thanks for your solution.

vesmihaylov commented 1 year ago

As of 2023 - bug still exists on Steam version of Counter-Strike for Linux. I'm on Ubuntu 22.04 LTS version. I'm playing kreedz servers and whenever I try to jump with MWHEELDOWN it will be 50/50 to register the event. I even brought a brand new mouse thinking it was the issue.

damage220 commented 1 year ago

As of 2023 - bug still exists on Steam version of Counter-Strike for Linux. I'm on Ubuntu 22.04 LTS version. I'm playing kreedz servers and whenever I try to jump with MWHEELDOWN it will be 50/50 to register the event. I even brought a brand new mouse thinking it was the issue.

I posted workaround few comments earlier, check it out.

vesmihaylov commented 1 year ago

@damage220 Hey, before I posted here I tried your solution with a different approach. Since I don't have a gaming mouse (I have only LEFT & RIGHT buttons on the mouse) I used "F7" and "F8" instead of "MOUSE4" and "MOUSE5" as you described. It still didn't work...