Configuration affichage Raspberry Pi - Sorties HDMI - Mode console et mode graphique

Mise à jour : Raspberry Pi OS 10.7

Ce document décrit

Sommaire

1 - Configuration du pilotage des afficheurs

1.1 - Fichier configuration par défaut

$ cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

1.2 - Exemple - Configuration pour écran tactile hdmi 7 pouces sur hdmi0

max_usb_current=1
hdmi_force_hotplug=1
config_hdmi_boost=7
hdmi_group=2
hdmi_mode=87
hdmi_drive=1 display_rotate=0 hdmi_cvt=1024 600 60 6 0 0 0
[hdmi:0]

# Set hdmi signal boost to the default value
config_hdmi_boost=5

# Set monitor mode to DMT

hdmi_group=2

# Set monitor resolution to 10024x600 / 60 Hz /
ratio 1:6
hdmi_mode=87
hdmi_cvt 1024 600 60 6 0 0 0

1.3 - Exemple 2 - Configuration pour moniteur PC sur hdmi1

[hdmi:1]

# Set monitor mode to DMT hdmi_group=2

# Set Normal HDMI mode (sound will be sent if supported and enabled)
hdmi_drive=2

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Set monitor resolution to 1920x1080 / 60 Hz /
ratio 16:9
hdmi_mode=87
hdmi_cvt=1920 1080 60
3

2 - Utilitaires

Les informations suivantes peuvent être obtenues depuis une console virtuelle ou une connexion ssh

2.1 - fbset

$ fbset -i

mode "1024x600"
geometry 1024 600 1024 600 16
timings 0 0 0 0 0 0 0
accel true
rgba 5/11,6/5,5/0,0/0
endmode

Frame buffer device information:
Name : vc4drmfb
Address : 0
Size : 1228800
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 0
LineLength : 2048
Accelerator : No

2.2 - tvservice

$ tvservice --list           # tvservice -l
1 attached device(s), display ID's are :
Display Number 2, type HDMI 0
$ tvservice --status         # tvservice -s
state 0xa [HDMI DMT (87)RGB full 15:9], 1024x600 @ 60.00Hz, progressive

$ tvservice -s -v2
state 0xa [HDMI DMT (87) RGB full 15:9], 1024x600 @ 60.00Hz, progressive
$ tvservice --off            # tvservice -o
Powering off HDMI

$ tvservice --preferred # tvservice -p
Powering on HDMI with preferred settings
$ tvservice --modes=DMT              # tvservice -m DMT
Group DMT has 3 modes:
mode 4: 640x480 @ 60Hz 4:3, clock:25MHz progressive
(prefer) mode 87: 1024x600 @ 60Hz 15:9, clock:49MHz progressive
mode 88: 1024x600 @ 60Hz 15:9, clock:49MHz progressive

$ tvservice -m CEA # tvservice -m CEA
Group CEA has 4 modes:
mode 4: 1280x720 @ 60Hz 16:9, clock:74MHz progressive
mode 16: 1920x1080 @ 60Hz 16:9, clock:148MHz progressive
mode 95: 3840x2160 @ 30Hz 16:9, clock:297MHz progressive
mode 97: 3840x2160 @ 60Hz 16:9, clock:594MHz progressive

$ tvservice --name # tvservice -n
[E] No device present

$ tvservice --name --device 2 # tvservice -n
[E] No device present

2.3 - edid

$  tvservice -d edid.dat
Nothing written!

$ parseedit edid.dat
????
$ aptitude show edid-decode
....
Description: decode the binary EDID information from monitors
EDID is binary data encoded in the monitor firmware, which the kernel exposes
via /sys/devices/.../drm/card*/card*/edid. edid-decode renders this binary
data into a human-readable text form.
...

$ sudo aptitude install edid-decode
$ aptitude install read edid-decode
$ find /sys/devices -name edid
/sys/devices/platform/gpu/drm/card0/card0-HDMI-A-1/edid

mais ce n'est pas le cas ....

3 - Mode texte

$ sudo dmesg |grep vc4
[ 5.071121] vc4-drm gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops [vc4])
[ 5.073838] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0

$ lsmod |grep "^vc4"
vc4 253952 0

$ sudo modinfo vc4
filename: /lib/modules/5.10.11-v7l+/kernel/drivers/gpu/drm/vc4/vc4.ko
license: GPL v2
author: Eric Anholt <eric@anholt.net>
description: Broadcom VC4 DRM Driver
alias: platform:vc4-drm
......

$ sudo dpkg reconfigure console-setup

pour obtenir par exemple les valeurs suivantes

$ sudo debconf-show console-setup |grep "*"
* console-setup/fontsize-fb47: 12x24 (uniquement tampon vidéo (« framebuffer »))
* console-setup/fontface47: Terminus
* console-setup/codeset47: # Latin1 and Latin5 - western Europe and Turkic languages
* console-setup/charmap47: UTF-8

4 - Mode graphique

4.1 - Processeurs graphiques

4.2 - Choix du module

Dans ce qui suit, on utilise fbdev

4.3 - Mode graphique sans bureau

$ sudo aptitude install --without-recommends xorg xserver-xorg xserver-xorg-video-fbdev openbox mesa-utils x11-xserver-utils
$ sudo aptitude install --without-recommends xorg xserver-xorg xserver-xorg-video-fbtrubo openbox mesa-utils x11-xserver-utils
$ startx
$ vblank_mode=0 glxgears
ATTENTION: default value of option vblank_mode overridden by environment.
9329 frames in 5.0 seconds = 1855,727 FPS
....

Note : La performance est fortement fonction de la taille de la fenêtre d'affichage

$ pkill xinit

4.4 - Mode graphique avec bureau "Pixel"

$ sudo apt install raspberrypi-ui-mods
$ systemctl start lightdm