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

Bug #1814938 reported by Davidaf on 2019-02-06
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
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.

Davidaf (davidaf) wrote :

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Brad Figg (brad-figg) on 2019-02-06
tags: added: bjf-tracking
賴家亨 (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"

Kai-Heng Feng (kaihengfeng) wrote :

Is the EDID file in initramfs?

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.

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)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers