Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Brother MFC490CW Printer driver issue [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
bugfarmer
n00b
n00b


Joined: 24 Sep 2006
Posts: 46

PostPosted: Mon Jun 28, 2010 10:29 pm    Post subject: Brother MFC490CW Printer driver issue [Solved] Reply with quote

Well, here's the sitch.

I have installed the Brother supplied driver for this printer. There is a gotcha. You need to copy the files from /usr/lib to /usrlibexec or the otherway round. Sorry can't quite remember. Lot of water under the bridge this weekend. (and beer).

The point is I can't print to it from windows. (No don't say it). No! seriously.

I use cups.

I have set up a printer class called Colour. That class has only one printer in it. If the printer is my Samsung CLP 310 and I print to it from either the windows Print Test Page or Cups Test Page, all is well and I get a print job out of it. Now, if I remove the Samsung and put in my Brother MFC490CW and repeat the exercise, only the cups test page is printed and an error shows in the logs. Something about ghostscript 8.71 having an unrecoverable error.

Well, what I did next was to ponce around with the filter for the Brother printer changing the following in /usr/local/Brother/Printer/mfc490cw/lpd/filtermfc490cw.

I added:
Code:

OUTPUT_TEMP=`mktemp /tmp/br_output.XXXXXX`

to the top of the file and changed:
Code:

eval cat $INPUT_TEMP | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP

to:
Code:

eval cat $INPUT_TEMP | $PSCONV $PSCONV_OP > $OUTPUT_TEMP
eval cat $OUTPUT_TEMP | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP

Printing from cups test page yields a print job but printing from windows yields a broken pipe error.

I think what's happening is that the output from /usr/bin/gs ($PSCONV) is being trunkated. Very much like trying to copy binary files in text mode. (Remember those issues in MSDOS?).
$PSCONV is just sugar for /usr/bin/gs -sDEVICE=ppmraw + a-whole-load-a-options. It's piped to $BRCONV which is sugar for /usr/local/Brother/Printer/mfc490cw/lpd/brmfc490cwfilter + a-whole-load-a-options. This is the final backend that outputs to the printer but it's a binary file and has no documentation or help option. So now I'm stuck. I'm not sure which of my two line is producing the broken pipe and therefore why. Could it be cat falling over or could it be brmfc490cwfilter? If there are aany cups gurus out there I'm all ears, finger and thumbs. I'm more than willing to do the legwork on this one. So if anyone wants to reverse engineer the backend I'm willing to try it. Either that or just help me find a solution.

All is not lost however. I can connect it via WIFI, Ethernet or USB. So, if I connect it via WIFI or Ethernet, my windows clients can get to it natively but I have to install drivers on them all. My cups users can get to it too. But I really want everyone to do it via cups. That way the Colour class can be redirected at will or setup with a failover arrangement. i.e. everyone prints to Colour which outputs on the Samsung and when it runs out of ink it outputs on the Brother until I get more ink for the Samsung. My users don't have to change any settings just which printer they grab the print job from.
_________________
--- If it's unreliable, It's me that's using it.! ---


Last edited by bugfarmer on Wed Jun 30, 2010 7:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
bugfarmer
n00b
n00b


Joined: 24 Sep 2006
Posts: 46

PostPosted: Wed Jun 30, 2010 7:24 pm    Post subject: Reply with quote

I hate replying to my own post but someone might find it useful.

The reason for the failure is that Ghostscript or more particularly /usr/bin/gs is not very good at shutting up and staying quiet. In the most part it is ok but give it a big file or one at least that its got to chew on for a bit and it pukes a little. As a result the Brother supplied binary chokes on it closing the pipe. Funny that!

The output format ppmraw is required by the Brother supplied binary that chats to the printer. The first line must be P3 or P6 according to the web. However, gs adds %% Ghostscript blah blah ..%% which is a bit of postscript getting through.

The cure is to edit /usr/local/Brother/Printer/mfc490cw/lpd/psconvertij2 which is the script that does the conversion.

look for:
Code:

GHOST_OPT="-q -dNOPROMPT -dNOPAUSE -dSAFER -sDEVICE=$OUTPUT_TYPE -sOutputFile=$OUT - -c quit"

and change it to:
Code:

GHOST_OPT="-q -dQUIET -dNOPROMPT -dNOPAUSE -dSAFER -sDEVICE=$OUTPUT_TYPE -sstdout=/dev/null -sOutputFile=$OUT - -c quit"


Note that it is case sensitive.

The additional -dQUIET is probably superfluous as it is what -q is supposed to do but I stuck it in to ram the point home. -sstdout=/dev/null is the baby doing the work probably. It redirects stdout to /dev/null in order to throw any output on stdout into the null device where it will be lost.

Low and behold a working printer. It only took me Saturday (all day), Sunday (all day), Monday night (until 2:00AM), Tuesday (until 1:00AM) and today 45mins. It was the 45mins that was the most logical and productive.
_________________
--- If it's unreliable, It's me that's using it.! ---
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Tue Jan 04, 2011 4:58 pm    Post subject: Reply with quote

*subscribes*

I think this fix could be useful for me in the future

thanks !
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum