I have an example that uses ashpd/gstreamer to get dmabufs from the pipewire stream. This could be expanded to take arguments to test different kinds of capture, using different GPUs, etc.
It works fine capturing an Intel output to a gstreamer waylandsink window, where Intel is the main_device. I can't seem to get vaapi or nvenc h264 encoding to work here (with different errors). When being careful to avoid copy to CPU.
Capturing the Nvidia output seems to fail here (xdg-desktop-portal cosmic is currently using dmabufs allocated with the main_device regardless of capture source). When I ran wayland-1-renderD129 xdg-desktop-portal-cosmic to capture with the Nvidia GPU, the compositor completely froze...
Anyway, this should be helpful for testing and improving xdg-desktop-portal-cosmic and cosmic-comp. I still need to test this with https://github.com/pop-os/cosmic-comp/pull/278. Though also, xdg-desktop-portal-cosmic (unlike cosmic-workspaces) isn't currently passing the node id to screencopy_session.attach_buffer.
I have an example that uses ashpd/gstreamer to get dmabufs from the pipewire stream. This could be expanded to take arguments to test different kinds of capture, using different GPUs, etc.
It works fine capturing an Intel output to a gstreamer
waylandsink
window, where Intel is themain_device
. I can't seem to get vaapi or nvenc h264 encoding to work here (with different errors). When being careful to avoid copy to CPU.Capturing the Nvidia output seems to fail here (xdg-desktop-portal cosmic is currently using dmabufs allocated with the
main_device
regardless of capture source). When I ranwayland-1-renderD129 xdg-desktop-portal-cosmic
to capture with the Nvidia GPU, the compositor completely froze...Anyway, this should be helpful for testing and improving xdg-desktop-portal-cosmic and cosmic-comp. I still need to test this with https://github.com/pop-os/cosmic-comp/pull/278. Though also, xdg-desktop-portal-cosmic (unlike cosmic-workspaces) isn't currently passing the node id to
screencopy_session.attach_buffer
.