Setting up Sunshine and Moonlight for high performance game streaming on Linux

  • g0nz0li0@piefed.social
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    2
    ·
    17 hours ago

    Sunshine worked brilliantly under Windows 11, but unfortunately on Linux it lacks the ability to encode the video stream using my RX 7800 XT and microstutters like crazy.

    • inclementimmigrant@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      6 hours ago

      I guess the question is did you set up VA-API and do you have an processor with integrated graphics?

      When I set my instance up, I had to do just a bit of ID’ing since my processor/MB has a iGPU at device 0 that was for debugging purposes and wasn’t going to be up to snuff for encoding.

      • g0nz0li0@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 hours ago

        Yes I do have VA-API and no iGPU, so there wasn’t an easy fix.

        I also see the same issue on Bazzite and CachyOS, and the same issue using Apollo and Sunshine. I’ve also deeply investigated network issues as the cause but I think that was a red herring.

        Windows was fine out of the box and has specific AMD gpu codexes that the Linux build doesn’t have (I assume proprietary?) so that seems the most likely cause.

    • ☂️-@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      6 hours ago

      is the output of the log (in the sunshine configurator web page) showing any codec errors? give that a read and report back to us with more info.

      i had a similar problem before and it was related to permissions and how it was installed. the sunshine packages are finnicky as fuck on linux.

      • g0nz0li0@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 hours ago

        No output errors at all. It actually runs at high frame rates and high resolution. No matter what res or frame cap or bandwidth limit it will microstutter in predictable ways :(

        I’ve tried Sunshine and Moonlight, on both Bazzite (pre-installed and configured) and CachyOS (pacman and AUR).

        • ☂️-@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          2 hours ago

          mine logs it as such:

          Info: Found H.264 encoder: h264_vaapi [vaapi]
          Info: Found HEVC encoder: hevc_vaapi [vaapi]
          

          after a bunch of messages about trying some codecs and setting bitrate and color depth for the found encoders. connecting with a client should show you no errors and a message with the selected encoder. you can try cpu encoding to see if that changes anything for a clue.

          if the encoders are showing up as properly detected and selected in the logs, then you might want to look into something else as encoders are probably not the cause.

    • Coleslaw4145@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      9 hours ago

      I use Sunshine+moonlight to stream from my Linux desktop (7900xtx) to my Steam Deck and it works great. Even AV1 streaming works.

      • g0nz0li0@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 hours ago

        I don’t know if it’s the encoder or Wayland being Wayland, but there stutters on the stream (but not the host screen) using VA-API.

        Using the same host/receiver on windows (but a different encoder) there’s no issue so not sure it’s related to VRR or framerate matching as many suggest.

      • FauxLiving@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        11 hours ago

        It works fine on my 7800XT.

        They’re just confusing ‘This isn’t working for me’ with ‘This isn’t working for Linux’

        • g0nz0li0@piefed.social
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 hours ago

          Dual booting Windows and it works fine there, and there’s definitely encoders not present in Linux that are in windows.

          Open to suggestions, or are you just here to have strong opinions about things?

    • garret@lemmy.ml
      link
      fedilink
      arrow-up
      6
      ·
      12 hours ago

      You can. Look at “Games on Whales” github. I run it daily with that hosting in a server and streaming on my tv

    • ferret@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      13 hours ago

      … what exactly do you intend to stream without a display server running? Yes you can run it headless, but you still need x11 or wayland obviously.

      • gazter@aussie.zone
        link
        fedilink
        arrow-up
        3
        ·
        11 hours ago

        This might be a time when an ignorant point of view helps, like mine. I don’t know anything about Wayland- Is it like Zululand but where the Way tribe lives? Anyway, my naive assumption is OP was wondering if you can run it on a server that does not have a display plugged in.

      • panda_abyss@lemmy.ca
        link
        fedilink
        arrow-up
        1
        ·
        9 hours ago

        I’m relatively new to Linux and this is deeper than a usual topic into a stack I don’t know.

        I have a server, it has a graphics card, and I already have steam running with GameScope so the whole app renders into a single frame buffer.

        I just don’t know how the graphics/app pipeline plumbing needs to work to be able to run that headlessly and stream it, which would be my ideal situation.

        • Nibodhika@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          8 hours ago

          For this to work you need a display to send through the network, but that display needs not be a physical one. So depending on your definition it can be run headless. If you meant without it being plugged to a display then yes, if you meant without having graphical stack installed then no (there would be no point to streaming display without a display).

          • panda_abyss@lemmy.ca
            link
            fedilink
            arrow-up
            2
            ·
            7 hours ago

            Thank you, and yes, I meant not needing to be plugged into an active monitor with mouse and keyboard running.

            I think from just this discussion I’m realizing some of what I didn’t know I didn’t know/misunderstood about the whole desktop system on Linux.

  • Teppichbrand@feddit.org
    link
    fedilink
    arrow-up
    4
    ·
    17 hours ago

    I used this some time ago on a raspberry pi to steam games from my desktop to my couch and TV. It worked great. Now, I run it in my laptop and plug it to the TV from time to time. Still a great setup.