Bug 17453 - Xvfb doesn't work at depth 32
Summary: Xvfb doesn't work at depth 32
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/DDX/Xvfb (show other bugs)
Version: 7.4 (2008.09)
Hardware: Other All
: medium normal
Assignee: Adam Jackson
QA Contact: Xorg Project Team
URL: http://bugs.debian.org/497954
Whiteboard: 2011BRB_Reviewed
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-05 10:48 UTC by Julien Cristau
Modified: 2018-05-15 19:09 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Julien Cristau 2008-09-05 10:48:50 UTC
Reported by Tim Phipps <tim@phipps-hutton.freeserve.co.uk>, verified on 1.5.0:
The man page suggest ths as an example:

Xvfb :1 -screen 0 1600x1200x32

and it crashes with this error:

Fatal server error:
Couldn't add screen 0

Tracked down to miDoInitVisuals() returning FALSE, because the loop over miVisuals ends with nvisual=0.
Comment 1 Adam Jackson 2008-09-12 12:07:30 UTC
32 really isn't a valid depth though.  Maybe we should just make that do the same thing as x24+32 instead.
Comment 2 Julien Cristau 2009-01-09 01:15:11 UTC
(In reply to comment #1)
> 32 really isn't a valid depth though.  Maybe we should just make that do the
> same thing as x24+32 instead.
> 
or just change the manpage to not give a non-working example :)
Comment 3 Jason Galyon 2009-05-15 08:52:59 UTC
Besides the manpage bug, setting 24 bits even with -pixdepths 32 does not work (says only 'Xvfb failed to start') and my images with alpha I am creating save with no alpha channel.
I test with a python program called 'pyglet' that is a wrapper around OpenGL.


This is on a headless EC2 Ubuntu 9.04 box with Xvfb version 2:1.6.0-0ubuntu14 which I access with ssh and the '-x' option.
Here is my test: (using the Python 2.6.2 interactive prompt)
xvfb-run --server-args="-screen 0 1024x768x24 -pixdepths 32" /usr/bin/python-2.6

>>> import pyglet
>>> import pyglet.gl as gl
>>> window = pyglet.window.Window()
>>> config = pyglet.gl.Config()
>>> current_config = pyglet.window.Screen.get_best_config(window.screen)
>>> current_config
XlibCanvasConfig10([('double_buffer', 0),
 ('stereo', 0),
 ('buffer_size', 24),
 ('aux_buffers', 0),
 ('sample_buffers', 0),
 ('samples', 0),
 ('red_size', 8),
 ('green_size', 8),
 ('blue_size', 8),
 ('alpha_size', 0),
 ('depth_size', 0),
 ('stencil_size', 0),
 ('accum_red_size', 0),
 ('accum_green_size', 0),
 ('accum_blue_size', 0),
 ('accum_alpha_size', 0),
 ('major_version', None),
 ('minor_version', None),
 ('forward_compatible', None),
 ('debug', None)])
>>> config.alpha_size = 8
>>> config.buffer_size = 32
>>> window = pyglet.window.Window(config=config)
>>> pyglet.window.Screen.get_best_config(window.screen)
XlibCanvasConfig10([('double_buffer', 0),
 ('stereo', 0),
 ('buffer_size', 24),
 ('aux_buffers', 0),
 ('sample_buffers', 0),
 ('samples', 0),
 ('red_size', 8),
 ('green_size', 8),
 ('blue_size', 8),
 ('alpha_size', 0),
 ('depth_size', 0),
 ('stencil_size', 0),
 ('accum_red_size', 0),
 ('accum_green_size', 0),
 ('accum_blue_size', 0),
 ('accum_alpha_size', 0),
 ('major_version', None),
 ('minor_version', None),
 ('forward_compatible', None),
 ('debug', None)])

So as you can see, even explicitly setting the depth to 32 does not work.

Comment 4 Jason Galyon 2009-05-18 10:13:09 UTC
I put the wrong command line.  In fact specifying '24+32' for the depth does not work either.
Comment 5 Jeremy Huddleston Sequoia 2011-10-15 18:48:30 UTC
Is this still an issue?  Does the problem exist with Xfake or with the null 
video driver and Xorg DDX?

I tried your example, but python and I don't get along and I was unable to 
reproduce.  If you can provide a reduced teste case without python I'd be 
appreciative.
Comment 6 Julien Cristau 2011-10-16 08:15:39 UTC
> --- Comment #5 from Jeremy Huddleston <jeremyhu@freedesktop.org> 2011-10-15 18:48:30 PDT ---
> Is this still an issue?  Does the problem exist with Xfake or with the null 
> video driver and Xorg DDX?
> 
the Xvfb manpage still has a broken example of depth 32, yes.
Comment 7 Maik Riechert 2013-03-25 21:48:10 UTC
I stumbled upon this today. If 32 isn't a valid depth, then xvfb should exit with an appropriate error message. By the way, why isn't 32 valid? (I don't have much experience on those details yet)
Comment 8 Adam Jackson 2018-05-15 19:09:58 UTC
(In reply to Maik Riechert from comment #7)
> I stumbled upon this today. If 32 isn't a valid depth, then xvfb should exit
> with an appropriate error message. By the way, why isn't 32 valid? (I don't
> have much experience on those details yet)

32 isn't a valid depth, in X11's opinion, because there is no pixel format where all 32 bits are used for r/g/b. Depth 24 is valid, and it will use 32 bits per pixel, but depth 32 is not a real thing.

Manual fixed now though:

commit d2d664df974ac5a55d5819f0379fcdac05d22fa3
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Apr 23 17:21:09 2018 -0400

    vfb: Fix man page in re depth
    
    32 is not a valid depth, and the default is now 24 not 8.
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.