Skip to content

Commit

Permalink
Square pixels for all HD/FHD/UHD displays
Browse files Browse the repository at this point in the history
For the GUI of MythTV, use a fixed pixel aspect ratio of 1.0 for all displays
that have a vertical resolution of at least 720 pixels.
Previously, the pixel aspect ratio was always computed from both the resolution and
the dimensions of the display as reported by the EDID when both are available.
This solves GUI issues when the display dimensions as reported by the EDID is not correct.
Note that for video playback the setting "Screen aspect ratio" is used.
  • Loading branch information
kmdewaal committed Mar 14, 2023
1 parent a604408 commit 1fbdd15
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mythtv/libs/libmythui/mythdisplay.cpp
Expand Up @@ -297,6 +297,10 @@ double MythDisplay::GetPixelAspectRatio()
if (m_physicalSize.isEmpty() || m_resolution.isEmpty())
return 1.0;

// HD-Ready or better displays always have square pixels
if (m_resolution.height() >= 720)
return 1.0;

return (m_physicalSize.width() / static_cast<double>(m_resolution.width())) /
(m_physicalSize.height() / static_cast<double>(m_resolution.height()));
}
Expand Down

3 comments on commit 1fbdd15

@paul-h
Copy link
Contributor

@paul-h paul-h commented on 1fbdd15 Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I understand where you are coming from with this it doesn't seem right that a display with correct EDID and non-square pixels with a >720 resolution should now be displayed incorrectly but a display with incorrect EDID and square pixels > 720 will now display correctly? Surely a display with correct EDID should always take precedence?

I would think most HD displays will now use square pixels so it may not be a problem in reality but it still seems wrong to me to ignore the EDID?

@paul-h
Copy link
Contributor

@paul-h paul-h commented on 1fbdd15 Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe us the value calculated from the EDID by default but add a setting that defaults to "Auto" or "Use EDID" or something like that but allows the pixel aspect ratio to be overridden to a specific value like 1.0 or 1:1 if the display sends bad EDID information?

@kmdewaal
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about making a setting for this but it will probably not be useful for anybody. As soon as anyone comes with an example of a monitor or TV that has 720p or better resolution and non-square pixels then that is a good moment to add a setting.
The problem with the geometry data in the EDID is that it is seldom correct. Even in my living room TV the size is reported as 160mm by 90mm while it has been sold to me as a 55 inch TV. The aspect ratio of the screen is indeed 16x9 and that is why the pixel aspect ratio was correct for me.
There exists software to read the EDID, modify it to your wishes and then use that EDID to replace what is coming from your TV. That is a good way to fix it but it is quite cumbersome. Maybe we can build an EDID override right into MythTV. Which could then also be used for the video aspect computations.

Please sign in to comment.