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

Issue in sway on NixOS #155

Open
rgrunbla opened this issue May 6, 2022 · 10 comments
Open

Issue in sway on NixOS #155

rgrunbla opened this issue May 6, 2022 · 10 comments

Comments

@rgrunbla
Copy link

rgrunbla commented May 6, 2022

Hello,

This issue follows my comment at #3 (comment)

I'm facing the WARN weylus::websocket: Failed to init screen cast: Failed to create element from factory name! error and screen sharing does not seem to work on my OS.

I believe there is two separate issues: one is the discovery of the libgstpipewire.so, that can be worked out by using GST_PLUGIN_PATH, but as this is not enough to get everything working, I believe there is another issue.

Here are the full logs of two commands (one is gst-inspect-1.0 pipewiresrc, the other is weylus, with the GST_PLUGIN_PATH trick): log.txt

@H-M-H
Copy link
Owner

H-M-H commented May 6, 2022

0:00:13.203166979 1145065 0x55d8593a2490 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:701:gst_element_factory_make_with_properties: no such element factory "appsink"!

This looks suspicious, what's the output of gst-inspect-1.0 appsink and gst-inspect-1.0 --plugin? Perhaps you are missing some more GStreamer plugins.

@rgrunbla
Copy link
Author

rgrunbla commented May 6, 2022

Indeed, i'm lacking more plugins:

[remy@typhoon:~]$ GST_PLUGIN_PATH=/nix/store/v8yddpay5ilm3m59yj64pdnc13gjkav1-pipewire-0.3.49-lib/lib/gstreamer-1.0/ gst-inspect-1.0 --plugin
pipewire:  pipewiredeviceprovider (GstDeviceProviderFactory)
pipewire:  pipewiresink: PipeWire sink
pipewire:  pipewiresrc: PipeWire source
staticelements:  bin: Generic bin
staticelements:  pipeline: Pipeline object

Let me try to fix all that, thanks !

@rgrunbla
Copy link
Author

rgrunbla commented May 7, 2022

So, to kind of "fix" the packaging on NixOS, I used an overlay to redefine the definition of the package:

weylus = super.weylus.overrideAttrs (old: {
          nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.makeWrapper ];


          GST_PLUGIN_PATH = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" [
            pkgs.gst_all_1.gst-plugins-base
            pkgs.gst_all_1.gst-plugins-good
            pkgs.gst_all_1.gst-plugins-bad
            pkgs.gst_all_1.gst-libav
            pkgs.pipewire
          ];

          postInstall = ''
            wrapProgram $out/bin/weylus \
              --prefix GST_PLUGIN_PATH : "$GST_PLUGIN_PATH"
          '';
        });

I now encounter a bug regarding the execution which seems it's not related to some lib weylus does not find:

[…]
             GST_BUS gstbus.c:377:gst_bus_post:<bus0> [msg 0x7ffb840019c0] dropped
         GST_MESSAGE gstelement.c:2241:gst_element_message_full_with_details:<pipewiresrc0> start
          GST_STATES gstelement.c:3118:gst_element_change_state:<appsink0> element changed state SUCCESS
    GST_ERROR_SYSTEM gstelement.c:2271:gst_element_message_full_with_details:<pipewiresrc0> posting message: Internal data stream error.
          GST_STATES gstelement.c:2806:gst_element_continue_state:<appsink0> completed state change to READY
           structure gststructure.c:2091:priv_gst_structure_append_to_gstring: No value transform to serialize field 'gerror' of type 'GError'
          GST_STATES gstelement.c:2706:_priv_gst_element_state_changed:<appsink0> notifying about state-changed READY to READY (VOID_PENDING pending)
[…]

Full log: log.txt

@H-M-H
Copy link
Owner

H-M-H commented May 7, 2022

Does screen recording work with other programs like OBS, does this snippet work: https://gitlab.gnome.org/-/snippets/19 ?

@H-M-H
Copy link
Owner

H-M-H commented May 8, 2022

Alright, I think I might have figured it out. It looks like sway abandoned support for the BGRx pixel format, which used to be the only format Weylus accepted. Now there is a choice between RGBx and YV12.

For now I just pretend BGRx == RGBx, which should make streaming, albeit with wrong colors, possible again. You can try the latest build here: https://github.com/H-M-H/Weylus/actions/runs/2288101214#artifacts

@rgrunbla
Copy link
Author

rgrunbla commented May 8, 2022

It indeed works on master now. I still get a few WARN weylus::websocket: Failed to init screen cast: Element failed to change its state! when I launch weylus, but it then work after those messages (which take maybe 30 seconds before appearing, meanwhile weylus appear unresponsive from the web interface).

Full logs: log.txt

@H-M-H
Copy link
Owner

H-M-H commented May 8, 2022

Alright, colors should be fixed now as well.

@rgrunbla
Copy link
Author

rgrunbla commented May 8, 2022

Indeed colors are now working ! So, aside from these problem when starting, it kind of works ! Thanks !

@H-M-H
Copy link
Owner

H-M-H commented May 8, 2022

aside from these problem when starting

That's a little weird. I started a sway session myself to do the debugging and testing of my changes and had no such problems.

@rgrunbla
Copy link
Author

rgrunbla commented May 8, 2022

Here is some example of what's happening: https://0x0.st/omq9.mp4 It seems I have to refresh the page (after a first load) to get weylus working.

Maybe we can interact on Matrix, if you're there ?

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

No branches or pull requests

2 participants