카테고리

asm (27) bootloader_x86_grub (1) C (92) compile (11) config (76) CPP (13) CSS (1) debugging (7) gimp (1) Go (1) html (1) Java (1) JavaScript (1) kernel (19) LibreOffice (3) Linux system progamming (21) MFC (1) opencv (4) OpenGL (1) PHP (1) Python (4) qemu (29) shell (3) socket (7) troubleshooting (2) ubuntu18.04 (2) windows (1)

2018/12/20

해상도 VESA 규격 (cvt, gtf, dp등등) 제어 정리.

1. 터미널 열기
Ctrl + Alt + T

2. 현재 모니터 및 해상도 상태 확인
shell> xrandr
Screen 0: minimum 320 x 200, current 4096 x 2160, maximum 8192 x 8192
eDP-1 connected (normal left inverted right x axis y axis)
   1920x1080     60.01 +  59.97    59.96    59.93 
   1680x1050     59.95    59.88 
   1600x1024     60.17 
   1400x1050     59.98 
   1600x900      59.99    59.94    59.95    59.82 

2.1 모니터 확인
xrandr --verbose | perl -ne '
if ((/EDID(_DATA)?:/.../:/) && !/:/) {
  s/^\s+//;
  chomp;
  $hex .= $_;
} elsif ($hex) {
  # apt install read-edid package installed
  # grep search
  open FH, "|parse-edid";
  print FH pack("H*", $hex);
  $hex = "";
}'

2.1 드라이버 지원 모드 확인
최신 제공하는 커널과 그랙픽 관련은 항상 충돌이 있음 Nvida 같은 경우 문제가 존제.
cuda nvida 설치 방법으로 해도 문제가 발생.

최신 드라이버 보다나는 칩세과 맞는 드라이버 설치.
sudo apt-cache search nvidia | grep driver

설정이 끝나면 커널 재 빌드한다.
sudo update-initramfs -u

2.2 해상도 확인
3. VESA CVT 해상도 확인
3.1 VESA 정의
VESA (Video Electronics Standards Association)은 컴퓨터 디스플레이 규격 협회, 1988년 NEC에 의해 만들어 졌다. 현재 회원사는 225개.

최초의 규격 Super VGA, 이 후 VESA Local Bus, GTF, CVT, DP, EDID 등을 만듬. 현재 DP 포트는 HDMI와 경쟁.
VESA에서 만든 규격 중 성공한 것도 있지만 Plug & Display와 Digital Flat Pane과 같은 모니터 커넥터 규격은 DVI에 밀려 실패.

평면 벽걸이형 TV 장치 규격은 VESA에서 만든 VESA Mounting Interface Standard이다.

3.2 GTF 유틸
Generalized Timing Formula : 일반화 된 타이밍 공식
아날로그 VGA 디스플레이 인터페이스 의 컴포넌트 비디오 신호 의 정확한 파라미터를 정의 하는 VESA 의 표준
VGA(640 × 480), UXGA(1600 x 1200) 또는 HD720 (1280X720)과 같은 대부분의 비디오 해상도 규격

XFree86 Modeline
Flags (optional): +HSync, -HSync, +VSync, -VSync, Interlace, DoubleScan, CSync, +CSync, -CSync

Modeline "1600x1200" 155   1600 1656 1776 2048   1200 1202 1205 1263
#           (Label) (clk)     (x-resolution)        (y-resolution)
#                     |
#              (pixel clock in MHz)

shell> gtf 1024 768 60 -x

shell> gtf 1920 1080 60 -x

디바이스가 제공하는 값으로만 계산 함.

3.3 CVT 유틸
Coordinated Video Timing modes : 조정 된 비디오 타이밍 모드
아날로그 VGA 디스플레이 인터페이스 의 컴포넌트 비디오 신호 의 정확한 파라미터를 정의 하는 VESA 의 표준
VGA(640 × 480), UXGA(1600 x 1200) 또는 HD720 (1280X720)과 같은 대부분의 비디오 해상도 규격

shell> cvt 1600 900

사용자가 제정의 할 수 있음.

3.4 DP
Display Port
8채널 24비트/196khz Linear PCM 음성신호와 영상을 동시에 전송

3.4.1 소프트웨어 기반 모니터 포트 지정 방법.
a) 패키지 설치
shell> sudo apt install i2c-tools ddccontrol
shell> sudo apt install ddccontrol ddccontrol-db gddccontrol

