Is there any constraints to use cvbs(interlaced) monitor in imx6q X11?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there any constraints to use cvbs(interlaced) monitor in imx6q X11?

1,118 Views
21300466
Contributor II

Hi, i'm trying to test the XOpenDisplay and other related to X11 functions.

I'm using custom board based on IMX6Q and the display is cvbs(interlaced).

And i'm using yocto image fsl-imx-x11.

However, when i execute 'startx' command to start x server, the below error message was shown.

====================================================

hostname: imx6qsabresd: Unknown host
xauth: file /home/root/.serverauth.891 does not exist


X.Org X Server 1.18.0
Release Date: 2015-11-09
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-31-generic x86_64
Current Operating System: Linux imx6qsabresd 4.1.15+gb63f3f52cb39 #15 SMP PREEMPT Mon Sep 2 20:00:55 CST 2019 armv7l
Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk3p2 rootwait rw
Build Date: 21 December 2016 12:47:42PM

Current version of pixman: 0.32.8
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Sep 2 09:42:20 2019
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
(EE) Backtrace:
(EE)
(EE) Segmentation fault at address 0x18
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

====================================================

To see detailed information of this error, i opened /var/log/Xorg.0.log file.

The below is whole content of log file.

====================================================

[4049245.196]
X.Org X Server 1.18.0
Release Date: 2015-11-09
[4049245.196] X Protocol Version 11, Revision 0
[4049245.197] Build Operating System: Linux 4.4.0-31-generic x86_64
[4049245.197] Current Operating System: Linux imx6qsabresd 4.1.15+gb63f3f52cb39 #15 SMP PREEMPT Mon Sep 2 20:00:55 CST 2019 armv7l
[4049245.197] Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk3p2 rootwait rw
[4049245.197] Build Date: 21 December 2016 12:47:42PM
[4049245.197]
[4049245.197] Current version of pixman: 0.32.8
[4049245.197] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[4049245.197] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[4049245.197] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Sep 2 09:42:20 2019
[4049245.197] (==) Using config file: "/etc/X11/xorg.conf"
[4049245.198] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[4049245.198] (==) No Layout section. Using the first Screen section.
[4049245.198] (==) No screen section available. Using defaults.
[4049245.198] (**) |-->Screen "Default Screen Section" (0)
[4049245.198] (**) | |-->Monitor "<default monitor>"
[4049245.199] (==) No device specified for screen "Default Screen Section".
Using the first device section listed.
[4049245.199] (**) | |-->Device "i.MX Accelerated Framebuffer Device"
[4049245.199] (==) No monitor specified for screen "Default Screen Section".
Using a default monitor configuration.
[4049245.199] (**) Option "BlankTime" "0"
[4049245.199] (**) Option "StandbyTime" "0"
[4049245.199] (**) Option "SuspendTime" "0"
[4049245.199] (**) Option "OffTime" "0"
[4049245.199] (==) Automatically adding devices
[4049245.199] (==) Automatically enabling devices
[4049245.199] (==) Automatically adding GPU devices
[4049245.199] (==) Max clients allowed: 256, resource mask: 0x1fffff
[4049245.199] (WW) The directory "/usr/share/fonts/X11/misc/" does not exist.
[4049245.199] Entry deleted from font path.
[4049245.199] (WW) The directory "/usr/share/fonts/X11/TTF/" does not exist.
[4049245.199] Entry deleted from font path.
[4049245.199] (WW) The directory "/usr/share/fonts/X11/OTF/" does not exist.
[4049245.199] Entry deleted from font path.
[4049245.199] (WW) The directory "/usr/share/fonts/X11/Type1/" does not exist.
[4049245.199] Entry deleted from font path.
[4049245.200] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[4049245.200] Entry deleted from font path.
[4049245.200] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[4049245.200] Entry deleted from font path.
[4049245.200] (==) FontPath set to:

[4049245.200] (==) ModulePath set to "/usr/lib/xorg/modules"
[4049245.200] (II) The server relies on udev to provide the list of input devices.
If no devices become available, reconfigure udev or disable AutoAddDevices.
[4049245.200] (II) Loader magic: 0x1b1a58
[4049245.200] (II) Module ABI versions:
[4049245.200] X.Org ANSI C Emulation: 0.4
[4049245.200] X.Org Video Driver: 20.0
[4049245.200] X.Org XInput driver : 22.1
[4049245.200] X.Org Server Extension : 9.0
[4049245.201] (II) xfree86: Adding drm device (/dev/dri/card0)
[4049245.201] (II) no primary bus or device found
[4049245.201] falling back to /sys/devices/platform/Vivante GCCore/drm/card0
[4049245.201] (II) LoadModule: "glx"

[4049245.202] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[4049245.212] (II) Module glx: vendor="X.Org Foundation"
[4049245.212] compiled for 1.18.0, module version = 1.0.0
[4049245.212] ABI class: X.Org Server Extension, version 9.0
[4049245.212] (==) AIGLX enabled
[4049245.212] (II) LoadModule: "vivante"
[4049245.212] (II) Loading /usr/lib/xorg/modules/drivers/vivante_drv.so
[4049245.213] (II) Module vivante: vendor="X.Org Foundation"
[4049245.213] compiled for 1.18.0, module version = 1.0.0
[4049245.213] Module class: X.Org Video Driver
[4049245.213] ABI class: X.Org Video Driver, version 20.0
[4049245.213] (II) VIVANTE: driver for vivante fb: VivanteGC500, VivanteGC2100,
VivanteGCCORE
[4049245.213] (--) using VT number 2

[4049245.223] (WW) Falling back to old probe method for vivante
[4049245.223] (II) Loading sub module "fbdevhw"
[4049245.223] (II) LoadModule: "fbdevhw"
[4049245.224] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[4049245.224] (II) Module fbdevhw: vendor="X.Org Foundation"
[4049245.224] compiled for 1.18.0, module version = 0.0.2
[4049245.224] ABI class: X.Org Video Driver, version 20.0
[4049245.224] (II) VIVANTE(0): using default device
[4049245.224] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[4049245.225] (II) VIVANTE(0): Device preferred mode 'fb0':D:720x576i-50
[4049245.225] (II) VIVANTE(0): Creating default Display subsection in Screen section
"Default Screen Section" for depth/fbbpp 24/32
[4049245.225] (==) VIVANTE(0): Depth 24, (==) framebuffer bpp 32
[4049245.225] (==) VIVANTE(0): RGB weight 888
[4049245.225] (==) VIVANTE(0): Default visual is TrueColor
[4049245.225] (==) VIVANTE(0): Using gamma correction (1.0, 1.0, 1.0)
[4049245.225] (**) VIVANTE(0): Option "fbdev" "/dev/fb0"
[4049245.225] (II) VIVANTE(0): checking modes against framebuffer device...
[4049245.225] (II) VIVANTE(0): checking modes against monitor...
[4049245.225] (II) VIVANTE(0): Use built in mode (bpp 32)
[4049245.225] (--) VIVANTE(0): Virtual size is 0x0 (pitch 0)
[4049245.225] (==) VIVANTE(0): DPI set to (96, 96)
[4049245.225] (II) Loading sub module "fb"
[4049245.225] (II) LoadModule: "fb"
[4049245.226] (II) Loading /usr/lib/xorg/modules/libfb.so
[4049245.226] (II) Module fb: vendor="X.Org Foundation"
[4049245.227] compiled for 1.18.0, module version = 1.0.0
[4049245.227] ABI class: X.Org ANSI C Emulation, version 0.4
[4049245.227] (II) Loading sub module "exa"
[4049245.227] (II) LoadModule: "exa"
[4049245.227] (II) Loading /usr/lib/xorg/modules/libexa.so
[4049245.227] (II) Module exa: vendor="X.Org Foundation"
[4049245.227] compiled for 1.18.0, module version = 2.6.0
[4049245.227] ABI class: X.Org Video Driver, version 20.0
[4049245.290] (II) VIVANTE(0): printing discovered frame buffer 'fb0' supported modes:
[4049245.291] (II) VIVANTE(0): Modeline "D:720x576i-50"x0.0 27.00 720 722 1010 1032 576 578 579 602 interlace +hsync +vsync -csync (26.2 kHz eP)
[4049245.302] (II) VIVANTE(0): Output DISP3 BG has no monitor section
[4049245.302] (II) VIVANTE(0): Not using mode "D:720x576i-50" (interlace mode not supported)
[4049245.302] (II) VIVANTE(0): No remaining probed modes for output DISP3 BG
[4049245.302] (II) VIVANTE(0): Output DISP3 BG connected
[4049245.302] (WW) VIVANTE(0): Unable to find initial modes
[4049245.302] (EE) VIVANTE(0): Output DISP3 BG enabled but has no modes
[4049245.302] (EE) VIVANTE(0): xf86InitialConfiguration failed
[4049245.302] (II) VIVANTE(0): FBDevPreInit: adjust display width 0
[4049245.302] (**) VIVANTE(0): PreInit done
[4049245.302] (EE)
[4049245.302] (EE) Backtrace:

