It is currently Thu Nov 26, 2020 9:46 am
All times are UTC + 8 hours

[Xvnc_Server(x11vnc)] without screen connected ... How-To

[Xvnc_Server(x11vnc)] without screen connected ... How-To

Postby father.mande » Sat Jul 25, 2020 8:58 pm

Hi,
====Target : solve problem x11vnc can't be use to manage Asportal App. when NAS was boot without a screen connected

==== Actual situation (F.Y.I.)
... when the NAS boot and NO screen is connected in HDMI ... x11vnc can't run as well ... so using Chrome or managing Kodi from remote is not directly possible (except if a specific inside tool exist)
here after the status of screen after a reboot without screen connected
Just after boot or reboot
Code: Select all
# xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
   ASUSTOR 4k resolution 30Hz  30.00
   ASUSTOR 4k resolution 60Hz  60.00

... if you connect a real screen and disconnect it ... a new VIRTUAL1 screen is available BUT lost in case of reboot

==== Solution proposed : ADD at Xorg start a VIRTUAL screen directly from base configuration AND using the VIRTUAL screen include in Intel graphic driver (so announced with a better support for acceleration, etc. etc.)
... To do this (TO BE DONE ONLY ONE TIME or to REDO AFTER UPDATE of Xorg) :
First add virtual screen (by adding device) permanently to Xorg using : /usr/local/AppCentral/xorg/usr/share/X11/xorg.conf.d/ folder (SO MUST BE REDO AT Xorg APKG update)
ex. add a file named : 20-intel.conf containing (this example add potentially 2 virtual screen max.) :
Code: Select all
Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
EndSection

... restart Xorg (or reboot)
... result is (after reboot without real screen ... in fact same result as connect / disconnect real screen ... but without the need to do it :mrgreen: )
Add new Virtual definition after reboot (best) or reload of Xorg ... using /usr/local/AppCentral/xorg/CONTROL/start-stop.sh reload
Code: Select all
# xrandr
Screen 0: minimum 8 x 8, current 1024 x 768, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
   ASUSTOR 4k resolution 30Hz  30.00
   ASUSTOR 4k resolution 60Hz  60.00
VIRTUAL1 disconnected (normal left inverted right x axis y axis)


... NOW it's time to add a mode (resolution and frequency) and connect the Virtual screen for using it with x11vnc (Xvnc_server)
... creating a shell script is the best to redo easily this when necessary

... 1 generate a modeline (screen definition mode) Asustor provide cvt tool build to do it.
generate a Modeline for 1920x1080 screen resolution for VIRTUAL1 using cvt tool
Code: Select all
# cvt 1920 1080
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync


... 2 Attach VIRTUAL1 at default output for X :0 ; define new mode using cvt result, attach new mode to VIRTUAL1
Code: Select all
xrandr -d :0 --output VIRTUAL1 --primary --auto
xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VIRTUAL1 "1920x1080_60.00"


... 3 Now result is :
Code: Select all
xrandr
Screen 0: minimum 8 x 8, current 8 x 8, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
   ASUSTOR 4k resolution 30Hz  30.00
   ASUSTOR 4k resolution 60Hz  60.00
VIRTUAL1 connected primary (normal left inverted right x axis y axis)
   1920x1080_60.00  59.96
VIRTUAL2 disconnected (normal left inverted right x axis y axis)


... BUT the "current" resolution is always low : current 8 x 8 ... so now adjust value to 1920x1080 resolution :
Code: Select all
xrandr --fb 1920x1080 -display :0


NOW the screen is available to be used by Vnc ... as a 1920x1080 screen managed by Intel I.G.P. (not dummy)
Code: Select all
xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
   ASUSTOR 4k resolution 30Hz  30.00
   ASUSTOR 4k resolution 60Hz  60.00
VIRTUAL1 connected primary (normal left inverted right x axis y axis)
   1920x1080_60.00  59.96
VIRTUAL2 disconnected (normal left inverted right x axis y axis)


A GOOD idea at this time is to restart asportal to avoid any screen tears or black square
Code: Select all
/usr/local/AppCentral/asportal/CONTROL/start-stop.sh reload


==== Technical aspect :
How to used Xorg command in A.D.M. easily (ex. cvt / xrandr / xdotool / etc.)
1 ... create in safe place the small shell script here after :
named : x_command
Code: Select all
#!/bin/sh
source /usr/local/AppCentral/xorg/CONTROL/env.sh
$(basename $0) $@

2 create link to x_command using the name of the command you want to use :
Code: Select all
ln -s /path/to/x_command cvt
ln -s /path/to/x_command xrandrd
ln -s /path/to/x_command setxkeymap
ln -s /path/to/x_command edid-decode
ln -s /path/to/x_command  xdotool
ln -s /path/to/x_command ..... etc.

.... it's just example ... search in xorg the command available and ... add it if need ... for this How-To only cvt and xrandr are useful


If I get some free time, I will be create a patch to do this automatically ... just be patient.

Philippe.
AS5202T /AS5002T / AS202TE / AS1002T
My Blog specific to my APKG : https://blog.father-mande.ovh/
User avatar
father.mande
 
Posts: 1047
Joined: Sat Sep 12, 2015 2:55 am

Return to Xnc-Server

  • You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot post attachments in this forum
  • Who is online

    Users browsing this forum: No registered users and 1 guest