b) 소스 기반 설치
shell> sudo apt install intltool
shell> git clone https://github.com/ddccontrol/ddccontrol-db.git
shell> cd ddccontrol-db
shell> ./autogen.sh
shell> ./configure --prefix=/usr/
shell> make

모듈 등록 확인
shell> cat /etc/modules-load.d/ddccontrol-i2c-dev.conf
# Load i2c-dev at boot to probe DDC/CI devices (displays)
i2c-dev

3.4.2 현재 사용중 모니터 확인
GUI
shell> sudo gddccontrol

CLI 기반
shell> sudo ddccontrol -p

Detected monitors :
 - Device: dev:/dev/i2c-5
   DDC/CI supported: No ---> 현재 LG 노트북
   Monitor Name: VESA standard monitor
   Input type: Digital
 - Device: dev:/dev/i2c-2 ---> 현재 사용중인 모니터
   DDC/CI supported: Yes
   Monitor Name: VESA standard monitor
   Input type: Digital
  (Automatically selected)
Reading EDID and initializing DDC/CI at bus dev:/dev/i2c-2...
I/O warning : failed to load external entity "/usr/share/ddccontrol-db/monitor/CND3200.xml" -> 아직 지원하지 않음.
Document not parsed successfully.
I/O warning : failed to load external entity "/usr/share/ddccontrol-db/monitor/CNDlcd.xml" -> 아직 지원하지 않음
Document not parsed successfully.

EDID readings:
Plug and Play ID: CND3200 [VESA standard monitor]
Input type: Digital
=============================== WARNING ===============================
There is no support for your monitor in the database, but ddccontrol is
using a basic generic profile. Many controls will not be supported, and
some controls may not work as expected.
Please update ddccontrol-db, or, if you are already using the latest
version, please send the output of the following command to
ddccontrol-users@lists.sourceforge.net:

LANG= LC_ALL= ddccontrol -p -c -d

Thank you.
=============================== WARNING ===============================

이 경고문은 ddccontrol 명령어에서 비표준 명령 및 값에 대한 설명을 인식하지 못해서이다.

여기서 참고해야 할 내용은
 - Device: dev:/dev/i2c-2
참고한 내용이다.

4.4.3 명령어 나열
shell> sudo ddccontrol -d dev:/dev/i2c-2
Controls (valid/current/max) [Description - Value name]:
Control 0x02: +/2/255 C [Secondary Degauss]
Control 0x04: +/0/1 C [Restore Factory Defaults]
Control 0x05: +/0/1 C [Restore Brightness and Contrast]
Control 0x08: +/0/1 C [Restore Factory Default Color]
Control 0x0b: +/50/65535 C [???]
Control 0x0c: +/70/170 C [???]
Control 0x10: +/50/100 C [Brightness]
Control 0x12: +/50/100 C [Contrast]
Control 0x14: +/11/11 C [???]
Control 0x16: +/68/100 C [Red maximum level]
Control 0x18: +/70/100 C [Green maximum level]
Control 0x1a: +/73/100 C [Blue maximum level]
Control 0x52: +/0/255   [???]
Control 0x60: +/3/3 C [Input Source Select - Digital]
Control 0x62: +/23/100 C [Audio Speaker Volume Adjust]
Control 0x6c: +/50/100 C [Red minimum level]
Control 0x6e: +/50/100 C [Green minimum level]
Control 0x70: +/50/100 C [Blue minimum level]
Control 0x8d: +/2/2 C [???]
Control 0xac: +/54000/65280 C [???]
Control 0xae: +/2400/65535 C [???]
Control 0xb2: +/1/8   [???]
Control 0xb6: +/3/4 C [???]
Control 0xc0: +/25/65535 C [???]
Control 0xc6: +/111/65535 C [???]
ioctl(): 그런 장치 혹은 주소가 없음
ioctl returned -1
Control 0xc8: +/18/65535 C [???]
Control 0xc9: +/1056/65535 C [???]
Control 0xca: +/2/2 C [???]
Control 0xcc: +/14/255 C [???]
Control 0xd6: +/1/4 C [DPMS Control - On]
Control 0xdc: +/4/5 C [???]
Control 0xdf: +/513/65535 C [???]
Control 0xff: +/0/1 C [???]

경고 무시 하고, 제어값 확인.
하나만 설명
Control 0x10: +/50/100 C [Brightness]
최대 밝기

4.4.4 밝기 값 확인
shell> sudo ddccontrol -r 0x10 dev:/dev/i2c-2
Reading 0x10...
Control 0x10: +/50/100 C [Brightness]

4.4.5 밝기 조정
shell> ddccontrol -r 0x10 -w 25 dev:/dev/i2c-2

조정 입력 값은 16진수와 10진수 입력이 가능하다.

4.4.6 모니터 입력 변경.
이 기능을 사용 하기 위해서는 지원하는 모니터를 구입하는게 좋다.
지원하는 모티터를 확인하기 위해서는
/usr/share/ddccontrol-db/monitor/CNDlcd.xml 에서 확인 한다.

입력 소스 주소 확인.
shell> sudo ddccontrol -r 0x60 dev:/dev/i2c-2

EDID readings:
        Plug and Play ID: DELA0D7 [DELL P2217H (VGA)]
        Input type: Analog

Reading 0x60...
Control 0x60: +/257/4626 C [Input Source Select]

변경 예제.
Value 15: DP
Value 16: mDP
Value 17: HDMI (MHL) 1
Value 18: HDMI (MHL) 2

DP 포트 선택
ddccontrol -r 0x60 -w 15 dev:/dev/i2c-2

4.4.7 DB에 없는 경우.
shell> sudo ddccontrol -r 0x60 dev:/dev/i2c-2

Control 0x60: +/3/3 C [Input Source Select - Digital] ---> 현재 사용 중인 모니터 정보 없음.
+/3/3 : 앞의 숫자 3 현재 모니터와 연결 위치 ---> 현재 사용 중인 모니터 정보 없음
앞의 3 값이 나중 다시 돌아가는 위치가 된다.

사용하고 있는 모니터가 있다면 OSD 모니터 기능중 자동 선택 비 활성화.

모니터 다른 컴퓨터의 vga 오는 신호를 사용하도록 전환 방법.
첫 번째 컴퓨터 : hdml 사용
두 번째 컴퓨터 : DP 사용


hdmi 0: ddccontrol -r 0x60 -w 0 dev:/dev/i2c-2
hdmi 3: ddccontrol -r 0x60 -w 1 dev:/dev/i2c-2
hdmi 2: ddccontrol -r 0x60 -w 17 dev:/dev/i2c-2
hdmi 1: ddccontrol -r 0x60 -w 3 dev:/dev/i2c-2

xml 매개변수 확인
file:///usr/share/doc/ddccontrol/html/apes02.html


Xorg 로그 확인
shell> vi /var/log/Xorg.0
모니터 시리얼 넘버 확인.

제품명 확인.
shell> sudo dmidecode -s system-product-name
11T750-GT58K


4.4.7 키 바이딩
#!/bin/bash
# switch-monitor-source
# This script is used for switching input sources between hdmi/vga/displayport
# for my DELL P2217H monitor test.
# It uses i2c-bus-by-monitor-serial script as a dependency.
# For your usage, you should edit the following in this script: TARGET_SERIAL (optional, if you
# want use your s/n as default), cases for your PNP_IDs, VALUEs for your monitor (I have described
# how to explore them here: https://askubuntu.com/a/1010096/795775) and possibly add additional keys
# for switching using them (for example, -h2 for hdmi2, -v2 for vga2).

if [[ $1 == "--help" ]]; then
echo -e "\
Usage:
switch-monitor-source [-s <serial_number>] [-i <i2c bus number>] [-p <Plug and Play ID>] -r|-u|-h|-v|-d|
-s - set serial number of your monitor which you want to control.
-i - needed when several monitors with same s/n were found. Otherwise is sets automatically.
-p - explicitly set PNP_ID instead of extracting from edid. For development needs.
-r - read current value for 0x60 command
-u - update cached i2c-id number. You need do this after every (?) reboot and after every (?) monitor
     replugging.
-h|-v|-d - switch input source of monitor to hdmi/vga/displayport
--help - print this help
Example:
switch-monitor-source -s 0G2TG7360DXB -u # update file with i2c-id for monitor with specified s/n
switch-monitor-source -s 0G2TG7360DXB -v # switch that monitor to vga input
"
exit
fi


if [[ $1 == "-s" ]]; then
TARGET_SERIAL=$2 # use passed s/n
shift; shift
else
:
TARGET_SERIAL="0G2TG7360EMB" # default s/n. change to your monitor's serial number
fi

if [[ `lsmod | grep i2c_dev` == "" ]]; then
echo "Probing i2c-dev module..."
sudo modprobe i2c-dev # you can add it permanently by running "i2c-dev >> /etc/modules"
else : echo "i2c-dev module was already probbed"
fi

CACHED_ID_FILE="/tmp/$TARGET_SERIAL.i2c-id.txt"

if #[[ /dev/i2c-`cat $CACHED_ID_FILE` -nt $CACHED_ID_FILE || $1 == "-u" ]]; then # TODO automatically check if need to update cached id
[[ ${!#} == "-u" ]]; then
echo `i2c-bus-by-monitor-serial -s $TARGET_SERIAL | tail -n1` > $CACHED_ID_FILE
echo -e "$TARGET_SERIAL is now on bus i2c-" "`cat $CACHED_ID_FILE`\n$CACHED_ID_FILE has been updated"
exit 0
fi

I2C_ID="-1"
if [[ `grep "and" $CACHED_ID_FILE` != "" ]]; then
echo "Warning! There are several i2c ids with the same monitor serial number!"
if [[ $1 != "-i" ]]; then
echo "Use -i to specify i2c id manually! Choose from `cat $CACHED_ID_FILE`"
exit 1
else
I2C_ID=$2 # manually specified if there are several ids
shift; shift
fi
elif [[ ! -f $CACHED_ID_FILE || ! -s $CACHED_ID_FILE ]]; then
echo "$CACHED_ID_FILE does not exist or is empty. Use -u to update/create it."
else
I2C_ID=`cat $CACHED_ID_FILE` # we got univocal id
fi

if [[ ${!#} == "-r" ]]; then # show current value for 0x60 command
echo "Going to read 0x60"
sudo ddccontrol -r 0x60 dev:/dev/i2c-$I2C_ID | grep "0x60"
fi

PNP_ID=`sudo ddccontrol -c dev:/dev/i2c-$I2C_ID 2>/dev/null | grep "Plug and Play ID:" | cut -f5 -d" "`
echo "PNP_ID=$PNP_ID"
VALUE=""
if [[ $1 == "-p" ]]; then
PNP_ID=$2
shift; shift
# echo "PNP_ID=$PNP_ID"
fi

case $PNP_ID in
"DELA0D7") # Dell P2217H over vga transport
case ${!#} in
"-h") VALUE=273 ;; # Switch to HDMI source
"-v") VALUE=257 ;; # Switch to VGA source
"-d") VALUE=271 ;; # Switch to DisplayPort source
esac
;;
"DELA0D9") # Dell P2217H over hdmi transport
case ${!#} in
"-h") VALUE=4369 ;; # Switch to HDMI source
"-v") VALUE=4353 ;; # Switch to VGA source
"-d") VALUE=4367 ;; # Switch to DisplayPort source
#"") # TODO count arguments and if zero, then
#echo "You have not specified a switch action"
esac
;;
esac

if [[ $VALUE != "" ]]; then
echo "Writing $VALUE to 0x60"
sudo ddccontrol -r 0x60 -w $VALUE dev:/dev/i2c-$I2C_ID 1>/dev/null
fi

# TODO maybe reprogramm on C language for more performance? This script takes about 3,1 seconds to switch input source,

텍스트
switch-monitor-source -s 0G2TG7360DXB -u # get and cache i2c-id number for monitor with specified s/n
switch-monitor-source -s 0G2TG7360DXB -v # switch that monitor to vga input
switch-monitor-source -s 0G2TG7360DXB -h # switch that monitor to hdmi input

3.5. EDID
EDID (Extended Display Identification Data)
모니터가 컴퓨터 자체에 대한 정보를 제공한다.
지원하는 해상도를 찾아서 읽고, 모니터 제공하는 헤르지 동기화.

EDID 정보를 읽을 수 없다면, 저해상도 디스플레이만 한다.
모니터 정보 확인
shell> lspci -vk | grep -iA20 vga

부팅 설정 확인
shell> vi /etc/default/grub

EDID 정보 확인.
sudo apt-get install get-edit edid-decode
sudo get-edid | parse-edid

4. HDMI
고선명 멀티미디어 인터페이스(High Definition Multimedia Interface, HDMI)
기존의 비디오 단자들과 달리 비디오, 오디오, 제어 등 멀티미디어 기기에서 필요한 모든 단자를 통합

댓글 없음:

댓글 쓰기