CAPS Universe documentation  1.0.4
All you need to know to be successful
Brother HL Laser Printers User Manual

Driver Usage

If the components of the CAPS universe are already present at your host, but no matching printer driver yet, you will get the following systemd journal entry:

CAPS kernel: usb 1-1: new full-speed USB device number 2 using musb-hdrc
CAPS kernel: usblp 1-1:1.0: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x04F9 pid 0x0027
CAPS systemd[1]: Created slice system-caps\x2dprinter.slice.
CAPS systemd[1]: Starting Printing Driver at /dev/usb/lp0...
CAPS systemd[1]: Reached target Printer.
CAPS caps-printer-prep[150]: Reading config settings from INI file '/etc/caps/caps.ini'
CAPS caps-printer-prep[150]: Parsing file '/etc/caps/caps.ini' at level 'base'
CAPS caps-printer-prep[150]: Merging more config settings from INI file '/etc/caps/capsmanagement.ini'
CAPS caps-printer-prep[150]: Parsing file '/etc/caps/capsmanagement.ini' at level 'base'
CAPS caps-printer-prep[150]: Starting printer discovering process...
CAPS caps-printer-prep[150]: Called for device node '/dev/usb/lp0'
CAPS caps-printer-prep[150]: New printing device discovered.
CAPS caps-printer-prep[150]: No printer driver available for the new printing device
CAPS caps-printer-prep[150]: Found printer device is a 'HL-2030 series' made by 'Brother'
CAPS caps-printer-prep[150]: Its USB vendor ID is 04f9, its USB product ID is 0027
CAPS caps-printer-prep[150]: Its serial number (less important) is: XXXXXXXX
CAPS caps-printer-prep[150]: The printer device's IEEE ID is: MFG:Brother;CMD:PJL,HBP;MDL:HL-2030 series;CLS:PRINTER;
CAPS caps-printer-prep[150]: Install a printer driver for this printer device first
CAPS systemd[1]: caps-printer@-dev-usb-lp0.service: Control process exited, code=exited status=22
CAPS systemd[1]: caps-printer@-dev-usb-lp0.service: Failed with result 'exit-code'.
CAPS systemd[1]: Failed to start Printing Driver at /dev/usb/lp0.
Note
The verbosity setting here was 'info'.

Your journal entry might differ, the shown entry is for my Brother HL-2030 printer device.

If the matching printer driver is already installed, the journal entry differs:

CAPS kernel: usb 1-1: new full-speed USB device number 3 using musb-hdrc
CAPS kernel: usblp 1-1:1.0: usblp0: USB Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x04F9 pid 0x0027
CAPS systemd[1]: Starting Printing Driver at /dev/usb/lp0...
CAPS caps-printer-prep[167]: Reading config settings from INI file '/etc/caps/caps.ini'
CAPS caps-printer-prep[167]: Parsing file '/etc/caps/caps.ini' at level 'base'
CAPS caps-printer-prep[167]: Merging more config settings from INI file '/etc/caps/capsmanagement.ini'
CAPS caps-printer-prep[167]: Parsing file '/etc/caps/capsmanagement.ini' at level 'base'
CAPS caps-printer-prep[167]: Starting printer discovering process...
CAPS caps-printer-prep[167]: Called for device node '/dev/usb/lp0'
CAPS caps-printer-prep[167]: New printing device discovered.
CAPS systemd[1]: Started Printing Driver at /dev/usb/lp0.
CAPS caps-printer[169]: Reading config settings from INI file '/etc/caps/caps.ini'
CAPS caps-printer[169]: Parsing file '/etc/caps/caps.ini' at level 'base'
CAPS caps-printer[169]: Merging more config settings from INI file '/etc/caps/capsmanagement.ini'
CAPS caps-printer[169]: Parsing file '/etc/caps/capsmanagement.ini' at level 'base'
CAPS caps-printer[169]: Called for device node '/dev/usb/lp0'
CAPS caps-printer[169]: Launching printer driver ...
CAPS caps-printer[169]: HL series driver is starting
CAPS caps-printer[169]: Parsing file '/etc/caps/drivers/capsdriver.ini' at level 'base'
CAPS caps-printer[169]: Reading the base settings from INI file '/etc/caps/drivers/capsdriver.ini'
CAPS caps-printer[169]: Reading the default settings from INI file '/usr/share/caps/drivers/caps-brother-HL2030-driver.ini'
CAPS caps-printer[169]: Parsing file '/usr/share/caps/drivers/caps-brother-HL2030-driver.ini' at level 'default'
CAPS caps-printer[169]: Merging more default features from INI file '/etc/caps/drivers/hl20-driver.ini'
CAPS caps-printer[169]: Parsing file '/etc/caps/drivers/hl20-driver.ini' at level 'defaults'
CAPS caps-printer[169]: Reading the run-time INI files from parameter directory '/var/lib/caps/printer_6PqHu2'
CAPS caps-printer[169]: Found file: 'service.ini'...
CAPS caps-printer[169]: File 'service.ini' accepted as ini file
CAPS caps-printer[169]: Parsing file '/var/lib/caps/printer_6PqHu2/service.ini' at level 'user'

