[personal profile] mjg59
A discussion a couple of days ago about DPI detection (which is best summarised by this and this and I am not having this discussion again) made me remember a chain of other awful things about consumer displays and EDID and there not being enough gin in the world, and reading various bits of the internet and wikipedia seemed to indicate that almost everybody who's written about this has issues with either (a) technology or (b) English, so I might as well write something.

The first problem is unique (I hope) to 720p LCD TVs. 720p is an HD broadcast standard that's defined as having a resolution of 1280x720. A 720p TV is able to display that image without any downscaling. So, naively, you'd expect them to have 1280x720 displays. Now obviously I wouldn't bother mentioning this unless there was some kind of hilarious insanity involved, so you'll be entirely unsurprised when I tell you that most actually have 1366x768 displays. So your 720p content has to be upscaled to fill the screen anyway, but given that you'd have to do the same for displaying 720p content on a 1920x1080 device this isn't the worst thing ever in the world. No, it's more subtle than that.

EDID is a standard for a blob of data that allows a display device to express its capabilities to a video source in order to ensure that an appropriate mode is negotiated. It allows resolutions to be expressed in a bunch of ways - you can set a bunch of bits to indicate which standard modes you support (1366x768 is not one of these standard modes), you can express the standard timing resolution (the horizontal resolution divided by 8, followed by an aspect ratio) and you can express a detailed timing block (a full description of a supported resolution).

1366/8 = 170.75. Hm.

Ok, so 1366x768 can't be expressed in the standard timing resolution block. The closest you can provide for the horizontal resolution is either 1360 or 1368. You also can't supply a vertical resolution - all you can do is say that it's a 16:9 mode. For 1360, that ends up being 765. For 1368, that ends up being 769.

It's ok, though, because you can just put this in the detailed timing block, except it turns out that basically no TVs do, probably because the people making them are the ones who've taken all the gin.

So what we end up with is a bunch of hardware that people assume is 1280x720, but is actually 1366x768, except they're telling your computer that they're either 1360x765 or 1368x769. And you're probably running an OS that's doing sub-pixel anti-aliasing, which requires that the hardware be able to address the pixels directly which is obviously difficult if you think the screen is one size and actually it's another. Thankfully Linux takes care of you here, and this code makes everything ok. Phew, eh?

But ha ha, no, it's worse than that. And the rest applies to 1080p ones as well.

Back in the old days when TV signals were analogue and got turned into a picture by a bunch of magnets waving a beam of electrons about all over the place, it was impossible to guarantee that all TV sets were adjusted correctly and so you couldn't assume that the edges of a picture would actually be visible to the viewer. In order to put text on screen without risking bits of it being lost, you had to steer clear of the edges. Over time this became roughly standardised and the areas of the signal that weren't expected to be displayed were called overscan. Now, of course, we're in a mostly digital world and such things can be ignored, except that when digital TVs first appeared they were mostly used to watch analogue signals so still needed to overscan because otherwise you'd have the titles floating weirdly in the middle of the screen rather than towards the edges, and so because it's never possible to kill technology that's escaped into the wild we're stuck with it.

tl;dr - Your 1920x1080 TV takes a 1920x1080 signal, chops the edges off it and then stretches the rest to fit the screen because of decisions made in the 1930s.

So you plug your computer into a TV and even though you know what the resolution really is you still don't get to address the individual pixels. Even worse, the edges of your screen are missing.

The best thing about overscan is that it's not rigorously standardised - different broadcast bodies have different recommendations, but you're then still at the mercy of what your TV vendor decided to implement. So what usually happens is that graphics vendors have some way in their drivers to compensate for overscan, which involves you manually setting the degree of overscan that your TV provides. This works very simply - you take your 1920x1080 framebuffer and draw different sized black borders until the edge of your desktop lines up with the edge of your TV. The best bit about this is that while you're still scanning out a 1920x1080 mode, your desktop has now shrunk to something more like 1728x972 and your TV is then scaling it back up to 1920x1080. Once again, you lose.

The HDMI spec actually defines an extension block for EDID that indicates whether the display will overscan or not, but doesn't provide any way to work out how much it'll overscan. We haven't seen many of those in the wild. It's also possible to send an HDMI information frame that indicates whether or not the video source is expecting to be overscanned or not, but (a) we don't do that and (b) it'll probably be ignored even if we did, because who ever tests this stuff. The HDMI spec also says that the default behaviour for 1920x1080 (but not 1366x768) should be to assume overscan. Charming.

The best thing about all of this is that the same TV will often have different behaviour depending on whether you connect via DVI or HDMI, but some TVs will still overscan DVI. Some TVs have options in the menu to disable overscan and others don't. Some monitors will overscan if you feed them an HD resolution over HDMI, so if you have HD content and don't want to lose the edges then your hardware needs to scale it down and let the display scale it back up again. It's all awful. I recommend you drink until everything's already blurry and then none of this will matter.
Page 1 of 3 << [1] [2] [3] >>

This is the reason...

Date: 2012-01-03 06:27 pm (UTC)
oshepherd: (Default)
From: [personal profile] oshepherd
...why, when purchasing smaller HD TVs, you want to find the ones which advertise themselves as a "TV monitor"

At least that way you have a chance that the TV will behave sanely. Thankfully for myself, I picked a TV which has settings which make it sane and not overscan and not apply any stupid sharpening algorithms to my picture (awesome!)

Guess how you activate this feature? You rename the inputs to "PC" or "DVI-PC". So now my TV's input selection has the DTV tuner, "HDMI PC", "DVI DVI-PC", "PC PC" (the VGA input), "Component" and "Ext1" (SCART)

The name also controls where the audio comes from (On the DVI/HDMI inputs, "PC" takes sound from the TMDS link, while "DVI-PC" takes it from the solitary audio input minijack)

So, entirely sane feature design there Samsung! It doesn't at all make me want to consume one of the bottles of Whiskey on my shelf...

(In unrelated news: One of the words in my reCaptcha looks like "Add.l". Are they scanning in a book containing some assembly language? :P)
From: (Anonymous)
Matthew almost certainly already knows this, as he's steeped in the many and various ways that consumer electronics manufacturers try and do things on the cheap, but for everyone else:

1366x768 comes from a quirk of at least one method for manufacturing LCD panels. At one stage in manufacture, they're made as a big sheet of pixels, much, much larger than you want as screens. This is then cut into individual screens, first by cutting into vertical chunks, then cutting the line of screens into single screens.

The trick comes in when you're cutting - defects tend to cluster in individual spots on the screen. Any finished screen with too many defects is a failure and has to be discarded. So, vertically, you want to cut into as small a number of sizes as possible, and cut horizontal chunks avoiding any defects.

There are no common 720 high 4:3 screen sizes - 960x720 is unusual. Lots of people still want 1024x768 4:3 screens for various applications. You may be seeing why 1366x768 is popular at this point - you can now cut your lots by 768 stage into a mix of 1024x768 4:3 and 1366x768 16:9 screens, and can therefore get more usable screens from the same vertical cut.

Plus, TV is all about samples of an idealised continuous function, not pixels, and we have well-understood "perfect" algorithms for scaling 1280x720 samples to 1366x768 samples, such that lighting up an LCD pixel will reproduce the "same" continuous function whether you're lighting up 1280x720 pixels, or 1366x768 pixels, or even 1920x1080 pixels. This is not so good for computers, which are pixel based, not sample based.
From: [identity profile] mas90.livejournal.com
we have well-understood "perfect" algorithms for scaling 1280x720 samples to 1366x768 samples, such that lighting up an LCD pixel will reproduce the "same" continuous function whether you're lighting up 1280x720 pixels, or 1366x768 pixels, or even 1920x1080 pixels

That can't possibly be true, unless you assume your continuous function entirely lacks high-frequency components -- you end up seriously degrading areas of high detail, which was the reason you bought a HDTV in the first place. Try enlarging a highly-detailed photo by 7% in the image editor of your choice.

