Yet another way to get a tear-free, stutter-free desktop with Plasma/KDE and Nvidia

So the proprietary Nvidia driver is a large, steaming, smelly pile of shit. At least that’s the impression you get when you read what developers say about it. There’s a bug here and a workaround there, and we haven’t even started talking about the messy situation that is EGLstreams yet. So why do people use Nvidia cards on Linux? Because so far, they give good bang for the buck, use relatively little energy for what they do and work with all commercial games. I’m pretty sure those are the reasons, anyway.

But Nvidia at least on Plasma/KDE has some serious problems with tearing and stutter — I have three Nvidia setups and they all are unsatisfying out of the box. If you use ForceCompositionPipeline like I recommended earlier, you will probably run into stutter issues. But I think I found the perfect setup now, stutter-free and tearing-free for desktop use as well as perfect for gaming.

There are two alternatives:

Solve it by switching the GL yield mechanism to USLEEP

Add the following to ~/.config/plasma-workspace/env/kwin.sh:

#!/bin/sh
export __GL_YIELD="usleep"

Thank mahenou on Steam for suggesting I try this again. The first time I did, it was probably too late in the environment for Kwin to pick it up. It’s important that the var is set when Kwin initializes.

Solve it by forcing triple buffering

 

Add the following to ~/.config/plasma-workspace/env/kwin.sh:

#!/bin/sh
export KWIN_TRIPLE_BUFFER=1 

And chmod +x the file. Then add the following to an Xorg config snippet, for example /etc/X11/xorg.conf.d/20-nvidia.conf:

Section "Device"
        Identifier      "Videocard0"
        Driver          "nvidia"
        Option          "TripleBuffer" "true"
EndSection

Finally, enable compositing and vsync

Then make sure you have compositing enabled in System Settings -> Display and Monitor -> Compositor. If you are very doubtful, do a restart. After that you should have a perfect, tear-free and stutter-free desktop experience. I had to disable compositing manually with Alt-Shift-F12 before starting games with the triple buffering method. This was unnecessary with the __GL_YIELD method.

I can’t truthfully explain why this works, but I know it works around a bunch of bugs and unexpected default settings in the Nvidia driver. Also, Kwin is now able to compute the right timings and handle triple buffering instead of rendering half-finished frames like a fucking moron when it still believed Nvidia was doing triple buffering by default.

For me this has been wonderful. The desktop is smooth as if I were using a proper graphics card like an AMD RX 580 with Mesa. Games run exceedingly well, and there is no stutter or delay like with ForceCompositionPipeline. Not even in videos. It’s all just perfect.

This is a mix of hints received from several people on Reddit and Steam that I unfortunately forgot the names of, as well as info from the Arch Linux wiki. I’d like to thank all these people for their knowledge.

Working around broken firmware for Realtek USB WLAN adapters on newer kernels

If you run a combination of newer (4.9ish) kernels and systemd, your USB wifi networking gear probably now gets funky names such as “wlx74da387e95fe” instead of “wlan0” like you were used to back in the good days. This wouldn’t be so bad, only that the firmware on those dongles can mess up when the device gets a long name. Suddenly it won’t let you connect to your wireless network, claiming that the network does not exist, even though you know for a fact that it does. What your machine is actually trying to say, I believe, is that the network device doesn’t seem to exist.

If you have those symptoms, this answer by Maciek on Stackexchange will probably help. I encountered the problem while using one of the Edimax USB wifi dongles that are popular on the Raspberry Pi.

I had to add this to /etc/udev/rules.d/70-persistent-net.rules:

# edimax USB stick
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ba:ba:ba:ba:ba:ba", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan", NAME="wlan1"

Substitute your own dongle’s MAC address for ba:ba:ba:ba:ba:ba and things should work. Of course make sure wlan1 isn’t taken already. If everything turns out well, your dongle now has a sane name again and connecting should just work.

Using Xbox 360-compatible controllers properly inside WINE

If you need to use WINE to play some Windows games, the lack of Xinput support might get on your nerves. WINE maps joystick devices to Dinput. That works for some older games, but buttons need to be mapped manually, and many newer games don’t detect the controllers at all because they expect Xinput.

I tried to get by this issue using x360ce, but this is a fickle beast already when run natively on Windows; even more so in WINE. But what worked really well for me was dumbxinputemu. Sometimes dumb things are the best.

To use it, determine if you’re running a 64-bit or a 32-bit WINE for the particular game you’re playing, then copy the matching xinput1_3.dll from the latest release to the same directory as the game’s binaries. So if you’re trying a Steam game inside WINE, that’s probably somewhere inside Steam/steamapps/common. Then make sure your WINE is set to prefer the native version of the DLL via winecfg:

In the “New override for library” dropdown select “xinput1_3”, then “Edit…” that entry to set it to “native” only. If you have a very new game, you might need to do repeat all these steps for xinput9_1_0.dll. This worked surprisingly reliably for me, no more double-detection of joysticks, no more wrong labels for buttons inside games, no more fiddly x360ce that works sometimes but then mysteriously breaks. Everything behaves as it shoud. Thank you, kozec.

Something for the weekend: Week 51, 2017

These are some longer things I’ve read this week. I don’t guarantee that they’re new, just that I found them interesting:

  1. Google is using its dominance to bully the makers of the Vivaldi browser. Google has blocked Vivaldi’s AdWords revenue and asked them to post links to “uninstall instructions” for the Vivaldi browser on their web page. Something Google itself doesn’t provide for Chrome. This is what happens when you let a single browser maker also control most of the online advertisement market, and things will only get worse the more people use Chrome and AdWords.
  2. Microsoft is using its dominance to bully Google (in the Windows Store). They kicked the Chrome installer out of the Windows Store because only browsers based on Microsoft Edge technologies are allowed there. This is similar to how Apple bullies browser makers on iOS, where you can’t add a browser with its own rendering or JavaScript engine, you must use Apple’s instead. This kind of non-competition is a straitjacket for innovation and destroys user freedom, just because some greedy big companies force it to be this way. Not the best technology wins, just whichever technology the oligopolist forces on users.

I’d be delighted if some of that tickled your curiosity.

Something for the weekend: Week 50, 2017

These are some longer things I’ve read this week. I don’t guarantee that they’re new, just that I found them interesting:

    1. Former Facebook exec says social media is ripping apart society. At least they admit it once they’ve quit the company.
    2. You don’t need to go vegan to save the planet. Nevertheless, your diet is one of the most important factors driving climate change. A less meat-heavy diet (like in the Mediterrean) is enough to improve things significantly. So you don’t have to buy a Tesla, just go vegetarian 5 days out of 7 and maybe add a vegan day now and then.
    3. Digitiser at 25, part 1. Mr Biffo is a Teletext celebrity. He did Teletext gaming journalism. In the 90s!
    4. How the US government pressured Sweden into taking down The Pirate Bay. If you are the USA, you can enforce your own values and laws all over the world. This has happened under the umbrella of the DMCA as when Norwegian special police stormed into Jon Lech Johansen‘s house and confiscated all his computers even though there were no legal grounds for it under Norwegian law. Why did they do it anyway? US government strongarming. This is also the reason all the banks in the world give up customer data about US customers, and only US customers, to the US government. Because otherwise the US central bank would cut off their access to US Dollars, and that would destroy any bank immediately.

I’d be delighted if some of that tickled your curiosity.

Something for the weekend: Week 49, 2017

These are some longer things I’ve read this week. I don’t guarantee that they’re new, just that I found them interesting:

  1. Google is blocking Amazon devices from YouTube. This is what happens when you have an oligopoly of powerful companies who make proprietary software and closed services. The companies start dictating what features you have on your devices and they decide when you lose them. Even though it’s you who owns the devices and it’s they who are fighting among themselves. The victim is the customer. The Verge covers this take as well.
  2. Google’s true origin partly lies in CIA and NSA research grants for mass surveillance. It’s interesting to know this, but as Facebook shows, you don’t have to be sponsored by the NSA to find out how profitable the destruction of privacy is.
  3. Facebook Messenger is now available specifically for kids. The privacy implications are horrendous. While this is very creepy, always remember that Microsoft follows a similar tactic. Hook them young (with discounted Office and Windows licenses for schools in the 90s, and now with free Office 365 subscriptions for education) and those kids will likely become your customers when they grow up. The sad thing here is that we might raise a generation of kids that is used to giving up their privacy to surveillance capitalism.
  4. Zeta Global acquires Disqus. What happens when the comments and communications from thousands of websites fall into the hands of a marketing company? This shows how dangerous it is to entrust your communications to a commercial private entity that can be bought, including all the data you thought was private. Granted, it’s about public website comments here. But the same could happen to e.g. Dropbox.
  5. Surveillance Capitalism thinks it won, but there’s still time to unplug it. Billions have given up their privacy in exchange for cat pictures and a free e-mail service (that in a private version would cost less than € 2/month, by the way). We can yet destroy surveillance capitalism, but those of us who are still feeding it need to change their habits.
  6. In praise of cash. An older article, but no less important. Corporate powers and even some governments want to move you away from cash and towards a cashless society that is easier to surveil, easier to manipulate. This not only threatens your privacy but also removes a lot of valid commercial activity at the fringes, done by people without smartphones, without a credit rating, without plastic money or bank accounts. And people who don’t need any of these things, because there is cash.

I’d be delighted if some of that tickled your curiosity.

Something for the weekend: Week 48, 2017

These are some longer things I’ve read this week. I don’t guarantee that they’re new, just that I found them interesting:

  1. Can the new Firefox Quantum browser regain its market share? Firefox is the last really open browser with any significance, but Microsoft, Google and Apple are actively trying to destroy the open web. Don’t let them succeed. The article covers half a dozen other angles that I didn’t address in my old article.
  2. A growing number of Americans are leaving desk jobs to farm. This resonated with me not because of the illusion that I could be a good farmer, but because of the sad state of the IT industry. If it gets any more closed or much more proprietary-services-driven, I think I would feel happier filling up shelves at Aldi.
  3. Facebook can’t cope with the world it’s created. They are dominating all of Asia except China. The former is a tragedy in the making for society, and the latter is just bad for Zuckerberg’s bottom line.
  4. Ciao, Chrome: Firefox Quantum is the browser built for 2017. I’m so glad that Mozilla is getting this much recognition. This is our last chance to preserve the free web (at least on the client side). I hope the new Firefox reaches 30% market share at some point, so we have a good competitive market. We should never have to depend on a web advertisement company that spies on us for our web browsing. But the fact that most people now browse on mobile and that only Android allows Firefox to exist is deeply troubling. On iOS, Firefox is just a wrapper around Apple’s web rendering engine, because Apple is the all-powerful iOS gatekeeper and doesn’t allow this competition.
  5. Electronic Arts: The Donald Trump of Gaming. EA is a terrible games company by many metrics, but you knew that before. The latest clusterfuck surrounding microtransactions in Star Wars: Battlefront II is just the piss-flavored icing on the shit cake EA has become. The problem is that their behavior may rub off on other, better game companies if they turn too greedy — and it seems like it already has.
  6. System76 will be removing Intel ME from all its laptops. If you weren’t aware of it, Intel ME contains an entire separate computer inside your computer that has access to all your hardware, all the memory, all your secret keys. It can take over your entire machine and runs even when your PC is switched off. All this is hidden from you and outside your control. Who controls it? You can’t know. No one knows. All we know is that any Intel PC is potentially open for complete takeover and no OS-level security tools can do anything against it. Up until now, nobody outside Intel has  been able to completely disable this spying machine. System76 laptops seem to be a first for us consumers, perhaps soon followed by the ones from Purism.

I’d be delighted if some of that tickled your curiosity.

Our terrible future of closed protocols and proprietary systems

TL;DR (1072 words): The current trend towards closed communications systems like Slack, Facebook and the like can only hurt us as society. An open standard needs to emerge. Who’s volunteering to support things like Matrix and the “new decentralized Internet”?

I’m trying to illustrate the newly closed nature of the Internet using team chat and team collaboration as an example. But you can expand this example to pretty much anything nowadays. Because the solution to combat this closed-ness applies equally to all of these issues, I hope you can extrapolate from this as necessary.

Continue reading “Our terrible future of closed protocols and proprietary systems”

Something for the weekend: Week 47, 2017

These are some longer things I’ve read this week. I don’t guarantee that they’re new, just that I found them interesting:

  1. Android at 10 part one, part two. As Android turns ten, Google is moving away from Linux and towards their own Fuchsia kernel. What might the next ten years of Android look like?
  2. Super Mario Odyssey review by Digitiser2000’s Mr Biffo. It sums up pretty much what I think about the new mechanics, and also calls out Mario for being a sexist pig. Don’t take this as virtue signaling, but yes, Nintendo might need to work on this when the only game starring Princess Peach is basically a pre-menstrual mood swing simulator with a far too easy  jump’n’run wrapped around it. You know, for girls! Girls can’t play video games! lololol!
  3. Google tracks and sells your location even if you’ve disabled location services. The surprise is probably that anyone’s surprised. Now that the company was caught red-handed doing this, will they promise to stop? I don’t think so, since Silicon Valley believes in “self-regulation” — thus no regulation at all. That we may have to thank Oracle for revealing this doesn’t make it any less bizarre.
  4. Microsoft appears to have lost the source code for parts of Office. And this is the same company that some governments trust with their sensitive data. Why doesn’t Microsoft publish all their software under a FOSS license? It’s like Linus Torvalds is rumored to have said, “Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it.”
  5. Ideas were not enough. Not the reformation alone brought religious freedom to western societies, but the fact that enforcing religious unity was becoming too expensive and politically cumbersome for the rulers.
  6. Stress can be good for you, but most toxic stress has measurable detrimental effects on your brain. The article explores the damage stress causes down to the physical level and gives some hints for post-stress recovery. Daily walks and meditation are mentioned. I’ve had episodes of stress and trauma leading to generalized anxiety (as the article also mentions) and I can say that meditation definitely can’t hurt.

I’d be delighted if some of that tickled your curiosity.

Facebook should be regulated, it is incapable of regulating itself

Directly from a Facebook employee formerly in charge of fixing the privacy issues of its developer platform:

[Facebook is] a company that reaches most of the country every day and has the most detailed set of personal data ever assembled, but has no incentive to prevent abuse

Read more at the New York Times.

This is a new trick I’m trying with simple short links to articles. Let me know if it’s annoying or fun.