Live data from Hacker News

Understanding the working of X11 from the ground up (2017)

magcius.github.io

71–80 of 134 posts

Re: Understanding the working of X11 from the ground up (2017)

#71
post #66

Earlier quoted context omitted.

Are you saying that Wayland doesn’t not only run on Nvidia, it’s also buggy as hell?

Yeah, I also should have said that the response of the other part of the community isn't exactly sympathetic (or useful), either. Truth is, a lot of the reason why X11 works so well today is that a bunch of us put up with a lot of X11 crap back in the day. E.g. things like xdotool haven't existed forever, either, and it took a lot of itches (and imperfect way of scratching them) before someone wrote that. X11 wasn't…

> And all this is in a context were fewer and fewer developers are interested in desktop development, and fewer and fewer companies are interested in investing in desktop development.

Which could make X11 the last linux/unix desktop thing. Anything new would have to come with the whole desktop paradigm shift.

Re: Understanding the working of X11 from the ground up (2017)

#72
post #39
post #32

Earlier quoted context omitted.

Not disagreeing we've moved on from it a bit in some places, but.. "Everything is a file" never meant "everything is a disk file" - think of std{in,out,err} or network sockets. The implications are more around having a standard set of syscalls for moving data in and out of a program, abstracting away where it actually lives and treating the data itself as something opaque.

> Not disagreeing we've moved on from it a bit in some places, but.. "Everything is a file" never meant "everything is a disk file" You're right that it never meant 'everything is a disk file', but generally the implication of the unix philosophy was that everything could be accessed from the filesystem. Have a look at Plan9, which is essentially directly descended from 7th edition UNIX and IIRC was built from what w…

On the BeagleBone Black (haven’t used others), the GPIO pins are accessible through SysFS at /sys/class/gpio

Re: Understanding the working of X11 from the ground up (2017)

#73
Author here. I stopped working on this a few years ago, so now's as good a time as any for an overly-long, rambly, unedited retrospective.

When I started this, I was working on GNOME's window manager full-time, and wanted to learn intricately how X11's drawing model worked, so over the course of a few weeks in a hotel room, I recreated large parts of X11's drawing model in a web browser, fixing artifacts as I went along, until I feel I had a really good grasp of it. My initial test scene was a traditional desktop-like approach with a taskbar and xeyes, both of which are still in the codebase today, but untested [0].

I didn't know what I wanted to do with it, until I settled upon using snippets of it to build a long-form article. I learned a lot about the difficulty of writing, of pedagogy, of that blurred line between being technically correct 100% of the time vs. telling a few small lies here and there to keep the flow consistent and help people see the broader picture.

At my day job, I had mostly moved onto Wayland, where some of the bits I picked up here really helped me design better protocols and systems. My goal with the series was to try to be as neutral as possible, and my original design was to have a giant caution sign around "Author Opinion Zones" where I would talk about how certain design features haven't held up well in practice. But quickly, people on Hacker News or Phoronix or Reddit seemed to skim the article, pick up a piece here or there, and go on straight to bashing Wayland, gleefully unaware that I was one of the people making it.

So, the end result was that I basically stopped working on Xplain basically after the second article. The COMPOSITE article was one I made after a colleague was having trouble understanding COMPOSITE, and I figured it was easier to write with my framework than explain in a chatroom, and maybe some others would appreciate it.

I have a deep passion for sharing my knowledge, and Xplain was the format I first really used to do it widely, so I tried to keep it exciting for me by changing it from "Xplain" to "Explanations", and opening up the topics from X11 to just about anything, but at some point I was just unhappy working on it.

The last thing I was working on was a continuation of my Basic 2D rasterization article, where I had a fun code editor you could use to make your own graphics [1] [2], but as fun as the technology was, I couldn't find a satisfying flow to the article, so I stopped it. Parts of it were later recycled for an article on the histories of 2D and 3D graphics. [3]

Around mid-2016, I had stopped working on Linux and open-source graphics entirely, and by 2017 I had exited the open-source industry completely and jumped ship to professional game development. I still have a deep love for graphics and a passion to explain things. I just released a new side project a few days ago for it, even.

Here's some stuff I'm working on these days. It's much cooler than X11/Wayland flamewars, in my opinion.

https://noclip.website/

https://blog.mecheye.net/2018/03/deconstructing-the-water-ef...

https://www.youtube.com/watch?v=8rCRsOLiO7k

--

[0] https://github.com/magcius/xplain/blob/gh-pages/src/clients/...

[1] https://u.teknik.io/XdSbC.webm

[2] Sort of up here at https://magcius.github.io/xplain/article/rast2.html

[3] https://blog.mecheye.net/2019/05/why-is-2d-graphics-is-harde...

Re: Understanding the working of X11 from the ground up (2017)

#74
post #3

Earlier quoted context omitted.

