Kodi Community Forum
[LINUX] XBMC for Linux port to ARM architecture CPU and SoC chips? - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Discussions (https://forum.kodi.tv/forumdisplay.php?fid=222)
+--- Forum: Feature Requests (https://forum.kodi.tv/forumdisplay.php?fid=9)
--- Thread: [LINUX] XBMC for Linux port to ARM architecture CPU and SoC chips? (/showthread.php?tid=35139)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48


- jefrey99 - 2010-03-26

Hey McGeagh,

thinking of re-designing my approach using your scratchbox method and using my custom kernel and file system built with Freescale's Linux Target Image Builder (LTIB). Right now I have a boot time of 4 seconds which is much faster then ~30-40 seconds with Ubuntu.

I am still getting my environment setup per your instructions (currently hung up on /arm-scripts/install-pkgs.sh ) It can't seem to be able to download all of the packages yet

One thing that I did notice is that the compiler selected in the documentation (cs2007q1) does not support the ARMv7 architecture which is on the Cortex-A8. Therefor it does not support the NEON co-processor nor does it fully support VFPv3 which is on the Cortex-A8. some of the math operations will be executed by software as VFPv2 is not completely IEEE754 compliant in hardware. VFPv3 is fully IEEE754 compliant in hardware (but unfortunately not pipelined) but the compiler needs to be aware of it's existence.

NEON will provide another huge performance boost to XBMC with it's SIMD capabilities but again the compiler needs to be aware of it. GCC 4.3.3 or better needs to be used which means cs2008q3 or later and apparently scratchbox-toolchain-arm-linux-cs2009q3-67 exists which should do the job.

here are the CFLAGS that I usually use for the Cortex-A8, I have seen a 3-4x performance improvement using these over ARMv6 flags

CFLAGS="-O3 -march=armv7-a -mtune=cortex-a8 -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -fomit-frame-pointer -ffast-math"

I'm still working through the issues and I'm sure that I will need your help soon.

Thanks,
Jeff


- McGeagh - 2010-03-26

the install pkg script is a dumb script that just tries to download packages from a hardcoded list of package urls...these links may be broken... simply change them in the pkgs.txt file with the new link and it will download.

Also, the documentation is not really up to date, so a few things may be wrong/incomplete, and hence the outdated compiler version.

there are a few additional cflags you have that i dont, so may give that a go at a later date (currently trying to optimise the gpu, not cpu, as its the bottleneck on the beagleboard)

Thanks for your input!


- jefrey99 - 2010-03-27

McGeagh

Where did you document the removal of libswscale from the build? If it is not documented please tell me how you did it?

I see the option --enable-swscale in the "build_xbmc.sh" scrip at xbmc_on_arm/xbmc/cores/dvdplayer/Codecs/ffmpeg/
is this something that can be disabled at the ./configure line or do we have to do something less elegant?

Thanks!


- davilla - 2010-03-28

Similar problem as IsaacZhang but only with shaders.

Code:
16:39:03 T:1103313200 M:821952512   DEBUG: EGL_EXTENSIONS:  EGL_create_pbuffer_from_client_buffer EGL_KHR_bind_client_buffer EGL_KHR_config_attribs EGL_KHR_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_NV_perfmon EGL_NV_system_time EGL_NV_coverage_sample EGL_NV_omx_il_sink EGL_KHR_lock_surface EGL_NV_sync EGL_NV_native_query
16:39:03 T:1103313200 M:821952512  NOTICE: GL_VENDOR = NVIDIA Corporation
16:39:03 T:1103313200 M:821952512  NOTICE: GL_RENDERER = NVIDIA Tegra
16:39:03 T:1103313200 M:821952512  NOTICE: GL_VERSION = OpenGL ES 2.0
16:39:03 T:1103313200 M:821952512  NOTICE: GL_EXTENSIONS = GL_OES_rgb8_rgba8 GL_OES_fbo_render_mipmap GL_NV_depth_nonlinear GL_NV_draw_path GL_OES_EGL_image GL_OES_vertex_half_float GL_NV_framebuffer_vertex_attrib_array GL_NV_coverage_sample GL_OES_mapbuffer GL_ARB_draw_buffers GL_ARB_half_float_pixel GL_EXT_Cg_shader GL_EXT_packed_float GL_OES_texture_half_float GL_OES_texture_float GL_EXT_texture_array GL_OES_compressed_ETC1_RGB8_texture GL_EXT_texture_compression_latc GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_NV_get_tex_image GL_NV_read_buffer GL_NV_shader_framebuffer_fetch GL_ARB_texture_rectangle GL_NV_fbo_color_attachments GL_EXT_bgra
16:39:03 T:1103313200 M:821952512   DEBUG: Shader - Loading shader file guishader_frag.glsl
16:39:03 T:1103313200 M:821952512   DEBUG: Shader - Loading shader file guishader_vert.glsl
16:39:03 T:1103313200 M:821952512   ERROR: GL: Error compiling vertex shader
16:39:03 T:1103313200 M:821952512   ERROR: GL: Error compiling vertex shader
16:39:03 T:1103313200 M:821952512   ERROR: GUI Shader - Initialise failed
16:39:03 T:1103313200 M:821952512    INFO: GLES: Maximum texture width: 2048

The debug log for shader compile is empty so no help there.


- McGeagh - 2010-03-30

im not removing libswscale, im simply not using the arm (or any) optimised version, i.e fallback software version.

It may not be documented anywhere other than as an svn comment... Please check the makefile.in in the dvdplayer folder for the exact change i did.


- djhalmy - 2010-03-30

Hi:

I obtain the same error as davilla but the macros GL_vendor/renderer/version/Extension returns NULL and i don't Know why.

If fact if I run a small example whit only basic functions (i.e. only eglGetDisplays(), eglInitialized(), eglCreateWindiwSurface(), eglCreateContext and eglMakeCurrent,) the macros GL_vendor/renderer//version/Extension are OK.

Other strange thing for me is that functions such as eglCreateWindiwSurface(), eglCreateContext() and eglMakeCurrent() ,only are called from WinSystemEGL.cpp::RefreshEGLContext() but when I run xbmc (by first time) this functions are not runned and the context egl is not created and for that GL_vendor/version/renderer/Extension returns NULL.

Could be my problem related to SDL functions? Mcgeagh had obtained some problems with SDL using SDK 3.01.00.02. Does SDL create the initial window surface?

My xbmc.log is:

Code:
18:26:16 T:1101396352 M: 92635136  NOTICE: GL_VENDOR = NULL
18:26:16 T:1101396352 M: 92635136  NOTICE: GL_RENDERER = NULL
18:26:16 T:1101396352 M: 92635136  NOTICE: GL_VERSION = NULL
18:26:16 T:1101396352 M: 92635136  NOTICE: GL_EXTENSIONS = NULL
18:26:16 T:1101396352 M: 92635136   DEBUG: GLES: Extension Support Test - GL_TEXTURE_NPOT NO
18:26:16 T:1101396352 M: 92643328   DEBUG: Shader - Loading shader file guishader_frag.glsl
18:26:16 T:1101396352 M: 92647424   DEBUG: Shader - Loading shader file guishader_vert.glsl
18:26:16 T:1101396352 M: 92651520   ERROR: GL: Error compiling vertex shader
18:26:16 T:1101396352 M: 92651520   ERROR: GL: *** Error compiling vertex shader
18:26:16 T:1101396352 M: 92651520   ERROR: GUI Shader - Initialise failed

I woud like to know what is your opinion. Thanks


- davilla - 2010-03-31

davilla Wrote:Similar problem as IsaacZhang but only with shaders.

Code:
16:39:03 T:1103313200 M:821952512   DEBUG: EGL_EXTENSIONS:  EGL_create_pbuffer_from_client_buffer EGL_KHR_bind_client_buffer EGL_KHR_config_attribs EGL_KHR_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_NV_perfmon EGL_NV_system_time EGL_NV_coverage_sample EGL_NV_omx_il_sink EGL_KHR_lock_surface EGL_NV_sync EGL_NV_native_query
16:39:03 T:1103313200 M:821952512  NOTICE: GL_VENDOR = NVIDIA Corporation
16:39:03 T:1103313200 M:821952512  NOTICE: GL_RENDERER = NVIDIA Tegra
16:39:03 T:1103313200 M:821952512  NOTICE: GL_VERSION = OpenGL ES 2.0
16:39:03 T:1103313200 M:821952512  NOTICE: GL_EXTENSIONS = GL_OES_rgb8_rgba8 GL_OES_fbo_render_mipmap GL_NV_depth_nonlinear GL_NV_draw_path GL_OES_EGL_image GL_OES_vertex_half_float GL_NV_framebuffer_vertex_attrib_array GL_NV_coverage_sample GL_OES_mapbuffer GL_ARB_draw_buffers GL_ARB_half_float_pixel GL_EXT_Cg_shader GL_EXT_packed_float GL_OES_texture_half_float GL_OES_texture_float GL_EXT_texture_array GL_OES_compressed_ETC1_RGB8_texture GL_EXT_texture_compression_latc GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_NV_get_tex_image GL_NV_read_buffer GL_NV_shader_framebuffer_fetch GL_ARB_texture_rectangle GL_NV_fbo_color_attachments GL_EXT_bgra
16:39:03 T:1103313200 M:821952512   DEBUG: Shader - Loading shader file guishader_frag.glsl
16:39:03 T:1103313200 M:821952512   DEBUG: Shader - Loading shader file guishader_vert.glsl
16:39:03 T:1103313200 M:821952512   ERROR: GL: Error compiling vertex shader
16:39:03 T:1103313200 M:821952512   ERROR: GL: Error compiling vertex shader
16:39:03 T:1103313200 M:821952512   ERROR: GUI Shader - Initialise failed
16:39:03 T:1103313200 M:821952512    INFO: GLES: Maximum texture width: 2048

The debug log for shader compile is empty so no help there.

Found it;

Quote:230 if ((m_SDLSurface = SDL_SetVideoMode(m_nWidth, m_nHeight, 0, options)))
231 {
232 RefreshEGLContext();
233 }

m_SDLSurface returned is zero. So something wrong with SDL and OpenGL/ES


- djhalmy - 2010-03-31

Hi
I have got to run xbmc in the bealeboard at the end but i had to remove an option of one function.
In the file WinSystemEGL.cpp in CWinSystemEGL::SetFullScreen (......) I had to change :
Code:
if ((m_SDLSurface = SDL_SetVideoMode(m_nWidth, m_nHeight, 0, [b]options[/b])))
    {
      RefreshEGLContext();
    }
by
Code:
if ((m_SDLSurface = SDL_SetVideoMode(m_nWidth, m_nHeight, 0, [b]SDL_FULLSCREEN[/b])))
{
      RefreshEGLContext();
}

i.e. i had to remove the option SDL_OPENGL in order to run xbmc.

Somebody understands, why doesn't xbmc work with SDL_OPENGL option or what are the consequences if I don't use that option??


- McGeagh - 2010-04-01

its not needed really. Which means you can also remove all the SDL_GL_SetAttrib calls too.
Should work without it (my testapp does atleast).
I just did a blanket convert from GL to ES code, regardless of whether certain lines were still needed lol.
Cant we get rid of SDL entirely? its such a pain!


- davilla - 2010-04-01

McGeagh Wrote:its not needed really. Which means you can also remove all the SDL_GL_SetAttrib calls too.
Should work without it (my testapp does atleast).
I just did a blanket convert from GL to ES code, regardless of whether certain lines were still needed lol.
Cant we get rid of SDL entirely? its such a pain!

How are you setting up m_eglWindow/m_wmWindow ? Right now this comes from SDL_GetWMInfo (info.info.x11.window/info.info.x11.wmwindow) and without getting m_SDLSurface back from SDL_SetVideoMode, these are null.


We would need an X11 event handler that translates X11 events into XBMC events. I've got a similar bug up my ass about SDL under OSX as OSX is event driven and SDL does a poll for events. One thought is to make an simple event handler that translates X11 events and uses the eventclient model to send events via tcp/ip loopback. Cursor handling is another issue.


- McGeagh - 2010-04-07

i am currently doing it how xbmc does it, i.e with SDL... but alternatively, can you not create the window by this method instead? (untested!):
Code:
Display* display;
    EGLDisplay sEGLDisplay;
    EGLConfig FBConfig;
    XSetWindowAttributes wa;
    XSizeHints sh;
    XEvent e;
    unsigned long mask;
    long screen;
    XVisualInfo *visual, template;
    Colormap colormap;
    int vID, n;
    Window window;

    screen = DefaultScreen(display);
    eglGetConfigAttrib(sEGLDisplay, FBConfig, EGL_NATIVE_VISUAL_ID, &vID);
    template.visualid = vID;
    visual = XGetVisualInfo(display, VisualIDMask, &template, &n);
    
    colormap = XCreateColormap(display,  RootWindow(display, screen),  visual->visual,     AllocNone);
    wa.colormap = colormap;
    wa.background_pixel = 0xFFFFFFFF;
    wa.border_pixel = 0;
    wa.event_mask = StructureNotifyMask | ExposureMask;

    mask = CWBackPixel | CWBorderPixel | CWEventMask | CWColormap;

    window = XCreateWindow(display,  RootWindow(display, screen), 0, 0, width, height, 0,  visual->depth, InputOutput, visual->visual, mask,  &wa);

    sh.flags = USPosition;
    sh.x = 10;
    sh.y = 10;
    
    XSetStandardProperties(display, window, title, title, None, 0, 0, &sh);

    XMapWindow(display, window);
    XSetWMColormapWindows(display, window, &window, 1);
    XFlush(display);



SDL with OPENGL ES - vane.xbmc - 2010-04-07

Hi all,

I've searching on the internet about the problem with the flag SDL_OPENGL used in SDL_SetVideoMode and i've found that you can use the flag SDL_OPENGLES if you use an extended SDL library to use with OpenGL ES. Anybody knows about it or have tested this library?

Quote:Cant we get rid of SDL entirely?

May I ask why do you want to get rid of SDL?

Thanks,

Vane.


- topfs2 - 2010-04-07

vane.xbmc Wrote:May I ask why do you want to get rid of SDL?

The idea would probably be to still have SDL but as a fallback when we don't have a native wrapping, the reasons are simple and thats SDL is far to abstracted for our use and way to slow to adapt new features. Don't get me wrong SDL is great but its limiting for us.


- davilla - 2010-04-07

vane.xbmc Wrote:Hi all,

I've searching on the internet about the problem with the flag SDL_OPENGL used in SDL_SetVideoMode and i've found that you can use the flag SDL_OPENGLES if you use an extended SDL library to use with OpenGL ES. Anybody knows about it or have tested this library?



May I ask why do you want to get rid of SDL?

Thanks,

Vane.

SDL_OPENGLES only works under the svn trunk of SDL 1.3. OpenGL/ES support was added for running SDL under the iPhone. There have not been any stable releases of SDL 1.3 so you would be targeting a moving svn if you used SDL 1.3. Is SDL 1.3 the "extended SDL library" that you are talking about ?


Sdl opengles - vane.xbmc - 2010-04-08

davilla Wrote:SDL_OPENGLES only works under the svn trunk of SDL 1.3. OpenGL/ES support was added for running SDL under the iPhone. There have not been any stable releases of SDL 1.3 so you would be targeting a moving svn if you used SDL 1.3. Is SDL 1.3 the "extended SDL library" that you are talking about ?

Yes, it is. I've seen it is under construction and that you can use it with OPENGL ES 1.x, so, I suppose it is not useful for XBMC because it uses OpenGL ES 2.0.

My question is: what is the difference between this three uses in XBMC?:

Code:
m_SDLSurface = SDL_SetVideoMode(m_nWidth, m_nHeight, 0, SDL_FULLSCREEN | SDL_DOUBLEBUF)

Code:
m_SDLSurface = SDL_SetVideoMode(m_nWidth, m_nHeight, 0, OPENGL | SDL_FULLSCREEN | SDL_DOUBLEBUF)

Code:
m_SDLSurface = SDL_SetVideoMode(m_nWidth, m_nHeight, 0, OPENGLES |SDL_FULLSCREEN | SDL_DOUBLEBUF)

I don't undestand why XBMC opens with the first option and does not open with the second one.


This forum uses Lukasz Tkacz MyBB addons.