3

I am using a 7" TFT LCD Display (1024x600) with the Raspberry Pi 3 and I can not make it work with that screen resolution. It looks like it is zoomed in.

I know that there are a bunch of topics about this issue in and out stackoverflow, and I have tried to edit the config.txt as much as I could, never getting different results. (BTW: I got it working with Raspian really easily editing the config.txt, but it does not work for android for some reason).

I used this Android image, and this is how my config.txt looks like:

hdmi_force_hotplug=1
hdmi_drive=2
hdmi_group=2
hdmi_mode=87
hdmi_cvt 1024 600 60
Framebuffer_width=1024
Framebuffer_height=600
disable_overscan=1
config_hdmi_boost=5
kernel=zImage
device_tree=bcm2710-rpi-3-b.dtb
dtparam=audio=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=vc4-kms-v3d,cma-256
initramfs ramdisk.img 0x01f00000
mask_gpu_interrupt0=0x400
avoid_warnings=2
gpu_mem=256
enable_uart=1

I would really appreciate some insight on this.

PS: I tried different resolutions with the hdmi_group and hdmi_mode, according to this RPi article, but the image remains the same.

1
  • So do you flash it or just copy the image into the system files directory?
    – user101218
    Commented Apr 9, 2019 at 9:46

2 Answers 2

4

I found a functional solution, albeit imperfect, for when I want to use vc4-kms-v3d mode, but also have a usable VNC resolution.

You can of course change the resolution using xrandr, but you first have to convince xrandr that it should let you. ;-) To do that, you need to generate the appropriate "mode" settings. The easiest way to do that is by using the "cvt" command.

Here I am using 1280x1024 @ 60 Hz as an example of the desired resolution.

$ cvt 1280 1024 60
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync

You also need to know what screen VNC is using, which you can find out by logging in with the default resolution still in effect. The xrandr command has the goods:

$ xrandr
Screen 0: minimum 320 x 200, current 720 x 480, maximum 2048 x 2048
HDMI-1 disconnected primary (normal left inverted right x axis y axis)
Composite-1 unknown connection (normal left inverted right x axis y axis)
   720x480       62.69

In my case it was pretty obvious, because I am not using HDMI and the only other choice was "Composite-1" which also shows the defaul 720x480 resolution. =D

Armed with all of that info, you can set the resolution as follows, by pasting the string from after "Modeline" in the cvt output. Here I took the liberty of simplifying the "1280x1024_60.00" to just "1280x1024_60" and then used that consistently:

xrandr --newmode "1280x1024_60"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode Composite-1 1280x1024_60
xrandr -s 1280x1024_60

I wasn't satisfied with having to run that every time I logged in, so I made it a system-wide change as follows:

$ sudoedit /etc/xdg/autostart/set-vnc-resolution.desktop

To which I added the following lines:

[Desktop Entry]
Name=set_vnc_resolution
Exec=/bin/bash -c "xrandr --newmode "1280x1024_60"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync && xrandr --addmode Composite-1 1280x1024_60 && xrandr -s 1280x1024_60"
Type=Application

So, now, the initial VNC login screen is still only 720x480, but a few seconds after login, it changes to 1280x1024. It disconnects me and I have to reconnect, but after that point it stays at 1280x1024 until the next reboot.

That disconnect / reconnect part is why I say it is an imperfect solution, but it's one that I can live with. =D

HTH someone. =D

0
2

So I finally got it working by trial and error. I used a different Android image that had the vc4-fkms-v3d overlay instead of the vc4-kms-v3d commonly used in the other Android images I tried before. That seemed to do the trick for me.

I read that the vc4-fkms-v3d overlay is still a bit experimental, so I do not know if there will be any limitations using it. And I would still appreciate if someone has any input on this, but for now the case is closed.

This is my config.txt with the settings that worked for me with this image:

# Kernel
kernel=zImage
initramfs ramdisk.img 0x01f00000

# Audio
dtparam=audio=on

# Display
hdmi_force_hotplug=1
hdmi_drive=2
hdmi_group=2
hdmi_mode=87
disable_overscan=1
framebuffer_width=1024
framebuffer_height=600
hdmi_cvt=1024 600 60
config_hdmi_boost=6

# Graphics acceleration
dtoverlay=vc4-fkms-v3d,cma-256
#dtoverlay=vc4-kms-v3d,cma-256
mask_gpu_interrupt0=0x400
avoid_warnings=2
gpu_mem=256

# I2C
dtparam=i2c_arm=on
dtparam=i2c1=on

# RPI display/touchscreen
dtoverlay=i2c-rtc,ds3231
dtoverlay=rpi-backlight
dtoverlay=rpi-ft5406

# Serial console
#enable_uart=1

# SPI
#dtparam=spi=on

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.