From nobody@FreeBSD.org  Wed Jun 20 00:24:54 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 789C316A400
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Jun 2007 00:24:54 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 693FF13C44B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Jun 2007 00:24:54 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l5K0Osqt039261
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Jun 2007 00:24:54 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l5K0OsV4039260;
	Wed, 20 Jun 2007 00:24:54 GMT
	(envelope-from nobody)
Message-Id: <200706200024.l5K0OsV4039260@www.freebsd.org>
Date: Wed, 20 Jun 2007 00:24:54 GMT
From: "Michael B. Trausch" <michael.trausch@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: USB printing fails w/ FreeBSD CUPS
X-Send-Pr-Version: www-3.0

>Number:         113870
>Category:       ports
>Synopsis:       USB printing fails w/ FreeBSD print/CUPS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dinoex
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 20 00:30:05 GMT 2007
>Closed-Date:    Fri Sep 28 14:21:32 CEST 2007
>Last-Modified:  Fri Sep 28 14:21:32 CEST 2007
>Originator:     Michael B. Trausch
>Release:        FreeBSD 6.2-RELEASE amd64
>Organization:
>Environment:
FreeBSD salt.lan 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Tue Jun 19 04:12:27 UTC 2007 root@salt.lan:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
        Using FreeBSD 6.2-RELEASE, the ability to use CUPS on a USB
        printer is broken.  I have attempted to report a bug to the
        CUPS project regarding it, and when it was discovered that
        the problem is not whether or not my printer is bidirectional,
        but something else FreeBSD specific, the CUPS author stated
        that the bug needed to go through FreeBSD "channels".

        The following trouble happens both with a stock kernel (e.g.,
        that which comes with 6.2-RELEASE known as GENERIC), and from
        a kernel slightly modified to treat the printer as a
        unidirectional USB device.

        When sending print jobs to the CUPS system, the CUPS
        system's USB backend will eventually go idle, not transmitting
        print jobs to the printer.  This same software works
        as-needed on the same hardware when using Ubuntu
        server, so it does seem that it is a FreeBSD-specific
        problem.  I am in the process of attempting to use
        the FreeBSD built-in printing solutions to see if I
        am able to use that, but would obviously prefer to be
        able to use CUPS.  However, it is more important that
        my server run FreeBSD for other features that come with
        the system.

>How-To-Repeat:
        Install FreeBSD 6.2, then pkg_add -r cups.
        Attach a Lexmark E240 printer to the system (which
         uses the pxlmono CUPS driver) and set it up with:
          lpadmin -p e240 -v usb:/dev/ulpt0 -m pxlmono.ppd \
           -L "Location" -D "Lexmark E240"
        Attempt to print test jobs to it both from localhost
        and from other networked machines.  (Note that the
        printer has to be set-up manually on other machines;
        FreeBSD's packaged version also doesn't seem to
        share the printers' information even when the config
        file is set up to do so.) 

>Fix:
        Unknown.  At first, the problem was suspected to be that
        the printer reports as bidirectional but really isn't; the
        CUPS person created a kernel modification to force the
        kernel as a unidirectional device.  This patch had no
        effect on the problem though it did alter the kernel's
        behavior regarding the device.

        To provide a comparison with another system which ran on
        this same server, Ubuntu Server 7.04 w/ CUPS worked as
        expected, after adding the configuration information to
        cupsd.conf to enable printer sharing.  The Linux kernel
        reports the printer as a bidirectional USB device and
        seems to treat it as such, and CUPS likes it just fine.

        Not knowing anything about the way kernel internals work,
        my best guess is that there is something in the dev
        interfaces that isn't functioning as expected, OR there is
        a bug in CUPS that is specific to FreeBSD (and this bug
        exists in packages/ports).  I apologize that I can not
        offer any more information to attempt to track down the
        problem's origin, nor a potential fix.