Date: 2012-01-03 07:34 pm (UTC)
From: [identity profile] mas90.livejournal.com
For added fun, the manufacturer of a 720p HDTV I used to have had apparently decided that this whole EDID thing was too complicated, so had copied the EDID verbatim from a Thinkpad monitor (the X server log actually printed the display's identity as "Thinkpad"). The Thinkpad monitor in question was apparently a 5:4, 1280x1024 model. So I got the middle 90% of my desktop, stretched horizontally by 40%.

The TV I currently have is detected by my graphics driver as 1360x768, for some reason. I don't understand why the vertical resolution is mysteriously correct. Thankfully it can be told not to scale/overscan at all, so I just have a 6-pixel black bar down one edge of the screen, which I can cope with.

EDID's and TV resolutions

Date: 2012-01-03 09:31 pm (UTC)
From: (Anonymous)
In my job I spend a lot of time reading TV EDIDs and swearing.

I only see the 1366x768 on older TV's that marketed at HD-Ready. What they meant, and what they state in the fine print, is that can accept an HD broadcast signal. Then the TV internally downscales to normal NTSC or PAL. I haven't seen one of the TV's that you describe where it actually has a reasonable resolution.

Another thing that is very common are 1080i TV's. Most people get the impression that they are getting 1080 rows of resolutions, when these TV's are also designed to accept 1080i resolution, they also downscale (usually to 720i).

In terms of oversampling and active resolutions, you do get a full 1920x1080 of viewable area. Instead the full resolution is much larger, and consequently the pixel clock frequency of your HDMI/DVI cable it much higher than it needs to be for 1920x1080.

Oversampling is just one small dumb point, the whole backwards compatibility thing really goes way to far. As far as I can tell DVI cables are designed for analog signals, but can also carry digital on separate data lines, even though no one ever used the analog part. The fact that both analog and digital went through the cable together, I guess it made sense at the time that the digital part would just be the analog equivalent. IE nothing more than ADC channel. They could then use the same clock freqency, same synchronization pulse times (to let the gun move from the right edge of the screen back to the left). WTF!!! It's digital why are we sending pulse signals to wait for a CRT gun? HMDI was just DVI, but with audio encoded in the dead time while synchronization pulse was been sent.

Where I think video signals really went wrong is with DisplayPort. Since DVI/HDMI were purely analog signals encoded in digital, DisplayPort would give us the chance to drop the analog oddities like sync pulses. No they didn't drop that, as they thought if they kept them, it would be easy for someone to make a DisplayPort to HDMI/DVI/VGA adaptor. Now in 2012 we still have to carry forward all of this CRT specific crud.
From: (Anonymous)
It does work, that's what the 3D comb filter is for; it already knows from the source format what the limits of the signal frequencies are and clamps the output to the same frequency. For discrete moving images like a video stream you set up a 3d matrix that has the lowest common multiple of elements in each respective dimension. You then calculate the interpolation points for each and then extract just the vectors needed for the target resolution / frame rate. Obviously with the wonders of mathematics you only need to calculate the "taps" that you need for those target vectors, this saves computation. To prevent aliasing you can use a finite impulse filter to act as a low pass filter; this has the advantage of doing the interpolation for you and also allows you to calculate only the necessary tap points. If you have a known set of inputs and (in the case of a LCD TV) one known output format you can easily wire this up in an ASIC.

Any TV/monitor recommendations?

Date: 2012-01-03 09:34 pm (UTC)
From: [identity profile] https://www.google.com/accounts/o8/id?id=AItOawkbPfjNvIUlT3QjuE584SdVM9mq5jh-XuE
Can anyone recommend a good LED-backlit display that functions as a TV and a computer monitor (with DVI or Mini-DisplayPort)? I have a MacBook Air and I want a TV/Monitor that behaves like a good TV when I'm watching TV and a good monitor when I'm on my computer, including functional power saving.

Date: 2012-01-03 09:38 pm (UTC)
From: [identity profile] https://www.google.com/accounts/o8/id?id=AItOawm9qVCUbxQoGyLJtq0cEvtCsspBzj0m3Ag
Matthew, I'm sorry to disappoint you, but EDID actually can specify proper pixel resolution. DTD block has parameters named HACTIVE and VACTIVE which have this exact kind of information. More over, that extension you named (DDDB, more precisely) has even more possibilities to specify the exact low-level structure of your display, including subpixel layout and response time.

Date: 2012-01-03 09:41 pm (UTC)
fluffymormegil: @ (Default)
From: [personal profile] fluffymormegil
Well, that's just dandy - but how many displays retailing at the going rate for the resolution etc. they provide actually do so?

Re: EDID's and TV resolutions

Date: 2012-01-03 09:46 pm (UTC)
From: [identity profile] https://www.google.com/accounts/o8/id?id=AItOawm9qVCUbxQoGyLJtq0cEvtCsspBzj0m3Ag
Sorry, I don't know your name, but you're completely wrong regarding analogue vs digital video systems. Synchronisation pulses *are* needed for digital displays, they just don't work otherwise. It's unrelated to CRT, completely.
DVI-D (and HDMI, which is essentially the same) were never analogue interfaces. They encode pixel data into TMDS which is much better to transfer data on high speeds than plain TTL, and also it requires less wires because of multiplexing which is, in turn, possible because of higher transfer rates.
I think you'd better read some literature on this specific topic.

Re: EDID's and TV resolutions

Date: 2012-01-03 10:14 pm (UTC)
From: (Anonymous)
Sync pulses are needed, because current video signals are based on it. They wouldn't be needed in the digital world, if each line of video were sent as a packet with a packet header. There would be no more need for blanking regions. Audio packets would just get an audio header. In the realm of Thunderbolt (which I have no idea about its internals) we could also send through PCIe packets.

There is no need for a sync pulse on digital display! Sync pulses are need to synchronize data in a DVI/HDMI/VGA cable.

Re: EDID's and TV resolutions

Date: 2012-01-03 10:24 pm (UTC)
From: [identity profile] https://www.google.com/accounts/o8/id?id=AItOawm9qVCUbxQoGyLJtq0cEvtCsspBzj0m3Ag
So you propose to increase the complexity of schematics just to use all that cool stuff? No way.

There is need. The pixel data have structure. They're organised in frames, rows and columns. So do real physical pixels. You need pixel synchronisation pulses to synchronise pixel data (no surprise!), and data active/horizontal synchronisation to split data into rows with minimal hardware. Frame synchronisation isn't needed, indeed, by most displays, but here you have two choices: either you leave a big gap between frames, so this can be detected automagically, or you send a synchronisation pulse. That makes it possible to keep the hardware simple and cheap, and introduce as little overhead as possible into protocol.

Also, inside the LCD panel, there *are* synchronisation pulses, they're just done differently. You can dig into this yourself if you want to.

One more thing. Audio should not be sent along with pixel data at all, it's completely unrelated, don't you think so?

HD ready 1080p

Date: 2012-01-03 10:26 pm (UTC)
From: (Anonymous)
HD ready 1080p seems to be the magic keyword we are looking for!
Display 1080p and 1080i video without overscan (1:1 pixel mapping)
HD ready on Wikipedia (https://secure.wikimedia.org/wikipedia/en/wiki/HD_ready#References)

Re: EDID's and TV resolutions

Date: 2012-01-03 10:40 pm (UTC)
From: (Anonymous)
The biggest overkill backwards compatibility thing, in my completely obnoxious opinion, is the 59.94 Hz drop frame timing thing.

Modern HDTV standards specify the expected 24, 25, 30, 50 and 60 Hz vertical refresh modes for progressive content (and interlaced at 50 and 60 Hz). They also add (for 24, 30 and 60 Hz) the option to multiply the vertical refresh by 1000 / 1001, to get 23.97 Hz, 29.97 Hz and 59.94 Hz.

Why do this? Back in the days of monochrome sets, 60 Hz regions used a genuine 60 Hz signal. When NTSC was designed, the chroma subcarrier was found to result in objectionable beat patterns on monochrome sets; the only way to fix this while staying within a 6 MHz channel bandwidth was to slightly reduce the frame rate, such that older sets (designed to lock to 60 Hz) would still lock to it, but would no longer interpret the chroma subcarrier as beat patterns in the picture.

Why keep it in HD standards? In theory, it means that if you are downscaling your HD content to SD, and then putting it into a monochrome TV set that's unaware of NTSC chroma encoding, you won't get the beat pattern. Colour-aware sets, even if they're monochrome (so virtually all designs since the 60s, and many 1950s designs) won't give the beat pattern at 60 Hz. But, we get to suffer the complications of drop frame, so that if you connect your HD source to a 1940s or 1950s TV, you won't see a beat pattern.


Date: 2012-01-03 11:05 pm (UTC)
From: (Anonymous)
Having experienced quite a bit of this, particularly the issues with overscan, and the issues you *didn't* mention with video lag due to internal processing, I personally plan on purchasing a real LCD monitor for my next TV, rather than something intended as a "TV". I don't actually care about having a built-in TV tuner, since I watch TV through a Linux box running MythTV. I do, however, want to have analog inputs (composite and component) for game consoles.

Any recommendations for decent LED/IPS monitors which have composite and component inputs? Looking for something large (>27"), rotatable (yay for portrait coding), and high resolution (1080p or better).
From: (Anonymous)
By definition, my continuous function has lost any high frequency components that cannot be represented in my 1280x720 sample image. If I scale it up to (say) 1920x1080, I don't get the detail that would have been there if I'd originally sampled at 1920x1080 (that detail has been permanently lost). I can, however, scale it up such that I lose no further detail, beyond that lost by the band limiting that occurs before you take your 1280x720 samples.

The basic theory is the infinite series form of the Whittaker-Shannon interpolation formula; you know that your input signal is band-limited by the input format (and that this limit is low enough that you can perfectly reconstruct the original analogue signal from your input samples). You can thus filter out any aliases above the sampling rate of the input format; with your filtered infinite series in hand, you sample this continuous signal at the output sample points.

A brute force implementation of this method ends up needing 921,600 MACs per output sample. There are many, many optimisations available (see the literature on spatial scaling) that massively reduce this, and of course an ASIC design is massively parallel anyway.

Why am I not surprised?

Date: 2012-01-03 11:22 pm (UTC)
From: (Anonymous)
Ha. I tried plugging in my computer (DVI) to my AV receiver (HDMI, with a simple adapter), and then to my HDTV (HDMI). I assumed that, being all-digital, it would all just work! Unfortunately, the picture was offset by half a screen width for some reason, and no amount of twiddling could make it work right.

I thought it was weird that an all-digital connection wouldn't be perfect. Now I'm impressed that anything showed up at all!

(It works great if I connect my computer directly into the TV, and all other HDMI sources I've tried can pass through my receiver just fine. It's just that particular combination that happens to fail.)
From: (Anonymous)
It is true, with caveats. The perfect resampling filter[*] is a sinc function (= sin x/x). It is 'perfect' in the sense that all frequencies present in the original signal will be present in the upscaled version with no loss. It is unfortunately also 'ideal' since the sinc function extends to infinity. Lanczos re-sampling (see wikipedia) is a 'nearly perfect' upscaling method which truncates the sinc function. Assuming you truncate at or near the precision of your machine, it's very nearly perfect.

[*] i.e. the kernel you use to 'blur' the infinitely sharp points of your original sampling before re-sampling said blurry continuous signal back into infinitely sharp points.

Rich Wareham
(who cannot be bothered to sign in)

Date: 2012-01-04 12:38 am (UTC)
From: (Anonymous)
And the entire mess you describe is significantly better than all the aspect and chroma-phase clocking issues in legacy analog NTSC signals... progresss.

Re: EDID's and TV resolutions

Date: 2012-01-04 01:22 am (UTC)
From: (Anonymous)
My work has been on video extension. Video to codec, codec to video. EDID pass through, with possible stripping of unsupported resolutions. I've never looked at LCD panel internals, but I'd be interested in anything you have to share

I don't see how that increases the complexity of schematics. For the sake of argument lets say video was done on a dedicated ethernet. A system that allows easy moving of packet data. How are your schematics more complicated? You now have a front end of 4 pairs across the channel, instead of TMDS pairs. From the HW schematic the front end chip isn't that much different from HDMI.

I also said you could put structure into packets, instead of a raw stream with pulses. That is your structure. Same structure, but a more modern representation.

Audio gets sent with video, as HDMI (and TV in general) means audio + video. Today's front end chips separate this, tomorrow will probably be the same. There are a lot of other systems that also try and bundle other things in the cable, but that is another discussion.

Thank you note...

Date: 2012-01-04 02:23 am (UTC)
From: (Anonymous)
I just wanted to express how funny and informative I find your posts. I had no idea that the "enlarged" picture on my TV is not my fault but the manufacturer's. I feel relieved and can now happily pass the buck :)

Re: This is the reason...

Date: 2012-01-04 02:48 am (UTC)
From: (Anonymous)
Samsung, go figure. They're great at making really nice, cheap electronics and then making a few ridiculous design decisions that ruin them. Like my monitor having a non-removable stand, or the horrible, horrible software in everything they've ever made.

Yeah, there's all sort of bizarreness

Date: 2012-01-04 03:15 am (UTC)
From: [identity profile] notting.id.fedoraproject.org
I have a TV/monitor that claims to support '1080p'.

According to its DVI EDID (and its docs) the max resolution is 1680x1050. However, if i hook up a device (Roku) via HDMI and set it to '1080p' mode, it claims via its info screen to be running in 1920x1080. Presumably that's just a description of the signal, not the resolution. It supposedly has a 1:1 pixel mode, in which case the display shows the 1920x1080 or 1280x720 signal (16:9) taking up the entire screen (1680x1050 == 16:10). Wha...?

Re: Yeah, there's all sort of bizarreness

Date: 2012-01-04 03:44 am (UTC)
From: (Anonymous)
There is an extended section for HDMI after the 128 byte EDID, that occupies the next 128 bytes. 1080p is in there, as well as all the information about your TV's audio (IE surround sound/stereo/etc)

Also quite often every different port of a TV has a different EDID. This is really dumb, but its true. Try reading the EDID from the HDMI port. For a bit of background this is a requirement for analog vs. digital as there is a bit in the EDID that specifies whether the monitor is analog (VGA) or digitial (DVI/HDMI). DVI and HDMI should really be the same though
Page 1 of 3 << [1] [2] [3] >>


Matthew Garrett

About Matthew

Power management, mobile and firmware developer on Linux. Security developer at Google. Ex-biologist. @mjg59 on Twitter. Content here should not be interpreted as the opinion of my employer.

Page Summary

Expand Cut Tags

No cut tags