Now the printer driver is running. If you have connected it the very first time, it will create a printer device specific configuration file as well. The journal entry:

CAPS caps-printer-prep[167]: New printing device discovered.

shows this state. And the journal entry:

CAPS caps-printer[169]: Reading the run-time INI files from parameter directory '/var/lib/caps/printer_6PqHu2'

shows where the printer driver expects this configuration file for exact this printer device.

The journal entry slightly differs, if the printer device is already known:

CAPS systemd[1]: Starting Printing Driver at /dev/usb/lp0...
CAPS caps-printer-prep[201]: Reading config settings from INI file '/etc/caps/caps.ini'
CAPS caps-printer-prep[201]: Parsing file '/etc/caps/caps.ini' at level 'base'
CAPS caps-printer-prep[201]: Merging more config settings from INI file '/etc/caps/capsmanagement.ini'
CAPS caps-printer-prep[201]: Parsing file '/etc/caps/capsmanagement.ini' at level 'base'
CAPS caps-printer-prep[201]: Starting printer discovering process...
CAPS caps-printer-prep[201]: Called for device node '/dev/usb/lp0'
CAPS systemd[1]: Started Printing Driver at /dev/usb/lp0.

In this case, the tool 'caps-printer-prep' has found this printer device in its database (usually /var/lib/printer-devices.ini) and just re-use all stored settings.

The content of the newly generated printer device specifc configuration file is generic, since it is generated from some detectable printer information:

$ cat /var/lib/caps/printer_6PqHu2/service.ini
# Automatically created by CAPS. Please adapt the printer device name to your needs
[info]
name = Brother_HL-2030 series_XXXXXXX

You can adapt it to your needs. For the [info] section the keyword 'brief' and 'location' are provided as well.

You can overwrite all settings from the main printer's INI file (for my printer it is /usr/share/caps/drivers/brother-HL2030-driver.ini), the driver's INI file (for my printer it is /etc/caps/drivers/brother-hl2-driver.ini) and these changes are valid only for this specific printer device.

After changing the printer device's configuration file, you must detach and re-attach the printer again, to take effect the changes.

After changing my /etc/caps/drivers/brother-hl2-driver.ini to:

[info]
name = My Brother Printer
brief = Prints fast and nice
location = Office#3

the tool 'capsprinter' shows:

$ capsprinter --list -v
name: 'My Brother Printer'
 description: Prints fast and nice
 location: Office#3
 state: Idle (ID 3)
 reason: Okay (ID 16)
 message: 'Idle'

Printer Device Configuration

Various settings cannot be set via the printing dialouge. They are defined in a printer device corresponding INI file instead.

The following list shows the INI files read-in by the HL1/2 printer drivers. Some of the shown INI files use generic names, see below.

INI File name Meaning Expected Location
caps.ini Shared initialization CAPS Configuration Directory
capsdriver.ini Shared class initialization CAPS Printer Driver Configuration Directory
devicedriver.ini (see note) Device Description CAPS Printer Driver Database Directory
feature.ini (see note) Driver Feature Configuration optional, CAPS Printer Driver Configuration Directory
parameter.ini (see note) Printing Device Parameters CAPS Printer Device Parameter Directory
Note
The devicedriver.ini is only an example name for a Device Description INI file. Its real name correlates with the printing device.
The feature.ini is only an example name for a Driver Feature Configuration INI file. It is defined in the devicedriver.ini and is optional.
The parameter.ini is only an example for one of the Printing Device Parameters INI files. All INI files from the physical printing device's directory are read-in.

For the caps-brother-hl1 printer driver the mentioned feature INI file is

  • brother-hl1-driver.ini

