Improving Printing with Interrupts

Most IA-32 computers provide one parallel port, which is most commonly used to drive a printer. Occasionally, you'll find other parallel port devices, such as scanners or Zip drives. In theory, parallel ports are capable of speeds approaching 2MB/s, but in practice this optimum speed is seldom obtained. Several causes of this deficit are common:

Sub-Optimal Port Settings Modern parallel ports support several different operating modes: standard parallel port (SPP), enhanced parallel port (EPP), and enhanced capabilities port (ECP). For ports built into the motherboard, you set the mode from the BIOS's setting screen, typically accessed by pressing Delete or some other key early in the boot process. For the best performance, select ECP mode, or at least EPP; SPP produces distinctly lower transfer rates than other modes.

Poor Cables Some cables don't work well with EPP or ECP modes, or they may not work at all with some printers. For the best results, be sure you're using an IEEE-1284 cable.

Interrupt Settings Parallel ports can work either without an interrupt (IRQ) or with one. IRQ-less operation consumes more CPU time and is usually slower than IRQ-driven operation; however, there are cases in which use of IRQs can impair performance. You may need to experiment to determine the optimal settings.

Linux's parallel port drivers have changed substantially over the years. With 2.4.x and later kernels, these drivers have several layers. For typical use with a printer on the IA-32 architecture, there are three drivers:

• parport, which provides basic parallel-port operation

• parport_pc, which handles the parallel port as implemented on IA-32 systems

• Ip, which uses the parallel port to communicate with a printer

Other parallel-interfaced devices use drivers other than Ip atop the parport and parport_pc drivers.

To determine whether your system is currently using interrupts for printing, type the following command, which displays a list of interrupts used by the parallel port driver:

# grep parport /proc/interrupts

7: 0 XT-PIC parportO

If this command produces no output, either your system isn't configured to use interrupts or the parallel port drivers aren't loaded. Check the contents of /proc/modules for the parport, parport_pc, and Ip modules. If they aren't present, review your kernel configuration to see if the drivers are compiled into the kernel.

If your printer performance isn't what you'd like it to be, you might try changing from IRQ-less to IRQ-driven printing, or vice-versa. This change isn't guaranteed to have a dramatic impact on printing speed, but it might help.

In order to change the interrupt settings using 2.4.x and later kernels, you need to change the parameters passed to the parport_pc driver, as described in Chapter 1. Specifically, you might use a line such as the following in /etc/modules.conf to enable interrupt-driven printing:

options parport_pc io=0x378 irq=7

This line tells the system to use I/O port 0x378 and IRQ 7 for the parallel port. IRQ 7 is typical for the first parallel port. I/O port 0x378 is also typical, but some systems use 0x3bc. Check your BIOS settings or the jumpers on the parallel port card to determine what io setting to use. You should also check/proc/interrupts to be sure that IRQ 7 isn't already in use by another device. If it is, you may need to reconfigure that device or the parallel port before proceeding.

After modifying /etc/modules.conf, you can remove the parallel port drivers by using rmmod to remove each of the modules. You can then type modprobe Ip to reload these drivers with the new settings. Check/proc/interrupts to see if the parallel port is now using the IRQ.

Warning It's possible, but unlikely, that the new parallel port settings will hang the computer. If this happens, you'll need to use an emergency recovery system to restore your original /etc/modules.conf before rebooting the computer.

Factors other than the interrupt setting can influence printing speed or reliability. One common problem relates to the use of Ghostscript when printing common document types. Linux doesn't use most non-PostScript printers' built-in fonts, so even many plain-text files are sent as huge bitmap graphics, which can be time-consuming. Chapter 13 addresses these high-level printing issues in more detail.

Team LIB

Team LIB

^ previous

Was this article helpful?

0 0
The Ultimate Computer Repair Guide

The Ultimate Computer Repair Guide

Read how to maintain and repair any desktop and laptop computer. This Ebook has articles with photos and videos that show detailed step by step pc repair and maintenance procedures. There are many links to online videos that explain how you can build, maintain, speed up, clean, and repair your computer yourself. Put the money that you were going to pay the PC Tech in your own pocket.

Get My Free Ebook


Post a comment