Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error when initiating screencasting #16

Open
isti115 opened this issue Dec 29, 2023 · 8 comments
Open

Runtime error when initiating screencasting #16

isti115 opened this issue Dec 29, 2023 · 8 comments

Comments

@isti115
Copy link

isti115 commented Dec 29, 2023

The Settings part of the portal seems to be working perfectly, but when I try to initiate a ScreenCast, I get the following error:

2023-12-29T10:54:58.517785Z  INFO
  dispatch_message {
    msg=Msg {
      type: MethodCall,
      sender: UniqueName(Str(Borrowed(":1.15"))),
      path: ObjectPath("/org/freedesktop/portal/desktop"),
      iface: InterfaceName(Str(Borrowed("org.freedesktop.impl.portal.ScreenCast"))),
      member: MemberName(Str(Borrowed("CreateSession"))), body: Signature("oosa{sv}")
    }
  }:dispatch_method_call {
    msg=Msg {
      type: MethodCall,
      sender: UniqueName(Str(Borrowed(":1.15"))),
      path: ObjectPath("/org/freedesktop/portal/desktop"),
      iface: InterfaceName(Str(Borrowed("org.freedesktop.impl.portal.ScreenCast"))),
      member: MemberName(Str(Borrowed("CreateSession"))),
      body: Signature("oosa{sv}")
    }
  }:dispatch_method_call_try {
    msg=Msg {
      type: MethodCall,
      sender: UniqueName(Str(Borrowed(":1.15"))),
      path: ObjectPath("/org/freedesktop/portal/desktop"),
      iface: InterfaceName(Str(Borrowed("org.freedesktop.impl.portal.ScreenCast"))),
      member: MemberName(Str(Borrowed("CreateSession"))),
      body: Signature("oosa{sv}")
    }
  }:
  xdg_desktop_portal_luminous::screencast:
  Start shot:
    path :/org/freedesktop/portal/desktop/request/1_77/obs4,
    appid: thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Connect(NoWaylandLib)', src/screencast.rs:194:63

I am running the binary from the development shell provided through flake.nix, so I assume, that the Wayland library should be present, as it's among the nativeBuildInputs. Also, wayshot works without any issues.

@Decodetalkers
Copy link
Collaborator

line 194 is libwayshot init connection, and it says there is no waylandlib

@Decodetalkers
Copy link
Collaborator

so, I think that is there is no wayland_display for the service

@Decodetalkers
Copy link
Collaborator

you can try to start it from commandline not systemd service..

image

it should need a WAYLAND_DISPLAY

@isti115
Copy link
Author

isti115 commented Dec 29, 2023

Thanks for helping me troubleshoot this!
The error message was in fact captured by running it in the terminal, but I also have my WAYLAND_DISPLAY imported into the systemd environment, so there has got to be another cause at play.

In case anyone is facing the same issue, the temporary workaround I came up with was using the wlr portal for screencasting and relying on the luminous portal for the accent-color and cholor-scheme settings only.
~/.config/xdg-desktop-portal/portals.conf:

[preferred]
default=wlr
org.freedesktop.impl.portal.Settings=luminous

@Shinyzenith
Copy link
Member

Shinyzenith commented Dec 29, 2023

Thanks for helping me troubleshoot this! The error message was in fact captured by running it in the terminal, but I also have my WAYLAND_DISPLAY imported into the systemd environment, so there has got to be another cause at play.

In case anyone is facing the same issue, the temporary workaround I came up with was using the wlr portal for screencasting and relying on the luminous portal for the accent-color and cholor-scheme settings only. ~/.config/xdg-desktop-portal/portals.conf:

[preferred]
default=wlr
org.freedesktop.impl.portal.Settings=luminous

This is really interesting. Just to be clear, I am a Nix newbie and I copied the flake.nix from another project...maybe my flake code is the real issue here?

Are you sure luminous portal is receiving the WAYLAND_DISPLAY properly? Because wayshot and luminous use the same code for the backend ( libwayshot ). If wayshot works, there's no reason why luminous shouldn't.

Can you provide your distribution and compositor?

@isti115
Copy link
Author

isti115 commented Dec 29, 2023

Can you provide your distribution and compositor?

Of course, it's NixOS 23.11 and river 0.2.6, but I tried under Sway as well and got the same result. I'll make a build that prints the environmental variables just to be sure that WAYLAND_DISPLAY is present and correct for the portal, but I would be very surprised if it wasn't, since as I've said, I have tried it from a terminal and have imported (and verified via systemctl --user show-environment) it into the systemd environment as well.

@Shinyzenith
Copy link
Member

Hm still sounds like it's worth a shot. Please let me know!

@Arun-Singh-1242

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants