You are not logged in.

#1 2015-04-12 21:57:37

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

HDMI 2nd monitor on laptop

I have an external HDMI monitor connected fto my laptop.  I have had to turn it off and on at boot to get the screen to start.  I found this script on the Xrandr-wiki page; Example 3a, and It works brilliant to start my monitor at boot.  The issue I am having is that when screen blanks after the set 15 min interval the HDMI stays off (does GDM control this feature?).  I Imagine suspend will yeald the same results.
Is there some place I should point the the Example 3a script to have it restart my HDMI monitor after screen blank, and suspend.
Your help is apreciated.

Last edited by jo-shva (2015-04-12 21:59:07)


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#2 2015-04-13 03:02:18

TheNineBaller
Member
Registered: 2014-12-03
Posts: 18

Re: HDMI 2nd monitor on laptop

Could you post the script in question? Perhaps that could help us solve your particular problem.

Offline

#3 2015-04-13 13:12:57

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: HDMI 2nd monitor on laptop

Certanly.

#!/bin/bash

XRANDR="xrandr"
CMD="${XRANDR}"
declare -A VOUTS
eval VOUTS=$(${XRANDR}|awk 'BEGIN {printf("(")} /^\S.*connected/{printf("[%s]=%s ", $1, $2)} END{printf(")")}')
declare -A POS
#XPOS=0
#YPOS=0
#POS="${XPOS}x${YPOS}"

POS=([X]=0 [Y]=0)

find_mode() {
  echo $(${XRANDR} |grep ${1} -A1|awk '{FS="[ x]"} /^\s/{printf("WIDTH=%s\nHEIGHT=%s", $4,$5)}')
}

xrandr_params_for() {
  if [ "${2}" == 'connected' ]
  then
    eval $(find_mode ${1})  #sets ${WIDTH} and ${HEIGHT}
    MODE="${WIDTH}x${HEIGHT}"
    CMD="${CMD} --output ${1} --mode ${MODE} --pos ${POS[X]}x${POS[Y]}"
    POS[X]=$((${POS[X]}+${WIDTH}))
    return 0
  else
    CMD="${CMD} --output ${1} --off"
    return 1
  fi
}

for VOUT in ${!VOUTS[*]}
do
  xrandr_params_for ${VOUT} ${VOUTS[${VOUT}]}
done
set -x
${CMD}
set +x

and It is started here:

~/.xprofile
srandrd ~/.13/detect_displays.sh

Also, it only starts the HDMI monitor sometimes, its hit and miss.

Last edited by jo-shva (2015-04-13 14:09:01)


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#4 2015-04-14 20:33:12

TheNineBaller
Member
Registered: 2014-12-03
Posts: 18

Re: HDMI 2nd monitor on laptop

If it is only starting the HDMI monitor sometimes you should probably go through the script and tweak it to your personal setup.

I don't know if you can set scripts to run after screen blank but if you place your script in /etc/pm/sleep.d/ then it will be run when you resume from a suspend.

Hope that helps.

Offline

#5 2015-04-14 22:29:49

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: HDMI 2nd monitor on laptop

Thanks for the response.  Im not really that good with bash, css is my thing.  I'm not sure what might give it better direction to the monitor.
I dont have a   /etc/pm/sleep.d/  folder.  I use Gnome and set suspend within the control cneter.  Im not sure whre that file/folder would be.


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#6 2015-04-15 12:19:36

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: HDMI 2nd monitor on laptop

I installed pm-utils and placedd the script where you suggested.  It doesn't work unfortunatly.  What my HDMI does is flash on for 8s saying 'not connected to any devices' during this time the script will never start the monitor, it has to wait for it to go back to sleep for 8s.  Its a pain!  so I added 'sleep 5' etc to the startup script.  Its seems that Pm-Utils turns on the main monitor to fast and doesn't run or cant run the script.
Any ideas?


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#7 2015-04-16 03:22:15

TheNineBaller
Member
Registered: 2014-12-03
Posts: 18

Re: HDMI 2nd monitor on laptop

I myself have similar problems with the timing of my xrandr scripts, although my problem is significantly less problematic.

Although as far as I understand the script shouldn't be capable of turning your monitor on. It should only be capable of enabling it.

Although if you truly think it is an issue of timing you might wish to set your sleep interval to something higher than 5.

Offline

