Display resolution not properly identifying in Ubuntu 21.04

Bug #1933758 reported by Midhun Mathew
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu
Undecided
Unassigned

Bug Description

OK I am using Ubuntu 21.04 on a Raspberry pi 4 model B 4GB ram.My Monitor is LG Flatron E1942 with a resolution of 1366x768,It's a VGA monitor so I am using an HDMI to VGA converter to connect it with the monitor.This resolution is not automatically detected by Ubuntu,but it worked with Raspbian and Kali Linux.Therefore I edited the config.txt file and added these following lines hdmi_group=2,hdmi_mode=39 and hdmi_cvt=1366 768 60 3 0 0 1 otherwise the display will go blank, after editing this the monitor used to work with Ubuntu 20 (but still was not perfect,it got some black vertical lines in gnome but it worked perfectly fine with KDE-plasma)
but after upgrading it to 21.04 this configuration doesn't work anymore.

So at this point how the monitor work is like is this:
1)If a turn on pi with monitor connected to it the boot menu and raspberry pi rainbow colors shows up,but the screen goes black once it enters gnome desktop.

2)If I connect the monitor only after the pi enters gnome.The monitors shows up with a weird resolution(1280x720) but goes black if I open settings.

3)If I connect the monitor after the pi enters gnome.The monitors shows up with a weird resolution(1280x720) and I use xrandr in terminal to set resolution "again to 1280x720",at this point I can open settings and change the resolution to 1360x768.Once I set it to 1360x768 the display is perfectly aligned,(I want this resolution every time I boot up without doing all these adventures)

I have to repeat this step 3 every time I boot up the pi otherwise the screen goes blank.
Kindly fix this bug.
Thanks

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: ubuntu-docs 21.04.1
ProcVersionSignature: Ubuntu 5.11.0-1012.13-raspi 5.11.21
Uname: Linux 5.11.0-1012-raspi aarch64
ApportVersion: 2.20.11-0ubuntu65.1
Architecture: arm64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Sun Jun 27 17:12:21 2021
ImageMediaBuild: 20201022
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_IN
 SHELL=/bin/bash
SourcePackage: ubuntu-docs
UpgradeStatus: Upgraded to hirsute on 2021-06-27 (0 days ago)

Revision history for this message
Midhun Mathew (memidhun) wrote :
affects: ubuntu → ubuntu-docs (Ubuntu)
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Some bot incorrectly changed this to a docs bug. Changing back to generic "Ubuntu".

affects: ubuntu-docs (Ubuntu) → ubuntu
Revision history for this message
Midhun Mathew (memidhun) wrote :

Ok.Thanks

Revision history for this message
Michael M. Dillow (mdillow) wrote :

Try appending config with your group, mode and cvt values, plus:
hdmi_force_hotplug=1

I was having a similar issue connecting my RPI3 to an older Dell monitor through a HDMI to VGA adapter and this did the trick for me.

Revision history for this message
Midhun Mathew (memidhun) wrote :

Yup I tried that but no hope,I tried all the possible combinations.For other distro's this usually works fine.Even with the older version of Ubuntu this worked, but after that update to Ubuntu 21.04 this isn't working anymore.
I tried changing hdmi_mode=39/86/87,hdmi_group=2 and hdmi_cvt=1366 768 60 3 0 0 1 as well as 1360 768 60 3 0 0 1.

This is what listed in my monitors.xml file:

<monitors version="2">
  <configuration>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>1</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>HDMI-1</connector>
          <vendor>AGO</vendor>
          <product>0x0001</product>
          <serial>0x434e3031</serial>
        </monitorspec>
        <mode>
          <width>1360</width>
          <height>768</height>
          <rate>60.015655517578125</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>
</monitors>

Changed in ubuntu:
assignee: nobody → Midhun Mathew (memidhun)
Revision history for this message
Midhun Mathew (memidhun) wrote :

I think Ubuntu is identifying wrong settings for my monitors,when I start the pi it sets the resolution to 1920x1080(16:9),which is not supported by my monitors,The maximum resolution is 1366x768(16:9),Is there any way to change that?

Changed in ubuntu:
assignee: Midhun Mathew (memidhun) → nobody
Revision history for this message
Dave Jones (waveform) wrote :

Ubuntu switched to using the "full" KMS graphics stack in Hirsute (21.04). However, this means that the traditional means of forcing an HDMI mode (hdmi_group, and hdmi_mode in config.txt) no longer work.

There's a couple of ways forward here, but first I should point out that I don't think this is a bug: your display isn't accurately communicating with either the graphics firmware, or the linux kernel: you were already having to force a video mode (and some timings) via config.txt settings because your display (or, more likely, your HDMI-VGA adapter) is probably advertising that it supports 1080p when it doesn't (or the adapter may support 1080p, but the attached monitor doesn't, yet the adapter still advertises that resolution in EDID anyway).

As the graphics stack has changed with 21.04, the method of forcing display settings on it (at a lower level than the Gnome GUI) has also changed. I understand that's frustrating, but that is unfortunately the price of opening up the graphics stack.

With that said, here's a couple of ways you could tackle this:

Switch back to Fake KMS
=======================

The first is to switch back to the legacy "fake" KMS (aka fkms) implementation. You can edit config.txt and change the following line:

  dtoverlay=vc4-kms-v3d

To:

  dtoverlay=vc4-fkms-v3d

This will use the legacy "fake" KMS implementation which should enable the hdmi_group, hdmi_mode, and other hdmi_* settings in config.txt to operate as they did before. However, be aware there will be other side effects from using fkms, e.g. choppy sound output and "tearing" during video playback, and that this won't be a supported configuration in future.

Stick with Full KMS
===================

Alternatively, you can stick with the "full" KMS implementation and try to find another mechanism of telling the kernel how to drive your monitor. The following bug may be useful in finding some solutions:

https://github.com/raspberrypi/linux/issues/4516

In particular I'd suggest trying 6by9's comments (https://github.com/raspberrypi/linux/issues/4516#issuecomment-895106299):

> Ideally your display would have a valid EDID that will be read and fully processed by
> vc4-kms-v3d. Sometimes it needs disable_fw_kms_setup=1 in config.txt to stop the firmware
> trying to influence it.
>
> If it doesn't have any EDID, then you could create one, put it in /lib/firmware, and add
> drm.edid_filename=foo.edid to /boot/firmware/cmdline.txt [*] to tell DRM to load that
> instead of trying to read it from the display.

[*] edited to point to Ubuntu's mount-point for the boot partition

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.