For the caps-brother-hl2 printer driver the mentioned feature INI file is

  • brother-hl2-driver.ini

The mentioned parameter INI file is always device dependend.

Note
The listed configuration parameters shown below get their default values in the mentioned feature INI files. You can change their values in one of these feature INI files (e.g. "once for all" ) or individually in the device's specific parameter INI files.

Printer Device Specific

The following settings makes sense in a printer device specific way.

In the paper the used paper to print to can be predefined. For example if your printer has only one paper tray, you can define the loaded paper here instead of in the printing dialouge.

The HL printers know a paper format and a paper type.

Paper Type

According to the documentation:

‍Media Type. The temperature of fixing unit is adjusted depending on this setting.

It seems the printer adapts its own physical printing parameters depending on the paper type. Thus, a paper type can be defined to use this feature.

Section Variable
paper type

Values:

  • Regular: Ordinary white copy paper (75 g … 90 g per m²)
  • Thick: Thick paper (90 g … 105 g per m²)
  • Thick2: Thick paper
  • Transparency: Foil
  • Thin: Thin paper (60 g … 70 g per m²)
  • Bond: Bonded paper (rag pulp kind of paper)
  • Env: Envelope
  • Envtck: (FIXME)
  • Envtn: (FIXME)
  • Used: Recycled paper (maybe pre-printed is meant instead)
Note
This is a fixed setting and the user cannot change it when printing.
If the paper type isn't set, a selection list is generated instead and the default_type setting instead comes into play (see Default Paper Type).
The list of supported values differ from printer to printer. Maybe not all entries of this list are valid for your specific printer.

Default Paper Type

If type (see Paper Type) isn't set, the default_type defines the default type in the generated PPD section. Accepted values are the same as for the type variable.

Section Variable
paper default_type
Note
This is a weak fixed setting. The user can change it when printing.

Default Paper Format

Define the expected default paper format in the printer's paper tray. Accepted are all values the libpaper can handle. Refer 'man paperconf' or 'paperconf -a' for a list of supported formats.

Section Variable
paper format

This define is optional. If not set here, a more generic setting is used instead. One source of a generic setting can be the CAPS wide setting in the base driver's INI file, e.g. capsdriver.ini, usually installed to /etc/caps/drivers. If the base driver's INI file doesn't define the paper format a second source can be the system wide setting from libpaper. Refer 'man paperconf' how to setup a default system wide paper format.

Eco Mode

Define the toner save feature.

Section Variable
features eco

Values:

  • Off
  • 1
  • 2
  • 3

Default Print Resolution

The default print resolution can be defined. Its value is always in a short form, like '3' for 300 DPI.

Section Variable
features resolution

Values:

  • 3 (for 300 DPI)
  • 6 (for 600 DPI)
  • 12 (for 1200 DPI)

Supported resolutions varies from printer to printer. Refer the brother-h1.driver.ini or brother-hl2-driver.ini (depending on your model) for the supported resolutions.

Note
Since it only defines the default, the user can still select a different resolution in the printing dialouge on a per print job base.

The key word power_save_time sets the time an idling printer enters the power save state. Its value can be a number and is meant in minutes or the keyword Off to disable this feature. Disabling isn't recommended. Refer section Saving Energy about the energy a printer consumes.

Example:

  power_save_time = 5

You can move the print area on the paper by changing offsets.

The keyword x_offset moves the print area horizontally, while the keyword y_offset moves it vertically. Units are 1/72 inch (TODO really?) and both directions are possible by positive or negative values.

Example:

  x_offset = 0
  y_offset = 0

The keyword density TODO

Example:

  density = 0

The keyword image_adapt TODO

Example:

  image_adapt = On

Generic Settings

These settings are derived from the printing framework and thus, are valid for the QL printer drivers as well.

Processing Priority

Section Variable
features priority

Values:

  • '0': No change in driver's process priority
  • '1…19': Adapt the driver's process priority to a lower priority

This entry can lower the priority of the driver. For the time of processing the print job, the driver may consume many CPU cycles, which can disturb other activity in the system. By lowering its priority this can be mitigated. The value set here is the so called nice level. Refer "man nice" for further details on it.

Note
If you don't set this feature, the default is "no change of the priority"
You can never set a higher priority this way.

Memory Buffer Size

Section Variable
interface buffer_size

Values:

  • A number, unit is kiB, e.g. 1024 means 1024 kiB

