niri icon indicating copy to clipboard operation
niri copied to clipboard

Implement cursor metadata in screencast

Open abmantis opened this issue 5 months ago • 12 comments

This implements cursor metadata for pipewire window and output screencasts.

abmantis avatar Jul 27 '25 21:07 abmantis

Please rebase onto main, it has the necessary spa_buffer access.

I did rebase to main yesterday, but it now seems to have some issue with the cursor bitmap buffer which I haven't figured out yet. Probably some bad pointer offset calculation. I should take a look at it back later today.

abmantis avatar Aug 07 '25 16:08 abmantis

For some reason, without https://github.com/YaLTeR/niri/commit/15b4acc17ee2c8ac31f7e6093df57aa66e6bc2de#diff-a517890ab4c703e485977a1943ceb154a6bcb3cc4d83135097a2841d569e7326L930-L931 the cast just stops after a second:

I've printed the stride and offset from the dmabuf and the current ones on the chunks, and for some reason the chunk ones overflow:

2025-08-08T14:18:18.137093Z DEBUG niri::pw_utils: pw stream: moving to ready state
2025-08-08T14:18:18.139977Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Streaming
2025-08-08T14:18:18.140313Z DEBUG niri::pw_utils: pw buffer: fd = 183, stride = 7168, offset = 0
2025-08-08T14:18:18.140324Z DEBUG niri::pw_utils: pw buffer: chunk stride = 7168, chunk offset = 0
2025-08-08T14:18:18.140329Z DEBUG niri::pw_utils: pw buffer: fd = 184, stride = 2048, offset = 10092544
2025-08-08T14:18:18.140333Z DEBUG niri::pw_utils: pw buffer: chunk stride = 2048, chunk offset = 10092544
2025-08-08T14:18:18.152639Z DEBUG niri::pw_utils: pw buffer: fd = 185, stride = 7168, offset = 0
2025-08-08T14:18:18.152673Z DEBUG niri::pw_utils: pw buffer: chunk stride = 7168, chunk offset = 0
2025-08-08T14:18:18.152681Z DEBUG niri::pw_utils: pw buffer: fd = 186, stride = 2048, offset = 10092544
2025-08-08T14:18:18.152688Z DEBUG niri::pw_utils: pw buffer: chunk stride = 2048, chunk offset = 10092544
2025-08-08T14:18:18.742885Z DEBUG niri::pw_utils: pw buffer: fd = 187, stride = 7168, offset = 0
2025-08-08T14:18:18.742918Z DEBUG niri::pw_utils: pw buffer: chunk stride = -1426063361, chunk offset = 2868903935
2025-08-08T14:18:18.742921Z DEBUG niri::pw_utils: pw buffer: fd = 188, stride = 2048, offset = 10092544
2025-08-08T14:18:18.742924Z DEBUG niri::pw_utils: pw buffer: chunk stride = -1442840576, chunk offset = 2852126720
2025-08-08T14:18:18.745123Z DEBUG niri::pw_utils: pw stream: state changed: Streaming -> Paused

They only overflow when I write to the bitmap array. I don't see anything wrong with the bitmap, so maybe something is failing to take the extra bitmap size into account?

abmantis avatar Aug 08 '25 14:08 abmantis

Hmm, idk, I looked through this PR's diff and the code in mutter and couldn't see a problem off the bat. Try filling the bitmap with sentinel values (like 0x01, 0x02, 0x03 and so on) to see where it overwrites subsequent data? Maybe check with gdb?

YaLTeR avatar Aug 09 '25 09:08 YaLTeR

Hmm, idk, I looked through this PR's diff and the code in mutter and couldn't see a problem off the bat. Try filling the bitmap with sentinel values (like 0x01, 0x02, 0x03 and so on) to see where it overwrites subsequent data? Maybe check with gdb?

I'm struggling to find the cause of this. The cursor_meta pointer is slightly different on every frame, which makes it so that I can't just watch that memory space for changes. I'll keep trying, but I've pushed the code here in case some one wants to try it too. This is now based on main, but contains a revert of https://github.com/YaLTeR/niri/commit/15b4acc17ee2c8ac31f7e6093df57aa66e6bc2de

abmantis avatar Aug 13 '25 23:08 abmantis

@YaLTeR looking at https://docs.pipewire.org/video-src_8c-example.html#a57 the example sets the stride/offset on every frame. Are you sure that is not required? Also, I noticed that the chunk address changes on every frame, so how can it have the stride set only at start?