[4049245.302] (EE)
[4049245.302] (EE) Segmentation fault at address 0x18
[4049245.302] (EE)
Fatal server error:
[4049245.303] (EE) Caught signal 11 (Segmentation fault). Server aborting
[4049245.303] (EE)
[4049245.303] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
[4049245.303] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[4049245.303] (EE)
[4049245.519] (EE) Server terminated with error (1). Closing log file.

====================================================

In above log file, what is the meaning of 'VIVANTE(0): Not using mode "D:720x576i-50" (interlace mode not supported)'?

Is that message saying the x11 startx couldn't be executed because the display is interlace mode?

I'll really appreciate if anyone tell me the cause of this error.

Regards,

Yoo

0 Kudos
5 Replies

962 Views
21300466
Contributor II

Hi,

Thanks for your answering.

However, i think the target uses the Linux imx6qsabresd 4.1.15+gb63f3f52cb39. am i wrong?

Because in the log, 

[4049245.197] Build Operating System: Linux 4.4.0-31-generic x86_64
[4049245.197] Current Operating System: Linux imx6qsabresd 4.1.15+gb63f3f52cb39 #15 SMP PREEMPT Mon Sep 2

are shown.

Please let me know if i am wrong.

Regards,

Yoo

0 Kudos

962 Views
igorpadykov
NXP Employee
NXP Employee

Hi Yoo

 

suggest try nxp linux from linux-imx - i.MX Linux kernel 

documentation

i.MX Software and Development Tools | NXP 

Best regards
igor

0 Kudos

962 Views
21300466
Contributor II

Hi, igor

I'm really sorry but i can not understand exactly...

I followed the i.MX Yocto Project User's Guide, Rev. L4.1.15_2.1.0-ga, 05/2017 pdf.

Moreover, when i typed uname -r on the target board, 4.1.15+gb63f3f52cb39.

Then, I think the target board is running on 4.1.15+gb63f3f52cb39. 

Are you meaning the kernel version 4.1.15+gb63f3f52cb39 that target board uses is not supported nxp?

Sorry for my lack of ability to catch your meaning.

Regards,

Yoo

0 Kudos

962 Views
igorpadykov
NXP Employee
NXP Employee

Hi Yoo

suggest to post issue on patch link

Patch for iMX6 BSP to support interlaced display on HDMI and LCD interface 

Best regards
igor

0 Kudos

962 Views
21300466
Contributor II

Hi, igor

Thank you for suggesting.

However, for right now, i changed the yocto image to use fb backend.

After changing to that, i was able to see fbCreateWindow and other functions to init egl and gles works normally.

However, 'glClear' function cause segmentation fault error.

I checked using gdb and gdb shows the below message.

===========================================

Program received signal SIGSEGV, Segmentation fault.
__glEvaluateSystemDrawableChange (gc=0x12539c, flags=1) at src/glcore/gc_es_context.c:676
676 src/glcore/gc_es_context.c: No such file or directory.

===========================================

Could you suggest the solution of this problem?

The whole source code is below.

============================================

#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

#include <EGL/egl.h>
#include <EGL/eglvivante.h>

#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <cstring>
#include <unistd.h>

//Configure window size here
#define WIDTH 720
#define HEIGHT 576
#define TRUE 1
#define FALSE 0

EGLNativeDisplayType display;
EGLNativeWindowType window;

EGLDisplay _eglDisplay;
EGLSurface _eglSurface;
EGLContext _eglContext;

EGLint numConfigs = 0;
EGLConfig eglConfig;


