[gs-bugs] [Bug 691499] CUPS Raster device has "Error: /undefined in --setpagedevice--" for some files only in banding mode

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Wed Jul 28 10:40:07 UTC 2010


http://bugs.ghostscript.com/show_bug.cgi?id=691499

--- Comment #13 from Till Kamppeter <till.kamppeter at gmail.com> 2010-07-28 10:40:05 UTC ---
I have looked into the source code of Ghostscript, file base/gdevprn.c,
functions gdev_prn_allocate() and gdev_prn_setup_as_command_list(), and there I
have seen what happens: If one does not touch the cache sizes by means of
cups_get_space_params() (in cups/gdevcups.c) then gdev_prn_allocate() sets
bufferSpace_is_default to "true" and therefore calls
gdev_prn_setup_as_command_list() with bufferSpace_is_exact = false. This allows
gdev_prn_setup_as_command_list() to double the size of the buffer space until
it is big enough for the given job.

Our sample command line

cat ~/ghostscript/gpl/testfiles/cups-does-not-show/CityMap.pdf | gs
-sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -r720x720
-dcupsBitsPerColor=8 -dcupsColorSpace=1 -_ > out.raster 2> log

uses the following actual sizes for the buffer then:

-r720x720:       4000000
-r7200x7200:    16000000
-r72000x72000: 128000000

If cups_get_space_params() sets the BufferSpace to any non-zero value
gdev_prn_allocate() sets bufferSpace_is_default to "false" and therefore calls
gdev_prn_setup_as_command_list() with bufferSpace_is_exact = true and this
means that the buffer size is nailed down to the given value. If the buffer
space gets limited by CUPS's default setting of RIP_MAX_CACHE to 8 MB the
current cups_get_space_params() gives only 800K of BufferSpace many jobs,
including the attached files printed in 720 dpi and CMYK color will fail. And
note that there are A0 printers, Gutenprint does 5760x2880 dpi with up to 8
inks, and numbers will get rather bigger than smaller ...

The BufferSpace is the memory size used for rendering one band when rendering
in banding mode. MaxBitmap is the maximum memory size to be used for rendering
in full page mode. If MaxBitmap is too small, it is automatically switched to
banding mode.

What I will change is:

cups_get_space_params() will not change any values (keep Ghostscript defaults)
if RIP_MAX_CACHE is not set, invalid, or zero. If the RIP_MAX_CACHE is set, it
will also set the BufferSpace to RIP_MAX_CACHE and not to RIP_MAX_CACHE / 10.

I also recommend that CUPS should use either an invalid or zero RIP_MAX_CACHE
or RIP_MAX_CACHE = <machine's RAM> / 4 on desktop machines and PC-like servers.
The 8 MB default makes only sense for very restricted device, like routers or
cell phones.

-- 
Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the gs-bugs mailing list