Live data from Hacker News

Hacking the LG Monitor's EDID

gist.github.com

101–110 of 146 posts

Re: Hacking the LG Monitor's EDID

#101
post #11
post #4

1. This is impressive debugging work by the author. No individual step is rocket science - especially when the story is the success path and not the forking paths of possible failures - but they kept their eyes on the prize and figured it out. 2. This reminds me why I no longer use linux on the desktop

> 2. This reminds me why I no longer use linux on the desktop Lest anyone read this and nodded along: This was a defect in the LG monitor the OP worked around, not anything to do with Linux.

I don’t think that’s actually correct either. The monitor is advertising Freesync/GSync variable refresh rate. The Ultragear monitors are high end gaming monitors so they come with 48-240Hz VRR on some monitors. That’s the 48-144hz extension in the EDID of this monitor.

Based on debugging some issues I was having in macOS, I discovered from various Reddit and forums that Linux doesn’t handle that well depending on your driver stack/how you connect. If you’re on very modern hardware, kernels, and the OEM drivers it’s a better situation. macOS also has partially broken support for Freesync (or ProMotion as Apple brands it) at the moment on Intel machines.

I have an Asus GSync monitor with 48-144hz compatibility. This works over DisplayPort on my M2 Pro MacBook. On my RX6800 equipped Intel Mac I get 100Hz over DisplayPort 1.4 and 120Hz over HDMI 2.0 due to a DSC bug affecting Intel Macs. Even without that bug, 120Hz sometimes presents the OP’s issues between startup and login so I use 100Hz. The betas for the next macOS apparently fix this.

Either way, it’s a fun patch

Re: Hacking the LG Monitor's EDID

#102
Related, I have to use BetterDisplay to force a custom EDID since my xiaomi gaming monitor goes into YCbCr colour space and blacks become gray when connected to macOS. (Ironically the fix I was using before finding out about EDID patching and the cause of the problem, which I thought was bad calibration on my end, was to switch input source back and forth which somehow fixed the issue until the monitor was shut down)

Re: Hacking the LG Monitor's EDID

#103

Well… this monitor and its EDID are actually correct. The monitor supports 3440x1440 @ 144hz and in the EDID it’s setting that mode as preferred. I checked online and LG market the monitor with those specs, so it’s not an error. It would probably have been easier to flip the bit in the EDID that says the 60hz rate is preferred rather than messing about with the timings - since there is a perfectly good 60hz timing in…

Couldn’t this just be that the software isn’t capable of handling the maximum setting since the graphics card drivers aren’t loaded yet? And of course windows and macOS boot up with more conservative display settings knowing this? Essentially the other OSes are doing just what you’re describing.

Re: Hacking the LG Monitor's EDID

#104
post #39

Earlier quoted context omitted.

If that's also true of MacOS, that would mean LG made the effort of adding extra data that their tested systems didn't actually use and then got it wrong anyway, which would be funny.

