[mythtv-users] mythfrontend performance over x11vnc

Ram Ramesh rramesh2400 at gmail.com
Thu Mar 17 16:10:35 UTC 2022


On 3/16/22 22:06, Stephen Worthington wrote:
> On Wed, 16 Mar 2022 18:34:53 -0500, you wrote:
>
>> On 3/16/22 16:38, Dave Ulrick wrote:
>>> I have two Intel NUC boxes that I use to run mythfrontend under Fedora
>>> 34. I like to do most administration remotely using x11vnc. (That way
>>> I can use an ergonomic keyboard and sit in front of a monitor that's
>>> within good viewing distance...much more comfortable than using a
>>> wireless keyboard while trying to look at a distant TV.)
>>>
>>> Sometimes remote control is nearly as fast as it would be to control
>>> the box locally--the OpenGL fade effects look pretty good and
>>> recording playback is very close to optimal--but other times it's
>>> extremely slow: > 1 second delay for response to any keystroke. Once
>>> the slow behavior kicks in, it persists from one x11vnc session to
>>> another until mythfrontend is restarted or the box's monitor (TV) is
>>> turned on.
>>>
>>> Note that the x11vnc slowness occurs even if I implement the solutions
>>> recommended for slowness issues: set -noxdamage, disable desktop
>>> compositing, disable vblank, etc..
>>>
>>> Just now I figured out how this issue occurs:
>>>
>>> 1. The remote PC's monitor is turned off.
>>> 2. The screensaver on the remote PC has blanked the screen.
>>> 3. x11vnc is invoked.
>>> 4. The VNC viewer connects and shows a blank screen.
>>> 5. Pressing a key brings the screen to life but from then on
>>> mythfrontend is very slow via x11vnc.
>>>
>>> My guess as to what's going on is that when the PC turns off the
>>> monitor, the X server loses sync so x11vnc falls back on a
>>> timeout-driven refresh scheme.
>>>
>>> I have come up with a simple solution.
>>>
>>> In my use case, I only have a monitor--that is, an HDTV switched to an
>>> HDMI input--turned on when I'm watching MythTV content. Otherwise, the
>>> monitor is turned off. Therefore, there's no need to run a screen
>>> saver. I didn't find a quick way to stop the screensaver
>>> (xfce4-screensaver) from running so I just went ahead and removed it
>>> from the boxes (dnf remove xfce4-screensaver).
>>>
>>> Since removing the screensaver, the screen hasn't blanked so
>>> mythfrontend has retained fast performance over VNC.
>>>
>>> Hope this helps someone out...
>>>
>>> Dave
> @Dave
>
> I have recently come across a more extreme version of your problem - I
> was using a cheap HDMI KVM switch that just turns off the keyboard,
> video and mouse connections to PCs that are not currently selected as
> the active PC.  I found that a VNC connection to x11vnc on a PC that
> was disconnected like that would not refresh at all - I just got a
> blank screen.  I have just received a much more expensive HDMI KVM
> switch that provides an emulated keyboard, video and mouse connection
> to all PCs connected to it at all times, and that fixes the problem.
>
>> Interesting. Without knowing this dependency, I have screensaver
>> uninstalled because the only monitor is TV and it is off in my case when
>> I am not actively using it. However, my x11vnc is always slow from one
>> machine and always reasonable from another machine (connected to two
>> different TVs)
>>
>> I noticed that when I boot without turning on TV, my X is 640x480. I
>> have to do xrandr --fb 1920x1080 to get it big or turn on the TV. When
>> this happens I have seen slowness also. So best to turn on TV, remove
>> screensaver and boot the PC.
>>
>> Regards
>> Ramesh
> @Ramesh
>
> When you boot without a monitor/TV, X is unable to get the EDID data
> from the monitor and so will boot up using whatever defaults it uses.
> For a lot of monitors and TVs, there is a big difference between
> standby and off.  If it is in standby (still has power from the
> mains), a monitor/TV will often respond to EDID requests.  And my old
> Sony 1080p TV actually responds to EDID requests even when it is
> unplugged from the mains - it must be getting enough power from its
> HDMI cable to be able to do that.  It only does not respond if the
> HDMI cable is unplugged.
>
> With the Nvidia drivers, it is possible to tell X to read a file where
> the EDID data has been stored and use that instead of reading the real
> EDID data.  That is very useful when your monitor/TV has bad EDID data
> that does not correctly map to its actual capabilities - you can read
> the real EDID data to a file and edit it, and then get the Nvidia
> drivers to read your edited EDID data.  That is usually a much easier
> alternative than telling the Nvidia drivers to ignore the EDID data
> and creating modelines for all the modes your monitor/TV has.  Bad
> EDID data is not at all uncommon.
>
> There is also an ability to tell the kernel on its command line to
> read an EDID file and provide that data when asked.  This is really
> useful on headless server PCs (and presumably on headless mythbackend
> PCs to allow mythtv-setup to be run), but I have not actually tried it
> out.
>
> Headless systems often use an EDID emulator plugged on to the HDMI
> port of the PC.  That is programmed to respond with appropriate EDID
> data and allows a headless system to easily be set up so that VNC
> works.
>
> My new HDMI KVM switch, like my old VGA KVM switch (and unlike my
> cheap HDMI KVM switch) provides EDID passthrough/emulation, where it
> takes a copy of the EDID data from the monitor every time it is read
> by a PC, and stores that data.  When a PC not actually connected to
> the monitor requests the EDID data, the KVM switch provides a copy of
> the stored data.  You can also buy passthrough EDID emulators that
> plug onto the HDMI cable and do the same job for a single HDMI
> connection.  However, there are apparently quite a few out there that
> do not work very well, so you need to choose a good one.
>
> On Ubuntu, to read the EDID data from a monitor/TV, try installing the
> read-edid package and using a command like this:
>
> get-edid >edid.dat
>
> If it works, it was able to find your monitor/TV and read its EDID
> data.  If it does not work, then that will mean that X is also unable
> to read the EDID data and if it needs to do that, it will revert to a
> default screen mode.
>
> It is also possible to just create a full set of modelines for your
> monitor/TV and tell X to ignore the EDID data.  Then it does not
> matter if the monitor/TV is connected or not at boot time.  I would
> hope that it would also mean that VNC would work properly at all
> times, but I have not tried that.  But creating the correct modelines
> is a *lot* of hard work.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
Thanks for the details. I came across this when I was actively trying to 
fix it, but later realized that it is fixed very simply by xrandr call. 
So, I left it at that. One of these days, I will use your guide to fix 
this properly so that the bootup is proper.

My TV is too old/bad to provide EDID when in standby. My newer LG does 
that fine and the PC connected to it always gets it right.

Regards
Ramesh



More information about the mythtv-users mailing list