Force resolution on VGA monitor using HDMI to VGA adapter


I am on a Jetson AGX Xavier dev kit and need to display a 640x480 image on a 640x480 VGA monitor with the X server turned off (I’m booting in text mode). To hook up the monitor on the dev kit, I use a HDMI to VGA adapter (TRIPP LITE model P131-06N).

Now I list the supported modes with:

cat /sys/class/graphics/fb0/modes

but I have the same results from that command either if I plug only the HDMI->VGA adapter or if I plug the HDMI->VGA adapter + VGA monitor, so I am guessing the listed modes are those exposed by the HDMI->VGA adapter only and 640x480 resolution is not part of that list.

The monitor is currently displaying at a resolution listed by the adapter.

$ cat /sys/class/graphics/fb0/mode

I need to force that resolution to 640x480.

I tried setting the resolution with:

echo 4 > /sys/class/graphics/fb0/blank  # Turn screen off
echo "V:640x480p-60" > /sys/class/graphics/fb0/mode  # Set text console resolution
echo 0 > /sys/class/graphics/fb0/blank  # Turn screen on

While this is working on another HDMI monitor that I got (no adapter involved), it does not on the VGA monitor. As soon as I plug the HDMI->VGA adapter, the resolution falls back to U:1024x768p-60. Is there a way I can force the resolution to 640x480 permanently?

Another thing I tried is I plugged the VGA monitor to a VGA port on a Windows PC (no adapter involved here) and I can force the 640x480 resolution successfully.

The monitor is a “near eye display” and is not the kind that is widely available commercially. Changing that monitor is not an option.

More details here. The following commands were done with the HDMI to VGA adapter + VGA monitor connected.

$ dmesg | grep hdmi
[    0.920117] vdd-hdmi-5v0: 5000 mV
[    1.782632] tegradc 15200000.nvdisplay: hdmi: invalid prod list prod_list_hdmi_board
[    1.782641] tegradc 15200000.nvdisplay: hdmi: tegra_hdmi_tmds_range_read(bd) failed
[    2.998440] tegradc 15200000.nvdisplay: hdmi: plugged
$ cat /sys/class/graphics/fb0/modes
$ cat /sys/class/graphics/fb0/mode
$ sudo find /sys/ -name edid
$ sudo cat /sys/kernel/debug/tegradc.0/edid
 00 ff ff ff ff ff ff 00 04 ef 01 00 31 30 4e 43
 2d 17 01 03 a0 1e 17 61 ea e4 de 9e 54 4a 97 23
 1c 4c 54 00 08 00 81 80 81 40 81 00 01 01 95 00
 01 01 01 01 01 01 64 19 00 40 41 00 26 30 18 88
 36 00 00 c0 10 00 00 18 02 3a 80 18 71 38 2d 40
 58 2c 45 00 dd 0c 11 00 00 1e 66 21 50 b0 51 00
 1b 30 40 70 36 00 32 31 34 00 00 1e 00 00 00 fa
 00 81 99 81 c0 81 fc 01 01 01 01 95 0f 0a 01 3c
 02 03 1b 61 23 09 07 07 83 01 00 00 67 03 0c 00
 20 00 80 2d 43 90 84 02 e2 00 0f 8c 0a d0 8a 20
 e0 2d 10 10 3e 96 00 a0 5a 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29
$ sudo cat /sys/kernel/debug/tegradc.1/edid
$ sudo cat /sys/kernel/debug/tegradc.2/edid

I used the EDID reader at to parse the data and I can see that the Timing Bitmap is listing 640x480 (see figure below)

Can you paste the full log without changing anything? I mean you just connect the monitor and turn on the xavier. Do no change anything on fb0.

Also, please do not parse any log when you don’t know which info is really needed.

Ok, so I plugged in the VGA monitor via the HDMI to VGA adapter and booted. Here is the log.
log.txt (69.5 KB)

It looks like the display driver is not able to get programmed correctly.

2.643927] tegradc 15200000.nvdisplay: dc_poll_register 0x41: timeout
[ 2.643931] tegradc 15200000.nvdisplay: timeout waiting for postcomp init state to promote
[ 2.695924] tegradc 15200000.nvdisplay: dc_poll_register 0x41: timeout
[ 2.695927] tegradc 15200000.nvdisplay: timeout waiting for win assignments to promote
[ 2.695930] tegradc 15200000.nvdisplay: tegra_nvdisp_head_enable, failed head enable
[ 2.695941] tegradc 15200000.nvdisplay: update windows ret = -14
[ 2.695944] tegradc 15200000.nvdisplay: sync windows ret = -14
[ 2.698750] extcon-disp-state external-connection:disp-state: cable 51 state 1

Actually, we don’t validate any adapters over jetson. Thus, we don’t guarantee the functionality of it.

If possible, please use native HDMI monitor.

Hi WayneWWW,

Thank you very much for your help.

As I said in my first post. The VGA monitor is in fact a military “near eye display” and changing it is not an option.

I know this is feasible with some tweaks, but I am not a linux guru yet ;) I get that the EDID data from the monitor doesn’t get through the HDMI to VGA adapter, but there must be a way to force the display driver to output a specific resolution (640x480)? Can I configure the display driver to ignore EDID?

Can you try a hotplug case and tell me if you can see anything on the screen in such case? or can you tell me did you see anything on the screen so far? Please just use pure jetpack release without modifying anything.

Boot up the device without connecting any monitor. Connect the cable after you are sure that the device is booting into kernel.

If you can see the screen in such case, then show me the log again.

So I booted up the device without any monitor connected. Then I hotplugged the monitor. Here is the log below.

log_hotplug.txt (70.1 KB)

I can see the console on the monitor but it is not the right resolution:

$ cat /sys/class/graphics/fb0/mode

Why do you only see the “console”? Are you sure you are using pure jetpack release without modification?

Start from the GUI desktop first please.

Like I said in my first post, I’m booting in text mode (no X server). I configured this behavior with the following command:

$ sudo systemctl set-default
Removed /etc/systemd/system/
Created symlink /etc/systemd/system/ -­> /lib/systemd/system/

The application we are developing is displaying directly on the framebuffer. I need to force the framebuffer resolution to 640x480.

Thanks for your help

Please fallback to graphic mode. And check the result from xrandr first.

That is why I said using the pure jetpack.

Before investing time to backup my current OS image and flash the board back with a fresh installation of Jetpack, I just started back the GUI desktop as follow:

$ sudo systemctl start gdm3.service

then I run xrandr with the VGA monitor plugged in. Here is the output:

$ xrandr
Screen 0: minimum 8 x 8, current 1024 x 768, maximum 32767 x 32767
HDMI-0 connected primary 1024x768+0+0 (normal left inverted right x axis y axis) 300mm x 230mm
   1024x768      60.01*+
   1920x1080     60.00    59.95  
   1440x900      74.99    59.89  
   1360x768      60.02  
   1280x1024     85.03    60.00  
   1280x960      60.00  
   1280x800      59.81  
   1280x720     120.00    60.00    59.94  
   720x480       59.94  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)

Thanks again

The fact is even though tegra can get your monitor edid (in hotplug case), It does not have a 640x480 mode on the list. Xrandr does not have it and previously the “modes” inside the sysfs also doesn’t have 640x480.

If you still want to check, we can dig into why it does not appear in the kernel driver. However, this requires you to add some debug print, re-build the kernel and apply it to the device.

I am not sure if you are okay to do that. The basic logic here is, if one specific mode does not appear inside the list, while your edid says it has, it probably means the mode timing from the edid is rejected by the tegra display driver.

If a mode is rejected by the driver, it probably means that mode violates some timing restriction inside the driver. I wouldn’t suggest to try that mode anymore.

However, if you still want to hack it and don’t care about the output gives out some noise on the screen, then you can go further.

Tegra does not get the EDID from my monitor as the HDMI to VGA adapter overwrites it by sending its own EDID data to Tegra (the ones you see listed above with xrandr). I’ve never seen the EDID from my VGA monitor, but I know from the datasheet that this monitor is doing 640x480. Also, when I plug a regular HDMI screen to the board, xrandr is listing the 640x480 mode.

Do you think that another HDMI to VGA adapter could do what I need? If not, I will appreciate some guidance about how to hack it.

From the beginning I said we don’t validate any HDMI to VGA adapter.
So the answer from me is negative. I don’t know if changing another adapter would get what you want or not. Maybe work, maybe not.

If you are really sure about this monitor can output 640x480, you can use the fallback method to write a hack edid inside the driver.

But again, you need to rebuilt the kernel since this fack edid is hacked inside the kernel driver.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.