04:32 ara1307: Hello, I'm trying to chain wlroots -> pipewiresrc -> vapostproc -> vah264enc. wlroots hardcodes DRM_FORMAT_XRGB8888 (aka XR24) while vah264enc works only with NV12. What's the best way to perform this conversion and where?
05:04 RAOF: I suspect that you're unlikely to get wlroots to render to NV12, so you'll want to perform the conversion later in the pipeline. gstreamer has a full set of colourspace converters. In fact, vapostproc itself can do that conversion.
05:04 RAOF: That _might_ be as simple as setting the caps on the vapostproc src pad to NV12?
05:28 soreau: might be able to use wf-recorder here
05:28 soreau: if the intermediate isn't important
05:38 ara1307: RAOF unfortunately it doesn't work (or I'm doing it wrong): pipewiresrc fd={fd} path={node_id} ! vapostproc ! video/x-raw(memory:DMABuf),format=DMA_DRM,width=1920,height=1080,drm-format=NV12:0x0100000000000002 ! vah264enc results: 0:00:00.291794557 68 0x1504b00 WARN basetransform gstbasetransform.c:1371:gst_base_transform_setcaps:<vapostproc0> transform could not transfo
05:39 ara1307: (memory:DMABuf), format=(string)BGRA, width=(int)1920, height=(int)1080, framerate=(fraction)0/1, max-framerate=(fraction)60/1 in anything we support
05:41 ara1307: I've found this: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4092 (render/vulkan: add support for NV12), does that mean switching to vulkan from gles will give me ability to generate frames in NV12?
05:42 soreau: ara1307: can you say where you want the final output to be?
05:42 ara1307: in webrtcsink
05:47 ara1307: so implicit conversion seems doesn't work... Is there a gstreamer element performing explicit conversion from XR24 / AR24 to NV12?
05:49 ara1307: nm, googled videoconvertscale. Will try vulkan, videoconvertscale and get back to you if these doesn't work..
05:49 ara1307: thanks!
06:15 RAOF: FWIW I'm _pretty_ sure that the wlroots MR you linked to adds texturing _from_ NV12, not rendering _to_ NV12 (so you'll still get the buffers out of it in XR24).
06:39 soreau: If you don't need input and only a single output, couldn't you do wf-recorder->/dev/videoX->...->webrtc?
06:41 wlb: weston Issue #833 closed \o/ (Dual screen in kiosk mode https://gitlab.freedesktop.org/wayland/weston/-/issues/833)
07:48 Company: there is no way to render to NV12 in Vulkan
07:48 Company: YUV formats (and also multiplane formats) can't be rendered to
07:50 Company: though I guess you could use special shaders and multiple color attachments, but then you'd have to manage those buffers manually and NV12 would appear nowhere in the format
08:19 wlb: weston Issue #843 opened by Rob Kramer (teegee) Gstreamer waylandsink sometimes not showing. https://gitlab.freedesktop.org/wayland/weston/-/issues/843
08:52 wlb: weston Issue #832 closed \o/ (VNC on imx8 https://gitlab.freedesktop.org/wayland/weston/-/issues/832)
08:54 wlb: weston Issue #826 closed \o/ (weston rdp screen sharing https://gitlab.freedesktop.org/wayland/weston/-/issues/826)
09:03 wlb: weston Issue #844 opened by Himanshu Bhavani (himanshu.d) Mouse click event issue on rdp + chromium https://gitlab.freedesktop.org/wayland/weston/-/issues/844
09:16 wlb: weston Issue #844 closed \o/ (Mouse click event issue on rdp + chromium https://gitlab.freedesktop.org/wayland/weston/-/issues/844)
10:56 userabc: in C, I want to read global keypresses. i realise that this is something wayland isn't supposed to do, but this is just for my own machine, and i'm fine with running my program with root privilages. i looked into libevdev, but another program had a lock on the keyboard, and i looked into libinput, but i thought that might be barking up the wrong tree. what should i be using?
10:58 emersion: there are already projects that do exactly this IIRC
10:59 emersion: hrm, nevermind
10:59 emersion: there is this but it's for sending events only https://github.com/ReimuNotMoe/ydotool
11:01 emersion: ah, this: https://git.sr.ht/~mil/lisgd
11:02 emersion: not quite what you want though
11:02 emersion: but could be a starting point
11:03 userabc: thank you
11:04 userabc: for context, this is for a program that displays which keys are currently pressed, for screen recordings
11:05 emersion: oh, then that exists already
11:05 emersion: https://github.com/ammgws/wshowkeys
11:08 userabc: thanks, that looks like what i want
11:09 userabc: i might try to make my own later for fun, do you think libinput would be the way to go?
11:15 userabc: are there any indicators that show whether keys are pressed or not, instead of showing a list of keydown events?
13:55 wlb: weston Merge request !1394 opened by Marius Vlad (mvlad) backend-wayland: Add support for fullscreen/maximized states https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1394 [Nested Wayland backend]
14:47 camron81: Hi folks, I've just started trying to mess about with wayland and OpenGL. I've set up a simple client but get a memory leak error on shutdown. I feel like I'm destroying all resources but must be missing something would appreciate if someone could have a look. https://paste.debian.net/1299067/
14:47 camron81: ==4002==ERROR: LeakSanitizer: detected memory leaks Direct leak of 192 byte(s) in 2 object(s) allocated from: #0 0x7f9d812bbdc7 in __interceptor_calloc (/nix/store/bmfc7mrr7kilf45wpfd60davjaqfmagv-gcc-12.2.0-lib/lib/libasan.so.8+0xbbdc7) #1 0x7f9d819875f3 in proxy_create (/nix/store/0597w4kkj5x9kryscks4g5pmj35f1vbs-wayland-1.22.0/lib/libwayland-client.so.0+0x65f3) SUMMARY: AddressSanitizer: 192 byte(s) leaked in 2 allocation(s).
14:49 daniels: camron81: wl_registry
14:54 camron81: daniels: Thank you!
16:35 ara1307: ok so seems wlroots -> pipewire -> va is not going to work theough dbabuf. As it was said above, Vulkan wouldn't help. videoconvert seems has a limited dmabuf support:
16:35 ara1307: ERROR GST_PIPELINE subprojects/gstreamer/gst/parse/grammar.y:1128:gst_parse_perform_link: could not link videoconvert0 to vah264enc0, videoconvert0 can't handle caps video/x-raw(memory:DMABuf), format=(string)DMA_DRM, width=(int)1920, height=(int)1080, drm-format=(string)NV12:0x0100000000000002
16:36 ara1307: as per gst-inspect, videoconvert supports only video/x-raw
16:38 ara1307: no, sorry, it does support DMA_DRM as per gst-inspect, but somehow produces error above
16:41 any1: wlroots will not output nv12. You'll need to do a pixel format conversion. This can be done in hardware, but I don't know how to set it up in gst. It's probably better to ask the gstreamer people if they have a channel.
16:42 any1: I know you can do it in ffmpeg using the scale_vaapi filter.
16:42 emersion: vaapi should be able to do it
16:42 emersion: right
16:43 emersion: but yeah otherwise a shader, probably gst has this already
16:55 ara1307: why videoconvert doesn't work? Isn't it designed to convert between different color schemas?
16:57 ara1307: the problem is with va and drm, wlrrots -> pipewiresrc -> qsvh264enc works very well
17:00 ara1307: vaapi doesn't support DMABuf
17:00 LaserEyess: how does one handle inputs with drm leasing? suppose I have a game client running in a DRM leased session, and I want to pass the controller to it
17:01 LaserEyess: it looks like drm-lease-v1 leaves that completely undefined
17:02 emersion: drm leases are just about drm
17:02 emersion: input usually done via side channels
17:02 emersion: "regular" input cannot work with drm leases
17:02 emersion: ara1307: vaapi does support DMA-BUFs
17:03 LaserEyess: emersion: what is an example of a "side channel" here? wayland based or?
17:04 emersion: usually the usual stuff games do, directly open /dev/input/…
17:04 ara1307: I mean in gst - vaapih264enc - doesn't support DMA-BUF
17:04 emersion: i've used DMA-BUFs + gst + vaapi in the past, but don't remember how
17:05 ara1307: :(
17:08 any1: fwiw, in ffmpeg, you can use the hwmap filter to map a DMA-BUF to a vaapi surface
17:08 LaserEyess: emersion: that doesn't sound fun... suppose I wanted to "cheat" with something like text-input, would that be viable?
17:08 LaserEyess: assuming a keyboard and mouse
17:09 emersion: cheating probably involves opening a toplevel and using pointer-constraints or something
17:09 emersion: but you'll never be able to get regular focus semantics
17:10 LaserEyess: you can open a top level on a leased output?
17:10 emersion: no, from the PoV of the compositor, a leased output doesn't exist in the output layout
17:10 LaserEyess: hm
17:10 emersion: i wouldn't recommend using drm leases for anything else than VR
17:11 LaserEyess: yes I admit I'm trying to commit crimes
17:12 LaserEyess: i.e. a client that gets a leased output and displays gamescope as a DRM client on it, for steam BPM, or something like mpv
17:12 LaserEyess: to get HDR :')
17:13 psykose: hey in 3 years when everyone figures out the hdr protocol you won't need that anymore :D
17:13 LaserEyess: but in the meantime, why would I deprive myself of a painful learning experience?
17:13 psykose: didn't the aux displays on some laptops (think macbook touchbar) also make use of drm leasing to not show up as actual outputs?
17:14 emersion: they show up as non-desktop, which is orthogonal to drm leasing, except compositors will make non-desktop outputs available for lease
17:14 psykose: ah, makes sense
17:14 emersion: and then touch input doesn't work
17:27 vaxry: dear high lord emersion I managed to do it, but unfortunately I had to sin to make it work:
17:27 vaxry: "#include "../../subprojects/wlroots/include/render/egl.h""
17:28 vaxry: you need those functions to make RBOs for yourself
17:28 emersion: please no honorifics
17:28 emersion: which functions exactly?
17:29 vaxry: all used in gles2: wlr_egl_save_context, wlr_egl_make_current, wlr_egl_destroy_image, wlr_egl_restore_context, wlr_egl_create_image_from_dmabuf
17:32 vyivel: wrong channel?
17:42 emersion: oh right let's continue there (brb)
19:02 ara1307: Looks like a DMA-BUF pipewire bug. This pipeline works fine: pipewiresrc fd={fd} path={node_id} ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=0/1,max-framerate=60/1 ! vah264enc ! video/x-h264,profile=constrained-baseline ! queue
19:02 ara1307: so there are no issues with BGRx to NV12 conversion in gstreamer.
19:02 ara1307: Attempting to use: `! video/x-raw(memory:DMABuf),format=DMA_DRM,width=1920,height=1080,drm-format=NV12:0x0100000000000002` crashes pipewire with:
19:02 ara1307: error: no more input formats
19:03 any1: Tried #gstreamer?
19:03 ara1307: not yet... maybe #pipewire is more relevant