Jump to content

Recommended Posts

Posted

Have an OPi 4B with installed Armbian (Armbian_21.05.1_Orangepi4_buster_legacy_4.4.213_xfce_desktop.img from here) which is working perfectly. HUGE thanks for that.

So i wanted to try images with mainline kernel and found that none of XFCE desktop images from the archive can correctly output HDMI signal for my screen, maximum i could achive was compressed and flickering image using method from docs (editing /etc/X11/xorg.conf.d/40-monitor.conf). 

by default there are no modes in /sys/class/drm/card0-HDMI-A-1/modes in mainline images and in legacy one there are two: 1280x800p60 and 1280x800p57.

EDID is there in both images.

And if i set resolution via /etc/X11/xorg.conf.d/40-monitor.conf in mainline i can't change it to anything via xrandr because "Configure crtc 0 failed".

 

on the latest mainline image (Armbian_22.08.10_Orangepi4_jammy_current_5.15.76_xfce_desktop.img) i was able to get normal resolution doing the following :

1. edit /etc/X11/xorg.conf.d/40-monitor.conf   from console like below:

Section "Monitor"

Identifier "HDMI-1"

Modeline "1280x800_try4" 75 1280 1290 1300 1500 800 805 810 823 +hsync -vsync

Option "PreferredMode" "1280x800_try4"

EndSection

 

this gets me a compressed screen after reboot.

2. then in terminal:

xrandr --newmode "1280x800_60.00" 83.46 1280 1344 1480 1680 800 801 804 828 -hsync +vsync

xrandr --addmode DP-1 1280x800_60.00

xrandr --output DP-1 --mode 1280x800_60.00

xrandr --output DP-1 --crtc 1

 

after that image on HDMI suddenly becomes normal but still no resolution changes can be applied to HDMI

 

Any chances for easy workaround here?

Posted (edited)

actuallly found kinda better solution - so 1280x800 is not very common mode as all other 16:10. So it has not very big list of possible settings built-in to the driver. Due to that only exact frequencyes from kernel/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c in array called dw_hdmi_mpll_config rockchip_mpll_cfg[] are accepted as okey when producing modeline. And despite edid from monitor is correct it doesn't match any frequency in that array and therefore modeline from edid gets thrown away as bad.

So i just picked the closest to the edid frequency from that array and putted modeline with it to /etc/X11/xorg.conf.d/40-monitor.conf. This way screen turns on and image is normal, but all startup messages do not display.

Gonna try building image with CONFIG_DRM_LOAD_EDID_FIRMWARE=y and providing custom edid.bin to see if this makes any difference

Edited by CraftWorld
fixed unfinished sentence
Posted

so, in case someone needs this too:

General guide to succesfuly use not so popular screen resolutions.

0) Make sure your monitor works with another PCs, and, maybe, with other distros

1) Get your monitor EDID any convinient way - through console ( cat /sys/class/drm/cardX-HDMI-A-Y/edid  X and Y are numbers depending on your setup) or another PC and check if it is OK.

2) Check what clock frequency is used in your EDID, (e.g. min was 71.33 MHz) and pick the closet in from given list: 27, 36, 40, 54, 65, 66, 74.25, 83.5, 108, 106.5 146.25, 148.5.( so i picked 74,25) and use modeline calculator using resolution and clock frequency as only inputs.

3a) EASY WAY but screen gets normal only when DM starts:

put your modeline to  /etc/X11/xorg.conf.d/40-monitor.conf like this:

Section "Monitor"

Identifier "HDMI-X"

Modeline "YOUR_MODE_NAME" 74.25 1280 1290 1300 1500 800 805 810 823 +hsync -vsync //here should be modeline you get from calculator

Option "PreferredMode" "YOUR_MODE_NAME"

EndSection

3b) LONG WAY but you'll be able to see boot messages and use cli interface on 1st login(if you do this before 1st launch of the image)

build your image with CONFIG_DRM_LOAD_EDID_FIRMWARE=y (in config menu search for EDID and it wiil whos where it is) something like device drivers -> graphics support->Direct Render...->enable loading edid insteadof probingfor it

compile custom EDID using modeline from step 2.

edit /boot/armbianEnv.txt: append extraargs=drm.edid_firmware=edid/YOUR_EDID.bin

place YOUR_EDID.bin to /lib/firmware/edid/

 

you're good to go

 

Posted (edited)

Thanks for posting this, it actually worked for me with 800x480 resolution, but my screen looks ugly and with bunch of waves...

Did I missed some numbers?

Here's my EDID:

root@rockpi-4b:~$ DISPLAY=:0 xrandr --props | edid-decode
edid-decode (hex):

00 ff ff ff ff ff ff 00 36 09 01 50 01 00 00 00
1c 13 01 03 81 0c 08 78 2e 35 85 a6 56 48 9a 24
12 50 54 af ef 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 3e 0d 20 00 31 e0 37 10 2c 58
36 00 dc 0c 11 00 00 1e 00 00 00 10 00 38 2d 40
10 2c 45 80 b9 88 21 00 00 1e 00 00 00 10 00 38
2d 40 10 2c 45 80 b9 88 21 00 00 18 00 00 00 fc
00 4d 50 49 35 30 30 31 0a 20 20 20 20 20 01 9a

02 03 21 71 4e 06 07 02 03 15 96 11 12 13 04 14
05 1f 90 23 09 07 07 83 01 00 00 65 03 0c 00 10
00 e4 0c 20 90 30 e0 31 10 0c 40 55 00 b9 88 21
00 00 18 01 1d 80 18 71 1c 16 20 58 2c 25 00 b9
88 21 00 00 9e 01 1d 80 d0 72 1c 16 20 10 2c 25
80 b9 88 21 00 00 9e 01 1d 00 bc 52 d0 1e 20 b8
28 55 40 b9 88 21 00 00 1e 02 3a 80 d0 72 38 2d
40 10 2c 45 80 b9 88 21 00 00 1e 00 00 00 00 86

----------------

Block 0, Base EDID:
  EDID Structure Version & Revision: 1.3
  Vendor & Product Identification:
    Manufacturer: MPI
    Model: 20481
    Serial Number: 1
    Made in: week 28 of 2009
  Basic Display Parameters & Features:
    Digital display
    DFP 1.x compatible TMDS
    Maximum image size: 12 cm x 8 cm
    Gamma: 2.20
    DPMS levels: Off
    RGB color display
    Default (sRGB) color space is primary color space
    First detailed timing is the preferred timing
  Color Characteristics:
    Red  : 0.6484, 0.3388
    Green: 0.2822, 0.6025
    Blue : 0.1425, 0.0703
    White: 0.3134, 0.3291
  Established Timings I & II:
    IBM     :   720x400    70.082 Hz   9:5    31.467 kHz  28.320 MHz
    DMT 0x04:   640x480    59.940 Hz   4:3    31.469 kHz  25.175 MHz
    DMT 0x05:   640x480    72.809 Hz   4:3    37.861 kHz  31.500 MHz
    DMT 0x06:   640x480    75.000 Hz   4:3    37.500 kHz  31.500 MHz
    DMT 0x08:   800x600    56.250 Hz   4:3    35.156 kHz  36.000 MHz
    DMT 0x09:   800x600    60.317 Hz   4:3    37.879 kHz  40.000 MHz
    DMT 0x0a:   800x600    72.188 Hz   4:3    48.077 kHz  50.000 MHz
    DMT 0x0b:   800x600    75.000 Hz   4:3    46.875 kHz  49.500 MHz
    Apple   :   832x624    74.551 Hz   4:3    49.726 kHz  57.284 MHz
    DMT 0x10:  1024x768    60.004 Hz   4:3    48.363 kHz  65.000 MHz
    DMT 0x11:  1024x768    70.069 Hz   4:3    56.476 kHz  75.000 MHz
    DMT 0x12:  1024x768    75.029 Hz   4:3    60.023 kHz  78.750 MHz
    DMT 0x24:  1280x1024   75.025 Hz   5:4    79.976 kHz 135.000 MHz
  Standard Timings: none
  Detailed Timing Descriptors:
    DTD 1:   800x480    60.004 Hz   5:3    32.102 kHz  33.900 MHz (476 mm x 268 mm)
                 Hfront   44 Hsync  88 Hback 124 Hpol P
                 Vfront    3 Vsync   6 Vback  46 Vpol P
    Dummy Descriptor:
    Dummy Descriptor:
    Display Product Name: 'MPI5001'
  Extension blocks: 1
Checksum: 0x9a

----------------

Block 1, CTA-861 Extension Block:
  Revision: 3
  Basic audio support
  Supports YCbCr 4:4:4
  Supports YCbCr 4:2:2
  Native detailed modes: 1
  Video Data Block:
    VIC   6:  1440x480i   59.940 Hz   4:3    15.734 kHz  27.000 MHz
    VIC   7:  1440x480i   59.940 Hz  16:9    15.734 kHz  27.000 MHz
    VIC   2:   720x480    59.940 Hz   4:3    31.469 kHz  27.000 MHz
    VIC   3:   720x480    59.940 Hz  16:9    31.469 kHz  27.000 MHz
    VIC  21:  1440x576i   50.000 Hz   4:3    15.625 kHz  27.000 MHz
    VIC  22:  1440x576i   50.000 Hz  16:9    15.625 kHz  27.000 MHz (native)
    VIC  17:   720x576    50.000 Hz   4:3    31.250 kHz  27.000 MHz
    VIC  18:   720x576    50.000 Hz  16:9    31.250 kHz  27.000 MHz
    VIC  19:  1280x720    50.000 Hz  16:9    37.500 kHz  74.250 MHz
    VIC   4:  1280x720    60.000 Hz  16:9    45.000 kHz  74.250 MHz
    VIC  20:  1920x1080i  50.000 Hz  16:9    28.125 kHz  74.250 MHz
    VIC   5:  1920x1080i  60.000 Hz  16:9    33.750 kHz  74.250 MHz
    VIC  31:  1920x1080   50.000 Hz  16:9    56.250 kHz 148.500 MHz
    VIC  16:  1920x1080   60.000 Hz  16:9    67.500 kHz 148.500 MHz (native)
  Audio Data Block:
    Linear PCM:
      Max channels: 2
      Supported sample rates (kHz): 48 44.1 32
      Supported sample sizes (bits): 24 20 16
  Speaker Allocation Data Block:
    FL/FR - Front Left/Right
  Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
    Source physical address: 1.0.0.0
  Detailed Timing Descriptors:
    DTD 2:   800x480    66.082 Hz   5:3    34.958 kHz  33.000 MHz (697 mm x 392 mm)
                 Hfront   12 Hsync  64 Hback  68 Hpol N
                 Vfront    5 Vsync   5 Vback  39 Vpol N
    DTD 3:  1920x1080i  60.000 Hz  16:9    33.750 kHz  74.250 MHz (697 mm x 392 mm)
                 Hfront   88 Hsync  44 Hback 148 Hpol P
                 Vfront    2 Vsync   5 Vback  15 Vpol P Vfront +0.5 Odd Field
                 Vfront    2 Vsync   5 Vback  15 Vpol P Vback  +0.5 Even Field
    DTD 4:  1920x1080i  50.000 Hz  16:9    28.125 kHz  74.250 MHz (697 mm x 392 mm)
                 Hfront  528 Hsync  44 Hback 148 Hpol P
                 Vfront    2 Vsync   5 Vback  15 Vpol P Vfront +0.5 Odd Field
                 Vfront    2 Vsync   5 Vback  15 Vpol P Vback  +0.5 Even Field
    DTD 5:  1280x720    50.000 Hz  16:9    37.500 kHz  74.250 MHz (697 mm x 392 mm)
                 Hfront  440 Hsync  40 Hback 220 Hpol P
                 Vfront    5 Vsync   5 Vback  20 Vpol P
    DTD 6:  1920x1080   50.000 Hz  16:9    56.250 kHz 148.500 MHz (697 mm x 392 mm)
                 Hfront  528 Hsync  44 Hback 148 Hpol P
                 Vfront    4 Vsync   5 Vback  36 Vpol P
Checksum: 0x86


So, I entered 800x480 and timing 36 from list you provide and got this Modeline from calculator:
 

"800x480@71" 36.00 800 832 968 1000 480 489 495 505



UPD.

So, I noticed that cvt generates Modeline with value 29.50 MHz:
 

root@rockpi-4b:~$ cvt 800 480 60
# 800x480 59.48 Hz (CVT) hsync: 29.74 kHz; pclk: 29.50 MHz
Modeline "800x480_60.00"   29.50  800 824 896 992  480 483 493 500 -hsync +vsync


And I tried to insert closer to 29.50 MHz value into Modeline calculator, which is 27, and it printed me this:
 

Modeline "800x480@55" 27.00 800 832 928 960 480 490 495 505


And screen looks perfectly!
Thank you!

I still need to figure out more dynamic fix, because we need to support different screens and I want them to work automatically

Edited by Roman Khudobei
Add UPD section
Posted (edited)

@Roman Khudobei I can suggest you try to add more supported resolutions throught 40-monitor.conf file. Then you can try to switch between them somehow. (not that good at linux scripts myself, but i do belive it's possible to read-edid of non-working monitor and then select corresponding modeline from 40-monitor.conf

 

 

Edited by CraftWorld
typo
Posted (edited)

Hello. i have some problems and the procedure is not much clear forme

 

i have a SoC based on rockchip RK3566 and i want to use a 5" 800x480 hdmi display. as know, rockchip hdmi drive refuse load a edid if is out of specs (pixelclock)

 

mine is one of them

 

this is the display if connect to my desktop pc

Quote

└───╼  cat /sys/class/drm/card0-HDMI-A-1/edid | edid-decode  
edid-decode (hex):

00 ff ff ff ff ff ff 00 32 8d 02 2c 01 01 01 01
01 15 01 03 80 59 32 78 0a 0d c9 a0 57 47 98 27
12 48 4c 20 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 02 0d 20 80 30 e0 2d 10 28 30
d3 00 6c 3e 00 00 00 1e 02 0d 20 80 30 e0 2d 10
28 30 d3 00 6c 3e 00 00 00 18 00 00 00 fc 00 4c
6f 6e 74 69 75 6d 20 53 65 6d 69 0a 00 00 00 fd
00 3a 3e 0e 46 06 00 0a 20 20 20 20 20 20 01 b7

02 03 16 c0 41 01 23 09 07 07 83 01 00 00 67 03
0c 00 10 00 00 0c 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 93

----------------

Block 0, Base EDID:
 EDID Structure Version & Revision: 1.3
 Vendor & Product Identification:
   Manufacturer: LTM
   Model: 11266
   Serial Number: 16843009
   Made in: week 1 of 2011
 Basic Display Parameters & Features:
   Digital display
   Maximum image size: 89 cm x 50 cm
   Gamma: 2.20
   RGB color display
   First detailed timing is the preferred timing
 Color Characteristics:
   Red  : 0.6250, 0.3398
   Green: 0.2802, 0.5947
   Blue : 0.1552, 0.0703
   White: 0.2832, 0.2978
 Established Timings I & II:
   DMT 0x04:   640x480    59.940476 Hz   4:3     31.469 kHz     25.175000 MHz
 Standard Timings: none
 Detailed Timing Descriptors:
   DTD 1:   800x480    68.349754 Hz   5:3     35.884 kHz     33.300000 MHz (108 mm x 62 mm)
                Hfront   40 Hsync  48 Hback   40 Hpol P
                Vfront   13 Vsync   3 Vback   29 Vpol P
   DTD 2:   800x480    68.349754 Hz   5:3     35.884 kHz     33.300000 MHz (108 mm x 62 mm)
                Hfront   40 Hsync  48 Hback   40 Hpol N
                Vfront   13 Vsync   3 Vback   29 Vpol N
   Display Product Name: 'Lontium Semi'
   Display Range Limits:
     Monitor ranges (GTF): 58-62 Hz V, 14-70 kHz H, max dotclock 60 MHz
 Extension blocks: 1
Checksum: 0xb7

----------------

Block 1, CTA-861 Extension Block:
 Revision: 3
 Underscans IT Video Formats by default
 Basic audio support
 Native detailed modes: 0
 Video Data Block:
   VIC   1:   640x480    59.940476 Hz   4:3     31.469 kHz     25.175000 MHz
 Audio Data Block:
   Linear PCM:
     Max channels: 2
     Supported sample rates (kHz): 48 44.1 32
     Supported sample sizes (bits): 24 20 16
 Speaker Allocation Data Block:
   FL/FR - Front Left/Right
 Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
   Source physical address: 1.0.0.0
   Maximum TMDS clock: 60 MHz
Checksum: 0x93  Unused space in Extension Block: 105 bytes

 

 

so, i need select the pixelclock most close to the pixelclock in the list. in my case 33.3, is 36.

 

now in my problem. i need edit the edid binary for edit the pixelclock value? only that value? no more? (with wxedid)

 

if no need, and i need generate a new modeline, if i what to use only wayland environment, what i need to do? maybe with wlr-rand? but the display is not detected

 

 

in my test, this not works:

 

edit /boot/extlinux/extlinux.conf file for add  

Quote

drm.edid_firmware=HDMI-A-1:edid/btt_hdmi_5.bin

 

and copy the modified or not modified edid (i have test both), to `/lib/firmware/edid` gets this:

 

Quote

[    2.435379] rockchip-drm display-subsystem: Direct firmware load for edid/btt_hdmi_5.bin failed with error -2
[    2.436279] rockchip-drm display-subsystem: [drm] *ERROR* [CONNECTOR:51:HDMI-A-1] Requesting EDID firmware "edid/btt_hdmi_5.bin" failed (err=-2)
[    2.545852] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes

 

 

greetings
 

Edited by sL1pKn07 SpinFlo
format
Posted (edited)

Hello. little progress

 

the error -2 is gone when add the edid file to the initramfs image.... but the display is still urecognized

 

tested with https://github.com/akatrevorjay/edid-generator and the metamode created by @Roman Khudobei

 

Quote

sl1pkn07@sL1-KliPpEr    cat /sys/class/drm/card0-HDMI-A-1/edid | edid-decode  
edid-decode (hex):

00 ff ff ff ff ff ff 00 31 d8 00 00 00 00 00 00
0c 1b 01 03 80 14 0c 78 ea 5e c0 a4 59 4a 98 25
20 50 54 00 00 00 45 00 01 01 01 01 01 01 01 01
01 01 01 01 01 01 8c 0a 20 a0 30 e0 19 10 20 60
94 00 d0 7d 00 00 00 1e 00 00 00 ff 00 4c 69 6e
75 78 20 23 30 0a 20 20 20 20 00 00 00 fd 00 3b
3d 1b 1d 03 00 0a 20 20 20 20 20 20 00 00 00 fc
00 42 54 54 20 35 0a 20 20 20 20 20 20 20 00 de

----------------

Block 0, Base EDID:
 EDID Structure Version & Revision: 1.3
 Vendor & Product Identification:
   Manufacturer: LNX
   Model: 0
   Made in: week 12 of 2017
 Basic Display Parameters & Features:
   Digital display
   Maximum image size: 20 cm x 12 cm
   Gamma: 2.20
   DPMS levels: Standby Suspend Off
   RGB color display
   First detailed timing is the preferred timing
 Color Characteristics:
   Red  : 0.6416, 0.3486
   Green: 0.2919, 0.5957
   Blue : 0.1474, 0.1250
   White: 0.3125, 0.3281
 Established Timings I & II: none
 Standard Timings:
   GTF     :   800x500    60.000689 Hz  16:10    31.080 kHz     31.329000 MHz
 Detailed Timing Descriptors:
   DTD 1:   800x480    55.693069 Hz   5:3     28.125 kHz     27.000000 MHz (208 mm x 125 mm)
                Hfront   32 Hsync  96 Hback   32 Hpol P
                Vfront    9 Vsync   4 Vback   12 Vpol P
   Display Product Serial Number: 'Linux #0'
   Display Range Limits:
     Monitor ranges (GTF): 59-61 Hz V, 27-29 kHz H, max dotclock 30 MHz
   Display Product Name: 'BTT 5'
Checksum: 0xde

 

 

what i do wrong?

 

greetings

Edited by sL1pKn07

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines