GUI Aspect Ratio Issue

For discussion of topics specific to MythTV on linux
Post Reply
brfransen
Newcomer
Posts: 4
Joined: Mon Feb 10, 2014 3:34 pm
United States of America

GUI Aspect Ratio Issue

Post by brfransen »

I recently updated from MythTV v30 to v33 and on a system that is connected to an old Onkyo receiver the GUI looks to be 4x3 stretched to the 16x9 (1920x1080) geometry. I have tried to override the Appearance -> Theme/Screen Settings -> Screen Aspect Ratio to 16x9 with no change. Changing the Screen Aspect Ratio to any of the options produces no change actually. So it is almost like that setting is being ignored.

The Onkyo was one of the first gens with HDMI and has always been a little bit weird. It is connected to a 1080p display. Connecting directly to the display the GUI looks perfect and no longer stretched, just as it did on v30. Comparing the logs what seems to make the difference is the Size(Qt).

Code: Select all

2023-03-10 14:24:54.924303 I  Display: Using screen 'HDMI-1' (Make: BNQ Model: BenQ PJ-)
2023-03-10 14:24:54.924312 I  Display: Qt screen pixel ratio: 1.00
2023-03-10 14:24:54.924323 I  Display: Geometry: 1920x1080+0+0 Size(Qt): 508mmx285mm

2023-03-10 14:40:37.622722 I  Display: Using screen 'HDMI-1' (Make: ONKYO Corporation Model: TX-SR604)
2023-03-10 14:40:37.622729 I  Display: Qt screen pixel ratio: 1.00
2023-03-10 14:40:37.622737 I  Display: Geometry: 1920x1080+0+0 Size(Qt): 640mmx480mm
The Onkyo is reporting a 4x3 size. I captured the BenQ's EDID info and force it into the kernel and start mythfrontend the GUI will show correctly. I can't leave the BenQ EDID though as audio changes don't negotiate correctly for various videos.

Any thoughts or suggestions on why the Screen Aspect Ratio setting has no effect? Or ideas on other things I can try to force the GUI aspect ratio?

Thanks
Britney
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: GUI Aspect Ratio Issue

Post by kmdewaal »

As tested on master right now, it looks like the ScreenAspectRatio setting has only effect on the video playback and not on the GUI.
The code in MythTV that does handle the ScreenAspectRatio setting is not even called when mythfrontend is started, it is only called on video playback.
I suggest that you create a ticket and attach a screenshot (or a photograph) that does show the problem.
Also, please give all system information such as Qt versions etc.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: GUI Aspect Ratio Issue

Post by paulh »

The aspect ratio of the GUI is largely defined by the theme. For example we have MythCenter that is designed for 4:3 and MythCenter-wide that is defined for 16:9. Myth does however assume the user is using a video mode with the correct aspect ratio for the theme. There is nothing to stop you using a 4:3 theme on a 16:9 display or vice versa it will just look a little stretched or squashed. There is/was at least one theme designed for 16:10 monitors that was popular at one time.
white_haired_uncle
Senior
Posts: 276
Joined: Thu Feb 23, 2023 8:55 pm
Location: Safe outside my gilded cage
United States of America

Re: GUI Aspect Ratio Issue

Post by white_haired_uncle »

Seems really odd a software upgrade would change this. One would hope a simple software fix would change it back, w/o you going to extremes, but...

I suppose you have a reason, such as the receiver acting as an HDMI switch, not to just run HDMI from the PC straight to the BenQ for video, and digital audio from the PC to the receiver. Should be a lot simpler if you can get away with it (I do).

I've never had to resort to tweaking the EDID info, as I was always able to accomplish what I needed via xrandr. Never had to use scale/transform/scaling mode, but a glance at xrandr --verbose makes me think keeping the EDID from the Onkyo and then adjusting the video using xrandr might be the (a?) way to go.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: GUI Aspect Ratio Issue

Post by paulh »

Mark made a lot of changes to both UI and Video rendering in v31 but unfortunately he left the project before completely finishing the upgrade so it's always possible something got broken but from what I understand Mark was working towards making things more consistent between renderers. He was one for taking settings way so users can't accidentally screw up their system. He preferred to automatically adjust things based on information it's given so it could be if Myth thinks a display is 4:3 then it will try to render in 4:3 format and there is no way to override that?

While the frontend has lots of problems this isn't one I've seen being mentioned before so I don't think it's a common problem. That's not to say Myth can't be made to work around the problem but the way things are I don't see anyone who is likely to step up to fix this.

