ChanServ changed the topic of #wayland to: https://wayland.freedesktop.org | Discussion about the Wayland protocol and its implementations, plus libinput
WhizzWr has quit [Remote host closed the connection]
Guest7858 has quit [Remote host closed the connection]
cool110 has joined #wayland
cool110 is now known as Guest7872
nerdopolis has quit [Ping timeout: 480 seconds]
teaper[m] has joined #wayland
nerdopolis has joined #wayland
ongy[m] has joined #wayland
<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?
j-james[m] has joined #wayland
nerdopolis has quit [Ping timeout: 480 seconds]
privacy has quit [Quit: Leaving]
bim9262 has quit [Ping timeout: 480 seconds]
bim9262 has joined #wayland
<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.
<RAOF>
That _might_ be as simple as setting the caps on the vapostproc src pad to NV12?
sima has joined #wayland
<soreau>
might be able to use wf-recorder here
<soreau>
if the intermediate isn't important
<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
<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
<soreau>
ara1307: can you say where you want the final output to be?
<ara1307>
in webrtcsink
glennk has quit [Ping timeout: 480 seconds]
<ara1307>
so implicit conversion seems doesn't work... Is there a gstreamer element performing explicit conversion from XR24 / AR24 to NV12?
<ara1307>
nm, googled videoconvertscale. Will try vulkan, videoconvertscale and get back to you if these doesn't work..
<ara1307>
thanks!
bim9262 has joined #wayland
kts has quit [Quit: Konversation terminated!]
<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).
bim9262 has quit [Ping timeout: 480 seconds]
bim9262 has joined #wayland
tzimmermann has joined #wayland
fgdfgdfgd has quit []
<soreau>
If you don't need input and only a single output, couldn't you do wf-recorder->/dev/videoX->...->webrtc?
Dami_Lu has quit [Remote host closed the connection]
caveman has quit [Remote host closed the connection]
caveman has joined #wayland
Dami_Lu has joined #wayland
mvlad has joined #wayland
pobthebuilder[m] has joined #wayland
<Company>
there is no way to render to NV12 in Vulkan
<Company>
YUV formats (and also multiplane formats) can't be rendered to
<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
userabc has quit [Remote host closed the connection]
privacy has joined #wayland
karmavil[m] has joined #wayland
userabc has joined #wayland
YHNdnzj[moz] has joined #wayland
ttancos[m] has joined #wayland
<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?
<emersion>
there are already projects that do exactly this IIRC
mvlad has quit [Remote host closed the connection]
bim9262 has joined #wayland
kts has joined #wayland
mvlad has joined #wayland
nerdopolis_ has quit [Ping timeout: 480 seconds]
enick_6941 has joined #wayland
FLHerne has quit [Ping timeout: 480 seconds]
JoshuaAshton has quit [Ping timeout: 480 seconds]
nerdopolis has joined #wayland
rubo_[m] has joined #wayland
leon-anavi has quit [Ping timeout: 480 seconds]
camron81 has joined #wayland
<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/
<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).
JoshuaAshton has joined #wayland
Brainium has quit [Quit: Konversation terminated!]
<daniels>
camron81: wl_registry
FLHerne has joined #wayland
bim9262 has quit [Ping timeout: 480 seconds]
<camron81>
daniels: Thank you!
camron81 has quit [Quit: Page closed]
gallo_ has joined #wayland
bim9262 has joined #wayland
gallo has quit [Ping timeout: 480 seconds]
ara1307_ has joined #wayland
ara1307_ has quit [Remote host closed the connection]
<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:
<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
bim9262 has joined #wayland
<ara1307>
as per gst-inspect, videoconvert supports only video/x-raw
gallo has quit [Ping timeout: 480 seconds]
<ara1307>
no, sorry, it does support DMA_DRM as per gst-inspect, but somehow produces error above
<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.
<any1>
I know you can do it in ffmpeg using the scale_vaapi filter.
<emersion>
vaapi should be able to do it
<emersion>
right
<emersion>
but yeah otherwise a shader, probably gst has this already
sevz has joined #wayland
<ara1307>
why videoconvert doesn't work? Isn't it designed to convert between different color schemas?
<ara1307>
the problem is with va and drm, wlrrots -> pipewiresrc -> qsvh264enc works very well
iomari892 has quit [Ping timeout: 480 seconds]
bim9262 has quit [Ping timeout: 480 seconds]
<ara1307>
vaapi doesn't support DMABuf
<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
<LaserEyess>
it looks like drm-lease-v1 leaves that completely undefined
<emersion>
drm leases are just about drm
<emersion>
input usually done via side channels
<emersion>
"regular" input cannot work with drm leases
<emersion>
ara1307: vaapi does support DMA-BUFs
<LaserEyess>
emersion: what is an example of a "side channel" here? wayland based or?
<emersion>
usually the usual stuff games do, directly open /dev/input/…
<ara1307>
I mean in gst - vaapih264enc - doesn't support DMA-BUF
<emersion>
i've used DMA-BUFs + gst + vaapi in the past, but don't remember how
bim9262 has joined #wayland
<ara1307>
:(
<any1>
fwiw, in ffmpeg, you can use the hwmap filter to map a DMA-BUF to a vaapi surface
<LaserEyess>
emersion: that doesn't sound fun... suppose I wanted to "cheat" with something like text-input, would that be viable?
<LaserEyess>
assuming a keyboard and mouse
<emersion>
cheating probably involves opening a toplevel and using pointer-constraints or something
<emersion>
but you'll never be able to get regular focus semantics
<LaserEyess>
you can open a top level on a leased output?
<emersion>
no, from the PoV of the compositor, a leased output doesn't exist in the output layout
<LaserEyess>
hm
<emersion>
i wouldn't recommend using drm leases for anything else than VR
nerdopolis has joined #wayland
<LaserEyess>
yes I admit I'm trying to commit crimes
<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
<LaserEyess>
to get HDR :')
<psykose>
hey in 3 years when everyone figures out the hdr protocol you won't need that anymore :D
<LaserEyess>
but in the meantime, why would I deprive myself of a painful learning experience?
<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?
<emersion>
they show up as non-desktop, which is orthogonal to drm leasing, except compositors will make non-desktop outputs available for lease
<psykose>
ah, makes sense
<emersion>
and then touch input doesn't work
basemale has joined #wayland
<vaxry>
dear high lord emersion I managed to do it, but unfortunately I had to sin to make it work:
<vaxry>
you need those functions to make RBOs for yourself
<emersion>
please no honorifics
<emersion>
which functions exactly?
<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
<vyivel>
wrong channel?
bim9262 has quit [Ping timeout: 480 seconds]
ecloud_ has joined #wayland
ecloud has quit [Ping timeout: 480 seconds]
bim9262 has joined #wayland
Narrat has quit []
tzimmermann has quit [Quit: Leaving]
<emersion>
oh right let's continue there (brb)
ambasta[m] has joined #wayland
gallo has joined #wayland
rv1sr has joined #wayland
leon-anavi has quit [Ping timeout: 480 seconds]
nerdopolis has quit [Ping timeout: 480 seconds]
Company has joined #wayland
ascent12_ has joined #wayland
bim9262 has quit [Ping timeout: 480 seconds]
mrkzboo[m] has joined #wayland
ascent12 has quit [Ping timeout: 480 seconds]
Kelseyjgilbert[m] has joined #wayland
bim9262 has joined #wayland
<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
<ara1307>
so there are no issues with BGRx to NV12 conversion in gstreamer.
<ara1307>
Attempting to use: `! video/x-raw(memory:DMABuf),format=DMA_DRM,width=1920,height=1080,drm-format=NV12:0x0100000000000002` crashes pipewire with:
<ara1307>
error: no more input formats
<any1>
Tried #gstreamer?
<ara1307>
not yet... maybe #pipewire is more relevant
cyrinux has quit []
cyrinux has joined #wayland
Moprius has joined #wayland
Sumera[m] has joined #wayland
PavelNasevich[m] has joined #wayland
bim9262 has quit [Ping timeout: 480 seconds]
Brainium has joined #wayland
bim9262 has joined #wayland
diamondburned[m] has joined #wayland
nazarewk[m] has joined #wayland
mokee has quit [Quit: off]
rayrapetyan has joined #wayland
bim9262 has quit [Ping timeout: 480 seconds]
ara1307 has quit [Quit: Page closed]
fgdfgdfgd has joined #wayland
hex[m]1 has joined #wayland
bim9262 has joined #wayland
arichardson[m] has joined #wayland
[old]freshgumbubbles[m] has joined #wayland
KingoftheElves[m] has joined #wayland
JosExpsito[m]1 has joined #wayland
rails[m] has joined #wayland
AndrewAylett[m] has joined #wayland
teh1[m] has joined #wayland
andreasbackx has joined #wayland
FbioPacheco[m] has joined #wayland
Bran[m] has joined #wayland
Guest7897 has quit [Remote host closed the connection]
cool110 has joined #wayland
cool110 is now known as Guest7941
PopLamina_ has joined #wayland
yshui` has joined #wayland
PopLamina has quit [Ping timeout: 480 seconds]
rv1sr has quit []
bim9262 has quit [Ping timeout: 480 seconds]
bim9262 has joined #wayland
Guest7941 has quit [Ping timeout: 480 seconds]
cool110_ has joined #wayland
cool110_ is now known as Guest7945
sima has quit [Ping timeout: 480 seconds]
bim9262 has quit [Ping timeout: 480 seconds]
bim9262 has joined #wayland
mvlad has quit [Remote host closed the connection]