Lenovo legion 5 problem : The refresh rate saga

Hello everyone! TurkeyJohn here. The funny fat turkey has finally bought a new laptop. A legion 5 with a 120hz 1080p screen, amd ryzen 5 5600h, rtx 3050 and other shenanigans.
Now, here is the funny “bug” that I have:
Introducing…
:turkey: Display refresh rate stuck at 120hz problem :turkey:

All DEs that I tried (except kde, check below) would not let me switch the refresh rate from 120hz to 60hz, nor would it register the VRR display, also tested x11 and wayland
KDE on the other hand, X11 does not let me switch the refresh rate. HOWEVER, if I switch to Wayland, I am able to do that but the screen would bug out and freeze it. So nothing could be done.

Xrandr always reports 120hz on all resolutions.

The edid method fixed something but only for KDE.
I am able to see the refresh rates from 60hz to 120hz. Switching them doesn’t do anything (or linux is so smooth lol) even if the screen flashed to black and back to normal as it should. On wayland…VRR is recognized, but switching refresh rates will still “break” the screen.

Xrandr…sort of recognizes all the resolutions.

I am left without any options. I request help from the EndeavourOS forum to see what I can fix on my laptop.
Gobble Gobble gobble

After googling the ryzen 5 5600h, it seems to be an apu. One of those cpu chips with integrated graphics, so my first guess is hybrid graphics shenanigans. I don’t have hybrid graphics and never have some how, so I don’t know the solutions for this kind of stuff. Maybe this could point you in the right direction though.

Not sure which model you have? Is it a legion 5 pro or slim? Can you post the hardware output? Post the url. I don’t see any on the lenovo site with those specs. They are just showing newer or other models.

Also does this laptop do 144hz screen? It is a hybrid with apu and Nvidia RTX 3050

Edit: I know some models do 144Hz or higher.

inxi -Faz | eos-sendlog

Maybe this helps?

https://wiki.archlinux.org/title/Variable_refresh_rate#Xorg_configuration

1 Like

I even tried dedicated graphics mode, and that didn’t work either. Maybe because nvidia had its own edid.bin file or something? Need to test more.

Legion 5 gen 6 standard/base version (not slim, not pro, nothing.)
Also sadly, I don’t have the 144hz screen (there is a 165hz screen but I can’t upgrade it myself or risk it anyway)

Ok so now the refresh rate doesn’t actually change but it actually “limits fps” to 60, no matter what I change.
Wayland has the same issue.
My screen is vrr capable but still, not sure why it keeps causing these issues…

output of the command you told me to run:

http://ix.io/4IEh

I see this in command line. Did you add this?

drm.edid_firmware=eDP:edid/edid.bin

Edit: I did see this so you may be on the right track. I dion’t have any experience setting edid as i don’t have any monitors that are above 60 hz.

I also see amdgpu.freesync_video=1 which i think is okay but if your monitor supports freesync i wouldn’t think it would be needed? I’m no expert but just a curious question thinking. :thinking:

1 Like