#8 2015-04-17 17:20:21

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: HDMI 2nd monitor on laptop

Im sorry I had meant enabling the monitor.
I decided to try and write an xorg.conf to see if that would help.  I am terrible working with the xorg stuff.  Would you  mind taking a look at what I have and let me know if anthing is missing or incorrectlly configured.  Maybe this will help with the unrully monitor.

Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/misc/"
	FontPath     "/usr/share/fonts/TTF/"
	FontPath     "/usr/share/fonts/OTF/"
	FontPath     "/usr/share/fonts/Type1/"
	FontPath     "/usr/share/fonts/100dpi/"
	FontPath     "/usr/share/fonts/75dpi/"
EndSection

Section "Module"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "eDPM1"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
	Option	     "PreferredMode" "1920x1080"
	Option      "Primary" "true"
EndSection

Section "Monitor"
	Identifier   "HDMI1"
	Option	     "PreferredMode" "1920x1080"
	Option      "RightOf" "eDPM1"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "NoAccel"            	# [<bool>]
        Option     "AccelMethod"        	"sna"
        #Option     "Backlight"          	# <str>
        #Option     "DRI"                	# <str>
        #Option     "Present"            	# [<bool>]
        #Option     "ColorKey"           	# <i>
        #Option     "VideoKey"           	# <i>
        #Option     "Tiling"             	# [<bool>]
        #Option     "LinearFramebuffer"  	# [<bool>]
        #Option     "VSync"              	# [<bool>]
        #Option     "PageFlip"           	# [<bool>]
        #Option     "SwapbuffersWait"    	# [<bool>]
        #Option     "TripleBuffer"       	# [<bool>]
        #Option     "XvPreferOverlay"    	# [<bool>]
        #Option     "HotPlug"            	# [<bool>]
        #Option     "ReprobeOutputs"     	# [<bool>]
        #Option     "DeleteUnusedDP12Displays" 	# [<bool>]
        #Option     "XvMC"               	# [<bool>]
        #Option     "ZaphodHeads"        	# <str>
        #Option     "VirtualHeads"       	# <i>
        #Option     "TearFree"           	# [<bool>]
        #Option     "PerCrtcPixmaps"     	# [<bool>]
        #Option     "FallbackDebug"      	# [<bool>]
        #Option     "DebugFlushBatches"  	# [<bool>]
        #Option     "DebugFlushCaches"   	# [<bool>]
        #Option     "DebugWait"          	# [<bool>]
        #Option     "BufferCache"        	# [<bool>]
	Identifier  "Card0"
	Driver      "intel"
	BusID       "PCI:0:2:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Thanks


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#9 2015-04-26 05:07:42

TheNineBaller
Member
Registered: 2014-12-03
Posts: 18

Re: HDMI 2nd monitor on laptop

I finally got a chance to look at your xorg configuration.

I highly doubt that this is the problem, however seeing as I have no problems with this I will post the sections of my configuration that differ.

Section "Monitor"
    Identifier   "Monitor0"
    VendorName   "Monitor Vendor"
    ModelName    "Monitor Model"
EndSection

Section "Device"
    Identifier  "Card0"
    Driver      "intel"
        Option  "TearFree"  "true"
    BusID       "PCI:0:2:0"
    Option      "monitor-eDP1" "Main"
    Option      "monitor-HDMI1" "Secondary"
EndSection

Section "Monitor"
    Identifier  "Main"
    Option      "PreferredMode" "1366x768"
    Option      "Position"  "0 0"
    Option      "Primary"   "true"
EndSection

Section "Monitor"
    Identifier  "Secondary"
    Option      "PreferredMode" "1920x1080"
    Option      "RightOf"   "Main"
    Option      "Primary"   "false"
EndSection

Section "Screen"
    Identifier  "Screen"
    Device      "IntelHD"
    Monitor     "Monitor0"
    DefaultDepth    24
    Option      "PreferredMode" "1366x768"
    Option      "Position" "0 0"
EndSection

A temporary rather hacky solution may be to set the BlankTime value higher in the ServerLayout section of your xorg.conf.

Other than that the problem would probably reside within the way your enabling the monitor with the script. If you need help with xrandr I found a helpful tutorial here http://x.debian.net/howto/use-xrandr.html.

Last edited by TheNineBaller (2015-04-26 05:13:26)

Offline

Board footer

Powered by FluxBB