HNHacker News
TopNewBestAskShowJobs

any1

298 karma · joined April 18, 2015

submissionscomments
any1··on Use a laptop as a 2nd display on Linux using FreeRDP
The problem with UDP for video is that, on a lossy network, you either end up sending a lot of key frames or reinventing TCP.

There is a trick for achieving low latency video with TCP: set SO_SNDBUF to the lowest possible value and do your own buffering. If your buffer grows too large, lower the bitrate and/or drop frames.

any1··on Use a laptop as a 2nd display on Linux using FreeRDP
https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rs...

I feel that the VNC protocol gets a bad reputation because of bad implementations. There's really nothing in the protocol itself that keeps it back.

What I like about VNC is that you can actually read the RFC and get fairly a good understanding of it in less than a day. I'm not sure if the same can be said for RDP.

Microsoft has this page where you can access a bunch of PDF documents that describe RDP in some sense, but I've no idea where I would even start and/or what's even relevant for any given problem that you might want to solve.

any1··on Delimiter-first code
It depends on your system of parsing. For example, code generated by a parser generator would be slightly more complex. A regular expression would also be slightly more complex.

I have written recursive descent parsers in the past, and if I remember correctly, the way I set things up, I had to handle leading list elements specially. It's possible that this was unnecessary and I was simply blinded to a simpler way of doing things because I was following the EBNF too strictly.

Edit: I noticed that we're not actually accounting for an empty list here. That makes things slightly more complex:

  comma-separated = [ element, *(",", element) ];
Your code would need to test if there is an element or a list terminator before processing the element.
any1··on Delimiter-first code
Fun fact: A list with leading markers is simpler to parse than a comma separated one.

If the marker is "-", EBNF might look like this:

  leading-marker-list = *("-", element)
Comma separated would look like this:

  comma-separated = [ element, *(",", element) ]
This is not meant as an argument for or against; just an observation.

Edit: Amended comma separated EBNF to account for an empty list.

any1··on Streaming lossless VNC to a web browser with Quite OK image format
VNC, the protocol, isn't at all inefficient. There are some encoding methods which are inefficient, but I'd say that more "modern" encoding methods such as "tight" aren't all that bad, depending on how they're implemented. There has also been a recent addition of h264 to some implementations.

An example of a truly inefficient encoding method is ZRLE. It is a tiled zlib and run-length encoded format that can't be split up into multiple jobs because future computation depends on past computation.

They got things right with the tight encoding method of which there are two variants: zlib (lossless) and jpeg. With zlib, you can have up to 4 separate zlib streams, which means that you can utilise 4 CPU cores for encoding in parallel. The jpeg method has no such limitations.

any1··on Streaming lossless VNC to a web browser with Quite OK image format
I am pretty sure that no RDP solution for any Linux desktop system uses graphics primitives. For that to happen, all the toolkits would have to implement some way of passing their scene graph and their primitives to the compositor and the compositor would have to know what to do with that info.

RDP also supports plain framebuffers and that's what we use.

Anyhow, with the advent of specialised hardware for video encoding, passing framebuffers isn't necessarily such a bad option. You just have to make sure that the CPU doesn't touch the framebuffer before encoding and after decoding.

any1··on Latency testing remote browsing: Why display streaming is hard
This comment seems overly contrarian to me.

Perhaps you can tell us what's wrong with his "ridiculous breadboard thing" rather than just stating that it's ridiculous?

About damage tracking and hardware encoding: The encoder must always diff the whole frame. There is no magic involved here. It probably does it intelligently, e.g. by hashing blocks and comparing the hashes rather than the memory regions. However, comparing the whole frame still means that you must read the entire frame from memory.

He is correct in saying that an encoder that is aware of damage regions would be more efficient. This is because it would require a lot less memory bandwidth.

He is also correct about 60 fps compositor updates. You probably just misinterpreted his meaning. What he's saying is that when there is nothing happening on screen, you shouldn't tell the compositor to keep updating the content because that just wastes energy on compositing something that hasn't changed.

However, this is tricky when you have a constant bandwidth h264 stream because you will have incremental updates for the same frame. A trick I've used to get past this is to stop encoding when the size of the encoded packages goes below a certain threshold, at which point the image isn't going to improve much.

any1··on Wayfire is a Wayland compositor based on wlroots
Doesn't xdg-desktop-portal-wlr work with wayfire?
any1··on You need to know what right-half-plane zeros are
Textbooks that use j instead of i are an indicator of what? Why is slightly different notation awkward? It's not as if notation is always consistent within the field of mathematics, right?
any1··on Why Darwin failed (2006)
Yeah, I was thinking the same thing: that having access to source code is really useful for developing and debugging, regardless of whether there is a community around the project.

I've been experimenting with ONVIF to create an IP camera that can be integrated with windows without the user having to install any additional software. I almost never touch windows and I must say that the experience has been very frustrating because things do not behave according to spec and I can't look at the source code to see what's actually happening.

Access to source code makes a world of difference. Otherwise, you're left guessing and the quality of your product will suffer because you end up doing "whatever works" under your circumstances. Under different circumstances that can break.

any1··on Using a RaspberryPi as a Display Adapter
I've wasted some time on trying to get multicast RTP working for various purposes and I don't recommend it. Software on the receiving end often isn't equipped to deal with it, so it falls flat. E.g. ffmpeg based software can connect to multicast RTP, but you need to explicitly state that you want multicast. A lot of software that uses ffmpeg doesn't even allow you to set those options.

About VNC, yes, it is slow and laggy... on a raspberry pi 3. ;)

It depends on the encoding and implementation, really. For example, I see that Mr. Wolf is using raw encoding for the RTP stream, so bandwidth is hardly a problem. Thus, I would be surprised if VNC with raw encoding would be any slower than that. In fact, it should be even faster because WayVNC will only send the parts of the image that actually changed, whereas wf-recorder will send the whole image every time. Of course, it also depends on the client. I recommend tigervnc.

I would also like to mention that VNC has, recently, gained support for H264 encoding and WayVNC can do zero-copy h264 encoding on the GPU/VPU using VAAPI. Clients that support h264 so far are: tigervnc and wlvncc. However, only wlvncc does it using hardware decoding and hardware rendering. It really falls short, when it needs to touch the CPU. When that happens, you're better off with Tight encoding.

Edit: I should mention that h264 does not work on Raspberry Pi yet. It needs hardware specific encoder and decoder.

Edit 2: Actually, I misremembered about RTP. My troubles were with multicast RTSP.

any1··on Why doesn't capitalism produce good kettles?
I bought a kettle that turned out to have an obnoxious loud beep, so I just desoldered the piezo speaker that emitted the beep from the circuit board. Problem solved.

Perhaps people like me, who just make things work, are a part of the problem? I mean, if they don't get any negative feedback, I guess they'll just assume that people are happy with their products.

Then again, does anyone actually want loud beeps and bright lights on home appliances? Who are those people?

any1··on Frankie Manning's dancing skills made him famous twice (2016)
Yeah, Herräng is actually a big networking event for engineers and scientists disguised as a dance camp.
any1··on An ex-ARM engineer critiques RISC-V
Well, actually, I discovered this when I was playing with implementing a lock free queue in shared memory. I was using singly linked lists; one for the queue and one for the free list. A node would sometimes come back to the queue's head from the free list and mess things up. It's not surprising that this is well known, but I learnt it by doing. :)
any1··on An ex-ARM engineer critiques RISC-V
LL/SC is superior to CAS in that a modification to the memory will be detected even though the value has since been set back to the original value. This avoids the ABA problem.
any1··on Petit Fat File System Module
There's also genimage [1] which uses mtools for FAT, but it can also do ext2 and more.

[1] https://github.com/pengutronix/genimage

any1··on Knolling
The article is about the importance of keeping your code clean. Do you disagree that it's important to keep your code clean?

I'm sorry, I don't see how your analogy with computer architecture applies. Like with all things, knolling can be taken to an extreme, but as I understand it, the idea is to keep shared work stations clean and ready for the next person or yourself and to keep things organised while you're working, in such a way that you don't have to go looking for tools that you need.

any1··on Knolling
You are correct. The distinction is actually less important than the main point of the article which is that diligently paying off technical debt in a long term software project pays off because it allows you to move faster.

The distinction helps me being honest with myself about what my role really is, and this means that I am less likely to be overly clever where it is not needed, which would lead to technical debt.

any1··on Knolling
Well, to be honest, some of my work is actually engineering, but I feel like most of it isn't, and by most of it I mean things such as: adding small features, finding bugs, fixing bugs, dealing with users.

To be clear: a craft is not a "lesser job" than engineering and very often requires just as much ingenuity. My main goal with writing the article is to keep myself honest about what my work is about most of the time and not to think too highly of myself.

Are you absolutely sure that most of your time is spent analyzing and designing and not implementing or doing routine maintenance?

any1··on Blosc – A high performance compressor optimized for binary data
Can blosc be used to compress/decompress regular zlib streams?
any1··on Checking Frame Damage on the GPU
Excellent question. I don't know of any video encoder libraries that support damage hints. My own VNC encoder supports it of course, but ZRLE isn't exactly a video codec.
any1··on Checking Frame Damage on the GPU
Hey, thanks for the tips! I've been trying to keep to GL ES 2.0, so PBOs are sadly out of reach at the moment. I might reconsider the version limitation. Maybe there are extensions for sync. If so, I guess I could do things on a worker thread instead.
any1··on Firefox 75 on Wayland now to have full WebGL, working VA-API acceleration
There is no screen tearing. That is quite noticeable.
any1··on Firefox 75 on Wayland now to have full WebGL, working VA-API acceleration
Yes, both Gnome and Sway have VNC: https://wiki.gnome.org/Projects/Mutter/RemoteDesktop, https://github.com/any1/wayvnc. Weston has RDP, and there are efforts being made to also add VNC.
any1··on Mutexes are faster than Spinlocks
According to "man vdso", futex is not in vDSO on any architecture. What eliminates the syscall cost is that it's rarely called due to elision.

A mutex may try to spin more than a "couple of times" before it calls futex. Example: https://git.musl-libc.org/cgit/musl/tree/src/thread/pthread_...

any1··on The Norwegian art of the packed lunch
The quotes by Ronald Sagatun read like self-deprecating satire. It seems that the BBC are either clueless or in on it. In any case this should not be taken too literally.
any1··on How I ended up writing opensnoop in pure C using eBPF
Thanks for sharing this, I will look into it. We have luajit on our system so this might be just what I need.
any1··on How I ended up writing opensnoop in pure C using eBPF
I do not think that I would mind so much having to re-compile between kernel versions if it's just a matter of running "make" and copying the binaries to the target.
any1··on How I ended up writing opensnoop in pure C using eBPF
My biggest grievance with BCC has been, as noted in the article, that it requires LLVM to be linked in. Also, it requires a Python interpreter on the target machine. I've also wondered why eBPF can't be pre-compiled.

Installing those dependencies on a regular PC is easy, but not so on an embedded system. I tried cross-compiling the dependencies once, but got stuck at some point. It would've been hard to justify the time spent if I'd continued, so I dropped it. I'm really happy that someone has invested time into this issue.

any1··on If You Say Something Is “Likely,” How Likely Do People Think It Is?
I usually just let the branch predictor figure it out on its own.
← PreviousPage 2 of 3Next →