Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDID length 127 is not a multiple of 128. #21

Open
bensuperpc opened this issue Jun 17, 2021 · 9 comments
Open

EDID length 127 is not a multiple of 128. #21

bensuperpc opened this issue Jun 17, 2021 · 9 comments

Comments

@bensuperpc
Copy link

bensuperpc commented Jun 17, 2021

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.

@Meister1593
Copy link

Same thing, and i noticed that every other binary in this repo is 127 bytes instead of 128
what happened?

@Saroumane
Copy link

I had this problem too, and it disappeared when I edit my *.S file to reduce TIMING_NAME to 12 letters maximum.
#define TIMING_NAME "xxxxxxx"

Besides, modeline2edid seems to ignore +/- Hsync Vsync parameters. You have to edit them manually in the *.S file before using make

In @bensuperpc case :

#define HSYNC_POL 0
#define VSYNC_POL 0

@olm52
Copy link

olm52 commented May 7, 2022

Using this modeline:
/usr/bin/zsh modeline2edid - <<< 'Modeline "3840x2160" 522.09 3840 3848 3880 3920 2160 2208 2216 2222 +hsync -vsync'

Result of make:

cc -c -DCRC="0x00" -o 3840x2160.o 3840x2160.S
edid.S: Assembler messages:
edid.S:171: Warning: value 0x00000000000001c1 truncated to 0x00000000000000c1
edid.S:205: Warning: value 0x0000000000000308 truncated to 0x0000000000000008
objcopy -Obinary 3840x2160.o 3840x2160.bin.nocrc
cat 3840x2160.bin.nocrc | edid-decode \
        | sed -ne 's/^[ ]*Checksum: 0x\w\+ (should be \(0x\w\+\))$/\1/p' >3840x2160.crc
cc -c -DCRC="$(cat 3840x2160.crc)" -o 3840x2160.p 3840x2160.S
edid.S: Assembler messages:
edid.S:171: Warning: value 0x00000000000001c1 truncated to 0x00000000000000c1
edid.S:205: Warning: value 0x0000000000000308 truncated to 0x0000000000000008
objcopy -Obinary 3840x2160.p 3840x2160.bin
objcopy -Oihex 3840x2160.p 3840x2160.bin.ihex
dos2unix --quiet 3840x2160.bin.ihex
rm 3840x2160.p 3840x2160.crc 3840x2160.bin.nocrc 3840x2160.o

Unfortunately the result is a 127 bit bin

@parkerlreed
Copy link

Same here for 1080p @ 120. Shorted the name to avoid 130 byte but ended up with 127

(255)(deck@steamdeck edid-generator)$ cat modeline
Modeline "1920x1080"  297.00  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync
(deck@steamdeck edid-generator)$ cat 1920x1080.bin | edid-decode
EDID length 127 is not a multiple of 128.

@parkerlreed
Copy link

Tried again with another name but same result

(130)(deck@steamdeck edid-generator)$ ./modeline2edid modeline
Searching for modelines in 'modeline'
-- Found modeline: Modeline "1920x1080120" 297.00 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Computed ratio: 16:9Wrote 1920x1080120.S
(deck@steamdeck edid-generator)$ make
cc -c -DCRC="0x00" -o 1920x1080120.o 1920x1080120.S
objcopy -Obinary 1920x1080120.o 1920x1080120.bin.nocrc
cat 1920x1080120.bin.nocrc | edid-decode \
        | sed -ne 's/^[ ]*Checksum: 0x\w\+ (should be \(0x\w\+\))$/\1/p' >1920x1080120.crc
cc -c -DCRC="$(cat 1920x1080120.crc)" -o 1920x1080120.p 1920x1080120.S
objcopy -Obinary 1920x1080120.p 1920x1080120.bin
objcopy -Oihex 1920x1080120.p 1920x1080120.bin.ihex
dos2unix --quiet 1920x1080120.bin.ihex
rm 1920x1080120.o 1920x1080120.p 1920x1080120.bin.nocrc 1920x1080120.crc
(deck@steamdeck edid-generator)$ cat 1920x1080120.bin | edid-decode
EDID length 127 is not a multiple of 128.

@parkerlreed
Copy link

This is the .S it creates

/* 1920x1080120: Modeline "1920x1080120" 297.00 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync */
#define HSYNC_POL 1
#define VSYNC_POL 1
#define YPULSE (63+5)
#define XPULSE 44
#define YPIX 1080
#define XPIX 1920
#define VFREQ 60
#define DPI 96
#define CLOCK 297000
#define VERSION 1
#define REVISION 3
#define XOFFSET 88
#define YOFFSET (63+4)
#define XY_RATIO XY_RATIO_16_9
#define YBLANK 45
#define XBLANK 280
#define TIMING_NAME "1920x1080120"
#include "edid.S"

@diegorondini
Copy link
Contributor

I am quite convinced this is related to compiler / compiler tools version. Gcc 12 for sure has this issue.
I've been able to build EDID with correct length using gcc 9 from a docker container. Something like this worked for me:

docker run -it --rm -v $(pwd):/workdir:Z --workdir=/workdir gcc:9 bash
apt update
apt install dos2unix edid-decode bsdmainutils zsh
git clone https://github.com/akatrevorjay/edid-generator.git
cd edid-generator
echo 'Modeline "1280x800R"   71.00  1280 1328 1360 1440  800 803 809 823 +hsync -vsync' | ./modeline2edid
make

@marwanramadan
Copy link

I might have a fix for this problem.

In Makefile are 2 calls of objcopy -Obinary. Adding the option -j .data to the 2 calls fixed the problem for me.
(Note the dot in front of data.)
I'm not sure if that is because of a change in gcc or in objcopy. With new versions, there will be some code in the .text segment and objcopy copies the .text segment instead of the .data segment.

Hope that will help someone.

diegorondini added a commit to diegorondini/edid-generator that referenced this issue Sep 20, 2022
Fix issue EDID bin length issue that apperead on recent versions of gcc
or objcopy (see akatrevorjaygh-21). The fix has been originally suggested by
marwanramadan.
@ant-222
Copy link

ant-222 commented Jan 2, 2023

I had the same problem, which caused the following kernel message:

[drm:edid_load [drm]] *ERROR* Size of EDID firmware "1280x1024.bin1" is invalid (expected 0, got 127

In my case, the problem was solved by installing edid-decode. Although it is listed as a prerequisite, it is still a defect that Makefile successfully builds a corrupt firmware binary in its absence. Please, do not ignore an absent edid-decode and abort the build process.

nazarewk added a commit to nazarewk/edid-generator that referenced this issue Oct 17, 2023
nazarewk added a commit to nazarewk/edid-generator that referenced this issue Oct 17, 2023
nazarewk added a commit to nazarewk/edid-generator that referenced this issue Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants