hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
273 stars 47 forks source link

Crash #38

Closed JojiiOfficial closed 1 year ago

JojiiOfficial commented 1 year ago

Installing xdg desktop portal hyprland as described on the website results in following crash when obs studio is opened. grim isn't working either (screenshot is black).

Apr 04 21:29:03 jojiiPC xdg-desktop-por[735]: Failed to close session implementation: Timeout was reached
Apr 04 21:29:05 jojiiPC xdg-desktop-portal-hyprland[1259]: 2023/04/04 21:29:05 [ERROR] - xdg-desktop-portal-hyprland: unsupported wl_shm format 0x34324742
Apr 04 21:29:06 jojiiPC systemd-coredump[1862]: [🡕] Process 1259 (xdg-desktop-por) of user 1000 dumped core.

                                                Stack trace of thread 1259:
                                                #0  0x00007f88073058ec n/a (libc.so.6 + 0x878ec)
                                                #1  0x00007f88072b6ea8 raise (libc.so.6 + 0x38ea8)
                                                #2  0x00007f88072a053d abort (libc.so.6 + 0x2253d)
                                                #3  0x00005573614c81f4 xdpw_format_drm_fourcc_from_wl_shm (xdg-desktop-portal-hyprland + 0xb1f4)
                                                #4  0x00005573614c9437 wlr_frame_buffer (xdg-desktop-portal-hyprland + 0xc437)
                                                #5  0x00007f880727a4f6 n/a (libffi.so.8 + 0x74f6)
                                                #6  0x00007f8807276f5e n/a (libffi.so.8 + 0x3f5e)
                                                #7  0x00007f8807279b73 ffi_call (libffi.so.8 + 0x6b73)
                                                #8  0x00007f8807657645 n/a (libwayland-client.so.0 + 0x7645)
                                                #9  0x00007f8807657e03 n/a (libwayland-client.so.0 + 0x7e03)
                                                #10 0x00007f8807657ffc wl_display_dispatch_queue_pending (libwayland-client.so.0 + 0x7ffc)
                                                #11 0x00005573614c5f9b start_screencast (xdg-desktop-portal-hyprland + 0x8f9b)
                                                #12 0x00005573614c6c87 method_screencast_start (xdg-desktop-portal-hyprland + 0x9c87)
                                                #13 0x00007f880759fe2d n/a (libsystemd.so.0 + 0x32e2d)
                                                #14 0x00007f88075b62be n/a (libsystemd.so.0 + 0x492be)
                                                #15 0x00005573614c31a2 main (xdg-desktop-portal-hyprland + 0x61a2)
                                                #16 0x00007f88072a1790 n/a (libc.so.6 + 0x23790)
                                                #17 0x00007f88072a184a __libc_start_main (libc.so.6 + 0x2384a)
                                                #18 0x00005573614c2905 _start (xdg-desktop-portal-hyprland + 0x5905)

                                                Stack trace of thread 1260:
                                                #0  0x00007f88073861b6 epoll_wait (libc.so.6 + 0x1081b6)
                                                #1  0x00007f880768b759 n/a (libspa-support.so + 0x16759)
                                                #2  0x00007f880767b9fb n/a (libspa-support.so + 0x69fb)
                                                #3  0x00007f88074d8227 n/a (libpipewire-0.3.so.0 + 0x45227)
                                                #4  0x00007f8807303bb5 n/a (libc.so.6 + 0x85bb5)
                                                #5  0x00007f8807385d90 n/a (libc.so.6 + 0x107d90)
                                                ELF object binary architecture: AMD x86-64
Apr 04 21:29:06 jojiiPC systemd[626]: xdg-desktop-portal-hyprland.service: Main process exited, code=dumped, status=6/ABRT
vaxerski commented 1 year ago

are you on Hyprland? what ver? Nvidia? 10 bit?

JojiiOfficial commented 1 year ago

Yes hyprland on latest git commit with Nvidia. No 10 bit

vaxerski commented 1 year ago

looks like that one issue with nvidia that requires a patch or something to me.

At any rate, nvidia is not supported.

realth000 commented 1 year ago

Maybe here is a workaround?

  1. git clone --recursive https://github.com/hyprwm/Hyprland.git
  2. Replace function wlr_output_preferred_read_format in wlroots/types/output/render.c like this:
uint32_t wlr_output_preferred_read_format(struct wlr_output *output) {
    return DRM_FORMAT_XRGB8888;
}

Then sudo make install and start Hyprland, both grim and obs works, though not fully tested.

dragm83 commented 1 year ago

Maybe here is a workaround?

1. `git clone --recursive https://github.com/hyprwm/Hyprland.git`

2. Replace function `wlr_output_preferred_read_format` in  `wlroots/types/output/render.c` like this:
uint32_t wlr_output_preferred_read_format(struct wlr_output *output) {
    return DRM_FORMAT_XRGB8888;
}

Then sudo make install and start Hyprland, both grim and obs works, though not fully tested.

This fixed the issue with obs and grim for me. Thank you.