Added after initial attempt to submit by way of send-pr:  It is not a problem with the USB buses, printer, or kernel---FreeBSD's native/internal printing systems/daemons print to my printer just fine, after writing a filter to process incoming things and exporting the LPD printer to my network.  So, it appears to be a problem with CUPS' on FreeBSD.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dinoex 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Jun 20 00:36:35 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113870 
State-Changed-From-To: open->feedback 
State-Changed-By: dinoex 
State-Changed-When: Wed Jun 20 07:13:56 CEST 2007 
State-Changed-Why:  

a) Wich version of cups is installed on your system? 

b) Debug the backend: 
truss /usr/local/libexec/cups/backend/parallel |& grep dev/ 



http://www.freebsd.org/cgi/query-pr.cgi?pr=113870 

From: dirk.meyer@dinoex.sub.org (Dirk Meyer)
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/113870: USB printing fails w/ FreeBSD print/CUPS
Date: Wed, 20 Jun 2007 16:58:30 +0200

 Michael B. Trausch schrieb:,
 
 > --=-H93BrmJgiFdXD2ny/b2+
 > Content-Type: multipart/alternative; boundary="=-Ll/2Y9WR6y0NIRgcPXCT"
 > 
 > 
 > --=-Ll/2Y9WR6y0NIRgcPXCT
 > Content-Type: text/plain
 > Content-Transfer-Encoding: quoted-printable
 > 
 > On Wed, 2007-06-20 at 07:34 +0200, Dirk Meyer wrote:
 > 
 > > Synopsis: USB printing fails w/ FreeBSD print/CUPS
 > >=20
 > > State-Changed-From-To: open->feedback
 > > State-Changed-By: dinoex
 > > State-Changed-When: Wed Jun 20 07:13:56 CEST 2007
 > > State-Changed-Why:=20
 > >=20
 > > a) Wich version of cups is installed on your system?
 > >=20
 > > b) Debug the backend:
 > > truss /usr/local/libexec/cups/backend/parallel |& grep dev/=20
 > 
 > 
 > Current from packages as well as ports was what was installed on the
 > system.
 > 
 > I will re-install it tomorrow after snapshotting to make sure I don't
 > destroy my current LPD configuration that I got working; I assume I will
 > be adjusting that truss command line to
 > be /usr/local/libexec/cups/backend/usb, since that is what is being
 > called?
 > 
 >     Thanks for the prompt reply!
 >     Mike Trausch
 > 
 > --
 > Michael B. Trausch
 >            michael.trausch@gmail.com
 > Phone: (404) 592-5746
 >                           Jabber IM:
 >            michael.trausch@gmail.com
 > Demand Freedom!  Use open and free protocols, standards, and software!
 > Support free speech---it is the most valuable freedom we have!
 > 
 
 "Current from packages as well as ports" is not unique.
 please report the exact Version.
 
 current is: cups-base-1.2.11_1
 
 /usr/local/libexec/cups/backend/usb is correct.
 
 kind regards Dirk
 
 - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
 - [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org]
 http://people.freebsd.org/~dinoex/errorlogs/
State-Changed-From-To: feedback->analyzed 
State-Changed-By: dinoex 
State-Changed-When: Fri Sep 28 14:11:16 CEST 2007 
State-Changed-Why:  

From:	michael.trausch@gmail.com (Michael B. Trausch) 
Date:	Wed, 20 Jun 2007 14:54:33 -0400 

On Wed, 2007-06-20 at 07:34 +0200, Dirk Meyer wrote: 

> a) Wich version of cups is installed on your system? 



[root@salt /var/log/cups]# pkg_info|grep cups 
cups-1.2.2          The Common UNIX Printing System: Metaport to install comple 
cups-base-1.2.2     The Common UNIX Printing System 
cups-pstoraster-8.15 Postscript interpreter for CUPS printing to non-PS printers 
[root@salt /var/log/cups]#  


Is the version on my system from FreeBSD's packaging systems. 


> b) Debug the backend: 
> truss /usr/local/libexec/cups/backend/parallel |& grep dev/  