Random anecdote: I work in the automotive industry, where we often use fancy unusual screen hardware a couple of years before it turns up in home consumer electronics or phones. For example special multi-axis curved stuff, dynamic angular privacy filters, or haptic feedback using electrostatic modulation of resistance instead of vibration motors (that allows you to make the screen feel rough and scaly or glidy, give…

> One time, we were told to use earplugs at work for a few days, because of a pre-release firmware bug that could in theory, if other safety mechanisms also failed, cause the haptics to potentially emit an ear-piercing low-frequency tone ...

Wow, on-demand tinnitus is one hell of a failure mode.

Re: Hacking the LG Monitor's EDID

#105

Earlier quoted context omitted.

A defect that was not in evidence for MacOs or Windows.

Basically, they tested it on these 2 and then shipped it. If it would fail on win or osx, LG would not ship it. At first, this seems a reason not to use Linux, but a future upgrade of win/osx will break your hardware. Tons of hardware gets obsoleted this way. Meanwhile, Linux will just keep on working.

> Basically, they tested it on these 2 and then shipped it. If it would fail on win or osx, LG would not ship it.

Yep. I first and foremost look fir Linux support explicitly called out in the system requirements. If I can't find it, I look for reviews mentioning Linux.

But explicitly supported is always the best, ideally backed by reviews that confirm it.

Re: Hacking the LG Monitor's EDID

#106
post #41

Apparently there are $5-15 EDID "emulator" devices that are just an HDMI passthrough adapter with a fake EDID ROM that always reports common modes as 4K60/2K60/VGA. Apparent purpose is to get PS5 to work with quirky 4K TVs. A similar device called HDMI "dummy plug" allows GPU acceleration on quirky PCs without having a display, but the latter has no passthrough port at the back. If that's all the author needs, that m…

My favorite use case is Looking Glass. Want to play video games that only run in Windows, but don't want to leave Linux? You can run Windows in a virtual machine and "passthrough" your GPU's PCIe slot. The advantage is that Windows can get the full performance of your GPU. The disadvantage is that it took the whole GPU away from your Linux host, along with whatever display it's attached to. You can use a second GPU f…

Genuine question, but are multiple inputs on the monitor not a consideration for your scenario? Or are multiple inputs on a single monitor unsuitable for this purpose?

Re: Hacking the LG Monitor's EDID

#107
post #86
post #80

Earlier quoted context omitted.

This has nothing to do with "Linux". The monitor is exposing a bad ID in its configuration block. Monitor says "I support 140Hz at 4k", so Linux (strictly the kernel framebuffer driver in use) says "OK then, that's the best one, give me that". And it doesn't work, because the Monitor lied. And the reason it works on Windows or (sometimes) MacOS is just that those systems have arbitrarily different default choices (e.…

I completely agree with you in principle. It's rarely an actual fault of anything in Linux. However the outside effect to me as a user is that I need to debug my monitor's EDID to get it to work correctly. Inconveniently for me (as much as I love digging into things like that) I really want to just plug in a conference room projector into my laptop and have other people already put in place out those workarounds for…

> I really want to just plug in a conference room projector into my laptop and have other people already put in place out those workarounds for me sometimes.

Then you should definitely use Linux more, and buy hardware that explicitly supports Linux.

Re: Hacking the LG Monitor's EDID

#108
post #95
post #74

Earlier quoted context omitted.

Linux contains lots of code to work around a myriad of EDID quirks (and loads of other HW quirks), too: https://github.com/torvalds/linux/blob/master/drivers/gpu/dr... There certainly isn't any big philosophical point to make here, Linux doesn't take a hard stance of expecting correct HW. Ultimately this is a symptom of (1) bugs happen (here, at LG) and (2) Linux has a lower market share and therefore sees less testi…

Linux* actually does have a tendency towards more hardline stances, simply because it's not answerable to market forces in quite the same way. For example, say 0.5% of monitors out there have dodgy edid values like this. For a commercial OS, that's a lot of unhappy people, many of whom have social media accounts, so "When displaying a new resolution, always start at max(60Hz, lowest available refresh rate) so if some…

I’ve seen many more monitor compatibility issues under MacOS than Linux, and have plenty of older hardware that works with reverse engineered Linux drivers, but no longer works with Windows.

I think the common case is that vendors test with the current version of Windows, MacOS and/or Linux (in decreasing priority order), then hope that it the hardware is EOL’ed before the drivers bit rot.

Re: Hacking the LG Monitor's EDID

#109
post #93

Earlier quoted context omitted.

Why doesn't macOS use the ports that monitors are connected to, to determine their layout (only treating a monitor as having moved if its port's EDID doesn't match the EDID in that port from before sleeping)?

Almost certainly the most common use case for multiple screens on Macs at this point is notebooks connected to an external monitor, some of the time. On modern Macbooks it's mostly all just Thunderbolt ports too, which are supposed to be interchangeable, people can plug in whatever wherever without thinking about. People may also run a monitor via a TB dock, which again may plug in wherever. Though even with desktops…

That's a poor excuse for shuffling screens that, like rather many (so not a rare bug), don't have unique serial numbers in their EDIDs, just because the user folded the laptop to sleep, and unfolded it the next day after breakfast to continue working/using.

Resolving assignments of cloned screens in the absence of physical-plugging-involving hotplug (that thus only comes from the monitor(s) also turning off when the laptop goes to sleep) by random instead of remembering physical ports/paths to them, across sometime as tame as a suspend-to-RAM, is frankly terrible UX.

Trying to use uniqueness features to be sticky across port swaps is good.... but I'd not be surprised if my grandparents would actually assume the way to swap them is by swapping the ports they are plugged into. Especially I'd expect them to be confused/surprised by swapping the plugs _not_ resulting in swapped content.

Re: Hacking the LG Monitor's EDID

#110

Earlier quoted context omitted.

My favorite use case is Looking Glass. Want to play video games that only run in Windows, but don't want to leave Linux? You can run Windows in a virtual machine and "passthrough" your GPU's PCIe slot. The advantage is that Windows can get the full performance of your GPU. The disadvantage is that it took the whole GPU away from your Linux host, along with whatever display it's attached to. You can use a second GPU f…

Genuine question, but are multiple inputs on the monitor not a consideration for your scenario? Or are multiple inputs on a single monitor unsuitable for this purpose?

Multiple inputs works fine with gpu pass through, but regularly switching monitor inputs is honestly a pain depending on your monitor. Its like a 10 second process for my monitor.

Also people running a setup like this are using the Linux host as their main desktop. If you only have one monitor and are switching inputs you lose your whole workflow on Linux host when using the vm. It’s better with dual monitors but I’d still prefer looking glass.

Post reply on HN