Steam In-home Streaming lags with NetworkManager revisited: Replacing NetworkManager with systemd-networkd

Back in early 2015 I encountered an issue with NetworkManager: Even if you have ever only told it about your one single wireless network (or AP, access point) it insists on scanning the airwaves at regular intervals (about every two minutes) looking for a better connection. I thought that was dumb. This behaviour is known to the developer and is working-as-intended. There is no off-switch. I thought that was really, seriously dumb. I still do.

It was not an issue for me until I tried live streaming, specifically using Steam’s in-home streaming that allows you to play a game on a different computer to the one you’re sitting at and streaming the ‘playback’ to your current machine. Then NetworkManager cuts into the smooth streaming every two minutes, turning it into a screenshot slideshow instead for 3-5 seconds. If you’re playing a game that requires attention to not dying/crashing/clicking-the-wrong-button, this is a bad thing for a long time.

Now, my gaming desktop died shortly afterwards (note to self: Never buy another (cheap) Corsair PSU as long as you live) so it quickly became a non-issue. I recently got a new gaming computer, dual-booting Windows 10 and Ubuntu 16.04 17.04.  Coupled with a new 802.11ac wireless network  it seemed obvious to try to make in-home streaming work with the desktop-to-HTPC streaming, essentially making the HTPC a high-end Steam Link, rather than a low-end gaming computer in it’s own right. Running the streaming ‘server’ from Windows, everything works. Streaming from linux I was instantly reminded of the problems I had two years ago.

About half a year ago, commenter William Bernting kindly added some information to my original post suggesting how to make NetworkManager stop the scanning routine. I hope it works for whoever finds this information and I should probably have tested his solution before forging ahead with my own, more radical one. However, I have no patience with NetworkManager anymore, I do only connect to one network and I had the impetus last night so here is what works for me: Rip out NetworkManager, replace with systemd-networkd.

(more…)

NetworkManager and intermittent lags in Steam Home-streaming

Steam in-home streaming is great. I can play graphics/CPU intensive games on my laptop sitting on my couch. Or I can let the (Windows) laptop run Spelunky while playing at my linux desktop. But I had a problems with it: I kept getting intermittent lagging. A little notice would pop up in the bottom left corner informing me of slow network speeds. Both machines are on wifi for network and so I thought putting the laptop on ethernet would solve the issue. Halving the strain on the air waves should do the trick but it made no difference. Which meant that the problem was likely to be on the linux desktop and it’s wireless connection.

Now, the most characteristic thing about the lags was the regularity with which they occured. I didn’t measure them but I started thinking to myself, “It’s gonna come any minute now…” About every two minutes for ten seconds or so. More than enough to get yourself good and killed in Spelunky. I tried network monitoring to see if I could catch whatever process was stealing Steam’s bandwidth but with no luck.

The reason for this is that it wasn’t a process hogging bandwith per se, it was NetworkManager scanning for networks. This happens at some specific interval and tends to cause a drop in bandwidth, something that is most noticeable in live streaming.

(more…)