[root@salt ~]# truss /usr/local/libexec/cups/backend/usb 2>&1| grep dev/ 
access("/dev/ulpt0",0)                           = 0 (0x0) 
access("/dev/unlpt0",0)                          = 0 (0x0) 
access("/dev/ulpt1",0)                           ERR#2 'No such file or directory' 
access("/dev/unlpt1",0)                          ERR#2 'No such file or directory' 
access("/dev/ulpt2",0)                           ERR#2 'No such file or directory' 
access("/dev/unlpt2",0)                          ERR#2 'No such file or directory' 
access("/dev/ulpt3",0)                           ERR#2 'No such file or directory' 
access("/dev/unlpt3",0)                          ERR#2 'No such file or directory' 
access("/dev/ulpt4",0)                           ERR#2 'No such file or directory' 
access("/dev/unlpt4",0)                          ERR#2 'No such file or directory' 
access("/dev/ulpt5",0)                           ERR#2 'No such file or directory' 
access("/dev/unlpt5",0)                          ERR#2 'No such file or directory' 
access("/dev/ulpt6",0)                           ERR#2 'No such file or directory' 
access("/dev/unlpt6",0)                          ERR#2 'No such file or directory' 
access("/dev/ulpt7",0)                           ERR#2 'No such file or directory' 
access("/dev/unlpt7",0)                          ERR#2 'No such file or directory' 
direct usb:/dev/ulpt0 "Unknown" "USB Printer #1" 
direct usb:/dev/unlpt0 "Unknown" "USB Printer #1 (no reset)" 
write(1,"direct usb:/dev/ulpt0 "Unknown" "...,110) = 110 (0x6e) 
[root@salt ~]#  


It seems to be opening it just fine.  The confusing part is that it 
sometimes tries to print and communicates with the printer (though there 
is a problem in the Ghostscript version that CUPS depends on and PCL/XL 
support; newer GPL Ghostscript deals with the issue just fine, but CUPS 
pulls the old stuff in as a dep.), and other times, the printing will 
silently fail with the usb backend doing absolutely nothing of value. 
Right now, I am still working on getting the USB part to hang... it is 
interesting how these problems come up when you need the printer, but 
when you try to replicate... :-) 

If I can get the silly thing to hang again, perhaps attaching truss to 
the process will yield some additional information, though I would 
imagine that would probably only yield information on what the signal 
handler does before it does.  At this point, though, the usb handler 
dies before I can get it attached, and it isn't hanging yet (with 25 
attempts... grr!). 

Also, though not related but in the same territory-- the USB backend 
runs as the system user cups when it is run.  The package should (but 
doesn't) alter the permissions of /dev/*lpt* so that the cups user can 
access it, or run the output filter as root so that it can open the 
device.  Manually changing the permissions is fine, but I would think 
nearly defeats the purpose of pulling a package onto the system.  The 
only way that I can reliably print with the printer at this point, 
though, is to use the FreeBSD lpd daemon and a custom filter script to 
handle printing, and since this is a production system (I've no testing 
system available at this point, at least, not one that will run FreeBSD; 
I have one, but FreeBSD panics on it before it even finishes booting) I 
can't continue to test this right now.  I apologize if there is not 
enough information at present to work on the bug; I can supply more when 
the printer is upgraded and I can move the current printer to a testing 
machine, assuming I can convince FreeBSD to boot on it. 

-- 
Michael B. Trausch 
michael.trausch@gmail.com 
Phone: (404) 592-5746 
Jabber IM: 
michael.trausch@gmail.com 
Demand Freedom!  Use open and free protocols, standards, and software! 
Support free speech---it is the most valuable freedom we have! 


http://www.freebsd.org/cgi/query-pr.cgi?pr=113870 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dinoex 
State-Changed-When: Fri Sep 28 14:18:40 CEST 2007 
State-Changed-Why:  
Problem not found, 
please try a new version of cups. 

There is no way to set permanetly the permission for devices 
in a generic way. To many places where this can be set up. 
- devfs rules 
- devd.conf 
- rc.scripts 


http://www.freebsd.org/cgi/query-pr.cgi?pr=113870 
>Unformatted:
