drm.edid_firmware fails to load firmware where crypsetup-initramfs is installed

Bug #1814938 reported by Davidaf
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

My HP LP2475W monitor reports incorrect EDID info resulting in bad image quality.

It can be fixed with a customized edid file, and adding drm.edid_firmware kernel boot parameter.

But in Ubuntu 18.04.1 and Ubuntu 18.10, if crypsetup-initramfs package is installed, it fails to load the firmware file.

Detailed bug report:

Following this istructions (https://blog.tingping.se/2018/12/01/amdgpu-fullrgb.html), I created a modified edid.bin file in /lib/firmware/edid/edid.bin and passed drm.edid_firmware=edid/edid.bin to the kernel at boot.

In my daily Ubuntu 18.04.1 dmesg report this error and I could not solve it.
[ 1.173897] platform HDMI-A-1: Direct firmware load for edid/edid.bin failed with error -2

So I tried in a fresh Ubuntu 18.10 and it worked nicely, no error and nice crisp display image.
But when I began to install the software I need for daily use it ceased to work and began to show the same message as in my work Ubuntu 18.04.1.

After some test it seems that the problem occurs after I install cryptsetup:
------
dmesg | grep edid
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.18.0-14-generic root=UUID=dfb5fdf3-b93b-4abf-99fd-d5a7ec4e66df ro drm.edid_firmware=edid/edid.bin quiet splash vt.handoff=1
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.18.0-14-generic root=UUID=dfb5fdf3-b93b-4abf-99fd-d5a7ec4e66df ro drm.edid_firmware=edid/edid.bin quiet splash vt.handoff=1
[ 3.792846] [drm] Got external EDID base block and 1 extension from "edid/edid.bin" for connector "HDMI-A-1"
------

I purged cryptsetup but the problem persisted, so I removed too cryptsetup-initramfs and the the problem disapeared and the edid file is loaded again, improving the display quality:
------
dmesg | grep edid
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.18.0-14-generic root=UUID=dfb5fdf3-b93b-4abf-99fd-d5a7ec4e66df ro drm.edid_firmware=edid/edid.bin quiet splash vt.handoff=1
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.18.0-14-generic root=UUID=dfb5fdf3-b93b-4abf-99fd-d5a7ec4e66df ro drm.edid_firmware=edid/edid.bin quiet splash vt.handoff=1
[ 3.717878] [drm] Got external EDID base block and 1 extension from "edid/edid.bin" for connector "HDMI-A-1"
-------

This question in AskUbuntu suggest that there are more people with this probem (https://askubuntu.com/questions/1113195/how-to-output-full-range-rgb-in-ubuntu-18-04-1)

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: linux-image-4.18.0-14-generic 4.18.0-14.15
ProcVersionSignature: Ubuntu 4.18.0-14.15-generic 4.18.20
Uname: Linux 4.18.0-14-generic x86_64
ApportVersion: 2.20.10-0ubuntu13.2
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: david 2007 F.... pulseaudio
 /dev/snd/pcmC0D1p: david 2007 F...m pulseaudio
 /dev/snd/controlC1: david 2007 F.... pulseaudio
Date: Wed Feb 6 18:37:39 2019
InstallationDate: Installed on 2019-02-06 (0 days ago)
InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 (20181017.3)
IwConfig:
 lo no wireless extensions.

 enp7s0 no wireless extensions.
MachineType: Gigabyte Technology Co., Ltd. To be filled by O.E.M.
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=es_ES.UTF-8
 SHELL=/bin/bash
ProcFB: 0 amdgpudrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.18.0-14-generic root=UUID=dfb5fdf3-b93b-4abf-99fd-d5a7ec4e66df ro drm.edid_firmware=edid/edid.bin quiet splash vt.handoff=1
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
RelatedPackageVersions:
 linux-restricted-modules-4.18.0-14-generic N/A
 linux-backports-modules-4.18.0-14-generic N/A
 linux-firmware 1.175.1
RfKill:
 0: hci0: Bluetooth
  Soft blocked: no
  Hard blocked: no
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 07/11/2016
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: U1n
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: Z68X-UD3H-B3
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: To be filled by O.E.M.
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrU1n:bd07/11/2016:svnGigabyteTechnologyCo.,Ltd.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnGigabyteTechnologyCo.,Ltd.:rnZ68X-UD3H-B3:rvrTobefilledbyO.E.M.:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.family: To be filled by O.E.M.
dmi.product.name: To be filled by O.E.M.
dmi.product.sku: To be filled by O.E.M.
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

Revision history for this message
Davidaf (davidaf) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Brad Figg (brad-figg)
tags: added: bjf-tracking
Revision history for this message
賴家亨 (laichiaheng) wrote :

[drm:drm_load_edid_firmware [drm]] *ERROR* Requesting EDID firmware "edid/edid1.bin" failed (err=-2)

user@user:~$ ls -la /usr/lib/firmware/edid/edid.bin
-rw-r--r-- 1 root root 256 1月 27 13:15 /usr/lib/firmware/edid/edid.bin

user@user:~$ ls -la /lib/firmware/edid/edid.bin
-rw-r--r-- 1 root root 256 1月 27 13:18 /lib/firmware/edid/edid.bin

user@user:~$ cat /etc/default/grub |grep firmware
GRUB_CMDLINE_LINUX_DEFAULT="drm.edid_firmware=/lib/firmware/edid/edid.bin quiet splash"

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Is the EDID file in initramfs?

Revision history for this message
Davidaf (davidaf) wrote :

SOLVED.

Reponding to Kai-Heng question, the edid file was not in initramfs and I didn't know how to add it at the time.

I was using another monitor the last months and didn't encounter this problem.
This week I connected the monitor and found the same problem again, this time with Ubuntu 19.10 and Kubuntu 19.10.

This time I was using an encrypted root partition so the edid file must be in the initfd file to be found by the kernel.

I managed to include it by creating a file named /etc/initramfs-tools/hooks/edid with this content:
-----------
#!/bin/sh
PREREQ=""
prereqs()
{
    echo "$PREREQ"
}

case $1 in
prereqs)
    prereqs
    exit 0
    ;;
esac

. /usr/share/initramfs-tools/hook-functions
# Begin real processing below this line
mkdir -p "${DESTDIR}/lib/firmware/edid"
cp -a /lib/firmware/edid/modified_edid.bin "${DESTDIR}/lib/firmware/edid/modified_edid.bin"
exit 0
-----------

The file needs execution permission: chmod +x /etc/initramfs-tools/hooks/edid
And initrd must be updated: update-initramfs -u

After that "lsinitramfs /boot/initrd.img-5.3.0-40-generic | grep edid" shows the file included.

With this the kernel is able to load the file at boot, and the monitor works nicely.

I suppose the source of this bug is me not knowing how to manage Ubuntu boot process, so if no one more is affected by this problem I think the bug can be closed.
Thanks.

Revision history for this message
Ryan Lovelett (ryan-lovelett) wrote :

I can confirm that davidaf's work around worked. Though the interesting thing to me was that in 19.10 I didn't have to put the file in initrafs. After upgrading to the 20.04 daily builds this became necessary. Not sure if that means anything or not. Just thought I'd provide an extra data point.

affects: linux (Ubuntu) → initramfs-tools (Ubuntu)
Revision history for this message
Tobias Görgens (tobipeter) wrote :

hey there, I have the exact same problem, but I couldn't find a solution yet.
I included the edid file using the script given above:

lsinitramfs /boot/initrd.img-5.11.0-25-generic | grep edid
usr/lib/firmware/edid
usr/lib/firmware/edid/edid.bin

my grub config looks like this:

cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash drm.edid_firmware=edid/edid.bin"
GRUB_CMDLINE_LINUX_DEFAULT="drm.edid_firmware=edid/edid.bin quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=1920x1080-24

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

and dmesg logs the following:

sudo dmesg | grep edid
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-5.11.0-25-generic root=UUID=79d59e63-ceea-4975-abf4-b34964ea06c0 ro rootflags=subvol=@ drm.edid_firmware=edid/edid.bin quiet splash vt.handoff=7
[ 0.050890] Kernel command line: BOOT_IMAGE=/vmlinuz-5.11.0-25-generic root=UUID=79d59e63-ceea-4975-abf4-b34964ea06c0 ro rootflags=subvol=@ drm.edid_firmware=edid/edid.bin quiet splash vt.handoff=7

Though, I still have a low monitor resolution at boot time, which becomes correct when completely booted.
Have I missed anything here?
I'm using Ubuntu 21.04.

I already tried to get the edid file using the nvidia control panel and the read-edid tool, both didn't work.

Revision history for this message
Prajjwal Devkota (pdinthecloud) wrote (last edit ):

Running into the same problem. I have 2 Acer G6 G276HL (EDID: ACR Model 768) 27 inch monitors - one of them somehow got its EDID corrupted recently. Ideally, I'd like to write the good EDID into the monitor with the corrupted EDID, but barring that (edid-rw didn't work for me - IO error), I'd like to boot the system with a good EDID. I have two systems - one of which it works perfectly on, the other not so much.

Good system: Ubuntu 21.10 - only had to add good edid to /usr/lib/firmware/edid/acer_monitor.bin and update the grub conf accordingly - everything works.

Bad system: Ubuntu 20.04 based system. Steps tried:
- added good edid to /usr/lib/firmware/edid/acer_monitor.bin
- updated initramfs using script above as reference

In the good system: cat /sys/class/drm/card*/edid shows the updated edid for the card, while for the bad system, I don't see an edid override. cat /proc/cmdline confirms the edid override is in place.

e.g. for 20.04 based system (bad):

# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-5.13.0-30-generic root=UUID=f896afab-6f99-4478-a402-9d612972a5b5 ro drm.edid_firmware=DP1:ed
id/acer_monitor.bin quiet splash vt.handoff=7

# lsinitramfs /boot/initrd.img|grep edid
usr/lib/firmware/edid
usr/lib/firmware/edid/acer_monitor.bin

# cat /sys/class/drm/card0-DP-1/edid
... no overridden EDID ...

Revision history for this message
Benjamin Drung (bdrung) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Ubuntu 18.10 (cosmic) reached end-of-life on July 18, 2019.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it anymore. But if you are then please upgrade to the latest Ubuntu version and re-test. If you then find the bug is still present in the newer Ubuntu version, please add a comment here telling us which new version it is in.

Changed in initramfs-tools (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for initramfs-tools (Ubuntu) because there has been no activity for 60 days.]

Changed in initramfs-tools (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.