akatrevorjay / edid-generator Goto Github PK
View Code? Open in Web Editor NEWHackerswork to generate an EDID blob from given Xorg Modelines, complete with valid checksum.
License: GNU General Public License v3.0
Hackerswork to generate an EDID blob from given Xorg Modelines, complete with valid checksum.
License: GNU General Public License v3.0
I have a 1440p screen on my laptop; with 1x scaling everything is too small and with 2x scaing everything is too large. So on Xorg I created a 4k resolution and used it with 2x scaling to get to a comfortable size. However, applying 3840x2160 doesn't seem to work using this tool. I also tried 3200x1800 with similar results. However, applying 1920x1080 works perfectly. I'm not if this is to any relevance, but here's what I've got:
LThinkpad โ $ sudo edid-decode 3840x2160.bin
[sudo] password for Luka:
Extracted contents:
header: 00 ff ff ff ff ff ff 00
serial number: 31 d8 00 00 00 00 00 00 05 16
version: 01 03
basic params: 6d 64 38 78 ea
chroma info: 5e c0 a4 59 4a 98 25 20 50 54
established: 00 00 00
standard: c1 c0 01 01 01 01 01 01 01 01 01 01 01 01 01 01
descriptor 1: 6b 16 00 c0 f5 70 4d 80 40 a0 35 00 e8 32 32 00 00 1e
descriptor 2: 00 00 00 ff 00 4c 69 6e 75 78 20 23 30 0a 20 20 20 20
descriptor 3: 00 00 00 fd 00 3b 3d 85 87 48 00 0a 20 20 20 20 20 20
descriptor 4: 00 00 00 fc 00 33 38 34 30 78 32 31 36 30 5f 36 30 2e
extensions: 30
checksum: 30
Manufacturer: LNX Model 0 Serial Number 0
Made week 5 of 2012
EDID version: 1.3
Analog display, Input voltage level: 0.7/0.7 V
Sync: Separate Composite Serration
Maximum image size: 100 cm x 56 cm
Gamma: 2.20
DPMS levels: Standby Suspend Off
RGB color display
First detailed timing is preferred timing
Established timings supported:
Standard timings supported:
1792x1008@60Hz
Detailed mode: Clock 57.390 MHz, 1000 mm x 562 mm
3840 3904 4064 5312 hborder 0
2160 2163 2168 2237 vborder 0
+hsync +vsync
Serial number: Linux #0
Monitor ranges (GTF): 59-61Hz V, 133-135kHz H, max dotclock 720MHz
Has 48 extension blocks
Checksum: 0x30 (should be 0x3e)
EDID block does NOT conform to EDID 1.3!
Name descriptor not terminated with a newline
EDID block does not conform at all!
Block has broken checksum
Also, I'm running Fedora. Apologies if I missed something blatantly obvious,
Thanks!
#Operating system: Ubuntu 16.04.1 LTS
Problem:
When using the parse-edid program (sudo apt-get install read-edid):
parse-edid < /etc/X11/3840x2160.bin
The data outputted does not match the data that should be outputted:
Section "Monitor"
Identifier "3840x2160"
ModelName "3840x2160"
VendorName "LNX"
# Monitor Manufactured week 5 of 2012
# EDID version 1.3
# Analog Display
DisplaySize 1000 560
Gamma 2.20
Option "DPMS" "true"
Horizsync 134-136
VertRefresh 59-61
# Maximum pixel clock is 600MHz
#Not giving standard mode: 1792x1008, 60Hz
Modeline "Mode 0" 594.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync
EndSection
I have tried creating a edid.bin as instructed in the readme but that also gives me the wrong value:
./modeline2edid - <<< 'Modeline "3840x2160_60.00" 712.75 3840 4160 4576 5312 2160 2163 2168 2237 -hsync +vsync'
Searching for runaway unicorns in '/dev/stdin'
Found naughty unicorn: Modeline "3840x2160_60.00" 712.75 3840 4160 4576 5312 2160 2163 2168
2237 -hsync +vsync
Wrote 3840x2160_60.00.S
make
cc -c -DCRC="0x00" -o 3840x2160_60.00.o 3840x2160_60.00.S
edid.S: Assembler messages:
edid.S:171: Warning: value 0x1c1 truncated to 0xc1
edid.S:180: Warning: value 0x1166b truncated to 0x166b
edid.S:270: Warning: repeat < 0; .fill ignored
objcopy -Obinary 3840x2160_60.00.o 3840x2160_60.00.bin.nocrc
cat 3840x2160_60.00.bin.nocrc | edid-decode \
| sed -ne 's/^[ ]*Checksum: 0x\w\+ (should be \(0x\w\+\))$/\1/p' >3840x2160_60.00.crc
cc -c -DCRC="$(cat 3840x2160_60.00.crc)" -o 3840x2160_60.00.p 3840x2160_60.00.S
edid.S: Assembler messages:
edid.S:171: Warning: value 0x1c1 truncated to 0xc1
edid.S:180: Warning: value 0x1166b truncated to 0x166b
edid.S:270: Warning: repeat < 0; .fill ignored
objcopy -Obinary 3840x2160_60.00.p 3840x2160_60.00.bin
objcopy -Oihex 3840x2160_60.00.p 3840x2160_60.00.bin.ihex
dos2unix 3840x2160_60.00.bin.ihex 2>/dev/null
rm 3840x2160_60.00.crc 3840x2160_60.00.p 3840x2160_60.00.o 3840x2160_60.00.bin.nocrc
parse-edid < 3840x2160_60.00.bin
You seem to have too many extension blocks. Will not continue to parse
Something strange happened. Please contact the author,
Matthew Kern at <[email protected]>
Would you have any idea on why this is happening?
I'm getting:
$ ./modeline2edid /etc/X11/xorg.conf
Searching for runaway unicorns in '/etc/X11/xorg.conf'
-- Found naughty unicorn: ModeLine "4096x2160_60.00" 760.00 4096 4432 4880 5664 2160 2163 2173 2237 -hsync +vsync ratio=17:9
template-S:57: unknown file attribute
And no name.S output.
Also, just ignorant, but stdin entry terminated with a blank line and ^d appears to do the Right Thing, but also results in no name.S output? Any hints, much appreciated.
$ cvt 2560 1080
# 2560x1080 59.98 Hz (CVT) hsync: 67.17 kHz; pclk: 230.00 MHz
Modeline "2560x1080_60.00" 230.00 2560 2720 2992 3424 1080 1083 1093 1120 -hsync +vsync
$ ./modeline2edid - <<< 'Modeline "2560x1080" 230.00 2560 2720 2992 3424 1080 1083 1093 1120 -hsync +vsync'
Searching for modelines in '/dev/stdin'
-- Found modeline: Modeline "2560x1080" 230.00 2560 2720 2992 3424 1080 1083 1093 1120 -hsync +vsync
Computed ratio: UNKNOWN%
$ make
cc -c -DCRC="0x00" -o 1600x1200.o 1600x1200.S
objcopy -Obinary 1600x1200.o 1600x1200.bin.nocrc
cat 1600x1200.bin.nocrc | edid-decode \
| sed -ne 's/^[ ]*Checksum: 0x\w\+ (should be \(0x\w\+\))$/\1/p' >1600x1200.crc
/bin/sh: 1: edid-decode: not found
cc -c -DCRC="$(cat 1600x1200.crc)" -o 1600x1200.p 1600x1200.S
objcopy -Oihex 1600x1200.p 1600x1200.bin.ihex
dos2unix --quiet 1600x1200.bin.ihex
make: dos2unix: Command not found
Makefile:32: recipe for target '1600x1200.bin.ihex' failed
make: *** [1600x1200.bin.ihex] Error 127
rm 1600x1200.bin.nocrc 1600x1200.crc 1600x1200.p 1600x1200.o
Hi, getting this on all resolution I try:
cat 1440x810.bin.nocrc | edid-decode \ | sed -ne 's/^[ ]*Checksum: 0x\w\+ (should be \(0x\w\+\))$/\1/p' >1440x810.crc
anything obvious I am missing?
I met this error when I make
with a modeline with resolution of 2304x1296
.
$ make
edid.S: Assembler messages:
edid.S:171: Warning: value 0x101 truncated to 0x1
edid.S: Assembler messages:
edid.S:171: Warning: value 0x101 truncated to 0x1
edid.S line 171 :
std_xres: .byte (XPIX/8)-31
It seems that what happens is that when XPIX
(x resolution) is >= 2304, (XPIX/8)-31
will be >= 0x101
, which does not fit inside a byte.
First of all tanks for nice tool, it seems to be the only way to set custom EDID when using wayland.
Unfortunatly I have a problem with custom Modeline generated with cvt_modeline_calculator_12.
Modeline generated with cvt12 3840 2160 26 -b
Using xrandr --newmode
3840x2160_26.00_rb2 works great , but I got error during boot when using EDID as firmware:
platform HDMI-A-2: Direct firmware load for edid/3840x2160_26.00_rb2.bin failed with error -2
[drm:drm_load_edid_firmware [drm]] *ERROR* Requesting EDID firmware "edid/3840x2160_26.00_rb2.bin" failed (err=-2)
cat 3840x2160_26.00_rb2.S
/* 3840x2160_26.00_rb2: Modeline "3840x2160_26.00_rb2" 222.90 3840 3848 3880 3920 2160 2173 2181 2187 +hsync -vsync */
#define HSYNC_POL 1
#define VSYNC_POL 1
#define YPULSE (63+8)
#define XPULSE 32
#define YPIX 2160
#define XPIX 3840
#define VFREQ 60
#define DPI 96
#define CLOCK 222900
#define VERSION 1
#define REVISION 3
#define XOFFSET 8
#define YOFFSET (63+13)
#define XY_RATIO XY_RATIO_16_9
#define YBLANK 27
#define XBLANK 80
#define TIMING_NAME "3840x2160_26.00_rb2"
#include "edid.S"
Trying to get the following .S
file working. The settings worked before on a Xorg machine.
/* 2560x1440_50hz: Modeline "2560x1440_50hz" 200.25 2560 2608 2640 2720 1440 1443 1448 1474 +HSync -Vsync */
#define HSYNC_POL 1
#define VSYNC_POL 1
#define YPULSE (63+5)
#define XPULSE 32
#define YPIX 1440
#define XPIX 2560
#define VFREQ 50
#define DPI 96
#define CLOCK 200250
#define VERSION 1
#define REVISION 3
#define XOFFSET 48
#define YOFFSET (63+3)
#define XY_RATIO XY_RATIO_16_9
#define YBLANK 34
#define XBLANK 160
#define TIMING_NAME "2560x1440_50hz"
#include "edid.S"
Applying it in /etc/default/grub
as a kernel parameter with GRUB_CMDLINE_LINUX="drm_kms_helper.edid_firmware=HDMI-A-2:edid/2560x1440_50hz.bin"
.
However, the resolution does not apply after boot and is not selectable.
I also tried to load the .bin
file in early KMS as suggested here but without success.
I'm on Arch GNOME. Any ideas what I am missing?
FYI, I also get the warnings reported in #5 .
I use 50Hz for video as I'm in the UK... not a native rate on my Linx 1010B fondle-slab. For xorg, I used to use a simple script with xrandr, and for Wayland shove the modeline in the sway config, but it seems both fail in recent kernels.
So.. I tried to use edid-generator to generate the edid file like this.
First, generate the modeline exactly as I'd done for the previously working xrandr
$ cvt 800 1280 50
# 800x1280 49.82 Hz (CVT) hsync: 65.76 kHz; pclk: 70.50 MHz
Modeline "800x1280_50.00" 70.50 800 856 936 1072 1280 1283 1293 1320 -hsync +vsync
Which with aspect ratio added becomes...
Modeline "800x1280_50.00" 70.50 800 856 936 1072 1280 1283 1293 1320 -hsync +vsync ratio=10:16
Which modeline2edid seems to grok just fine.
Make though, breaks.
$ make
cc -c -DCRC="0x00" -o 800x1280_50.00.o 800x1280_50.00.S
edid.S: Assembler messages:
edid.S:270: Warning: repeat < 0; .fill ignored
edid.S:175: Error: invalid operands (*UND* and *ABS* sections) for `<<'
make: *** [Makefile:16: 800x1280_50.00.o] Error 1
1280x800_50 builds fine, but this fondle-slab needs portrait definitions.
The content of the errant .S
$ cat 800x1280_50.00.S
/* 800x1280_50.00: Modeline "800x1280_50.00" 70.50 800 856 936 1072 1280 1283 1293 1320 -hsync +vsync ratio=10:16 */
#define HSYNC_POL 1
#define VSYNC_POL 1
#define YPULSE (63+10)
#define XPULSE 80
#define YPIX 1280
#define XPIX 800
#define VFREQ 60
#define DPI 96
#define CLOCK 70500
#define VERSION 1
#define REVISION 3
#define XOFFSET 56
#define YOFFSET (63+3)
#define XY_RATIO XY_RATIO_10_16
#define YBLANK 40
#define XBLANK 272
#define TIMING_NAME "800x1280_50.00"
#include "edid.S"
Using Linuxmint 21.1
I tried the 1920x1080.bin and it causes my centos7 with kernel 4.4.189 to panic, however, I tried the 2560x1440.bin and that worked just fine.
even though edid-decode was happy with both, I am wondering if 1920x1080.bin is corrupt in some way??
p.s. my working kernel command line is like this, simply switching to 1920x1080.bin causes the problem
BOOT_IMAGE=/boot/vmlinuz-4.4.189-1.el7.elrepo.x86_64 root=UUID=f41e390f-835b-4223-a9bb-9b45984ddf8d ro console=tty0 crashkernel=auto console=ttyS0,115200i video=LVDS-1:d video=VGA-1:e drm_kms_helper.edid_firmware=edid/2560x1440.bin
The way to use a generated EDID firmware is mentioned but in passing in the Why? section. I suggest that it be explained in greater detail in a separate paragraph or Install firmware section. The correct kernel parameter these days seems to be drm.edid_firmware
rather than the old drm_kms_helper.edid_firmware
. The user must be warned that the value is a path relative to /lib/firmware/
and that the following pseudo-paths are hard-coded into the kernel:
edid/800x600.bin
edid/1024x768.bin
edid/1280x1024.bin
edid/1600x1200.bin
edid/1680x1050.bin
edid/1920x1080.bin
and take precedence over whatever actual file may be present at those paths.
Modeline "1920x240" 37.778 1920 1977 2154 2376 240 243 245 265 -hsync -vsync
Computed ratio: UNKNOWN
this modeline is needed for ultrawide resolution in ancient arcade machine.
I have a project that's using a monitor. The monitor we sourced doesn't include an EDID image, but adding one inline using a serial EEPROM would be possible. We just need to be able to generate an EDID Firmware to make it work.
Would it be a lot of work if support for interlaced modes was added?
Some people would need it, I would need it. (CRT projector, 1080 lines interlaced.)
Meanwhile, I'm studying your work and alternative ways to spoof the EDID.
I'm using an ultra-wide samsung monitor (https://www.samsung.com/ca/monitors/ultra-wide/ultra-wqhd-monitor-with-21-9-wide-screen-34-inch-ls34j552wqnxza/), which is 3440x1440. That's an aspect ratio of 7x4 (or 21x9 as Samsung puts it, which is an odd way of writing a ratio). Anyways, I'm trying to get it to work on my Ubuntu machine, and I'm using your tool. It generates this code: 3440x1440_60.00.S.txt When I try to compile the generated code, I get this error:
edid.S:175: Error: invalid operands (UND and ABS sections) for `<<'
This appears to be because the ratio isn't defined as one of the XY_RATIO* definitions at the top of edid.S. I looked in the EDID specifications, and it looks like only those 4 (16x10, 4x3, 5x4 and 16x9) are supported by EDID. I feel like EDID should support these sorts of weird aspect ratios, but at a quick glance it doesn't appear to. What am I missing here?
Is it possible to define ratio like 3:1? From code and wiki page I only see 4 possible variants of ratio and no way to add more.
Hi,
I am trying to use the tool in Fedora 33, kernel 5.8.11, gcc version 10.2.1 and stuck in the following error:
./modeline2edid - <<< 'Modeline "2560x1080_60.00" 230.00 2560 2720 2992 3424 1080 1083 1093 1120 -hsync +vsync ratio=21:9'
...
Wrote 2560x1080_60.00.S
$ make:
cc -c -DCRC="0x00" -o 2560x1080_60.00.o 2560x1080_60.00.S
edid.S: Assembler messages:
edid.S:171: Warning: value 0x121 truncated to 0x21
edid.S:270: Warning: repeat < 0; .fill ignored
edid.S:175: Error: invalid operands (*UND* and *ABS* sections) for `<<'
make: *** [Makefile:16: 2560x1080_60.00.o] Error 1
$
Any suggestion on what could be the problem?
Is the generated .bin file generic and related only to the resolution/rate? (independently from GPU, SO, etc..)
If so, could the 2560x1080@60 be also committed to the repo, please? It is a common resolution for newer ultrawide displays and really helpful for users to direct download and attempt the fix.
Thank you
I have issues, when i use this command:
./modeline2edid - <<< 'Modeline "800x1280" 68.500 800 816 832 880 1280 1283 1285 1296 -HSync -VSync ratio=16:10'
make
edid-decode 800x1280.bin
it return : EDID length 127 is not a multiple of 128.
I created an EDID based on
Modeline "1280x960@85R" 146.77 1280 1314 1574 1728 960 961 964 1011 +HSync +VSync
This did not work. The monitor did not sync to it. However, that same mode worked via xrandr
. The problem is obvious when the EDID is viewed via edid-decode -X [email protected]
:
Modeline "1280x960_84.01" 146.770 1280 1314 1318 1728 960 961 964 1011 +HSync +VSync
Everything matches, but the end of horizontal sync was changed from 1574 to 1318. The horizontal sync pulse is extremely short, from 1314 to 1318, and that is too short. Some overflow caused this to happen, and there was no error message.
Note how verifying the mode via edid-decode -X
is useful.
BTW. The mode was customized from 1280x960 85 Hz to match image position on the CRT with other sources. I did not need such a long horizontal sync pulse. So I shortened it, successfully created an EDID based on the following modeline, and got the desired results on the monitor:
Modeline "1280x960_84.01" 146.770 1280 1314 1474 1728 960 961 964 1011 +HSync +VSync
This is a great tool, thanks very much.
I am using it to get Linux to boot on an apple emac.
I wondered if it's possible to include multiple modes in one EDID binary?
I believe EDID normally supports this?
It would be good to have all the different modes of the emac monitor supported out of the box.
Thanks again
Searching for runaway unicorns in '/dev/stdin'
-- Found naughty unicorn: Modeline "1088x816_83.00" 103.50 1088 1160 1272 1456 816 819 823 859 -hsync +vsync
Wrote 1088x816_83.00.S
EDID version: 1.3
Manufacturer: HKL Model 0 Serial Number 0
Made in week 12 of 2017
Digital display
Maximum image size: 28 cm x 21 cm
Gamma: 2.20
DPMS levels: Standby Suspend Off
RGB color display
First detailed timing is preferred timing
Display x,y Chromaticity:
Red: 0.6416, 0.3486
Green: 0.2919, 0.5957
Blue: 0.1474, 0.1250
White: 0.3125, 0.3281
Established timings supported:
Standard timings supported:
1088x816@60Hz 4:3
Detailed mode: Clock 103.500 MHz, 283 mm x 212 mm
1088 1160 1272 1456 hborder 0
816 819 823 859 vborder 0
+hsync +vsync
VertFreq: 82 Hz, HorFreq: 71085 Hz
Serial number: Linux #0
Monitor ranges (GTF): 59-61Hz V, 70-72kHz H, max dotclock 110MHz
Monitor name: 1088x816_83.0
Has 48 extension blocks
Checksum: 0xa (should be 0x63)
cat 1088x816_83.00.bin > /home/mittorn/debug/dri/0/VGA-1/edid_override
cat: write error: Invalid argument
/* 1088x816_83.00: Modeline "1088x816_83.00" 103.50 1088 1160 1272 1456 816 819 823 859 -hsync +vsync */
#define HSYNC_POL 1
#define VSYNC_POL 1
#define YPULSE (63+4)
#define XPULSE 112
#define YPIX 816
#define XPIX 1088
#define VFREQ 60
#define DPI 96
#define CLOCK 103500
#define VERSION 1
#define REVISION 3
#define XOFFSET 72
#define YOFFSET (63+3)
#define XY_RATIO XY_RATIO_16_9
#define YBLANK 43
#define XBLANK 368
#define TIMING_NAME "1088x816_83.00"
#include "edid.S"
I generated a file for my 1360x768 monitor and everything worked in edid-generator
. But the resulting file doesn't load at boot time:
$ dmesg|grep -i edid
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-linux-lts root=UUID=335e9118-3b2d-419e-97e8-9ecb1f5bb34c rw amdgpu.cik_support=1 radeon.cik_support=0 amdgpu.dc=1 drm_kms_helper.edid_firmware=edid/1360x768_60.00.bin video=1360x768
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux-lts root=UUID=335e9118-3b2d-419e-97e8-9ecb1f5bb34c rw amdgpu.cik_support=1 radeon.cik_support=0 amdgpu.dc=1 drm_kms_helper.edid_firmware=edid/1360x768_60.00.bin video=1360x768
[ 1.560475] platform DVI-I-1: Direct firmware load for edid/1360x768_60.00.bin failed with error -2
[ 1.560500] [drm:drm_load_edid_firmware [drm_kms_helper]] *ERROR* Requesting EDID firmware "edid/1360x768_60.00.bin" failed (err=-2)
[ 1.640462] platform DVI-I-1: Direct firmware load for edid/1360x768_60.00.bin failed with error -2
[ 1.640481] [drm:drm_load_edid_firmware [drm_kms_helper]] *ERROR* Requesting EDID firmware "edid/1360x768_60.00.bin" failed (err=-2)
[ 1.750471] platform DVI-I-1: Direct firmware load for edid/1360x768_60.00.bin failed with error -2
[ 1.750505] [drm:drm_load_edid_firmware [drm_kms_helper]] *ERROR* Requesting EDID firmware "edid/1360x768_60.00.bin" failed (err=-2)
[ 8.011317] [drm:drm_load_edid_firmware [drm_kms_helper]] *ERROR* Size of EDID firmware "edid/1360x768_60.00.bin" is invalid (expected 6272, got 130
[ 8.090596] [drm:drm_load_edid_firmware [drm_kms_helper]] *ERROR* Size of EDID firmware "edid/1360x768_60.00.bin" is invalid (expected 6272, got 130
[ 11.760539] [drm:drm_load_edid_firmware [drm_kms_helper]] *ERROR* Size of EDID firmware "edid/1360x768_60.00.bin" is invalid (expected 6272, got 130
[ 19.440719] [drm:drm_load_edid_firmware [drm_kms_helper]] *ERROR* Size of EDID firmware "edid/1360x768_60.00.bin" is invalid (expected 6272, got 130
The system is Arch Linux with the LTS kernel
$ uname -a
Linux AlgoCompSynth 4.14.68-1-lts #1 SMP Wed Sep 5 14:38:31 CEST 2018 x86_64 GNU/Linux
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.