以下T507主板双屏异显的演示过程均在盈鹏飞嵌入式AHD-T507主板上进行,如果其他公司主板,可能略有区别。
什么是双屏异显呢?什么是双屏异控呢?他们两个概念上有什么区别呢?
双屏异显就是两个屏幕可以显示不同的内容。但是只有一个屏幕是可以带人机的,也就是带触摸屏或者鼠标键盘等。
双屏异控就是两个屏幕可以显示不同的内容,同时两个屏幕都是可以带人机的,也就是带触摸屏或者鼠标键盘等。
T507主板只能实现QT的双屏异显,无法实现双屏异控。
AHD-T507简要介绍如下:
AHD-T507功能图:
AHD-T507的”产品特性
采用Allwinner公司Cortex-A53四核T507处理器,运行最高速度为1.5GHZ;
支持Mali-G31 MP2 GPU,支持OpenGL ES 3.2/2.0/1.0, Valkan 1.1,OpenCL 2.0
支持4K/25fpsH.264视频编码,支持4K/15fps MJPEG编码;
多格式4K/60fps视频解码 (H.265,H.264,VC-1, MPEG-1/2/4, VP8) ;
支持双屏异显;支持RGB666/LVDS,分辨率最高1920x1080/60fps;支持HDMI 2.0A,分辨率最高4K/60fps;支持TV CVBS OUT(NTSC/PAL);
支持1-2G Bytes LPDDR4SDRAM;
支持EMMC 4G-64G大容量电子盘,可启动;
支持SDIO3.0,5路USB2.0 HOST和一路OTG,1路I2C,4路RS485,2路PWM(应用于背光)
支持双路以太网,一路10/100M;一路10/100/1000M;
支持3G/4G通信;
支持6路AHD视频输入;
稳定的操作系统的支持,可预装Android10.0/LINUX 4.9/UBUNTU 20.04;
尺寸为:146*132MM
如何定制如何定制T507双屏异显呢?
1)更改源代码双屏异显配置
kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/dev_fb.c中,使能编译变量:
#define BIND_FB1_TO_SCREEN1
2)如下DTS中disp_mode=0,
特别注意的是:
screen0_output_type = <1>;
screen0_output_mode = <4>;//0x23 for 4K
screen1_output_type = <3>;
screen1_output_mode = <10>;
全志的软件设置中SCREEN0一般匹配到是缓冲区FB0,一般硬件接LCD.
全志的软件设置中SCREEN1一般匹配到是缓冲区FB1,一般硬件接hdmi.
我们使能编译变量BIND_FB1_TO_SCREEN1后,也就是这个意思。
disp_mode (0:screen0<screen0,fb0>)
screenx_output_type (0:none; 1:lcd; 2:tv; 3:hdmi;5:vdpo)
screenx_output_mode (used for hdmi output, 0:480i 1:576i 2:480p 3:576p 4:720p50)
(5:720p60 6:1080i50 7:1080i60 8:1080p24 9:1080p50 10:1080p60)
&disp {
disp_init_enable = <1>;
disp_mode = <3>;/*diff_screen=3*/
screen0_output_type = <1>;
screen0_output_mode = <4>;//0x23 for 4K
screen1_output_type = <3>;
screen1_output_mode = <10>;
screen0_output_format = <0>;
screen0_output_bits = <0>;
screen0_output_eotf = <4>;
screen0_output_cs = <257>;
screen0_output_dvi_hdmi = <2>;
screen0_output_range = <2>;
screen0_output_scan = <0>;
screen0_output_aspect_ratio = <8>;
screen1_output_format = <0>;
screen1_output_bits = <0>;
screen1_output_eotf = <4>;
screen1_output_cs = <257>;
screen1_output_dvi_hdmi = <2>;
screen1_output_range = <2>;
screen1_output_scan = <0>;
screen1_output_aspect_ratio = <8>;
dev0_output_type = <1>;
dev0_output_mode = <4>;//0x23 for 4K
dev0_screen_id = <0>;
dev0_do_hpd = <0>;
dev1_output_type = <3>;
dev1_output_mode = <10>;
dev1_screen_id = <1>;
dev1_do_hpd = <1>;
def_output_dev = <0>;
hdmi_mode_check = <1>;
fb0_format = <9>;/*9-RGB888?need check ,embfly,23-04-13*/
fb0_width = <1024>;
fb0_height = <600>;
fb1_format = <0>;
fb1_width = <1920>;//3840 for 4K
fb1_height = <1080>;//2160 for 4k
/* fb0_format = <0>;
fb0_width = <1920>;//3840 for 4K
fb0_height = <1080>;//2160 for 4k
fb1_format = <5>;
fb1_width = <1024>;
fb1_height = <600>;
*/
chn_cfg_mode = <1>;
disp_para_zone = <1>;
/* VCC-LCD */
dc1sw-supply = <®_sw>;
/* VCC-LVDS and VCC-HDMI */
bldo1-supply = <®_bldo1>;
/* VCC-TV */
cldo4-supply = <®_cldo4>;
};
3)如何测试
系统启动后,会在LVDS LCD上显示第一个画面。(我们默认固件是1280X800的lvds屏)
然后执行/etc目录下的qtenv_fb1.sh,因为是双屏异显,不是双屏异控,因为qtenv_fb1.sh中只是运行界面程序。
不能有任何触摸或者鼠标动作。
qtenv_fb1.sh
以上工作,在AHD-T507主板上都已经做好,启动后,在lvds显示器上已经可以正常显示内容:
执行tenv_fb1.sh脚本,那么我们就可以开起qt程序video camera程序,这个程序将在HDMI上显示,如下图:
# ./qtenv_fb1.sh
Error:Input device gt9xxnew_ts can not be found,plz check it!
cat: /tmp/dbusaddr: No such file or directory
find qt5 installed done
# Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
00:04:28 124 QStyleFactory::keys ("Windows", "Fusion")
00:04:28 361 "查找完成 -> 数量: 4 用时: 10 毫秒" ("/dev/video0", "/dev/video1", "/dev/video2", "/dev/video3")
00:04:28 414 "查找完成 -> 数量: 4 用时: 10 毫秒" ("/dev/video0", "/dev/video1", "/dev/video2", "/dev/video3")
00:04:28 482 "查找完成 -> 数量: 4 用时: 10 毫秒" ("/dev/video0", "/dev/video1", "/dev/video2", "/dev/video3")
00:04:28 505 "查找完成 -> 数量: 4 用时: 10 毫秒" ("/dev/video0", "/dev/video1", "/dev/video2", "/dev/video3")
/dev/fb1 fb:1