If defined, the printer data buffer is extended to this value. E.g. the printer gets the printing data in one turn of this size instead of many small pieces.

Note
Some printers are in trouble if you send the printing data in many small pieces and thus, sometimes time out.

The time out especially can happen if the printer starts printing immediately when the first printing data arrives. Some printers cannot stop a printing activity once it has started. The printer then needs a continuous stream of data to continue and to finish the printing activity. Increase the buffer size if you face this kind of trouble.

The default value is 128 kiB if this setting isn't made in any INI file. It it also limited to max. 8 MiB (refer PRINTER_STREAM_BUFFER_DEFAULT_SIZE and PRINTER_STREAM_BUFFER_MAX_SIZE for the settings).

The printer driver is free when to flush the printing data buffer. It can flush the printing data buffer at the end of each processed page (for simplex print and on demand even for duplex print) or after two processed pages for duplex print. This is printer device dependend and should already be handled by the printer driver.

Note
If the printer driver already sets the buffer_size value, there is no reason to change its value.
Attention
The special value of '0' sets up a fully unbuffered mode. In this case the printer receives the printing data in many small pieces. This could make sense in some rare and special use cases.

Printer Monitoring

Monitoring means the printer's status gets read (periodically) in order to be able to report the printer's state to a user. Think about the paper tray is empty and needs to be refilled. The paper tray can be empty while a new printing job should start or it can be empty while already printing. Thus, it makes sense to monitor the printer's status periodically.

But the world isn't perfect and some printers are in trouble if you retrieve their status too often. There are known printers in the field, where a status read destroys the printer's buffer content which makes the print fail.

Section Variable
features monitor

Values:

  • always
  • never
  • idle

always

Monitor the printer device:

  • when idle
  • prior sending the printing data for each page

never

Never monitor the printer device.

idle

Monitor the printer device:

  • when idle

This setting can control how to monitor the printer. A printer which is perfect can live with the always setting. In this case it gets monitored even in idle state. Some printers report their transition into the power save mode while idle for a long period of time. With always this transition will be reported to the printing coordinator and can be retrieved by clients. With this setting an empty paper tray will be reported immediately. The same is valid for all kind of paper jam or other types of errors which can happen at the printer's side while printing.

The never setting is the opposite of always. With this setting there will be no disturbance of any printing activity, but no status reports for clients as well. Even if the paper tray is empty, there will be no warning for a client about this fact.

Some printers are in trouble only if they currently are printing when their status should be read. With the setting idle monitoring is restricted to the idle period only. Monitoring is stopped prior the printing of the first page and continued after the last page was printed, e.g. the next idle period is started.

If this setting isn't made, the default behaviour is always: the printer is expected as perfect.

If an invalid setting is made instead, it defaults to never to be safe.

You can add this INI setting into

For what events are monitored refer the internal function caps_drv_printer_check().

Halftone Processing

Define the default halftone processing method for monochrome prints.

‍From Wikipedia:
Halftone is the reprographic technique that simulates continuous-tone imagery through the use of dots, varying either in size or in spacing, thus generating a gradient-like effect.

Section Variable
features halftone

Values:

  • none
  • ordered
  • fls
  • jjn

Value: none

Method: Simple threshhold

This method has no grey scale emulation at all. Pixels below a fixed threshhold are printed, pixels above this threshold aren't.

For simple black text or graphics to print, this method might be sufficient. But for coloured text or grey scale graphics it might skip complete content and the printed result isn't what you expect (at least most of the time).

Left: original, right binary halftone

Value: ordered

Method: Bayer Pattern

Left: original, right ordered halftone

Value: fls

Method: Floyd and Steinberg

This is a so called "error diffusion" halftone method and the most popular one. Its result is very good for text and graphics and it has less visible artefacts on large areas with the same grey scale.

Left: original, right FLS halftone

Value: jjn

Method: Jarvis, Judice, and Ninke

This is a so called "error diffusion" method and similar to the fls one. Its result is very good for text and graphic, but it has visible artefacts on large areas with the same grey scale.

Left: original, right JJN halftone
Note
If no halftone processing method is defined, Floyd and Steinberg is used as the default.
Attention
This halftone processing method is used only, if the document format's rasterizer doesn't support monochrome raster. In this case libcapsdriver pre-processes the raster data with halftone method selected here.
If the corresponding rasterizer supports monochrome raster, it selects its own halftone method, which can differ from the one selected here.