Xpra: Ticket #1443: restore get_depth in pygtkglext OSX patch

When coercing pygtkglext to build on OSX (see ticket:533#comment:25), we removed the "get_depth" function which we did not use. We do need it now for high bit depths.. see ticket:1309#comment:2. So we need to find a way to restore it and make it work.



Thu, 16 Feb 2017 17:16:25 GMT - Antoine Martin: status changed

r15094 worksaround the missing method so the opengl rendering will be enabled - but we won't know if the display is using a high bit depth.


Fri, 24 Mar 2017 07:33:45 GMT - Antoine Martin: owner, status changed

Implemented in gtkglext then restored the function which exposes it in pygtkglext: r15375. Just run:

jhbuild buildone -f gtkglext
jhbuild buildone -f pygtkglext

Tested on a 24-bit display, which now shows "depth : 24" when running the "OpenGL_check" tool. (previously, no value was shown)


@smo: do you have access to any macos system with high bit depth enabled? Not sure what graphics cards and / or monitor are required (but the mac mini I have sure isn't cutting it), it should look like this: 4K and 5K iMacs Support 10-Bit Color Depth on OS X El Capitan. If you can find a system that shows anything higher than 24, or even any value other than 24 (low bit depths should work too), then please post the OpenGL_check output and try to run the client - ideally against a 30-bit server (see wiki/ImageDepth).


Wed, 12 Jul 2017 12:17:54 GMT - Antoine Martin:

For testing high bit depth, see ticket:1309#comment:8 and ticket:1553#comment:2.


Thu, 20 Jul 2017 07:23:46 GMT - Antoine Martin: owner changed

@maxmylyn: do you have access to a macos system with "deep color" (aka high bit depth) display?


Thu, 20 Jul 2017 20:49:17 GMT - J. Max Mena: owner changed

Sadly neither of our OSX machines here are high-bit depth. They're all just the standard 32-bit color depth. I'll pass this to Afarr to look around the office and maybe some marketing folks will have fancy machines.


Tue, 08 Aug 2017 00:34:05 GMT - alas: attachment set

mac properties to confirm color depth


Tue, 08 Aug 2017 00:58:08 GMT - alas: owner changed

Found both time and a mac that looks like it supports 30-bit depth. mac properties to confirm color depth

Using the steps from #1309 - connected a 2.2 r16657 client (./xpra attach tcp:10.0.32.138 --pixel-depth=30 --opengl=yes) to a 2.2. r16657 fedora 25 server (xpra --no-daemon --bind-tcp=0.0.0.0: --start-child=xterm --start-child=firefox start :13 --html=on --pixel-depth=30 -d compress) ... got output that included a lot of those 'r210' indicators that seem to mark as running the 30-bit depth.

2017-08-07 17:31:35,848 sound source using container format ogg
2017-08-07 17:31:38,733 compress:   0.6ms for  765x61   pixels at    0,0    for wid=2     using  rgb24 with ratio   5.8%  (  182KB to    10KB), sequence     5, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:38,843 compress:   0.5ms for  765x61   pixels at    0,0    for wid=2     using  rgb24 with ratio   6.0%  (  182KB to    10KB), sequence     6, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:39,510 compress:   0.7ms for  765x61   pixels at    0,0    for wid=2     using  rgb24 with ratio   6.0%  (  182KB to    10KB), sequence     7, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:39,654 compress:   0.5ms for  765x61   pixels at    0,0    for wid=2     using  rgb24 with ratio   6.0%  (  182KB to    10KB), sequence     8, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:39,706 compress:   0.2ms for  765x61   pixels at    0,0    for wid=2     using  rgb24 with ratio   5.9%  (  182KB to    10KB), sequence     9, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:39,878 compress:   2.2ms for 1047x433  pixels at    0,0    for wid=2     using  rgb24 with ratio   3.6%  ( 1770KB to    63KB), sequence    10, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:40,016 compress:   3.6ms for 1280x684  pixels at    0,0    for wid=2     using  rgb24 with ratio   3.2%  ( 3420KB to   109KB), sequence    11, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:40,225 compress:   4.3ms for 1280x684  pixels at    0,0    for wid=2     using  rgb32 with ratio   3.2%  ( 3420KB to   109KB), sequence    12, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:40,658 compress:   1.7ms for  610x621  pixels at    0,0    for wid=2     using  rgb32 with ratio   5.2%  ( 1479KB to    76KB), sequence    13, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:40,979 compress:   3.2ms for 1280x684  pixels at    0,0    for wid=2     using  rgb32 with ratio   3.2%  ( 3420KB to   109KB), sequence    14, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:41,384 compress:  46.4ms for 1325x1120 pixels at    0,0    for wid=2     using   jpeg with ratio   1.2%  ( 5796KB to    72KB), sequence    15, client_options={'quality': 72}
2017-08-07 17:31:41,557 compress:  36.8ms for 1325x1120 pixels at    0,0    for wid=2     using   jpeg with ratio   0.6%  ( 5796KB to    36KB), sequence    16, client_options={'quality': 72}
2017-08-07 17:31:41,748 compress:  17.4ms for 1325x1120 pixels at    0,0    for wid=2     using  rgb32 with ratio   0.7%  ( 5796KB to    43KB), sequence    17, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:41,807 compress:   0.8ms for 1068x19   pixels at   24,6    for wid=2     using  rgb24 with ratio  15.9%  (   79KB to    12KB), sequence    18, client_options={'bucket': 0, 'lz4': 1, 'store': 37, 'rgb_format': 'r210'}
2017-08-07 17:31:41,886 compress:   0.1ms for  175x16   pixels at  810,8    for wid=2     using  rgb24 with ratio  36.7%  (   10KB to     4KB), sequence    19, client_options={'flush': 2, 'bucket': 1, 'lz4': 1, 'store': 39, 'rgb_format': 'r210'}
2017-08-07 17:31:41,887 compress:   0.1ms for  332x16   pixels at  338,8    for wid=2     using  rgb24 with ratio  34.7%  (   20KB to     7KB), sequence    20, client_options={'flush': 1, 'bucket': 2, 'lz4': 1, 'store': 41, 'rgb_format': 'r210'}
2017-08-07 17:31:41,888 compress:   0.1ms for  174x16   pixels at   24,8    for wid=2     using  rgb24 with ratio  30.6%  (   10KB to     3KB), sequence    21, client_options={'bucket': 3, 'lz4': 1, 'store': 43, 'rgb_format': 'r210'}
2017-08-07 17:31:42,006 compress:   0.3ms for  175x16   pixels at  810,8    for wid=2     using  rgb24 with ratio   0.5%  (   10KB to     0KB), sequence    22, client_options={'delta': 39, 'bucket': 1, 'lz4': 1, 'rgb_format': 'r210', 'flush': 2, 'store': 45}
2017-08-07 17:31:42,009 compress:   0.1ms for  332x16   pixels at  338,8    for wid=2     using  rgb24 with ratio   0.5%  (   20KB to     0KB), sequence    23, client_options={'delta': 41, 'bucket': 2, 'lz4': 1, 'rgb_format': 'r210', 'flush': 1, 'store': 47}
2017-08-07 17:31:42,010 compress:   0.1ms for  174x16   pixels at   24,8    for wid=2     using  rgb24 with ratio   0.5%  (   10KB to     0KB), sequence    24, client_options={'delta': 43, 'bucket': 3, 'lz4': 1, 'store': 49, 'rgb_format': 'r210'}
2017-08-07 17:31:42,507 compress:   0.3ms for 1325x19   pixels at    0,6    for wid=2     using  rgb32 with ratio  22.3%  (   98KB to    21KB), sequence    26, client_options={'flush': 1, 'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:42,507 compress:   0.2ms for 1325x15   pixels at    0,43   for wid=2     using  rgb32 with ratio  21.7%  (   77KB to    16KB), sequence    27, client_options={'lz4': 1, 'rgb_format': 'r210'}
2017-08-07 17:31:42,726 compress:   1.2ms for 1325x16   pixels at    0,42   for wid=2     using  rgb32 with ratio  20.5%  (   82KB to    16KB), sequence    28, client_options={'lz4': 1, 'rgb_format': 'r210'}

I'm not sure I can tell the difference with my eye though, not even with a lawn gnome

(google link edited out).

Meanwhile, running the 'OpenGL_check', I'm also seeing depth = 24.

./OpenGL_check
/Users/maint/Desktop/xpra-clients/xpra-ant-2-2-16657/Xpra.app/Contents/Resources/lib/python/xpra/platform/darwin/gui.py:89: Warning: invalid cast from 'GtkMenuBar' to 'GtkWindow'
/Users/maint/Desktop/xpra-clients/xpra-ant-2-2-16657/Xpra.app/Contents/Resources/lib/python/xpra/platform/darwin/gui.py:89: GtkWarning: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
OpenGL_accelerate module loaded
OpenGL properties:
* GLU.extensions                  :
* GLU.version                     : 1.3 MacOSX
* accelerate                      : 3.1.1a1
* accum-blue-size                 : 0
* accum-green-size                : 0
* accum-red-size                  : 0
* alpha-size                      : 8
* aux-buffers                     : 0
* blue-size                       : 1
* depth                           : 24
* depth-size                      : 0
* display_mode                    : DOUBLE
* double-buffered                 : True
* extensions                      : GL_ARB_color_buffer_float, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_draw_elements_base_vertex, GL_ARB_draw_instanced, GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB, GL_ARB_half_float_pixel, GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_instanced_arrays, GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_provoking_vertex, GL_ARB_seamless_cube_map, GL_ARB_shader_objects, GL_ARB_shader_texture_lod, GL_ARB_shading_language_100, GL_ARB_shadow, GL_ARB_shadow_ambient, 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_env_add, GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, GL_ARB_texture_float, GL_ARB_texture_mirrored_repeat, GL_ARB_texture_non_power_of_two, GL_ARB_texture_rectangle, GL_ARB_texture_rg, GL_ARB_transpose_matrix, GL_ARB_vertex_array_bgra, GL_ARB_vertex_blend, GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ARB_window_pos, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_bindable_uniform, GL_EXT_blend_color, GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_clip_volume_hint, GL_EXT_debug_label, GL_EXT_debug_marker, GL_EXT_depth_bounds_test, GL_EXT_draw_buffers2, GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, GL_EXT_geometry_shader4, GL_EXT_gpu_program_parameters, GL_EXT_gpu_shader4, GL_EXT_multi_draw_arrays, GL_EXT_packed_depth_stencil, GL_EXT_packed_float, GL_EXT_provoking_vertex, GL_EXT_rescale_normal, GL_EXT_secondary_color, GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, GL_EXT_texture_array, GL_EXT_texture_compression_dxt1, GL_EXT_texture_compression_s3tc, GL_EXT_texture_env_add, GL_EXT_texture_filter_anisotropic, GL_EXT_texture_integer, GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp, GL_EXT_texture_rectangle, GL_EXT_texture_shared_exponent, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_decode, GL_EXT_timer_query, GL_EXT_transform_feedback, GL_EXT_vertex_array_bgra, GL_APPLE_aux_depth_stencil, GL_APPLE_client_storage, GL_APPLE_element_array, GL_APPLE_fence, GL_APPLE_float_pixels, GL_APPLE_flush_buffer_range, GL_APPLE_flush_render, GL_APPLE_object_purgeable, GL_APPLE_packed_pixels, GL_APPLE_pixel_buffer, GL_APPLE_rgb_422, GL_APPLE_row_bytes, GL_APPLE_specular_vector, GL_APPLE_texture_range, GL_APPLE_transform_hint, GL_APPLE_vertex_array_object, GL_APPLE_vertex_array_range, GL_APPLE_vertex_point_size, GL_APPLE_vertex_program_evaluators, GL_APPLE_ycbcr_422, GL_ATI_blend_equation_separate, GL_ATI_blend_weighted_minmax, GL_ATI_separate_stencil, GL_ATI_texture_compression_3dc, GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_ATI_texture_mirror_once, GL_IBM_rasterpos_clip, GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_fog_distance, GL_NV_light_max_exponent, GL_NV_texgen_reflection, GL_NV_texture_barrier, GL_SGI_color_matrix, GL_SGIS_generate_mipmap, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod,
* gdkgl
  - version                       : 1.0
* gdkglext
  - version                       : 1.2.0
* green-size                      : 1
* gtkglext
  - version                       : 1.2.0
* has-depth-buffer                : False
* has-stencil-buffer              : False
* has_alpha                       : True
* max-viewport-dims               : (16384, 16384)
* opengl                          : 2, 1
* pygdkglext
  - version                       : 1.0.0
* pyopengl                        : 3.1.1a1
* red-size                        : 1
* renderer                        : AMD Radeon HD - FirePro D300 OpenGL Engine
* rgba                            : True
* safe                            : True
* sample-buffers                  : 166518688
* samples                         : 166518688
* shading-language-version        : 1.20
* stencil-size                    : 0
* stereo                          : False
* texture-size-limit              : 16384
* transparency                    : False
* vendor                          : ATI Technologies Inc.
* zerocopy                        : True

I do notice that the Graphics/ Displays section of my hardware specs lists an AMD FirePro? D300 for Slot-1 and Slot-2, but the screenshot above is the Slot-2 specs, the Slot-1 doesn't have any indications one way or the other for the Displays... is it possible the OpenGL_check needs to check both? (Or, is it just good enough that it gets any value at all?)

Anyway, handing back to you.


Tue, 08 Aug 2017 01:29:46 GMT - Antoine Martin: owner changed

To check for high bit depth support, don't use images from google as none of those will use high bit depth. We have test applications just for that: ticket:1309#comment:9. (both an opengl and a non-opengl version) Press any key to increase the bit depth, and "-" to decrease. The point at which it stops changing is the maximum bit depth supported by the screen.

On macos, it is available directly as Xpra.app/Contents/Helpers/Example-Colors-Gradient and Example-OpenGL-Colors-Gradient, and for testing the forwarding via xpra you can run the same application on the server: xpra/client/gtk_base/example/colors_gradient.py and gl_colors_gradient.py.


Tue, 08 Aug 2017 01:53:17 GMT - alas: status changed; resolution set

Tested with xpra/client/gtk_base/example/colors_gradient.py... and sure enough, able to detect differences in the lower grey bands up to the 10 bits listing.

Looks like that's doing pretty well. I'll go ahead and close this.


Tue, 08 Aug 2017 06:29:12 GMT - Antoine Martin:

Interesting to see (gl_check output from comment:6) that we cannot detect high bit depth through opengl: blue-size, green-size and red-size are all bogus (set to 1). As for slots, I believe we get the card in the slot that we end up using - so we shouldn't worry too much about that part.


Sat, 23 Jan 2021 05:24:27 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1443