[wplug-bsd] FreeBSD 4.9-RELEASE Printer Issues (PROBLEM IDENTIFIED)

Poyner, Brandon bpoyner at ccac.edu
Thu Nov 20 16:41:43 EST 2003


First let me apologize if this turns out to be html email.  I'm taking a sick day from work and using web mail.
 
It sounds to me like the USB drivers in FreeBSD are what's giving you the headache, especially since this printer is known to work under Linux.  I simply don't know enough about USB to help you figure out what's going on there.  It would be interesting to see if all the data is making it through /dev/ulpt0 and if all the data is making it to the printer, or if it is being truncated somewhere along the way.  I'm not exactly thinking clearly at the moment either. :)  In any case this is probably best if you send in a problem report.
 
My understanding is that lpd opens the input filter and redirects to that filter stdin to the file in the print spool, stdout to the printer and stderr to whatever was specified as the log file.  So I would recommend modifying the input filter.  You can create a printcap such as this (modifiy as needed)
 
lp|local line printer:\
        :sh:mx#0:\
        :lp=/dev/ulpt0:sd=/var/spool/lpd/samsung:lf=/var/log/lpd-errs:\
        :if=/usr/local/libexec/ifhp:
 
Copy /usr/share/examples/printing/ifhp to /usr/local/libexec/ifhp and chmod it.  Modify the gs line to match your printer DEVICE and add the pipe to the perl script to slow the stdout.  That should in theory do it.  I also think you can get away with more than 4k/sec, I was really just making a wild guess when I suggested that.

	-----Original Message----- 
	From: Benjamin Slavin [mailto:bslavin_list at wavecrazy.net] 
	Sent: Wed 11/19/2003 3:47 PM 
	To: Poyner, Brandon 
	Cc: 
	Subject: Re: [wplug-bsd] FreeBSD 4.9-RELEASE Printer Issues (PROBLEM IDENTIFIED)
	
	

	Well, sir, I think we've found the problem.
	
	It prints terribly slowly, but at 4k/sec, this is to be expected.
	
	Now, to get lpd to limit itself to that speed. I assume that, since it
	spools the job to disk before printing, this buffer needs to sit between
	LPD and the printer, not between the filter and LPD. I attempted to hack
	together a simple shell script to do this, thinking that by setting
	lp=/path/to/script, the script would take the data to be printed via
	STDIN, but found that it just wrote over the file instead.
	
	Any recommendations for this last step?
	
	Thanks so much,
	  --Ben
	
	Poyner, Brandon wrote:
	
	>It certainly sounds more and more like a problem with USB.  You might
	>want to try slowing down the stream of data going into the printer,
	>perhaps the printer buffer wigs out when it fills up completely?
	>(doubtful but I'm just grasping at straws).  You could use this perl
	>script as a pipe to stream ~4K/sec into the redirect to /dev/ulpt0. 
	>
	>#!/usr/bin/perl -w
	>
	>use strict;
	>
	>my $buf;
	>
	>while(read(STDIN, $buf, 4096)) {
	>        print STDOUT "$buf";
	>        sleep(1);
	>}
	>
	>Brandon Poyner
	>Network Engineer II
	>CCAC - College Office
	>412-237-3086
	>
	> 
	>
	
	




More information about the wplug-bsd mailing list