Jump to content

Is your Firefox-derived browser unusable over Microsoft's Remote Desktop? Try this.


Recommended Posts

With the Covid-19 pandemic still smoldering, and occasionally flaring up, many of you may be working from home, and using Microsoft's Remote Desktop or something similar to access your work PC. I've been doing that for a year and a half now, although since getting vaccinated I do occasionally go to the office.

One major nuisance I kept running into was that, when using any Firefox-derived browser (I generally use @roytam1's Serpent but they were all affected), certain Web sites would freeze Remote Desktop up. The only thing I could do was click to hide the browser window, disconnect, reconnect, and hope that it wouldn't lock back up again as soon as I brought the window back. A very frustrating way to work, and forcing me back to the office more than I'd like.

The other day I found a solution. I was in the office, and experimenting with the setting layout.frame_rate in the about:config page. It had somehow gotten set to 240 on my Serpent browser, I think as a result of the "UOC Patch". I reduced that to 60, my monitor's actual refresh rate, and got a noticeable performance improvement at work (where I was not running Remote Desktop, of course). But once back home, I still had problems with Remote Desktop. Apparently too high a setting overloads the Internet connection, causing the desktop to slow down or even stop for long periods. And Remote Desktop has no way to "dump the queue" other than disconnecting and reconnecting.

So I decided to try reducing it further. When I went down to about 12, my Remote Desktop problems went away! Animations started looking pretty jerky, though, so I did some more experimentation: in my case, 20 was still too high, but 15 was just right, giving animations that didn't look too jerky without Remote Desktop freezing up.

I'm guessing the ideal setting depends on many factors, with the speed of your Internet connection probably being the most important. So if you're in the same situation, you'll need to experiment to find the best setting of layout.frame_rate for your environment.

  • Like 2
Link to comment
Share on other sites


22 hours ago, UCyborg said:

-1 = runs at default 60 FPS.

Are you sure it is a hardcoded 60FPS?

Not some arbitrary value like "as fast as possible", or "same as current monitor refresh rate"?

I tried toggling the layers.acceleration.draw-fps setting, but the values shown don't make sense to me. It's usually between "001 001 000" and "007 007 000" on my PC. And in the Android version of FireFox it doesn't show anything.

Any other way to measure the browser FPS?

Link to comment
Share on other sites

2 hours ago, RainyShadow said:

Are you sure it is a hardcoded 60FPS?

Should be.

/gfx/thebes/gfxPrefs.h

DECL_GFX_PREF(Once, "layout.frame_rate", LayoutFrameRate, int32_t, -1);

/gfx/thebes/gfxPlatform.cpp

/***
 * The preference "layout.frame_rate" has 3 meanings depending on the value:
 *
 * -1 = Auto (default), use hardware vsync or software vsync @ 60 hz if hw vsync fails.
 *  0 = ASAP mode - used during talos testing.
 *  X = Software vsync at a rate of X times per second.
 */
already_AddRefed<mozilla::gfx::VsyncSource>
gfxPlatform::CreateHardwareVsyncSource()
{
  RefPtr<mozilla::gfx::VsyncSource> softwareVsync = new SoftwareVsyncSource();
  return softwareVsync.forget();
}

/* static */ bool
gfxPlatform::IsInLayoutAsapMode()
{
  // There are 2 modes of ASAP mode.
  // 1 is that the refresh driver and compositor are in lock step
  // the second is that the compositor goes ASAP and the refresh driver
  // goes at whatever the configurated rate is. This only checks the version
  // talos uses, which is the refresh driver and compositor are in lockstep.
  return gfxPrefs::LayoutFrameRate() == 0;
}

/* static */ bool
gfxPlatform::ForceSoftwareVsync()
{
  return gfxPrefs::LayoutFrameRate() > 0;
}

/* static */ int
gfxPlatform::GetSoftwareVsyncRate()
{
  int preferenceRate = gfxPrefs::LayoutFrameRate();
  if (preferenceRate <= 0) {
    return gfxPlatform::GetDefaultFrameRate();
  }
  return preferenceRate;
}

/* static */ int
gfxPlatform::GetDefaultFrameRate()
{
  return 60;
}

The comments hint at existence of hardware vsync, but I didn't find it.

2 hours ago, RainyShadow said:

I tried toggling the layers.acceleration.draw-fps setting, but the values shown don't make sense to me. It's usually between "001 001 000" and "007 007 000" on my PC.

Should go up with dynamic content or if you test with autoscrolling; make sure it's enabled, then activate it with middle click on a page long enough to scroll for a bit that way. The first number is the current frame rate, the others...I'd have to go dig inside the code.

The number is only relevant for as long as something is going on since it doesn't refresh constantly like a game.

2 hours ago, RainyShadow said:

Any other way to measure the browser FPS?

If hardware acceleration works, theoretically any software that measures frame rate in games could pick it up. I seem to remember seeing DxTory's frame counter in normal desktop applications.

It's been a while since I've used it, back then it did work on XP. It's paid software, but if I remember correctly, there weren't restrictions when used just as a frame counter.

Older version of RivaTuner Statistic Server might be more suitable for this task alone.

Edited by UCyborg
Added answer regarding alternative FPS measuring methods
  • Upvote 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...