HDMI Resolutions testing

Sorry, davemf.
About the green screen bug for 1024x768 and 1024x600 hdmi output, I haven’t any idea for it now.
And I will put this into my work list but need some times to fix it.

2 Likes

1024x600 has green screen.
But 1024x768 has bug - >


1 Like

Hi, terry!
I use 1280*800 resolution, it work fine.
In addition to the bugs above, there is another…

Cold start - when the computer is turned off for more than some hours.
The screen resolution is set arbitrarily after the cold start. After rebooting, it returns to the previously selected resolution.

Also this happens if you turn khadas without monitor.

Can you provide some informations for me? Thanks

# adb shell
# cat /sys/class/display/mode
# wm size
# fbset
# getbootenv
# logcat
# dmesg

@london told about this bug.

dmesg on post

I’ll create new logs soon.

Hello, terry!
These are my logs (result of all commands in one file) with adb, when image on the screen seen like this.

another time, with the same image on the screen, the output of fbset was different (but, fbset is same when the image on the screen is correct):
kvim2:/ # fbset
fbset

mode “1280x720-0”
# D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz
geometry 1280 720 1280 2160 32
timings 0 0 0 0 0 0 0
accel false
rgba 8/0,8/8,8/16,8/24
endmode

1 Like

Hi, terry!
@london maked all logs.

london, thank you for help!

Hi all, I’m new to Khadas vim platform,
I have a custom VR HMD and vim2 MAX dev board, the HMD have special HDMI timing:

[ 7598.006] (II) NVIDIA(GPU-0): Validating Mode “2880x1440_68”:
[ 7598.006] (II) NVIDIA(GPU-0): Mode Source: EDID
[ 7598.006] (II) NVIDIA(GPU-0): 2880 x 1440 @ 68 Hz
[ 7598.006] (II) NVIDIA(GPU-0): Pixel Clock : 297.00 MHz
[ 7598.006] (II) NVIDIA(GPU-0): HRes, HSyncStart : 2880, 2906
[ 7598.006] (II) NVIDIA(GPU-0): HSyncEnd, HTotal : 2918, 2998
[ 7598.006] (II) NVIDIA(GPU-0): VRes, VSyncStart : 1440, 1444
[ 7598.006] (II) NVIDIA(GPU-0): VSyncEnd, VTotal : 1446, 1449
[ 7598.006] (II) NVIDIA(GPU-0): H/V Polarity : +/+
[ 7598.006] (II) NVIDIA(GPU-0): Mode “2880x1440_68” is valid.

Test env: Ubuntu-mate 16.04
Kernel Porting branch: ubuntu-4.9 from GitHub - khadas/linux: Linux kernel for Khadas VIMs & Edges
U-boot branch: MultiOS from GitHub - khadas/u-boot: U-Boot for Khadas VIMs & Edge

I study the u-boot and kernel driver for filling these parameter in hdmitx module to create special mode,
but I stuck at video encoder register assignment inside “enc_cfg_hw.c” , I don’t know how to assign these values :slightly_frowning_face: (here tvregs_1440p_68hz is copy from tvregs_1080p, for test and failed)

Code Segments

static const struct reg_s tvregs_1440p_68hz = {
{P_ENCP_VIDEO_EN, 0},
{P_ENCI_VIDEO_EN, 0},
{P_ENCP_VIDEO_FILT_CTRL, 0x1052},
{P_VENC_DVI_SETTING, 0x0001},
{P_ENCP_VIDEO_MODE, 0x4040},
{P_ENCP_VIDEO_MODE_ADV, 0x0018},
{P_ENCP_VIDEO_YFP1_HTIME, 140},
{P_ENCP_VIDEO_YFP2_HTIME, 2060},
{P_ENCP_VIDEO_MAX_PXCNT, 2199},
{P_ENCP_VIDEO_HSPULS_BEGIN, 2156},
{P_ENCP_VIDEO_HSPULS_END, 44},
{P_ENCP_VIDEO_HSPULS_SWITCH, 44},
{P_ENCP_VIDEO_VSPULS_BEGIN, 140},
{P_ENCP_VIDEO_VSPULS_END, 2059},
{P_ENCP_VIDEO_VSPULS_BLINE, 0},
{P_ENCP_VIDEO_VSPULS_ELINE, 4},
{P_ENCP_VIDEO_HAVON_BEGIN, 148},
{P_ENCP_VIDEO_HAVON_END, 2067},
{P_ENCP_VIDEO_VAVON_BLINE, 41},
{P_ENCP_VIDEO_VAVON_ELINE, 1120},
{P_ENCP_VIDEO_HSO_BEGIN, 44},
{P_ENCP_VIDEO_HSO_END, 2156},
{P_ENCP_VIDEO_VSO_BEGIN, 2100},
{P_ENCP_VIDEO_VSO_END, 2164},
{P_ENCP_VIDEO_VSO_BLINE, 0},
{P_ENCP_VIDEO_VSO_ELINE, 5},
{P_ENCP_VIDEO_MAX_LNCNT, 1124},
{P_VPU_VIU_VENC_MUX_CTRL, 0xA},
{P_VENC_VIDEO_PROG_MODE, 0x100},
{P_ENCI_VIDEO_EN, 0},
{P_ENCP_VIDEO_EN, 1},
{MREG_END_MARKER, 0},
};