I think your best bet is to fix the screen size and/or aspect ratio so it's reported correctly to Myth and it will then do the right thing.
brfransen
Newcomer
Posts: 4
Joined: Mon Feb 10, 2014 3:34 pm
United States of America

Re: GUI Aspect Ratio Issue

Post by brfransen »

Thanks for all the responses!

kmdewaal - That is interesting that it is only called on playback. I didn't test playback with all the options but in both Auto (square and display) and 16x9 settings I know playback didn't appear to be the wrong aspect.

paulh - I am using 16x9 themes. The video mode seems to be correct as the other apps (PlexHTPC, mpv, firefox) I have used on the system don't display stretched. I agree it is probably not a common problem and the root cause is the weird HDMI on this receiver. I just found it odd how it seems to be only the GUI that is affected.

white_haired_uncle - I am using the receiver as an HDMI switch. I did experiment with a HDMI splitter going directly to the display and receiver but that made things worse as it seemed that on audio or framerate changes it would try to pull the current EDID and would sometimes end up with either no video the display or no audio to the receiver. My guess is that it was picking up the wrong device info and failed to sync. I haven't been successful getting the physical display size set via xrandr. I did get the Onkyo EDID info modified to exclude the physical display size. Now I just need to figure out how to reliably override the EDID at boot and before mythfrontend is started.

Thanks,
Britney
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: GUI Aspect Ratio Issue

Post by kmdewaal »

The pixel aspect ratio that is used by the GUI is determined in mythdisplay.cpp in the following function starting at line 295:

Code: Select all

double MythDisplay::GetPixelAspectRatio()
{
    if (m_physicalSize.isEmpty() || m_resolution.isEmpty())
        return 1.0;

    return (m_physicalSize.width() / static_cast<double>(m_resolution.width())) /
           (m_physicalSize.height() / static_cast<double>(m_resolution.height()));
}
With a resolution of 1920x1080 and an incorrect size of 640x480, as reported by the EDID, this does lead to an incorrect pixel aspect ratio.

In the past, the SD glass TV's and IIRC the first HD-Ready LCD displays did have non-square pixels.
However, to the best of my knowledge, ALL displays with a resolution of FullHD (1920x1080) or higher do have square pixels.
N.B I did in the past have discussions with Mark Kendall about pixel aspect ratio's and this has lead to the option for the "Screen aspect ratio" in which it is possible to specifiy square pixels but this is only used for the video, not for the GUI. The GUI was not discussed at the time.
For background, see https://en.wikipedia.org/wiki/Pixel_aspect_ratio

I intend to fix this by doing the pixel aspect ratio computation based on the reported physical size only when the resolution is less than Full HD.
The code will then look like this:

Code: Select all

double MythDisplay::GetPixelAspectRatio()
{
    if (m_physicalSize.isEmpty() || m_resolution.isEmpty())
        return 1.0;

    // FullHD or better displays always have square pixels
    if ((m_resolution.width() >= 1920) && (m_resolution.height() >= 1080))
        return 1.0;

    return (m_physicalSize.width() / static_cast<double>(m_resolution.width())) /
           (m_physicalSize.height() / static_cast<double>(m_resolution.height()));
}
brfransen
Newcomer
Posts: 4
Joined: Mon Feb 10, 2014 3:34 pm
United States of America

Re: GUI Aspect Ratio Issue

Post by brfransen »

kmdewaal - Great detective work! So with your intended fix a 720p display and an incorrect EDID size would still result in what I am seeing? Are you not including 1280x720 because not all 720p displays have square pixels? Doesn't affect me just wanting to understand.

It might be helpful to add something like the following to the help text in mythtv/programs/mythfrontend/globalsettings.cpp static HostComboBoxSetting *ScreenAspectRatio():
"This setting only applies to video playback, not the GUI. Most modern displays..."

Would it still be helpful for me to open an issue for this?

Britney
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: GUI Aspect Ratio Issue

Post by kmdewaal »

Hi Britney,

I can reproduce what you describe for the GUI by changing the pixel aspect ratio, so it is not needed to open an issue anymore.

I did need to look it up but also the pixel ratio of the HD-Ready TV's of the past, with a resolution of 1368x768, is very near to being square.
As we are talking about displays and not about video formats I think it is safe to assume that all displays with a height of 720 pixels or more have square pixels. A fix is forthcoming.

Klaas.
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: GUI Aspect Ratio Issue

Post by kmdewaal »

The pixel aspect ratio is now fixed in master in commit 1fbdd15e5cf691a45cadb44d5961bab6a08be9e5 and the help text for the Screen aspect ratio is improved in commit 8a2da90397d7eca271c0578e60f206ee726e9d32.

Thanks,
Klaas.
Post Reply