Announcement

Collapse
No announcement yet.

Stadia on linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stadia on linux

    Since there is now a free version of stadia I tried it on linux but there is some serious issues on linux. I got very hi latency and stutter.

    After some debugging it looks like multithreading in chrome on linux is broken.

    To easily see the problem first fill up the cpu's with low priority work since this makes the issue really obvious. then play a game in stadia.

    ex:

    nice -n20 md5sum /dev/zero &

    start one for every cpu in the system. nproc will show how many is needed. run top to see that there is no idle time and that most of the cpu is in nice mode.


    The low priority tasks should not have any impact but they do. stadia is now unusable on my computer. What is the real problem?? I'm not sure but a strace shows chrome is using sched_yield() systemcall and that is probably not a good idea but it looks like it's not called frequently enough to be the only issue.


  • #2
    https://www.technovelty.org/c/sched_...d-harmful.html So not a new problem this is 2005.

    In a well written program you should see zero calls to sched_yield as that is telling the scheduler its fine to go off and run background low priority processes because I wish to be put at the back of the scheduler que.

    Basically it does not take a lot of sched_yields to start a stack of other processes you don't want. A sleeping mutex in most cases is better option.

    Lot of cases you are better to run out your timeslice than you are to use a sched_yield. Remember sched_yield you are telling the scheduler to put me to end of que I am not busy run something else if you can that includes all the low priority work that is going to consume full time slices.

    Temp workaround around this can be using cpuset to lock badly coded application ie chrome to particular cores by itself so it does not have any low priority applications to be put behind. Nice with Linux only kind of works cgroup/namespace priorities are stronger.

    Comment


    • #3
      What about stadia? Is it playable?

      Comment


      • #4
        Its playable in chrome under windows 10 and better than I thought it was going to be. But still even in windows you can feel the delay. But there is obviously many games where the extra delay is not that important. But I will most likely terminate the account when the free time is up. If you can afford a gaming PC stadia just do not make much sense.

        Comment


        • #5
          Originally posted by kenjo View Post
          Its playable in chrome under windows 10 and better than I thought it was going to be. But still even in windows you can feel the delay. But there is obviously many games where the extra delay is not that important. But I will most likely terminate the account when the free time is up. If you can afford a gaming PC stadia just do not make much sense.
          I think that you are right, it also seems to me that at the moment there is simply no sense in this. I think such a thing will be relevant only in about 3-4 years, when the components on the gaming PC will be unrealistically expensive.

          Comment


          • #6
            Kenjo, have you by chance tried Stadia with Chromium-vaapi and the Stadia+ extension?

            I use these arguments for my Chromium w/ VAAPI:

            --ignore-gpu-blacklist
            --enable-gpu-rasterization
            --enable-oop-rasterization
            --enable-native-gpu-memory-buffers
            --disable-frame-rate-limit
            --disable-gpu-vsync
            --enable-zero-copy

            Some people say Stadia works better when hardware video decoding is used.

            Furthermore, at least one person reported improved Stadia smoothness by setting the CPU governor to performance:
            Code:
            sudo cpupower frequency-set -g performance
            Last edited by Xaero_Vincent; 08 May 2020, 08:50 PM.

            Comment


            • #7
              Originally posted by Xaero_Vincent View Post
              Kenjo, have you by chance tried Stadia with Chromium-vaapi and the Stadia+ extension?
              No I had not and now I did but the chromium browser is now some snap package and I did not get vaapi to work.

              A few years ago I did a test video https://www.youtube.com/watch?v=ynvJmyaazs4 that easily show if the player drops frames. that was 2016 and I have still not found a single linux system that do not drop frames.

              the video is very simple its just alternating red and green screens. This should play as a yellow/orange video. its going to look a bit flickery but it should look the same all the time, and even a single dropout is going to be very easy to see.

              I used to play perfectly on the chromecast device but google has messed up that and now only my phone and the youtube player on playstation 4 is displaying without dropped frames.

              I guess until the chrome browser shows this OK there is no way in hell that stadia is going to work ok.

              Comment


              • #8
                And if you want a file you can test in any video player google for kenjo_vidtest_60fps.mp4 I had it in my dropbox that I no longer use but it looks like someone copied it. with that you can see that its not only chrome browser that has issues. if I play it in vlc and at the same time move some window around there is dropped frames all over.

                Comment


                • #9
                  Originally posted by kenjo View Post

                  No I had not and now I did but the chromium browser is now some snap package and I did not get vaapi to work.

                  A few years ago I did a test video https://www.youtube.com/watch?v=ynvJmyaazs4 that easily show if the player drops frames. that was 2016 and I have still not found a single linux system that do not drop frames.

                  the video is very simple its just alternating red and green screens. This should play as a yellow/orange video. its going to look a bit flickery but it should look the same all the time, and even a single dropout is going to be very easy to see.

                  I used to play perfectly on the chromecast device but google has messed up that and now only my phone and the youtube player on playstation 4 is displaying without dropped frames.

                  I guess until the chrome browser shows this OK there is no way in hell that stadia is going to work ok.
                  You need a patched version of Chromium to support VAAPI. You need to add the PPA and enable it with the proper chromium flags. I suggest trying mine as posted above. The --disable-gpu-vsync flags further help reduce the input lag to virtually unnoticeable when using the VAAPI version.

                  https://www.linuxuprising.com/2018/0...celerated.html

                  Also try the performance CPU governor mode like I mentioned above.

                  I was able to get that 60 FPS youtube video to play without frame drops (according to Stats for Nerds) if I don't try to multitask a bunch but that doesn't prove very much in regards to Stadia experience. Stadia works fine for me as well, even without GPU video decode enabled, it just has more noticeable input lag without it.

                  Comment


                  • #10
                    Originally posted by Xaero_Vincent View Post
                    I was able to get that 60 FPS youtube video to play without frame drops (according to Stats for Nerds) .
                    No that does not work. stat for nerds do not show the issue. you have to look at the video. I made a slowmo recording of how it looks for me. Note how the stats is not showing any dropped frames (well it has it constantly at the same value). Probably the software thinks it is showing every frame and maybe it is but if that is the case the frame rate is way off as my monitor is 60Hz and the video is 60Hz the frames should be alternating red/green every frame flip and this video shows that there is very uneven displaytimes for frames.

                    https://youtu.be/dsNlEcs8ghE this is very wrong. it usually is not this bad. I probably should make one of the ps4 also just to show how it should look like in slowmo.

                    edit: i added a video from the ps4 also https://youtu.be/dsNlEcs8ghE if you single step the video. first "spacebar" to stop video then "." to step frame you see that the ps4 display the red/green equal time as it should, this is not happening for me under linux.
                    Last edited by kenjo; 08 May 2020, 09:52 PM.

                    Comment

                    Working...
                    X