You are not logged in.

#1 2014-07-28 21:44:54

aoba
Member
Registered: 2013-08-30
Posts: 70

Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Hello, my fellow nerds.  I have created an OpenGL-based compositing manager for X.  I have named it Ortle and you can find it on github (https://github.com/aoba1217/ortle).


WARNING

Ortle has been stable for me for months using the binary Nvidia driver, but it has locked up my GPU (and X) when using nouveau.  I do not know why yet.  Also, it apparently doesn't work at all on Intel Haswell hardware.  Please be careful if you try it on untested hardware/software configurations!


Important Note

Ortle has only been tested on one machine (with an Nvidia GTX 660) with one(-ish) software configuration (the binary Nvidia driver).  If you do not have an Nvidia card or you use nouveau, Ortle may very likely be some combination of nonfunctional and pointless.

Also, this is the first time I have shared a project like this.  If the code or documentation is lacking, or I do something particularly silly, please feel free to point it out.  I won't learn anything if I don't know I messed up smile


Background

I had been happily using compton (mainly to get rid of the tearing effects I get when using the binary Nvidia driver), but after I upgraded my video card I couldn't find the right incantation to make it work as well as I'd like.  So, with no small amount of hubris, I started working on my own compositor, hoping to make something 'better.'  I feel I have succeeded to a small extent, so I decided to share the result.


Purpose and Features

  1. Eliminate tearing by using vertical sync

  2. Be as not-annoying as possible

  3. Display ARGB windows properly

I spent most of my effort trying to satisfy #2.  Moving windows is super-smooth, but it still lags a little compared with a non-composited display (which is probably as good as it will get).  Resizing windows is still a little choppy, but have a few ideas that might help with that.  Other than that (and the fact that ARGB windows show up correctly), I can't tell that Ortle is running at all.


Is That Really It?

Yup.  I may add shadows sometime down the road, but I wouldn't be surprised if Wayland becomes standard before that happens.


Requirements

  • A C++11 compiler and friends (base-devel)

  • An OpenGL 3.3-compatible video card and driver (nvidia, etc.)

  • Xlib (libx11)

  • X Composite >= 0.4 (libxcomposite)

  • X Fixes >= 2 (libxfixes)

  • X Shape >= 1.1 (libxext)

  • GLX >= 1.4 (libgl)

  • git to download the source (git)

  • Possibly other things; I only have one machine to test this out on

The driver and libgl are the most important requirements.  Ortle won't run at all without certain OpenGL extensions like GLX_EXT_swap_control and GLX_EXT_texture_from_pixmap, and may not work well if those extensions have different implementations than they do on my machine.


Building

 $ sudo pacman -S base-devel git libx11 libxcomposite libxfixes libxext libgl
 $ git clone https://github.com/aoba1217/ortle.git
 $ cd ortle
 $ make

Running

 $ /path/to/ortle

Credits

This was put together by one person (my email is the same name as my github account at gmail dot com), but it would probably not have happened without Keith Packard's xcompmgr (http://cgit.freedesktop.org/xorg/app/xcompmgr/) and Christopher Jeffrey and Richard Grenville's compton (https://github.com/chjj/compton).  Those programs gave me a starting place (a set of events to watch) and, just as important, a working reference I could look to whenever something weird happened that I couldn't figure out.  The online Xlib manual provided by Christophe Tronche (http://tronche.com/gui/x/xlib/) as well as countless other examples and references scattered across the Internet were also invaluable.


Two Points in Closing

First, I don't have any idea if there are any people out there who would find such a simple compositor useful, but if you give it a shot, I hope Ortle works out for you.  If it doesn't, and your machine meets the requirements, post back and I'll try my best to get it working for you.

Second, I hope I never use Xlib again.

Last edited by aoba (2014-07-29 16:19:21)

Offline

#2 2014-07-28 22:12:40

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Whenever I played with compton, though admittedly the last time was many months ago, I too couldn't get it running well, for example moving windows would always lag, and no combination of the many options compton has could make things run smoothly. So should I ever want to run a compositor (I'm currently ok with pure openbox), ortle is something that would suit me well. Unfortunately, doesn't run on Intel Haswell:

Ortle: ERROR: GLX: Failed to load glXSwapIntervalEXT.
Ortle: ERROR: Shutting down...

You're using glXSwapIntervalEXT for vsync, right? It seems you'll have to implement a different method for mesa drivers. compton has quite a few of them, unfortunately I don't know which one works best. I think it's time I take compton for another spin. Edit: The opengl-swc (SGI_swap_control) and opengl-mswc (MESA_swap_control) methods work best, moving windows is smooth with almost no lag. Still, the lag bothers me.

In case it helps, full glxinfo output on Haswell:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, 
    GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB, 
    GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, 
    GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
    GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_swap_control
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, 
    GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, 
    GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile, 
    GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, 
    GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, 
    GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_SGI_make_current_read, 
    GLX_SGI_swap_control, GLX_SGI_video_sync
GLX version: 1.4
GLX extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, 
    GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, 
    GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile, 
    GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context, 
    GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, 
    GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_SGI_make_current_read, 
    GLX_SGI_swap_control, GLX_SGI_video_sync
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Desktop x86/MMX/SSE2
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.2.4
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
    GL_3DFX_texture_compression_FXT1, GL_AMD_conservative_depth, 
    GL_AMD_draw_buffers_blend, GL_AMD_seamless_cubemap_per_texture, 
    GL_AMD_shader_trinary_minmax, GL_AMD_vertex_shader_layer, 
    GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5, 
    GL_APPLE_object_purgeable, GL_ARB_ES2_compatibility, 
    GL_ARB_ES3_compatibility, GL_ARB_base_instance, 
    GL_ARB_blend_func_extended, GL_ARB_buffer_storage, 
    GL_ARB_clear_buffer_object, GL_ARB_conservative_depth, GL_ARB_copy_buffer, 
    GL_ARB_debug_output, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, 
    GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend, 
    GL_ARB_draw_elements_base_vertex, GL_ARB_draw_instanced, 
    GL_ARB_explicit_attrib_location, GL_ARB_fragment_coord_conventions, 
    GL_ARB_fragment_shader, GL_ARB_framebuffer_object, 
    GL_ARB_framebuffer_sRGB, GL_ARB_get_program_binary, 
    GL_ARB_half_float_pixel, GL_ARB_half_float_vertex, 
    GL_ARB_instanced_arrays, GL_ARB_internalformat_query, 
    GL_ARB_invalidate_subdata, GL_ARB_map_buffer_alignment, 
    GL_ARB_map_buffer_range, GL_ARB_multi_bind, GL_ARB_occlusion_query2, 
    GL_ARB_pixel_buffer_object, GL_ARB_point_sprite, GL_ARB_provoking_vertex, 
    GL_ARB_robustness, GL_ARB_sample_shading, GL_ARB_sampler_objects, 
    GL_ARB_seamless_cube_map, GL_ARB_separate_shader_objects, 
    GL_ARB_shader_atomic_counters, GL_ARB_shader_bit_encoding, 
    GL_ARB_shader_objects, GL_ARB_shader_texture_lod, 
    GL_ARB_shading_language_420pack, GL_ARB_shading_language_packing, 
    GL_ARB_sync, GL_ARB_texture_buffer_object, 
    GL_ARB_texture_buffer_object_rgb32, GL_ARB_texture_buffer_range, 
    GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map_array, 
    GL_ARB_texture_float, GL_ARB_texture_gather, 
    GL_ARB_texture_mirror_clamp_to_edge, GL_ARB_texture_multisample, 
    GL_ARB_texture_non_power_of_two, GL_ARB_texture_query_levels, 
    GL_ARB_texture_query_lod, GL_ARB_texture_rectangle, GL_ARB_texture_rg, 
    GL_ARB_texture_rgb10_a2ui, GL_ARB_texture_storage, 
    GL_ARB_texture_storage_multisample, GL_ARB_texture_swizzle, 
    GL_ARB_texture_view, GL_ARB_timer_query, GL_ARB_uniform_buffer_object, 
    GL_ARB_vertex_array_bgra, GL_ARB_vertex_array_object, 
    GL_ARB_vertex_attrib_binding, GL_ARB_vertex_shader, 
    GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_vertex_type_2_10_10_10_rev, 
    GL_ARB_viewport_array, GL_ATI_blend_equation_separate, 
    GL_ATI_texture_float, GL_EXT_abgr, GL_EXT_blend_equation_separate, 
    GL_EXT_draw_buffers2, GL_EXT_draw_instanced, GL_EXT_framebuffer_blit, 
    GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_multisample_blit_scaled, 
    GL_EXT_framebuffer_sRGB, GL_EXT_packed_depth_stencil, GL_EXT_packed_float, 
    GL_EXT_pixel_buffer_object, GL_EXT_provoking_vertex, 
    GL_EXT_shader_integer_mix, GL_EXT_texture_array, 
    GL_EXT_texture_compression_dxt1, GL_EXT_texture_compression_rgtc, 
    GL_EXT_texture_compression_s3tc, GL_EXT_texture_filter_anisotropic, 
    GL_EXT_texture_integer, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_decode, 
    GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm, 
    GL_EXT_texture_swizzle, GL_EXT_timer_query, GL_EXT_transform_feedback, 
    GL_EXT_vertex_array_bgra, GL_IBM_multimode_draw_arrays, GL_KHR_debug, 
    GL_MESA_pack_invert, GL_MESA_texture_signed_rgba, 
    GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_packed_depth_stencil, 
    GL_OES_EGL_image, GL_OES_read_format, GL_S3_s3tc

OpenGL version string: 3.0 Mesa 10.2.4
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
    GL_3DFX_texture_compression_FXT1, GL_AMD_conservative_depth, 
    GL_AMD_draw_buffers_blend, GL_AMD_seamless_cubemap_per_texture, 
    GL_AMD_shader_trinary_minmax, GL_ANGLE_texture_compression_dxt3, 
    GL_ANGLE_texture_compression_dxt5, GL_APPLE_object_purgeable, 
    GL_APPLE_packed_pixels, GL_APPLE_vertex_array_object, 
    GL_ARB_ES2_compatibility, GL_ARB_ES3_compatibility, 
    GL_ARB_blend_func_extended, GL_ARB_buffer_storage, 
    GL_ARB_clear_buffer_object, GL_ARB_color_buffer_float, 
    GL_ARB_conservative_depth, GL_ARB_copy_buffer, GL_ARB_debug_output, 
    GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture, 
    GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend, 
    GL_ARB_draw_elements_base_vertex, GL_ARB_draw_instanced, 
    GL_ARB_explicit_attrib_location, GL_ARB_fragment_coord_conventions, 
    GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, 
    GL_ARB_fragment_shader, GL_ARB_framebuffer_object, 
    GL_ARB_framebuffer_sRGB, GL_ARB_get_program_binary, 
    GL_ARB_half_float_pixel, GL_ARB_half_float_vertex, 
    GL_ARB_instanced_arrays, GL_ARB_internalformat_query, 
    GL_ARB_invalidate_subdata, GL_ARB_map_buffer_alignment, 
    GL_ARB_map_buffer_range, GL_ARB_multi_bind, GL_ARB_multisample, 
    GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_occlusion_query2, 
    GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, 
    GL_ARB_provoking_vertex, GL_ARB_robustness, GL_ARB_sample_shading, 
    GL_ARB_sampler_objects, GL_ARB_seamless_cube_map, 
    GL_ARB_separate_shader_objects, GL_ARB_shader_atomic_counters, 
    GL_ARB_shader_bit_encoding, GL_ARB_shader_objects, 
    GL_ARB_shader_texture_lod, GL_ARB_shading_language_100, 
    GL_ARB_shading_language_420pack, GL_ARB_shading_language_packing, 
    GL_ARB_shadow, GL_ARB_sync, GL_ARB_texture_border_clamp, 
    GL_ARB_texture_compression, GL_ARB_texture_compression_rgtc, 
    GL_ARB_texture_cube_map, GL_ARB_texture_cube_map_array, 
    GL_ARB_texture_env_add, GL_ARB_texture_env_combine, 
    GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, 
    GL_ARB_texture_float, GL_ARB_texture_gather, 
    GL_ARB_texture_mirror_clamp_to_edge, GL_ARB_texture_mirrored_repeat, 
    GL_ARB_texture_multisample, GL_ARB_texture_non_power_of_two, 
    GL_ARB_texture_query_levels, GL_ARB_texture_query_lod, 
    GL_ARB_texture_rectangle, GL_ARB_texture_rg, GL_ARB_texture_rgb10_a2ui, 
    GL_ARB_texture_storage, GL_ARB_texture_storage_multisample, 
    GL_ARB_texture_swizzle, GL_ARB_texture_view, GL_ARB_timer_query, 
    GL_ARB_transpose_matrix, GL_ARB_uniform_buffer_object, 
    GL_ARB_vertex_array_bgra, GL_ARB_vertex_array_object, 
    GL_ARB_vertex_attrib_binding, GL_ARB_vertex_buffer_object, 
    GL_ARB_vertex_program, GL_ARB_vertex_shader, 
    GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_vertex_type_2_10_10_10_rev, 
    GL_ARB_window_pos, GL_ATI_blend_equation_separate, GL_ATI_draw_buffers, 
    GL_ATI_envmap_bumpmap, GL_ATI_separate_stencil, 
    GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_EXT_abgr, 
    GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_equation_separate, 
    GL_EXT_blend_func_separate, GL_EXT_blend_minmax, GL_EXT_blend_subtract, 
    GL_EXT_compiled_vertex_array, GL_EXT_copy_texture, GL_EXT_draw_buffers2, 
    GL_EXT_draw_instanced, GL_EXT_draw_range_elements, GL_EXT_fog_coord, 
    GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, 
    GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, 
    GL_EXT_framebuffer_sRGB, GL_EXT_gpu_program_parameters, 
    GL_EXT_multi_draw_arrays, GL_EXT_packed_depth_stencil, 
    GL_EXT_packed_float, GL_EXT_packed_pixels, GL_EXT_pixel_buffer_object, 
    GL_EXT_point_parameters, GL_EXT_polygon_offset, GL_EXT_provoking_vertex, 
    GL_EXT_rescale_normal, GL_EXT_secondary_color, 
    GL_EXT_separate_specular_color, GL_EXT_shader_integer_mix, 
    GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, 
    GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D, 
    GL_EXT_texture_array, GL_EXT_texture_compression_dxt1, 
    GL_EXT_texture_compression_rgtc, GL_EXT_texture_compression_s3tc, 
    GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, 
    GL_EXT_texture_env_add, GL_EXT_texture_env_combine, 
    GL_EXT_texture_env_dot3, GL_EXT_texture_filter_anisotropic, 
    GL_EXT_texture_integer, GL_EXT_texture_lod_bias, GL_EXT_texture_object, 
    GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_decode, 
    GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm, 
    GL_EXT_texture_swizzle, GL_EXT_timer_query, GL_EXT_transform_feedback, 
    GL_EXT_vertex_array, GL_EXT_vertex_array_bgra, 
    GL_IBM_multimode_draw_arrays, GL_IBM_rasterpos_clip, 
    GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate, GL_KHR_debug, 
    GL_MESA_pack_invert, GL_MESA_texture_signed_rgba, GL_MESA_window_pos, 
    GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp, 
    GL_NV_light_max_exponent, GL_NV_packed_depth_stencil, 
    GL_NV_primitive_restart, GL_NV_texgen_reflection, 
    GL_NV_texture_env_combine4, GL_NV_texture_rectangle, GL_OES_EGL_image, 
    GL_OES_read_format, GL_S3_s3tc, GL_SGIS_generate_mipmap, 
    GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp, 
    GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays

OpenGL ES profile version string: OpenGL ES 3.0 Mesa 10.2.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.0
OpenGL ES profile extensions:
    GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5, 
    GL_APPLE_texture_max_level, GL_EXT_blend_minmax, 
    GL_EXT_color_buffer_float, GL_EXT_discard_framebuffer, 
    GL_EXT_map_buffer_range, GL_EXT_multi_draw_arrays, 
    GL_EXT_read_format_bgra, GL_EXT_separate_shader_objects, 
    GL_EXT_shader_integer_mix, GL_EXT_texture_compression_dxt1, 
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_format_BGRA8888, 
    GL_EXT_texture_rg, GL_EXT_texture_type_2_10_10_10_REV, 
    GL_EXT_unpack_subimage, GL_NV_draw_buffers, GL_NV_fbo_color_attachments, 
    GL_NV_read_buffer, GL_OES_EGL_image, GL_OES_EGL_image_external, 
    GL_OES_compressed_ETC1_RGB8_texture, GL_OES_depth24, GL_OES_depth_texture, 
    GL_OES_depth_texture_cube_map, GL_OES_element_index_uint, 
    GL_OES_fbo_render_mipmap, GL_OES_get_program_binary, GL_OES_mapbuffer, 
    GL_OES_packed_depth_stencil, GL_OES_rgb8_rgba8, 
    GL_OES_standard_derivatives, GL_OES_stencil8, GL_OES_surfaceless_context, 
    GL_OES_texture_3D, GL_OES_texture_npot, GL_OES_vertex_array_object

20 GLX Visuals
    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav
  id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------------
0x020 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x021 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x08a 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x08b 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x08c 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x08d 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 Slow
0x08e 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  4 1 None
0x08f 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  8 1 None
0x090 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x091 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x092 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x093 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x094 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x095 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x096 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 Slow
0x097 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  4 1 None
0x098 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  8 1 None
0x099 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x09a 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x05d 32 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None

44 GLXFBConfigs:
    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav
  id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------------
0x05e  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0  0  0  0  0  0  0  0 0 None
0x05f  0 tc  0  16  0 r  . .   5  6  5  0 .  .  0  0  0  0  0  0  0  0 0 None
0x060  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
0x061  0 tc  0  16  0 r  . .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
0x062  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0 24  8  0  0  0  0  0 0 None
0x063  0 tc  0  16  0 r  . .   5  6  5  0 .  .  0 24  8  0  0  0  0  0 0 None
0x064 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x065 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x066 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x067 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x068  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
0x069  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0 16 16 16  0  0 0 Slow
0x06a 32 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x06b 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 Slow
0x06c  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0  0  0  0  0  0  0  4 1 None
0x06d  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0  0  0  0  0  0  0  8 1 None
0x06e  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  4 1 None
0x06f  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  8 1 None
0x070 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  4 1 None
0x071 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  8 1 None
0x072 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x073 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x074  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0  0  0  0  0  0  0  0 0 None
0x075  0 dc  0  16  0 r  . .   5  6  5  0 .  .  0  0  0  0  0  0  0  0 0 None
0x076  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
0x077  0 dc  0  16  0 r  . .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
0x078  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0 24  8  0  0  0  0  0 0 None
0x079  0 dc  0  16  0 r  . .   5  6  5  0 .  .  0 24  8  0  0  0  0  0 0 None
0x07a 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x07b 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x07c 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x07d 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x07e  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
0x07f  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0 16 16 16  0  0 0 Slow
0x080 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x081 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 Slow
0x082  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0  0  0  0  0  0  0  4 1 None
0x083  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0  0  0  0  0  0  0  8 1 None
0x084  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  4 1 None
0x085  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  8 1 None
0x086 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  4 1 None
0x087 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  8 1 None
0x088 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x089 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None

Last edited by Gusar (2014-07-28 22:36:08)

Offline

#3 2014-07-28 22:47:32

aoba
Member
Registered: 2013-08-30
Posts: 70

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Interesting.  I sort of suspected that this might be an Nvidia-only deal, but GLX_MESA_swap_control looks like it might be a fitting substitute.  Can you give the most recent commit (f833f353) a try?

Offline

#4 2014-07-28 23:27:21

aoba
Member
Registered: 2013-08-30
Posts: 70

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Gusar wrote:

The opengl-swc (SGI_swap_control) and opengl-mswc (MESA_swap_control) methods work best, moving windows is smooth with almost no lag. Still, the lag bothers me.

It bothers me, too, and I don't think I can get rid of it entirely.

Moving windows, as I handle it at least, is probably going to result in the same sort of lag because I can't tell OpenGL to render a quad where the window is now, I have to tell OpenGL to render the quad where the X server last told me the window was.  Maybe if Ortle was a window manager, too, (and could therefore be in charge of ConfigureRequests) I could get rid of it, but that's not the case.  The best I've done is try to make it as smooth as possible.  This is a long way of saying that if compton looks smooth to you, Ortle will probably only be about that "good" as well.

A possibly interesting note is that this is why glXBindTexImageEXT (GLX_EXT_texture_from_pixmap) is so important (pretty sure compton's GLX backend uses this).  I don't have to update window damage or anything at all, the server keeps the texture automatically up to date, and so you don't (well, you shouldn't) see any lag in movies or games.  Or, using terms from the previous paragraph, I can tell OpenGL to render a window's quad as it is now.

Offline

#5 2014-07-29 10:37:16

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Different error this time:

Ortle: ERROR: Foreign exception caught:
Ortle: ERROR: Compatible framebuffer not found.
Ortle: ERROR: Shutting down...

It'd be a shame if the lag can't be fully removed. I'll continue without a compositor then, the occasional tearing in windowed videos doesn't bother me as much as the lag does.

Offline

#6 2014-07-29 17:10:22

aoba
Member
Registered: 2013-08-30
Posts: 70

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Thanks again for posting back.  I'm going to ask for one more favor: can you please get me the output of glxinfo -v? It's pretty big, so you may want to paste it somewhere/email me.

Offline

#7 2014-07-29 20:24:58

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Here you go, glxinfo -v: http://pastie.org/9430043

Offline

#8 2014-07-30 08:12:02

Jedipottsy
Member
Registered: 2008-05-22
Posts: 18

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Really nice, but would you mind throwing it up on the AUR please.
Also im not sure if this applies, but are you using double or triple buffering? Triple buffering should eliminate the responsiveness while also providing tear free images. Although i have no idea if this is only for fullscreen openGL and DX applications, but i assume that since your waiting for VSync before copying the frame into the front buffer it should apply.

http://en.wikipedia.org/wiki/Multiple_b … _buffering

Edit

I created a quick PKGBUILD and gave this a try. Moving windows around is incredibly laggy, with a 1-2 second delay.

This works flawlessly for me, not sure if its any help

compton --vsync opengl --glx-use-copysubbuffermesa -b

Edit 2

Upon further testing it appears as though windows move normally under most conditions, however once they move above some windows they slow to a massive crawl. The best example is moving something over the chromium window.

Last edited by Jedipottsy (2014-07-30 10:35:11)

Offline

#9 2014-07-30 15:19:53

sekret
Member
Registered: 2013-07-22
Posts: 283

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

PKGBUILD

I put in dependencies that showed up during the make process and with the help of namcap in a clean chroot environment. It runs just fine on my system with an AMD card with the open source driver.

The license is BSD, right?

Offline

#10 2014-07-30 18:01:05

aoba
Member
Registered: 2013-08-30
Posts: 70

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

@Jedipottsy

I was able to reproduce the slow rendering problem with Chromium + hardware acceleration (but not without).  Not 100% sure why yet, but throwing a glFinish before swapping buffers sped things up for me.  Please give the latest a shot!

I'll look into triple buffering.  I really want to say that it probably won't help because swapping buffers is currently (with glFinish) an order of magnitude faster than the actual rendering, but the GL implementation is a black box so what do I know.


@sekret

It is BSD, and I'm really glad to hear that it's working on AMD.  Thanks for the PKGBUILD as well.  Would you please change 'mesa-libgl' to 'libgl'?  And I think that 'libxext' should be added as a dependency as well.

Offline

#11 2014-07-30 21:32:11

sekret
Member
Registered: 2013-07-22
Posts: 283

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Ok you're right, mesa-libgl isn't right for every system, changed that. And libxext is provided as a dependency for mesa (mesa -> libxxf86vm -> libxext). Is mesa installed on systems with the nvidia closed source driver?

edit: Since I'm a dwm user and most probably won't ever want to use a compositor, I'd be happy to give the package to someone else. I just was in the mood to create a package.

Another thing, is it normal that the compositor uses about 10% of my 2x 1,6GHz CPU when NOTHING is happening on screen? What a waste of ressources!

Last edited by sekret (2014-07-30 21:35:14)

Offline

#12 2014-07-30 22:41:29

aoba
Member
Registered: 2013-08-30
Posts: 70

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Does that CPU usage occur before the Chromium fix (cfd88f7)?  Ortle generally idled for me at around 0.3 - 0.7% CPU* (4x 2.8 Ghz) usage before that commit, but after, usage was greater than 90%.  I'll have to find a different answer for the Chromium problem.

Thanks for noticing it.

Also, I think I had to install mesa manually.  It's definitely needed for the GLX headers, but shouldn't be needed to run (which I think libgl takes care of).

*Edit: with usage spikes whenever configure events (e.g. moving and resizing) came in.

Last edited by aoba (2014-07-30 22:42:37)

Offline

#13 2014-07-31 06:13:48

sekret
Member
Registered: 2013-07-22
Posts: 283

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

With 72d30e1 and the now up-to-date e1b5f82 the cpu usage is the same, so the chromium fix isn't the culprit.

Could it be, that on your system and its hardware configuration + the closed source nvidia driver, ortle uses the gpu more/better than on my system with AMD and open source driver? That might cause the difference, right?

Offline

#14 2014-07-31 10:25:35

Jedipottsy
Member
Registered: 2008-05-22
Posts: 18

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

I've updated to the latest master and the chromium issues persist (e1b5f82), ill test with chrome-stable/beta

My understanding with triple buffering is that while swapping the buffer is fast no matter the solution, you dont have to wait for either the vsync to initate a buffer draw or wait for the buffer to finish rendering to swap the buffer, as there should always be an up to date buffer to swap with.
I.e., if a frame is still drawing and can't be swapped out, the other finished buffer will be swapped, and the rendering doesnt have to wait for V-sync to start or stop. But like i said i've no idea about anything GL related, i just know it provides fast tear free rendering on fullscreen applications/games with negligible mouse acceleration.

Edit
The issues persist in chrome, no idea why i thought it wouldnt

Last edited by Jedipottsy (2014-07-31 10:32:46)

Offline

#15 2014-07-31 17:21:20

aoba
Member
Registered: 2013-08-30
Posts: 70

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

@sekret

I think it's likely.  The amount of work that Ortle itself does isn't huge in theory (process pending events; issue opengl commands; wait and swap), so the apparent CPU usage on machine A could be smaller than machine B if, for example, all gl* commands are just passed to a command buffer (and return immediately) on machine A but are processed entirely before returning on machine B.  The actual CPU usage could very well be equal in both cases, but it depends on the driver.  It's something I will try to minimize as time goes on, but it will have to wait until I solidify the basic functionality. 

It would be interesting to know how much CPU compton (using its GLX backend) uses for you as a comparison, if you don't mind spending the time to look.  Also useful would be the output of glxinfo -v (it's in the mesa-demos package).  The more information you can flood me with, the better smile