I did them both and…well…it does show up when I am in hybrid graphics (I can "switch refresh rates)
X11 : Refresh rate switches but it stays on 60hz no matter what (if I go back to 120hz for example)
Wayland : Changing refresh rates breaks the display output and freezes the system until I do a force reboot.
Interestingly, going from hybrid to dedicated mode through bios, Nvidia ignores the edid I set and actually uses its own Edid, which breaks everything and keeps my system stuck at 120hz.
Honestly, I just want to be able to use freesync and save up battery when i go to 60hz.
Not sure why ONLY KDE Plasma is able to let me switch the refresh rates somewhat. Even with a mutter-vrr patch for gnome it wouldn’t budge.
This could be a driver issue from amdgpu, nvidia and the kernel itself, as I can easily switch from 120hz to 60hz and back and forth. Hell, even freesync!
This is a rather tiresome experiment and probably a waste of time, but I want to contribute to the Linux community somehow.
Regardless, I was thinking of tweaking the edid a bit more and see what I can do to make it work.
I don’t know who to talk about this. I am in SERIOUS need for help…

I will try out the link you provided

Also, this is what I tried before making this post.

According to what i have read you have to use 165hz to use freesynce on AMD

https://linuxreviews.org/HOWTO_enable_Adaptive_Vertical_Sync_(Freesync)_on_AMD_GPUs

It works on 120hz screens too, otherwise it wouldn’t show up in windows. Even the specs say that too

Sorry i meant VRR not Freesync.

VRR is basically Freesync

1 Like

Can you explain what the solution was?

Yes, no worries!

SOLUTION FOR THE REFRESH RATE SAGA!
After spending countless hours figuring out what, how and why to fix this issue and dealing with certain caveats, I managed to overcome this problem.

For starters, you need a edid.bin file from Windows by extracting it with CRU. This is the best way to do so as Legion hardware was (sadly) built with Windows in mind.

Boot up your favorite linux distribution and type the following commands in the terminal:
BEFORE RUNNING THE COMMAND BELOW, UNPLUG ALL EXTERNAL DISPLAYS!
Get the display ID by running:

for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done

My display ID is eDP-1 or eDP-2 (switching distributions changes this id. Not sure why and how)

Then, we need to create a folder and move the edid.bin file there:

sudo mkdir /lib/firmware/edid && sudo cp (path to edid file)/edid.bin /lib/firmware/edid

Then, you will need to add some parameters in GRUB/systemd-boot:

GRUB

sudo nano /etc/default/grub
*Add these in LINUX_DEFAULT section: *
amdgpu.freesync_video=1 drm.edid_firmware=x:edid/edid.bin video=x:e

*update GRUB by running update-grub or other methods you use. Reboot* 

SYSTEMD-BOOT
sudo nano /efi/loader/entries/(conf file of your current boot. make sure it's not the rollback file!)
*Add these in OPTIONS section:*
amdgpu.freesync_video=1 drm.edid_firmware=x:edid/edid.bin video=x:e

*Reboot*

*change x with the display id you found earlier.*
*amdgpu command is only for amd hardware*.

Confirmed linux distributions that work based on what I did earlier:

  • Ubuntu : Works.
  • Linux mint : Works…sort of. It didn’t acknowledge my edid file until I did 2-3 reboots.
  • Pop_OS : Old Gnome version, refuses to acknowledge the edid file (probably throws an error but I couldn’t catch it…)
  • EndeavourOS : Works only if you DON’T use KDE PLASMA (it’s either a plasma issue or something related to vrr. Not sure yet)
  • Manjaro : Same as EndeavourOS
  • Fedora : Same as EndeavourOS
  • Kubuntu : Throws an error=-2, doesn’t read the edid file for some reason.

(UPDATE 2024 : This method works in all major distros. Wayland + nvidia 560 and above will fix any duplicated refresh rate values, as well as changing them very well!)

If you use this method, at least for now don’t use it on distributions that bundle Plasma(Maybe plasma version 6 will fix this issue?) as the default DE or a very old version of the current DEs. Not sure what causes this and I can’t look into this even further. I did notice something rather strange : Gnome with VRR patch sometimes plays nicely with the edid file, other times refuses to acknowledge it. (noticed this on Nobara.)
This is also a semi fix as if you reduce the resolution, you will be forced back to the highest refresh rate. Maybe there is more to be done here, but that’s past my knowledge and time. So, I invite others to contribute here. Good luck!
Gobble Gobble.

2 Likes

One last addition:
It seems the edid method creates 2 60hz refresh rates. One is the working one and the other is the broken one. This is what I noticed with Gnome in particular.
Maybe this is why the refresh rate bug still occurs on vrr compatible DEs like Plasma, as it registers the BROKEN 60hz mode.
Maybe this happens because :

  • Edid has another mode called “hz range” which is used for freesync
  • Plasma replaces the working 60hz with the broken 60hz (maybe this is why it also is more buggy on Wayland)

Welp, guess I am “stuck” with gnome for now, until i find a fix (will removing the “hz range” break freesync?)

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.