Hacker News new | ask | show | jobs
by vardump 4759 days ago
Wayland is a critical technology for Linux desktop community.

X11 has been a reliable workhorse, but its time is up - simply too much cruft accumulated over the years that's not even used anymore. Yet all of it needs to be continually supported, adding to complexity. No one uses X11 primitives for drawing apart from bitmap functionality - even repainting dirty regions (expose events) often involves sending over a new bitmap and using X11 to draw it. This is very inefficient.

To implement a reasonably fast GUI, X11 has essentially resorted to hacks (extensions). DRI2 (+GLX) is probably the most important of those. AFAIK, it's what almost everything uses for drawing, and does not work over network at all. Yes, modern X11 is local only. If you're on a network, it's back sending those uncompressed bitmaps. Even with all these hacks, X11+DRI2 can't even maintain tearing free display. Well, at least DRI3 should fix tearing...

So if none of modern software needs nothing but a bitmap surface to draw on, why implement and maintain anything else?

Which leaves us with Wayland criticizers' favorite topic - network transparency (which X11 practically doesn't have either, but unfortunately that does little to stop some loud uninformed people):

Remote display software should use low latency video encoding for essentially same user experience as working locally. Preferably hardware accelerated. But even with software, you can encode a frame under 10ms, using for example a subset of h.264. Even if you added network latency, time for one frame network throughput and client display hardware retrace period, you'd still typically end up with a figure well under 50ms. That'd feel essentially local. It'd beat easily X11 over network, VNC, RDP, etc. in latency and thus practical usability. Heck, that'd even beat Xbox 360 or Playstation 3 game display latency when connected to a typical modern TV (70-170ms)! Many TVs do image processing that adds over 50ms of latency before image is actually displayed. (Note that this processing latency has nothing to do with "pixel response time").

Why no one I know of has written remote display software that functions this way is beyond me. Anyone except OnLive and Gaikai, that is...

So, let the old X11 horse have its well-earned rest. It's time to move on.

7 comments

DRI2 (+GLX) is probably the most important of those. AFAIK, it's what almost everything uses for drawing, and does not work over network at all.

Uhh, isn't the entire point of GLX/AIGLX network transparency? http://en.wikipedia.org/wiki/AIGLX

krh is working on a lossless "codec" that uses a rsync-like rolling hash that should provide good compression with no artifacts (as long as the app isn't too skeuy). http://people.freedesktop.org/~krh/rolling-hash/
...but why? In my experience, using H.264 to encode screen captures gives you extremely high quality video for reasonable CPU and network expenditures. Is the last 1% of video quality really worth it?

For a demo, you can try using FFmpeg + x264 using the x11grab input. It's very easy to adjust the amount of CPU used (by changing the preset) and the bandwidth (by changing the CRF, or by setting the bit rate).

Lossless encoding is important for text, especially sub-pixel antialiased test.
Can you back that up? In my experience, when I replay an H.264 screen capture, I can't tell the difference. I'd be happy to post PNG screenshots.

Keep in mind that H.264 does not have to be 4:2:0, it can easily be 4:4:4.

It sounds cool, I would be very curious to try it!

Edit: If you're offering, I would like to see some screenshots. Also, what settings do you use for it?

I would expect the rolling hash to be much faster than H.264 while also being lossless.
I used NX protocol some tiem ago. It use compression, differential messages, do the X protocol Async, and have a intelligent caching system. It's impressive better that any VNC! I connect to my Desktop (Download 2Mb ,Upload 512Kb connexion at these time) from the University, and was like using my Desktop in my house!

The bad point is that not support OpenGL, so 3d software can be used via NX.

Why is it impossible to evolve X11 to a satisfactory state?
Quartz architect Mike Paquette: Why Apple didn't use X for the window system (2003) http://developers.slashdot.org/comments.pl?sid=75257&cid=673...

In retrospect, Xorg developers like Daniel Stone actually implemented most of the hacks in that list and have come to regret it.

Cool link, thanks! What do you mean "regret it"? It didn't work properly/performantly?
Performant is not an adjective. Performantly is not an adverb. Niether is a word. Use real words when you write. Maybe write, "It didn't work properly / perform adequately," instead of writing nonsense.
It obviously conveyed the author's meaning. Not sure what more you look for in a word.
One of my (subjective) requirements is that the word not be annoying (i.e. incongruent with the rest of the language). "Performantly" certainly was not, I think smalltalk is only complaining for complaining's sake.
> Niether is a word. Use real words when you write.

Aside from the glaring spelling error, this betrays a complete linguistic ignorance coupled with utter historical illiteracy. In short: Every new word, or semantic shift applied to an existing word, was railed against, often by people with no knowledge of linguistics, and many have since become productive parts of our language down to the present day. Some haven't, admittedly, but not because of the people who ranted against them.

For example, is 'television' a word? Can 'nice' be used to mean 'pleasant'? Can 'actor' be applied to a woman? Can a house made of wood ever become 'dilapidated'? (Seriously.)

If you're seriously opposed to 'non-words', the answer to all of those questions is NO.

Isn't that what Airplay Mirror (and the underlying Intel tech doing the encoding on the hardware) does? To the Apple TV, this is merely MPEG4 over HTTP Live Streaming
xpra does the video compression stuff:

http://xpra.org/trac/wiki/Enhancements

Seems pretty cool! What kind of latency it achieves?
Can't toolkits use XRender over a network instead of sending huge bitmaps around? Or was XRender support dropped altogether when DRI2 proved so much better?
I guess the bandwidth savings would be completely offset by the increased latency from the larger number of required RPC calls.