ChanServ changed the topic of #wayland to: https://wayland.freedesktop.org | Discussion about the Wayland protocol and its implementations, plus libinput
sima has quit [Ping timeout: 480 seconds]
glennk has quit [Ping timeout: 480 seconds]
Brainium has quit [Quit: Konversation terminated!]
Moprius has quit [Quit: bye]
Calandracas has quit [Ping timeout: 480 seconds]
garnacho has quit [Ping timeout: 480 seconds]
<riteo>
Hi folks I just found something that left me with my head scratching for a while: it looks like compositors, when passing pipe file descriptors, have to close their ends. I know that sounds dumb in hindsight but the whole unix ancillary message thing has already very few resources so it took a while for me to figure out
<riteo>
is this common knowledge for linux developers? Perhaps it could be documented somewhere
<danieldg>
file descriptors in general should be closed when not needed
<riteo>
well I found out that if I did it would do weird things when doing my dumb proxy
<riteo>
like, I had to check for pipes/fifos in particular to avoid issues
<danieldg>
and yes, if you're creating a pipe and passing one end to a peer, your copy of that end needs to be closed
<riteo>
but it's also true that I'm building a very weird and hacky proxy so who knows
<danieldg>
pipes are funny this way because many programs wait for the condition "all writers have closed their fd"
<riteo>
yea danieldg thing is that this also happened to me while working with ancillary data in unix messages
<riteo>
and I had no idea it was actually, a new file descriptor
<riteo>
might really be just me who is new to the concept ig
<danieldg>
ah, yeah, that's just how cmsg stuff works
<riteo>
I see
<riteo>
I guess that's just common knowledge then indeed
<danieldg>
common knowledge of a feature that is not generally encountered, yes
<riteo>
I'm really sorry I have issues getting the tone of the message, is that sarcasm
<riteo>
no heat here to be clear
<danieldg>
no
<riteo>
oh all right
<danieldg>
doing fd passing isn't an overly common action in general
<riteo>
yeye that's fair
<danieldg>
if you do it, then the close behavior is common knowledge
<danieldg>
sometimes you discover it when you run out of FDs :)
<riteo>
I see lol
<riteo>
well it's kinda worring that dmabuf stuff fails when I close the fd after passing it then
<riteo>
I have no idea if they're the special boys or if pipes really just want to get closed and that's it
<riteo>
well, I guess that's relatively low priority, first I gotta finish up this proxy :P
<danieldg>
generally the kernel takes no action on a close of a dup'd file descriptor, only on final close of the file description (sendmsg counts as dup)
<danieldg>
that's true for pipes and likely is true of dmabuf
<riteo>
Oh. I see. That means I'm doing something quite wrong or I need some special handling somewhere.
<riteo>
thank you for clearing that up! :D
<danieldg>
strace is pretty good at letting you determine where fds go
<danieldg>
it isn't as helpful with drm stuff, though
<danieldg>
(that's generally a bunch of ioctls at the syscall interface)
<riteo>
I just tried replicating the bug by removing the special stat stuff and well... It's not happening anymore. That's weird.
<riteo>
Maybe I just messed up something else while moving stuff around, sorry for the noise then
<riteo>
If it ever pops up again I'll definitely try with strace :D
<riteo>
yup here it is, catched it again, so it was not useless noise
garnacho has joined #wayland
garnacho has quit []
garnacho has joined #wayland
nerdopolis has quit [Ping timeout: 480 seconds]
azerov has joined #wayland
iomari891 has joined #wayland
codingkoopa3218 has quit []
codingkoopa3218 has joined #wayland
glennk has joined #wayland
kts has joined #wayland
tzimmermann has joined #wayland
crazybyte4 has quit [Read error: Connection reset by peer]
crazybyte4 has joined #wayland
kts has quit [Ping timeout: 480 seconds]
kts has joined #wayland
coldfeet has joined #wayland
mohit815822635306 has joined #wayland
coldfeet has quit [Quit: Lost terminal]
rasterman has joined #wayland
leon-anavi has joined #wayland
bim9262_ has joined #wayland
bim9262 has quit [Ping timeout: 480 seconds]
bim9262_ is now known as bim9262
akimoto has quit [Ping timeout: 480 seconds]
kode544 has joined #wayland
kode54 has quit [Ping timeout: 480 seconds]
kts has quit [Ping timeout: 480 seconds]
coldfeet has joined #wayland
coldfeet has quit [Quit: Lost terminal]
mohit815822635306 has quit [Remote host closed the connection]
mohit815822635306 has joined #wayland
mohit815822635306 has quit [Read error: Connection reset by peer]
mohit815822635306 has joined #wayland
kenny has quit [Ping timeout: 480 seconds]
<pq>
riteo, if you can find a good explanation of file descriptor vs. file description, that might clear some confusion. It can also point out hidden pitfalls, like the implicit file offset being stored in the description, meaning it is shared by all descriptors even across process boundaries.
<pq>
TL;DR: make sure you never rely on the implicit file offset when touching fd shared with someone else.
<pq>
not saying you are hitting this problem, but it's a sneaky problem with mysterious consequences
<pq>
swick[m], I don't think perceptual destroys any value. There will be differences, sure, but it's still an indication whether something is grossly wrong.
<pq>
The main point is that the test app is easy to use, and gives two renderings of a picture to compare on the same monitor.
<pq>
If perceptual had a rigid definition, we wouldn't need the eye-balling part, unless for a lack of a suitable screenshooting interface.
<pq>
JEEB, thanks!
pochu has quit [Quit: reboot]
narodnik has quit [Quit: WeeChat 4.5.2]
<pq>
The app can say whether the two pictures are supposed to look identical or just roughly similar.
<llyyr>
zamundaaa[m]: thanks! should this perhaps log a message to inform the user why hdr metadata isn't being used?
<zamundaaa[m]>
Not sure, if a game has a bug in the HDR metadata, it would probably spam the warnings every single frame, which would be a bit much
<davidre>
static bool "warned once?"
<llyyr>
yeah, warning once is probably fine
<davidre>
* "static bool warned_once" ?
<pq>
Does Vulkan require or encourage setting the HDR static metadata every frame?
<zamundaaa[m]>
No, it persists on the swapchain until the application changes it again
<pq>
Then it would be nice to see if Mesa can warn once per setting it. Maybe games go through a few (invalid) states before settling for the running state?
<riteo>
pq: yea in the end the issue was not stuff regarding offsets, it turns out I skipped certain packets and it messed up the fd queue
<zamundaaa[m]>
pq: Vulkan not encouraging or requiring apps to set it every frame doesn't mean they don't do it
<pq>
riteo, oh yeah, can't even blindly pass through messages, need to understand each one, at least how many fds it carries.
<riteo>
pq: I'll take a look at the concepts you described though, thanks
<riteo>
once I get the proxy in good shape I'm definitely going to document everything in my website
<pq>
zamundaaa[m], ideally there'd be some way for end users to notice and bug their game providers ;-)
<llyyr>
the MR warns once now
<llyyr>
seems good to me
kode544 has quit []
kode54 has joined #wayland
leon-anavi has quit [Quit: Leaving]
<zamundaaa[m]>
pq: I think that part mostly has to be tackled at the source, in the game engines. Game publishers ship with pretty broken support on Windows, it's unlikely they'll make Wayland-only changes when users complain
<zamundaaa[m]>
I've been nudging Godot into the correct direction for example, they're on a good path to making HDR "just work" on Wayland as it should :)
<pq>
awesome!
<zamundaaa[m]>
Not sure how feasible that is in other engines, but it's worth trying
<pq>
right, so users should complain to game engine projects?
andyrtr_ has joined #wayland
sally has quit [Quit: ZNC 1.9.1+deb2+b2 - https://znc.in]
sally has joined #wayland
<zamundaaa[m]>
I guess. Ultimately most HDR metadata is bad rather than triggering a protocol error, so I don't think that's gonna fix too much
andyrtr has quit [Ping timeout: 480 seconds]
andyrtr_ is now known as andyrtr
<zamundaaa[m]>
Windows games aside, most engines will only do HDR on Wayland once someone adds support for that in the engine, so the developer side is the best way to make it work properly
<pq>
and we better make use of that metadata in compositors in a visible way
<zamundaaa[m]>
I already do :)
sima has joined #wayland
<pq>
I *just* started typing some code to make use of parametric image description.
ity has quit [Quit: WeeChat 4.5.1]
ity has joined #wayland
kts has joined #wayland
lsd|2 has joined #wayland
lsd|2 has quit []
ahartmetz has joined #wayland
coldfeet has joined #wayland
mclasen has joined #wayland
coldfeet has quit [Quit: Lost terminal]
Sid127- has joined #wayland
Sid127 has quit [Read error: Connection reset by peer]