@Jedipottsy

Would you mind confirming whether or not the lag issue happens when Chromium's hardware acceleration is disabled?  The setting is near the bottom of the chrome://settings page after you click 'show advanced settings.'  The output of glxinfo -v (it's in the mesa-demos package) would also be helpful.

The way you explain it, triple buffering could be useful, but still requires far more thought, coding and testing on my part.  The mysterious thing about the Chromium issue - assuming your problem is the same as what I can reproduce - is that glXSwapBuffers waits several frames before completing the swap when moving another window over the Chromium window.  Why it waits like that is still a whodunit, but I'm working on it.

Offline

#16 2014-07-31 18:00:19

sekret
Member
Registered: 2013-07-22
Posts: 283

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Sure, no problem. Installed compton-git, executed

compton

and watched top. Basically there's no difference in cpu consumption with or without compton. So I think, this command itself isn't enough, so I used

compton --vsync opengl --glx-use-copysubbuffermesa

like mentioned above by Jedipottsy. Now the cpu consumption of X.bin goes up from ~0.5 to ~1.5 when the system is idle. Compton itself only consumes ~0.3 %.

What I did with dwm was to move a floating window around to see the behavior. With both ortle and compton the window lags a bit behind the mouse pointer. I think that's normal with compositors. But the lag is bigger with ortle.

Here's my output of glxinfo -v. Hope there's something useful for you in it. I'm no coder, so unfortunately I cannot give you more help..

Offline

#17 2014-08-10 20:35:37

aoba
Member
Registered: 2013-08-30
Posts: 70

Re: Ortle - [TESTING] - A Simple OpenGL-based Compositing Manager for X

Real life is currently a thing (and will likely continue to be for a bit), but I have a small update:

I'm giving glXWaitVideoSyncSGI a go in place of glFinish.  It seems to improve responsiveness, both in general and with the Chromium problem (though not completely), without the spike in CPU usage.  Probably doesn't do much for what sekret sees, however.  Hopefully it makes things less bad overall.

Offline

Board footer

Powered by FluxBB