static struct vic_tvregs_set tvregsTab = {

{HDMI_3840x2160p50_16x9_Y420, tvregs_4k2k_25hz},
{HDMI_2880x1440p68_2x1, tvregs_1440p_68hz},
};

In hdmi_parameters.c :

static struct hdmi_format_para fmt_para_2880x1440p68_2x1 = {
.vic = HDMI_2880x1440p68_2x1,
.name = “2880x1440p68hz”,
.sname = “1440p68hz”,
.pixel_repetition_factor = 0,
.progress_mode = 1,
.scrambler_en = 0,
.tmds_clk_div40 = 0,
.tmds_clk = 297000,
.timing = {
.pixel_freq = 297000,
.frac_freq = 296703,
.h_freq = 99066,
.v_freq = 68368,
.vsync_polarity = 1,
.hsync_polarity = 1,
.h_active = 2880,
.h_total = 2998,
.h_blank = 118,
.h_front = 26,
.h_sync = 12,
.h_back = 80,
.v_active = 1440,
.v_total = 1449,
.v_blank = 9,
.v_front = 4,
.v_sync = 2,
.v_back = 3,
.v_sync_ln = 1,
},
.hdmitx_vinfo = {
.name = “1440p68hz”,
.mode = VMODE_HDMI,
.width = 2880,
.height = 1440,
.field_height = 1440,
.aspect_ratio_num = 2,
.aspect_ratio_den = 1,
.sync_duration_num = 68,
.sync_duration_den = 1,
.video_clk = 297000000,
.viu_color_fmt = COLOR_FMT_YUV444,
},
};

in u-boot testing:

kvim2#hdmitx get_preferred_mode
edid preferred_mode is 1440p68hz[109]
Saving Environment to aml-storage…
mmc env offset: 0x27400000
Writing to MMC(1)… done
kvim2#hdmitx output 1440p68hz
set hdmitx VIC = 109
config HPLL = 2970000
HPLL: 0xc000027b
config HPLL done
j = 4 vid_clk_div = 1
hdmitx: set enc for VIC: 109
rx version is 1.4 or below div=10
hdmtix: set audio
hdmitx phy setting done

After Patch and driver modify, I can’t get HMD works, maybe I missing some Parameter or code to
drive HDMI timing?

Edit: Add my patch:
kernel: 0001-Add-New-timing-mode-for-2880x1440-68hz-HMD.patch - Google Drive
u-boot: 0001-u-boot-Add-new-timing-for-2880x1440-68hz-HMD-testing.patch - Google Drive

Hi, terry!
I build new ROM for VIM1 on source V180206 with this patch and VIM1 has new bug - green screen on 1024*600 like VIM2!
But VIM1 does not has “green screen” and “cold start” bugs on old source with last putch!!!

How to fix it?
And how to fix “cold start” bug?

1 Like

Hi, terry!!!

I did an experiment, I built ROM N712 for VIM2 of old source codes (September - October 2017), like VIM1. Applied the latest patches.

All resolutions work perfect on VIM2!!! It has not “green screen” bug!!!

What is done in the new source code V180206, which leads to the appearance of bugs???

How to add DVB boart support on old source?

1 Like

I updated source code from official amlogic on V180206. There’s a lot of difference between V171029 and V180206.

You can download the DVB patch and try to add support for it. Thanks

1 Like

Hi, terry!
I’ve been testing ROM V171029 for a week.
It has “cold start” bug like ROM V180206.
That this may be? Any idea how to fix this?

@Terry
Where are you?
What about HDMI bugs? And what about Oreo for VIM2?

Hello! Can you tell if there is a way to run at 2560x1080 (ultrawide)? I am not a Linux expert, just an enthusiast, I do not understand deep kernet patch applications and so on. I have seen in an Armbian forum that in fbdev mode in the latest kernels it is possible to enable newer resolutions, can you tell if this applies to khadas? What do I need to do to run Khadas in fbdev on Armbian with kernel 4.17 or later?

1 Like

hi, jcpuga, the resolutions 2560x1080 is not support at present.

Hello,

I Testet your Rom and it Works good.
Thanks for your Hard Work.
Could you please also provide me with the modified Code?
Just need one extra Resolution to the Rom.

Regards
Ray

Hello! But do you have any plans to launch 2560x1080 support? Ultrawide monitors are becoming more common, but it’s a shame we can not use them in the right way. I’m almost stopping using the expensive Khada vim2 because of it. I wanted to make use of the correct resolution in Linux, I have no interest in Android.

Just to say, with mainline Linux starting from 4.18, you can have almost any VGA and DVI resolutions supported directly without any hacks or tweaks :wink:

7 Likes

Any body has managed to get the 2560x1440 resolution to work on VIM2? Thanks

Hi omegasystem, did you manage to recompile the kernel to work with the resolution?