abmantis avatar Aug 21 '25 23:08 abmantis

I'm logging the bitmap_data address and bitmap_data.add(MAX_CURSOR_BITMAP_SIZE as usize), and also the address on the spa_data chunk: image

Notice that the address pairs pointed by the green (frame 1) and blue (frame 2) arrows match, which means that the bitmap_data is in the proper memory space since the data chunk comes right after. Also notice that the address pointed by the red arrow (frame 2) is in the middle of the address range of bitmap_data of frame 1. That is why it gets a corrupted value when I write the bitmap vs. when I don't.

abmantis avatar Aug 22 '25 00:08 abmantis

From Matrix:

well on main there are only dmabufs, and for them stride and offset are data about the dmabuf itself, not about pipewire structures since dmabufs are allocated once and then don't change, there's no need to change their stride and offset (dmabuf is like a handle to GPU memory) That said, at least Mutter sets them every frame, like niri before that commit. It's not impossible that pipewire itself has some issue where it automatically changes those values even for dmabufs and nobody has noticed so far. (This is just speculation) The screencast codepaths there don't get a lot of various testing Have you tried debugging with gdb and watching the memory location corresponding to the stride field and seeing what changes it?

I'm open to changing it back to set stride/offset every frame, but if it's indeed a bug in PW, it'd be good to get it found and fixed

YaLTeR avatar Aug 22 '25 04:08 YaLTeR

Non-dmabuf stride and offset do not fall under what I described above of course

YaLTeR avatar Aug 22 '25 04:08 YaLTeR

Opened an issue on pipewire: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4884

abmantis avatar Sep 07 '25 23:09 abmantis

Thanks, subscribed

YaLTeR avatar Sep 08 '25 05:09 YaLTeR

I was able to confirm that the PR linked to that issue fixes the problem! :partying_face: I can finally get back to implementing this.

abmantis avatar Sep 10 '25 00:09 abmantis

Awesome! I guess you should add a runtime check for pipewire version with the fix though.

YaLTeR avatar Sep 10 '25 04:09 YaLTeR

Is there more work that needs to be done on this for cursor data to be sent for screencasting? I have built with these changes locally but the cursor still does not appear in screencasts. Would love an update on this. Thanks.

ASong5 avatar Nov 23 '25 09:11 ASong5

fwiw I haven't had a chance to look at this again yet; I'll try to before the next release if I find time. Testing is very welcome

YaLTeR avatar Nov 23 '25 10:11 YaLTeR

Is there more work that needs to be done on this for cursor data to be sent for screencasting? I have built with these changes locally but the cursor still does not appear in screencasts. Would love an update on this. Thanks.

No, it should be done. What version of pipewire do you have installed?

abmantis avatar Nov 23 '25 23:11 abmantis

Is there more work that needs to be done on this for cursor data to be sent for screencasting? I have built with these changes locally but the cursor still does not appear in screencasts. Would love an update on this. Thanks.

No, it should be done. What version of pipewire do you have installed?

I am on 1.2.7 which is what comes with Ubuntu 25.04. Will I need to build pipewire from source?

ASong5 avatar Nov 24 '25 02:11 ASong5

Is there more work that needs to be done on this for cursor data to be sent for screencasting? I have built with these changes locally but the cursor still does not appear in screencasts. Would love an update on this. Thanks.

No, it should be done. What version of pipewire do you have installed?

I am on 1.2.7 which is what comes with Ubuntu 25.04. Will I need to build pipewire from source?

Yeah, you need ~~1.2.8~~ at least. The previous versions had a buffer memory bug. EDIT: meant 1.4.8.

abmantis avatar Nov 24 '25 02:11 abmantis

Is there more work that needs to be done on this for cursor data to be sent for screencasting? I have built with these changes locally but the cursor still does not appear in screencasts. Would love an update on this. Thanks.

No, it should be done. What version of pipewire do you have installed?

I am on 1.2.7 which is what comes with Ubuntu 25.04. Will I need to build pipewire from source?

Yeah, you need 1.2.8 at least. The previous versions had a buffer memory bug.

Updated to pipewire 1.4.7 and the cursor still does not appear in screencasts. In the journal it says that WARN niri::pw_utils: cursor metadata mode requires PipeWire >= 1.4.8. I'm guessing you meant 1.4.8 not 1.2.8.

ASong5 avatar Nov 24 '25 03:11 ASong5

After compiling pipewire 1.5.8 from source, I get the following in journal:

WARN niri::pw_utils: error rendering cursor, using default bitmap

How do I further troubleshoot this? Have you tested on later version of pipewire or only 1.4.8?

ASong5 avatar Nov 24 '25 04:11 ASong5

After compiling pipewire 1.5.8 from source, I get the following in journal:

WARN niri::pw_utils: error rendering cursor, using default bitmap

How do I further troubleshoot this? Have you tested on later version of pipewire or only 1.4.8?

That log message is a bit misleading since there is no default bitmap. I've just updated.

Anyway, can you enable debug logs and see if something else pops up? I don't know why the rendering of the cursor elements is failing.

abmantis avatar Nov 24 '25 12:11 abmantis

After compiling pipewire 1.5.8 from source, I get the following in journal: WARN niri::pw_utils: error rendering cursor, using default bitmap How do I further troubleshoot this? Have you tested on later version of pipewire or only 1.4.8?

That log message is a bit misleading since there is no default bitmap. I've just updated.

Anyway, can you enable debug logs and see if something else pops up? I don't know why the rendering of the cursor elements is failing.

Nov 24 22:13:29 pundrew-desktop niri[3200758]: 2025-11-25T03:13:29.065236Z ERROR niri::pw_utils: error rendering cursor
Nov 24 22:13:29 pundrew-desktop niri[3200758]: 2025-11-25T03:13:29.235871Z ERROR niri::pw_utils: error rendering cursor
Nov 24 22:13:29 pundrew-desktop niri[3200758]: 2025-11-25T03:13:29.732085Z ERROR niri::pw_utils: error rendering cursor
Nov 24 22:13:29 pundrew-desktop niri[3200758]: 2025-11-25T03:13:29.943374Z ERROR niri::pw_utils: error rendering cursor
Nov 24 22:13:39 pundrew-desktop niri[3200758]: 2025-11-25T03:13:39.099299Z DEBUG niri::pw_utils: pw stream: state changed: Streaming -> Paused stream_id=1
Nov 24 22:13:39 pundrew-desktop niri[3200758]: 2025-11-25T03:13:39.105405Z DEBUG niri::dbus::mutter_screen_cast: stop
Nov 24 22:13:39 pundrew-desktop niri[3200758]: 2025-11-25T03:13:39.105442Z DEBUG niri::niri: StopCast session_id=1
Nov 24 22:13:39 pundrew-desktop niri[3200758]: 2025-11-25T03:13:39.105472Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Unconnected stream_id=1
Nov 24 22:13:46 pundrew-desktop xdg-desktop-portal-gnome[3201079]: Failed to associate portal window with parent window 
Nov 24 22:13:46 pundrew-desktop xdg-desktop-portal-gnome[3201079]: vkAcquireNextImageKHR(): A swapchain no longer matches the surface properties exactly, but can still be used to present to the surface successfully. (VK_SUBOPTIMAL_KHR) (1000001003)
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.281916Z DEBUG niri::dbus::mutter_screen_cast: record_monitor connector="DP-1" properties=RecordMonitorProperties { cursor_mode: Some(Metadata), _is_recording: None }
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.282368Z DEBUG niri::dbus::mutter_screen_cast: start
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.282385Z DEBUG niri::niri: StartCast session_id=4 stream_id=4
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.282415Z DEBUG niri::pw_utils: pw stream: state changed: Unconnected -> Connecting stream_id=4
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.284338Z DEBUG niri::pw_utils: pw stream: state changed: Connecting -> Paused stream_id=4
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.284347Z DEBUG niri::pw_utils: pw stream: sending signal with 68 stream_id=4
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.319507Z DEBUG niri::pw_utils: pw stream: got format = VideoInfoRaw { format: VideoFormat::BGRx, flags: VideoFlags(0xc), modifier: 0, size: spa_rectangle { width: 2560, height: 1440 }, framerate: spa_fraction { num: 0, denom: 1 }, max_framerate: spa_fraction { num: 165080, denom: 1000 }, views: 0, interlace_mode: 0, pixel_aspect_ratio: spa_fraction { num: 0, denom: 0 }, multiview_mode: 0, multiview_flags: 0, chroma_site: 0, color_range: 0, color_matrix: 0, transfer_function: 0, color_primaries: 0 } stream_id=4
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.319521Z DEBUG niri::pw_utils: pw stream: fixating the modifier stream_id=4
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.319527Z DEBUG niri::pw_utils: find_preferred_modifier: size=Size<smithay::utils::geometry::Physical> { w: 2560, h: 1440 }, fourcc=XR24, modifiers=[144115188621556484, 144115188621556484, 144115188621556484, 144115188621556484, 144115188621540100, 144115188621343492, 144115188621122308, 144115188621557508, 144115188621541124, 144115188621344516, 144115188621123332, 144115188075858436, 0, 72057594037927935]
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.319735Z DEBUG niri::pw_utils: pw stream: allocation successful (modifier=Unrecognized(144115188621556484), plane_count=2), moving to confirmation pending stream_id=4
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.320575Z DEBUG niri::pw_utils: pw stream: got format = VideoInfoRaw { format: VideoFormat::BGRx, flags: VideoFlags(0x4), modifier: 144115188621556484, size: spa_rectangle { width: 2560, height: 1440 }, framerate: spa_fraction { num: 0, denom: 1 }, max_framerate: spa_fraction { num: 165080, denom: 1000 }, views: 0, interlace_mode: 0, pixel_aspect_ratio: spa_fraction { num: 0, denom: 0 }, multiview_mode: 0, multiview_flags: 0, chroma_site: 0, color_range: 0, color_matrix: 0, transfer_function: 0, color_primaries: 0 } stream_id=4
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.320584Z DEBUG niri::pw_utils: pw stream: moving to ready state stream_id=4
Nov 24 22:13:48 pundrew-desktop niri[3200758]: 2025-11-25T03:13:48.323409Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Streaming stream_id=4
Nov 24 22:13:55 pundrew-desktop niri[3200758]: 2025-11-25T03:13:55.182715Z ERROR niri::pw_utils: error rendering cursor
Nov 24 22:13:55 pundrew-desktop niri[3200758]: 2025-11-25T03:13:55.184213Z ERROR niri::pw_utils: error rendering cursor

