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

1 comment

sorted by: hot top controversial new old

That seems like an awful lot of work when I can telnet into a public NetHack server from anywhere.

  • source
  • 25 comments in c/linux@lemmy.ml view that post
    [–] 8 points 8 months ago (15 children)

    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.

  • source
  • hideshow 15 child comments
  • [–] 14 points 8 months ago (1 child)

    Sunshine should be able to do hardware encoding for that GPU, it has support for VA-API

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 8 months 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.

  • source
  • parent
  • [–] 5 points 8 months ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 8 months 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.

  • source
  • parent
  • [–] 3 points 8 months ago* (4 children)

    Sunshine uses VA-API for AMD GPUs, works fine on my RX 6600

  • source
  • parent
  • hideshow 4 child comments
  • [–] 6 points 8 months ago (3 children)

    It works fine on my 7800XT.

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

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 8 months ago (2 children)

    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?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 8 months ago (1 child)

    I have both strong opinions on things and suggestions.

    The Windows software stack is completely independent of the Linux software stack. This doesn't tell you anything about the problem. Trying Windows tells you that the hardware has the capability, but you could have learned that from a spec sheet.

    If you want to solve the problem on Linux, make a post with the details of the problem and what you've tried so far as well as any logging that you can get out of Sunshine which would show you starting Sunshine and starting a stream.


    Without any other information:I read the fantastic manual.

    It looks like you're likely running into a documented problem: Mesa has disabled VA-API for legal reasons

    Without vaapi support, sunshine falls to software encoding which means the encoding is running on your CPU and that is what is causing the stuttering, so to fix it you would need to install a version of mesa that's been compiled with the correct flags (h264enc, 265enc).

    The instructions for doing this depends on our distro. On Arch, amdonly-gaming-mesa-git is listed as an optional package for the AUR version of sunshine, amdonly-gaming-mesa-git is compiled with video-codes=all which will enabled the h264, h265 support.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 8 months ago* (last edited 8 months ago)

    I did exactly this but unfortunately it didn’t address the issue I was experiencing. I read the manual you linked and the support forum for Sunshine.

    I posted about it in support forums and also got helpful advice about network latency, matching res and refresh rates to host, running Wayland only session, running game scope, using Apollo, etc.It unfortunately didn’t help.

    I tried it on Bazzite (where it is preconfigured) and CachyOS and got the same result on both.

    It suspect it’s the encoder but I think it could be a Wayland issue. I didn’t test X11 as that didn’t really suit my purposes.

    I explored this issue pretty thoroughly and spent hours trying to solve it :(

  • source
  • parent
  • [+] 0 points 8 months ago* (last edited 7 months ago) (1 child)
  • [–] 1 point 8 months 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).

  • source
  • parent
  • load more comments (-1 replies)
    [–] 6 points 8 months ago (8 children)

    Can you run this headless, or do you need Wayland running?

  • source
  • hideshow 8 child comments
  • [–] 2 points 8 months ago (5 children)

    … 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.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 3 points 8 months 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.

  • source
  • parent
  • [–] 1 point 8 months ago (2 children)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 8 months ago (1 child)

    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).

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 8 months 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.

  • source
  • parent
  • 1 comment in c/linux@programming.dev view that post
    [–] 4 points 8 months ago

    moonlight/sunshine is really good, i heavily recommend it! You can also use it as a teamviewer alternative, but at the moment it requires some light fiddling to open ports etc. so its not really easy enough for "grandma downloads sunshine to get tech support from you" yet.

  • source