• Frenchgeek@lemmy.ml
    link
    fedilink
    arrow-up
    11
    arrow-down
    1
    ·
    9 hours ago

    Too bad Wayland is glacially slow when taking screenshots next to X11 (Had a python script taking screenshots of a Minecraft window and doing some image recognition at 60 fps on X11 and …3 on Wayland. I now need to rewrite it to stream the whole desktop as a webcam for the same thing.)

    • muusemuuse@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 hours ago

      X11 was built to solve a completely different problem and it did that marvelously well. But then it kept being adapted to solve a different problem it wasn’t great at. It was just the only real option for so long that people optimized the shit out of it and it kept up. Seriously, there is absolutely no reason x11 should have been able to do what it was doing as well it was doing it.

      Wayland says enough is enough. We are starting over and building on what we’ve learned over the past few decades and making something based on how it will actually be used rather than working backwards like X11 ended up doing.

      Then Covid hit and remote use cases exposed it weaknesses. So it’s adapting too.

      Wayland is built in a way that lets you meet in the middle cleaner than X11 did. It’ll be fine. It’s just young.

    • yardratianSoma@lemmy.ca
      link
      fedilink
      arrow-up
      7
      ·
      8 hours ago

      My uneducated guess is maybe it should be written in C instead of python. On top of that, screen recording via OBS works great on Wayland, so Wayland can’t be fully to blame.

      • michaelmrose@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        4 hours ago

        At least part of that is complete nonsense. Python often already does low level things in c and it was doing 60 fps under X so python is unlikely to be the bottleneck. You would need to profile it to determine the actual bottleneck.

      • Frenchgeek@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        6 hours ago

        Most likely, it’s Wayland throttling screenshot demands. Obs actually stream the desktop instead of grabbing it.

    • antimidas@sopuli.xyz
      link
      fedilink
      arrow-up
      3
      ·
      8 hours ago

      Is it not an option for you to just use Pipewire, or is that what you mean by a webcam? It’ll be somewhat of a refactor but should still be quite fast compared to screenshots even on X11.

      • Frenchgeek@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        5 hours ago

        Did you know there is no accessible documentation to do so with pipewire? The best I could find was an uncommented python source and a technical wiki that skips the basics. V4Lloopback is far simpler. And shorter.