I don't know if these logs help but it's all I get in journal which is still flooded with these "error rendering cursor" messages.

ASong5 avatar Nov 25 '25 03:11 ASong5

Along with the cursor issue, niri crashed completely when I started a screencast:

v 27 12:08:21 pundrew-desktop waybar[3516842]: Error reading events from display: Connection reset by peer
Nov 27 12:08:21 pundrew-desktop xdg-desktop-portal-gtk[3517570]: Error reading events from display: Broken pipe
Nov 27 12:08:21 pundrew-desktop easyeffects[3517200]: Lost connection to Wayland compositor.
Nov 27 12:08:21 pundrew-desktop org.gnome.Nautilus[581213]: Lost connection to Wayland compositor.
Nov 27 12:08:21 pundrew-desktop niri[3516722]: 2025-11-27T17:08:21.132051Z DEBUG niri::utils::watcher: exiting watcher thread for Regular { user_path: "/home/pundrew/.config/niri/config.kdl", system_path: "/etc/niri/config.kdl" }
Nov 27 12:08:20 pundrew-desktop niri[3516722]: 2025-11-27T17:08:20.741268Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Unconnected stream_id=5
Nov 27 12:08:20 pundrew-desktop niri[3516722]: 2025-11-27T17:08:20.741164Z DEBUG niri::pw_utils: pw stream: state changed: Streaming -> Paused stream_id=5
Nov 27 12:08:20 pundrew-desktop niri[3516722]: 2025-11-27T17:08:20.741060Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Unconnected stream_id=4
Nov 27 12:08:20 pundrew-desktop niri[3516722]: 2025-11-27T17:08:20.741012Z DEBUG niri::pw_utils: pw stream: state changed: Streaming -> Paused stream_id=4
Nov 27 12:08:20 pundrew-desktop niri[3516722]: 2025-11-27T17:08:20.740910Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Unconnected stream_id=2
Nov 27 12:08:20 pundrew-desktop niri[3516722]: 2025-11-27T17:08:20.740797Z DEBUG niri::pw_utils: pw stream: state changed: Streaming -> Paused stream_id=2
Nov 27 12:08:20 pundrew-desktop niri[3516722]: 2025-11-27T17:08:20.740690Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Unconnected stream_id=1
Nov 27 12:08:20 pundrew-desktop niri[3516722]: 2025-11-27T17:08:20.739668Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Unconnected stream_id=0
Nov 27 12:08:20 pundrew-desktop niri[3516722]: 2025-11-27T17:08:20.739275Z DEBUG niri::pw_utils: pw stream: state changed: Streaming -> Paused stream_id=0
Nov 27 12:08:20 pundrew-desktop niri[3516722]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at /rustc/595b9a498bc55fcd30111e430d8e4290ed833b4c/library/core/src/ops/function.rs:250:5
Nov 27 12:08:20 pundrew-desktop niri[3516722]:   15: call_once<fn() -> core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>, ()>
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./git/niri/src/main.rs:265:10
Nov 27 12:08:20 pundrew-desktop niri[3516722]:   14: main
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/calloop-0.14.3/src/loop_logic.rs:670:13
Nov 27 12:08:20 pundrew-desktop niri[3516722]:   13: run<niri::niri::State, niri::main::{closure_env#3}, core::option::Option<core::time::Duration>>
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./git/niri/src/main.rs:265:46
Nov 27 12:08:20 pundrew-desktop niri[3516722]:   12: {closure#3}
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./git/niri/src/niri.rs:715:19
Nov 27 12:08:20 pundrew-desktop niri[3516722]:   11: refresh_and_flush_clients
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./git/niri/src/niri.rs:3816:18
Nov 27 12:08:20 pundrew-desktop niri[3516722]:   10: redraw_queued_outputs
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./git/niri/src/niri.rs:4635:17
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    9: redraw
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./git/niri/src/backend/mod.rs:79:38
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    8: with_primary_renderer<(), niri::niri::{impl#5}::redraw::{closure_env#3}>
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./git/niri/src/backend/tty.rs:1462:14
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    7: with_primary_renderer<(), niri::niri::{impl#5}::redraw::{closure_env#3}>
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./git/niri/src/niri.rs:4645:22
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    6: {closure#3}
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at ./git/niri/src/niri.rs:5325:26
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    5: render_windows_for_screen_cast
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    4: get_window_pointer_location
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at /rustc/595b9a498bc55fcd30111e430d8e4290ed833b4c/library/core/src/option.rs:2169:5
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    3: core::option::unwrap_failed
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at /rustc/595b9a498bc55fcd30111e430d8e4290ed833b4c/library/core/src/panicking.rs:148:5
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    2: core::panicking::panic
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at /rustc/595b9a498bc55fcd30111e430d8e4290ed833b4c/library/core/src/panicking.rs:78:14
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    1: core::panicking::panic_fmt
Nov 27 12:08:20 pundrew-desktop niri[3516722]:              at /rustc/595b9a498bc55fcd30111e430d8e4290ed833b4c/library/std/src/panicking.rs:698:5
Nov 27 12:08:20 pundrew-desktop niri[3516722]:    0: __rustc::rust_begin_unwind
Nov 27 12:08:20 pundrew-desktop niri[3516722]: stack backtrace:
Nov 27 12:08:20 pundrew-desktop niri[3516722]: called `Option::unwrap()` on a `None` value
Nov 27 12:08:20 pundrew-desktop niri[3516722]: thread 'main' (3516722) panicked at src/niri.rs:5228:14:

Will update when I have reproduced it with verbose logs. I never experienced this prior to building with these changes.

ASong5 avatar Nov 27 '25 17:11 ASong5

Was able to reproduce consistently by starting a screencast and then dragging the screencasted window via Mod+MB1. @abmantis are you able to reproduce this on your system?

ASong5 avatar Nov 27 '25 18:11 ASong5

Was able to reproduce consistently by starting a screencast and then dragging the screencasted window via Mod+MB1. @abmantis are you able to reproduce this on your system?

I've just tried that and cannot reproduce the crash. But I'll look at the unwraps and see if I can make them safer.

abmantis avatar Nov 30 '25 02:11 abmantis

@ASong5 can you try again and check the logs? The error rendering cursor message should now log the error to. Also the crashes when dragging should now be fixed. :crossed_fingers: Can you test that out too since I was not able to reproduce it?

abmantis avatar Dec 02 '25 02:12 abmantis

I just tested and the crashes are gone! However, cursor data is still not being sent properly for me:

pundrew@pundrew-desktop:~$ journalctl -r -b -0
Dec 01 21:30:25 pundrew-desktop niri[952124]:     1: Failed to bind Framebuffer
Dec 01 21:30:25 pundrew-desktop niri[952124]:     0: error binding texture
Dec 01 21:30:25 pundrew-desktop niri[952124]: Caused by:
Dec 01 21:30:25 pundrew-desktop niri[952124]: 2025-12-02T02:30:25.197522Z ERROR niri::pw_utils: error rendering cursor: error rendering
Dec 01 21:30:25 pundrew-desktop niri[952124]:     1: Failed to bind Framebuffer
Dec 01 21:30:25 pundrew-desktop niri[952124]:     0: error binding texture
Dec 01 21:30:25 pundrew-desktop niri[952124]: Caused by:
Dec 01 21:30:25 pundrew-desktop niri[952124]: 2025-12-02T02:30:25.008598Z ERROR niri::pw_utils: error rendering cursor: error rendering
Dec 01 21:30:24 pundrew-desktop niri[952124]:     1: Failed to bind Framebuffer
Dec 01 21:30:24 pundrew-desktop niri[952124]:     0: error binding texture
Dec 01 21:30:24 pundrew-desktop niri[952124]: Caused by:
Dec 01 21:30:24 pundrew-desktop niri[952124]: 2025-12-02T02:30:24.873792Z ERROR niri::pw_utils: error rendering cursor: error rendering
Dec 01 21:30:24 pundrew-desktop niri[952124]:     1: Failed to bind Framebuffer
Dec 01 21:30:24 pundrew-desktop niri[952124]:     0: error binding texture
Dec 01 21:30:24 pundrew-desktop niri[952124]: Caused by:
Dec 01 21:30:24 pundrew-desktop niri[952124]: 2025-12-02T02:30:24.737332Z ERROR niri::pw_utils: error rendering cursor: error rendering
Dec 01 21:30:24 pundrew-desktop niri[952124]:     1: Failed to bind Framebuffer
Dec 01 21:30:24 pundrew-desktop niri[952124]:     0: error binding texture
Dec 01 21:30:24 pundrew-desktop niri[952124]: Caused by:
Dec 01 21:30:24 pundrew-desktop niri[952124]: 2025-12-02T02:30:24.580520Z ERROR niri::pw_utils: error rendering cursor: error rendering
Dec 01 21:30:24 pundrew-desktop niri[952124]:     1: Failed to bind Framebuffer
Dec 01 21:30:24 pundrew-desktop niri[952124]:     0: error binding texture
Dec 01 21:30:24 pundrew-desktop niri[952124]: Caused by:
Dec 01 21:30:24 pundrew-desktop niri[952124]: 2025-12-02T02:30:24.238514Z ERROR niri::pw_utils: error rendering cursor: error rendering
Dec 01 21:30:24 pundrew-desktop niri[952124]:     1: Failed to bind Framebuffer
Dec 01 21:30:24 pundrew-desktop niri[952124]:     0: error binding texture

https://github.com/YaLTeR/niri/issues/511 is the most related issue I can find, but it seems to be fixed already and mainly affected nvidia cards whereas I use amd:

pundrew@pundrew-desktop:~$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: AMD Radeon RX 7800 XT (radeonsi, navi32, LLVM 20.1.8, DRM 3.64, 6.17.0-6-generic)

I'm not sure if you had a chance to test with newer versions of pipewire than 1.4.8 but I will downgrade to 1.4.8 and report back in case it is an issue with newer versions of pipewire.

ASong5 avatar Dec 02 '25 02:12 ASong5

I've just tested it with pipewire 1.4.9 since that is now available on NixOS. Regarding the error, I'll try to look a bit into it. How are you running niri?

abmantis avatar Dec 02 '25 02:12 abmantis

Tested with pipewire version 1.4.8 and the issue persists.

I'm running niri via SDDM

ASong5 avatar Dec 02 '25 03:12 ASong5

Same here. It also breaks the original cursor capture function.

The error occurred at let pointer_vec = match render_to_vec

edited:

I found that pointer_elements.len() is 0 when starting screencast if you didn't move the cursor, which is why it reports an error.

But it's not the reason why the cursor disappears.

busyoGG avatar Dec 06 '25 13:12 busyoGG

What app are you testing with @ASong5 @busyoGG ? I was not able to reproduce the errors.

But I've found a bug when using a second display where the cursor is missing. I'll look into that.

abmantis avatar Dec 17 '25 01:12 abmantis