Skip to main content
Topic: Avoiding resolution changes during boot? (Read 723 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Avoiding resolution changes during boot?

Just wondering if there is a way to avoid resolution changes during boot.  I use a TV as a monitor and it's preferred resolution is 3840x2160 but at this resolution it only supports up to 30hz refresh, so I run everything at 1920x1080@60hz.  I've managed to get working xorg.conf.d files to set 1920x1080 as preferred and so X defaults to 1920x1080 no problem.  Also in refind.conf the resolution successfully sets to 1920x1080.  I also have a kernel parameter of video=HDMI-A-1:1920x1080@60 but I'm not sure if this is a good method as the arch wiki says that any vga= or video= parameters will interfere with kms but without it my console resolution defaults to 3840x2160.

Thing is even with the video= line there, during boot I get switch to 3840x2160 followed immediately by a switch back to 1920x1080.  I'm assuming this is happening when amdgpu driver is loaded.  I was hoping maybe there was something to be put in /etc/modprobe.d to configure amdgpu's preferred resolution but it doesn't look like there are any parameters relating to that.

My latest attempt was to use the drm_kms_helper.edid_firmware= kernel parameter after generating an edid file from my modeline I used in xorg.conf.d using the instructions here https://kodi.wiki/view/Archive:Creating_and_using_edid.bin_via_xorg.conf#Method_2:_Generate_edid.bin_from_an_Xorg_modeline_(edid-generator).

I tried drm_kms_helper.edid_firmware=HDMI-A-1:edid/1920x1080_60.bin as well as drm_kms_helper.edid_firmware=edid/1920x1080_60.bin but it has no effect.  I just placed my generated 1920x1080_60.bin in /usr/lib/firmware/edid/ but something tells me that's not enough and it should be included with mkinitcpio maybe?

Any ideas?

Re: Avoiding resolution changes during boot?

Reply #1
I just placed my generated 1920x1080_60.bin in /usr/lib/firmware/edid/ but something tells me that's not enough and it should be included with mkinitcpio maybe?

Any ideas?
Try it. You have the FILES section of /etc/mkinitcpio.conf https://wiki.archlinux.org/title/Mkinitcpio#BINARIES_and_FILES
Code: [Select]
FILES=(/usr/lib/firmware/edid/1920x1080_60.bin)
Then rebuild it obviously.

Re: Avoiding resolution changes during boot?

Reply #2
Yes I tried that after making my post but it made no difference.  Also I noticed that the file I built (1920x1080_60.bin) reports "EDID length 127 is not a multiple of 128." when I run edid-decode 1920x1080_60.bin for some reason though I have no idea why since I just copied the modeline from xorg.conf.d file.  But the edid-generator package comes with a 1920x1080.bin which seems like it would work:

Code: [Select]
Standard Timings:
    DMT 0x52:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz

Of course I'm not really at the point of worrying about the quality of the .bin file since I can't seem to get it to be loaded as intended.

Re: Avoiding resolution changes during boot?

Reply #3
Okay I have succeeded through a few attempts.  Here's what I had to do.

1) The correct kernel parameter: drm_kms_helper.edid_firmware=edid/1920x1080_60.bin. I'm a little surprised that I didn't need the "HDMI-A-1:" part in there, but maybe it would work I just had the wrong identifier somehow, maybe it wants HDMI-0 or HDMI-A or HDMI-1, I was just going off an earlier read tutorial / forum-post on what to use, so no idea if it's valid.

(edit, a little more trial and error revealed that using "drm_kms_helper.edid_firmware=HDMI-A-1:edid/1920x1080_60.bin" does in fact work, I had been using card0-HDMI-A-1which is what shows up in /sys/class/drm/ so I figured that was right)

2) Add "FILES=(/lib/firmware/edid/1920x1080_60.bin)" to mkinitcpio.conf and run mkinitcpio -P ... I tried it without it in there and with, and it doesn't work if it's not included so that answers that question.

3) Apparantly, the issue I was having with my generated EDID being "EDID length 127 is not a multiple of 128." was a result of gcc versions (perhaps), but someone on github found a solution of adding "-j .data" to the two calls of "objcopy -Obinary" in the Makefile.  So after those changes I was able to generate my own EDID.bin rather than using the one that came supplied (though I would imagine the supplied one would probably have been fine).

After these changes were made I no longer have any flashes / modechanges during boot, just 1080p all the way from rEFInd to xfce.  In addition there is no longer even the option to set the 4k @30hz resolution, so I likely don't even need to specify resolution settings anywhere (xorg.conf.d for example).

Edit (again)... now my sound isn't working.  Somewhere in the edid there must be something audio related?  And the minimal edid I am using circumvents that I guess.  Ugh.. that's brutal.  I thought I had hit paydirt.  Well... scrap this whole idea I guess.

So I downloaded this program off the aur called wxedid that can open, edit, and save an edid and I went through the factory edid and changed everything in there to 1920x1080 and using that modified edid I have 1080p as preferred/native resolution.

Unfortunately I still have a bright purple flash a second or two before X starts up.  Blah what a frustration to get so close...

Re: Avoiding resolution changes during boot?

Reply #4
Well thanks for coming back and detailing what you did to get it (partially?) working.

Now that you've edited the factory edid is your sound working again ?

Re: Avoiding resolution changes during boot?

Reply #5
Yes sound is functional as the audio block (portion?) is just as it was, I only edited the video stuff.  And even though I have 1920x1080 as default (preferred) resolution, I still have the weird purple fullscreen flash before X starts which is kind of annoying.  Perfect solution would be to somehow copy out the audio blocks from the factory edid and paste them into my generated edid but that is beyond my abilities unfortunately.

Re: Avoiding resolution changes during boot?

Reply #6
Have you tried something like this in /etc/default/grub (issue # update-grub after editing) :
Code: [Select]
# 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 `videoinfo'
GRUB_GFXMODE=1920x1080,auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep
It might help - or might not  :D  You can usually set the resolution in the desktop settings, which is handled separately when the desktop starts - different desktops do this differently, and certainly some desktops will give a flash of something when starting up on some hardware, while other desktops will work correctly on the same machine.

Re: Avoiding resolution changes during boot?

Reply #7
Just tried it and it does the same thing, purple flash right before my consolefont gets loaded.  I've been using rEFInd with a snazzy theme but kept grub there in case I did something stupid to my rEFInd setup.

I've been having no luck finding anybody else complaining about this although I did find a bug-report that dates back to kernel 2.something that sounds very similar though maybe more severe:

https://savannah.gnu.org/bugs/index.php?33318
https://bugs.launchpad.net/ubuntu/+source/nvidia-settings/+bug/781445

What's frustrating is that using a stripped down replacement EDID does solve the problem, I just need to figure out away to somehow include the audio data in it :P

Well ... it's not a perfect solution but if I just reenable the onboard audio and switch a few plugs I can use the barebones generated EDID, to avoid the purple flash / modesetting issues.  So I guess it's all good :)  Edid's are a pain though I tell ya.  Maybe I'll revisit it at some point.  Something tells me a hex editor might be a decent approach to copy-pasting sections, though it seems there's always a "header" that indicates how many bytes are contained within it's section.  Doable I'm sure my brain is just slow these days :P

Re: Avoiding resolution changes during boot?

Reply #8
Well the grub advice won't help as your using rEFInd. (best choice imho)

Unless you are chainloading into Grub from rEFInd?
Which can be done if Grub is present. Might be worth trying but I doubt that would help?

As you suspect I think your best hope is to continue to play around with the edid file or train yourself to execute a well timed blink  ;)