void init_egl()
{
display = fbGetDisplayByIndex( 0 );
assert( display );

// setup attribs
static const EGLint configAttribs[] =
{
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8, // buffers with the smallest alpha component size are preferred
EGL_DEPTH_SIZE, 1,
EGL_STENCIL_SIZE, EGL_DONT_CARE,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_NONE, EGL_NONE
};

// create a context
EGLint contextAttribs[] =
{
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};

_eglDisplay = eglGetDisplay( display );
assert( EGL_SUCCESS == eglGetError() );
assert( 0 != _eglDisplay );

eglInitialize( _eglDisplay, NULL, NULL );
assert( EGL_SUCCESS == eglGetError() );

eglBindAPI(EGL_OPENGL_ES_API);

eglChooseConfig( _eglDisplay, configAttribs, &eglConfig, 1, &numConfigs );
assert( EGL_SUCCESS == eglGetError() );
assert( 1 == numConfigs );

window = fbCreateWindow( display, 0, 0, WIDTH, HEIGHT );
assert( window );

printf("DEBUG : fbCreateWindow done.\n");

_eglSurface = eglCreateWindowSurface( _eglDisplay, eglConfig, window, NULL );
EGLint iErr = eglGetError();
switch(iErr) {
case EGL_SUCCESS :
printf("EGL_SUCCESS");
break;
case EGL_NOT_INITIALIZED :
printf("EGL_NOT_INITIALIZED");
break;
case EGL_BAD_ACCESS :
printf("EGL_BAD_ACCESS");
break;
case EGL_BAD_ALLOC :
printf("EGL_SUCCESS");
break;
case EGL_BAD_ATTRIBUTE :
printf("EGL_SUCCESS");
break;
default :
printf("Another error");
break;
}
printf("\n");
assert( EGL_SUCCESS == eglGetError() );

printf("DEBUG : eglCreateWindowSurface Done.\n");
//assert( EGL_SUCCESS == eglGetError() );

_eglContext = eglCreateContext( _eglDisplay, eglConfig, EGL_NO_CONTEXT, contextAttribs );
assert( EGL_SUCCESS == eglGetError() );
iErr = eglGetError();
switch(iErr) {
case EGL_SUCCESS :
printf("EGL_SUCCESS");
break;
case EGL_NOT_INITIALIZED :
printf("EGL_NOT_INITIALIZED");
break;
case EGL_BAD_ACCESS :
printf("EGL_BAD_ACCESS");
break;
case EGL_BAD_ALLOC :
printf("EGL_SUCCESS");
break;
case EGL_BAD_ATTRIBUTE :
printf("EGL_SUCCESS");
break;
default :
printf("Another error");
break;
}

printf("\n");
assert( EGL_SUCCESS == eglGetError() );

printf("DEBUG : eglCreateContext Done.\n");

eglMakeCurrent( _eglDisplay, _eglSurface, _eglSurface, _eglContext );
assert( EGL_SUCCESS == eglGetError() );
iErr = eglGetError();
switch(iErr) {
case EGL_SUCCESS :
printf("EGL_SUCCESS");
break;
case EGL_NOT_INITIALIZED :
printf("EGL_NOT_INITIALIZED");
break;
case EGL_BAD_ACCESS :
printf("EGL_BAD_ACCESS");
break;
case EGL_BAD_ALLOC :
printf("EGL_SUCCESS");
break;
case EGL_BAD_ATTRIBUTE :
printf("EGL_SUCCESS");
break;
default :
printf("Another error");
break;
}


printf("\n");
printf("DEBUG : eglMakeCurrent Done.\n");
}

const char* vertexShaderStr =
"attribute vec4 vPosition; \n"
"void main() \n"
"{ \n"
" gl_Position = vPosition; \n"
"} \n";

const char* fragmentShaderStr =
"precision mediump float; \n"
"void main() \n"
"{ \n"
" gl_FragColor = vec4(0.0, 1.0, 0.0 ,1.0);\n"
"} \n";

GLfloat vVertices[] = { -0.0f, 0.5f, 0.0f,
-0.5f, -0.5f, 0.0f,
0.5f, -0.5f, 0.0f, };

GLuint shaderProgram = 0;
GLuint textureId;
GLint positionLoc;
GLint texCoordLoc;
GLint samplerLoc;
GLint length;
GLint ret;
GLuint vertexShader;
GLuint fragmentShader;

GLuint loadShader (const char *shaderSrc, GLenum type)
{
GLuint shader;
GLint compiled;

/* Create the shader object */
shader = glCreateShader(type);

if (shader == 0)
{
printf("Failed to create Shader..\n");
return FALSE;
}

/* Load the shader source */
glShaderSource(shader, 1, &shaderSrc, NULL);

/* Compile the shader */
glCompileShader(shader);

/* Check the compile status */
glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);

if (!compiled)
{
GLint infoLen = 0;

glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);

if (infoLen > 1)
{
char *infoLog = (char*)malloc(sizeof(char) * infoLen);

glGetShaderInfoLog(shader, infoLen, NULL, infoLog);
printf("Error compiling shader:\n%s\n", infoLog);
free(infoLog);
}

glDeleteShader(shader);
return FALSE;
}

return shader;
}

int glesInit()
{
vertexShader = loadShader(vertexShaderStr, GL_VERTEX_SHADER);
fragmentShader = loadShader(fragmentShaderStr, GL_FRAGMENT_SHADER);

shaderProgram = glCreateProgram();

if (shaderProgram == 0)
{
printf("Failed to create Shader program..\n");
return FALSE;
}

glAttachShader(shaderProgram, vertexShader);
glAttachShader(shaderProgram, fragmentShader);

/* Bind vPosition to attribute 0 */
glBindAttribLocation(shaderProgram, 0, "vPosition");

/* Link the program */
glLinkProgram(shaderProgram);

/* Check the link status */
GLint linked;
glGetProgramiv(shaderProgram, GL_LINK_STATUS, &linked);

if (!linked)
{
GLint infoLen = 0;

glGetProgramiv(shaderProgram, GL_INFO_LOG_LENGTH, &infoLen);

if (infoLen > 1)
{
char *infoLog = (char*)malloc(sizeof(char) * infoLen);

glGetProgramInfoLog(shaderProgram, infoLen, NULL, infoLog);
printf("Failed to link Shader program..\n%s\n", infoLog);

free(infoLog);
}

glDeleteProgram(shaderProgram);
return FALSE;
}

glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
return TRUE;
}

int main(int argc,char *argv[])
{

init_egl();
printf("egl Init Done.\n");

/* init GLES */
if (glesInit() != TRUE)
{
printf("Failed to initialize GLES..\n");
return -1;
}

printf("gles Init Done.\n");

int ret = 0;
int running = 1;
GLenum err;

while( running && ret != -1 )
{
/* Draw */
glViewport(0, 0, WIDTH, HEIGHT);
printf("glViewport.\n");
err = glGetError();
if (err != GL_NO_ERROR)
printf("0x%x\n", err);

printf("before glClear.\n");
glClear(GL_COLOR_BUFFER_BIT);                  /**************Segmentation Fault here************************/
printf("glClear.\n");
err = glGetError();
if (err != GL_NO_ERROR)
printf("0x%x\n", err);


glUseProgram(shaderProgram);
printf("glUseProgram.\n");
err = glGetError();
if (err != GL_NO_ERROR)
printf("0x%x\n", err);

glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vVertices);
printf("glVertexAttribPointer.\n");
err = glGetError();
if (err != GL_NO_ERROR)
printf("0x%x\n", err);

glEnableVertexAttribArray(0);
printf("glEnableVertexAttribArray.\n");
err = glGetError();
if (err != GL_NO_ERROR)
printf("0x%x\n", err);

glDrawArrays(GL_TRIANGLES, 0, 3);
printf("glDrawArrays.\n");
err = glGetError();
if (err != GL_NO_ERROR)
printf("0x%x\n", err);

eglSwapBuffers(_eglDisplay, _eglSurface);
EGLint iErr = eglGetError();
switch(iErr) {
case EGL_SUCCESS :
printf("EGL_SUCCESS");
break;
case EGL_NOT_INITIALIZED :
printf("EGL_NOT_INITIALIZED");
break;
case EGL_BAD_ACCESS :
printf("EGL_BAD_ACCESS");
break;
case EGL_BAD_ALLOC :
printf("EGL_SUCCESS");
break;
case EGL_BAD_ATTRIBUTE :
printf("EGL_SUCCESS");
break;
default :
printf("Another error");
break;
}
printf("\n");

}

return 0;
}

Best Regards,

Yoo

0 Kudos