16:24 bl4ckb0ne: would it be a bad thing to have a compositor run the server event loop in a thread?
16:26 emersion: gamescope does this
16:26 emersion: and it's a mistake
16:26 emersion: synchronizing all of the threads is a huge pain
16:26 bl4ckb0ne: im having a hard time handling the wayland events in wxrc
16:26 emersion: what is the reason?
16:27 emersion: openxr API is blocking?
16:27 bl4ckb0ne: yeah
16:27 bl4ckb0ne: openxr has a clear start/end of frame
16:28 emersion: if there really isn't a way around it, my suggestion would be to put the blocking openXR stuff in a thread
16:28 emersion: then integrate the thread with the main event loop
16:28 bl4ckb0ne: its more about following the order of the frame rather than blocking
16:28 bl4ckb0ne: sending the hmd vp matrix / input position to the clients and gettings back a surface
16:37 daniels: yeah definitely, it's going to be much easier to run libwayland-server as is, record all its state, then hand that over to OXR once per frame
16:39 emersion: the quick-and-dirty way is probably to have a "wayland lock
16:39 emersion: and lock the wayland state from the XR thread
16:40 emersion: (only when necessary, e.g. when rendering)
16:40 bl4ckb0ne: do you have an example about integrating a thread into thr main loop?
16:40 emersion: you can look at gamescope's wlserver.cpp
16:41 emersion: https://github.com/Plagman/gamescope/blob/master/src/wlserver.cpp#L1061
16:41 emersion: it's… not great
16:46 bl4ckb0ne: so this one is the main thread
16:47 daniels: using a mutex implies that you'd be blocking the OXR thread at times though, which seems ... not great
16:52 emersion: that is correct
16:55 bl4ckb0ne: so that would mean I have to lock anytime im doing wlroots calls
16:55 bl4ckb0ne: or wl call from the xr thread
16:55 emersion: yes
16:56 emersion: the threads would run in lock-step
16:57 bl4ckb0ne: might require some redesign in the codebase
16:59 emersion: the global lock is Bad™, but shouldn't require any redesign
17:12 bl4ckb0ne: eh i can shove it in my server struct
17:18 kennylevinsen: OpenXR really should have a non-blocking wait...
17:19 kennylevinsen: The thing gets preempted anyway, so doubt it's that much more precise than, idk, a timerfd (which could fire slightly early if needed)
17:27 bl4ckb0ne: i opened an issue to get a fd for integration into another event loop but never got an answer