I'm running Sway WM right now, a Wayland compositor that implements an i3-compatible window manager, and in fact working on the code (hopefully merging my first contribution soon.) I'd say the biggest issue is really maturity. I actually find Wayland to be a surprisingly nice piece of software engineering. I don't know if I like the architecture really, but it comes together fairly nicely in the end. For example, the…

> The screenshot tool is just flat out not present when running under Wayland due to the above issue. That's odd - it's present (and functioning) in my Firefox (69.0.1) running on Gnome-on-wayland Firefox is generally quite crashy, however, which I'm guessing is Wayland-related

So Firefox supports screenshots when running on the Gnome compositor, but not running on sway? Looks like we're heading into interesting times where applications are getting tied to certain DEs with little to no cross-compatibility.

Re: Understanding the working of X11 from the ground up (2017)

#75
post #33
post #15

Earlier quoted context omitted.

Like I said... I gave up and bought an AMD card. Not everyone is going to do this. It's a step down from my NVIDIA card. I think there is still hope. Obviously today's reality is still bleak with signed blobs and plenty of question marks, but I think open-gpu-doc is a sign that NVIDIA does actually want to square away this problem, maybe they're just not sure how. I do believe NVIDIA is mostly responsible for Wayland…

Personally I’m not the biggest fan of wayland (I haven’t found a compositor I like and using OpenGL for everything including VTEs feels like a mistake.) but I will say it’s common knowledge (as far as I’m aware) that nvidia drivers on Linux are pretty bad and you’re not going to have a good experience with them no matter what kind of display manager you use.

In what world are nVidia drivers crap? I'm regularly doing some pretty funky stuff with OpenGL on top of X11 and nVidia and this setup fails me less often and less hard than any equivalent AMD setup has done so far. Unless I'm trying to allocating tons textures or ridiculously sized vertex buffers, I don't see any hickups at all.

Re: Understanding the working of X11 from the ground up (2017)

#76
post #73

Author here. I stopped working on this a few years ago, so now's as good a time as any for an overly-long, rambly, unedited retrospective. When I started this, I was working on GNOME's window manager full-time, and wanted to learn intricately how X11's drawing model worked, so over the course of a few weeks in a hotel room, I recreated large parts of X11's drawing model in a web browser, fixing artifacts as I went al…

I just watched the YouTube link, and it's amazing! I've been toying with making some of my own video content, and this is inspiring. There's only so many hours in the day though.

Re: Understanding the working of X11 from the ground up (2017)

#77

This is a bit of topic but: Every time I see the X11 protocol, I realize that the UNIX philosophy (everything is a file) is dead. It’s a pity that instead of improving the speed of the file system, everyone started to ignore it, hence making it’s speed even less important, and on and on... And now nobody uses the file system for these purposes.

How do you think it should have evolved? I personaly think posix way of filesystem needs to be changed into specialized oject filesystems, but I am not sure what object filesystem for a UNIX OS should look like specially since it needs to be generalized into something all the other sub-systems can benefit from.

There are some things like audio where it's nice to simply copy an audio file to a /dev/audio to play audio and read from /dev/audio to record audio.

That doesn't preclude having more advanced interfaces, too.

Re: Understanding the working of X11 from the ground up (2017)

#78
post #73

Author here. I stopped working on this a few years ago, so now's as good a time as any for an overly-long, rambly, unedited retrospective. When I started this, I was working on GNOME's window manager full-time, and wanted to learn intricately how X11's drawing model worked, so over the course of a few weeks in a hotel room, I recreated large parts of X11's drawing model in a web browser, fixing artifacts as I went al…

I want to thank you for this page! It really helped me understand how X11 worked when my job at the time required some rather esoteric (to me) X11 knowledge. I had to write a very specific purpose window manager (in JavaScript, which really made it interesting) that had to work around some odd client behavior, and I also had to submit a patch to X.org to fix a bug in Xephyr. Without your guide I would have spent far longer digging in the docs to figure things out.

Re: Understanding the working of X11 from the ground up (2017)

#79
post #73

Author here. I stopped working on this a few years ago, so now's as good a time as any for an overly-long, rambly, unedited retrospective. When I started this, I was working on GNOME's window manager full-time, and wanted to learn intricately how X11's drawing model worked, so over the course of a few weeks in a hotel room, I recreated large parts of X11's drawing model in a web browser, fixing artifacts as I went al…

I just watched the YouTube link, and it's amazing! I've been toying with making some of my own video content, and this is inspiring. There's only so many hours in the day though.

Thank you! Making good YouTube content has been on my bucket list for a while, so I'm really happy I did it. I will admit it took a lot out of me -- basically all my weekends and spare time for about a month. But the reception has been more than worth it.

If you ever do make some good YouTube content, do let me know! You've definitely been an inspiration for me in my graphics journey, and I imagine you have some incredible insights and perspective into the graphics world.

Post reply on HN