OpenPrinting / libppd

Apache License 2.0
2 stars 13 forks source link

Brother DCP-J125 not printing after update to cups-filters 2.0b3 & 2.0rc1 #20

Closed GrzegorzBB closed 1 year ago

GrzegorzBB commented 1 year ago

Hello,

after update to Fedora 38 and cups-filter rpm package from 1.28 to 2.0 b3 I have a problem with printing on my Brother DCP-J125 - printer do not print at all and do not react for any actions executed from cups. Every print job ends with "No pages found!" error in cups logs. After short investigation below part attract my attention:

May 07 14:21:12 hp840 cupsd[17511]: cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Active clients, printing jobs, and dirty files"
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] ppdFilterLoadPPD: Color profile qualifier determined from job and PPD data \'..\'
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] ppdFilterLoadPPD: No ICC profiles specified in PPD
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] ppdFilterLoadPPD: Searching for profile \"-/-\"...
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] ppdFilterLoadPPD: Last filter determined by the PPD: brlpdwrapperdcpj125; Final data MIME type: application/vnd.cups-postscript => PDF filter will not log pages in page_log.
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] ppdFilterUniversal: \"*cupsFilter(2): ...\" lines in the PPD file:
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] ppdFilterUniversal:    application/vnd.cups-raw application/octet-stream 0 -
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] ppdFilterUniversal:    application/vnd.cups-postscript 0 brlpdwrapperdcpj125
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] ppdFilterUniversal: PPD uses \"*cupsFilter: ...\" lines, so we always convert to format given by FINAL_CONTENT_TYPE
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] ppdFilterUniversal: Converting from application/vnd.cups-pdf-banner to application/vnd.cups-postscript
May 07 14:21:12 hp840 cupsd[17511]: [Job 172] cfFilterChain: Running filter: universal

From my understanding cups is trying to use universal filter instead of brlpdwrapperdcpj125. This in my opinion could be the source of my problem. Because I am not familiar with cups printing flow I would like to ask you for small help with investigation. Full log can be found in attachment, print job number is 172. Thanks in advance!

GrzegorzBB commented 1 year ago

cups_log_j125_job172.txt

zdohnal commented 1 year ago

Hi,

based on the logs both filters are run - universal filter just encapsulates common conversions, so only one executable is started instead of having bannertopdf+pdftopdf+pdftops executables and once the filter generates postscript, it is passed to the brother filter.

It would be great if you attached the link to the driver you use, so we could try to reproduce the behavior locally for further debugging. According logs universal filter generates one page as it should, but we have to check whether that output is valid (looks ok in a PS viewer like gsx).

GrzegorzBB commented 1 year ago

Hi, thanks for clarification. I am using rpms provided directly by brother, packages are available directly on theirs website. Driver packages can be found here :

GrzegorzBB commented 1 year ago

Hi, today cups filter package has been updated to version 2.0~rc1-1 but problem is still there. In attachment you can find current log (Job 174). cups_log_j125_job174.txt

soltysh commented 1 year ago

I have a somewhat similar problem, this time it's with Brother DCP-J315W:

although in my case this fails with "No pages found!" which leads me to think that one of the filters is clearing the pages and I can't figure out which :disappointed:

zdohnal commented 1 year ago

Hi @soltysh and @GrzegorzBB ,

can you run the following commands and see what is in the file generated by them (for @soltysh \<printer> is DCP-J315W and for @GrzegorzBB DCPJ125, \<user> soltysh and grzegorz)?

$ cd
$ sudo cp /etc/cups/ppd/<printer>.ppd .
$ sudo chown <user>:<user> <printer>.ppd
$ PPD=<printer>.ppd CONTENT_TYPE=text/plain FINAL_CONTENT_TYPE=application/vnd.cups-postscript /usr/lib/cups/filter/universal 1 <user> '' 1 '' /etc/fstab > out.ps
$ file --mime out.ps
$ # after you installing gsx
$ gsx out.ps

If my suspicion is correct and brother filter is reporting correctly, the file will be empty.

soltysh commented 1 year ago

@zdohnal followed your commands and indeed I got an empty out.ps file, any further things I should try, or do you need additional logs, ppd file?

tillkamppeter commented 1 year ago

@soltysh I would like to see the screen output of your

PPD=<printer>.ppd CONTENT_TYPE=text/plain FINAL_CONTENT_TYPE=application/vnd.cups-postscript /usr/lib/cups/filter/universal 1 <user> '' 1 '' /etc/fstab > out.ps

command.

soltysh commented 1 year ago

@tillkamppeter here you go: filter.log

GrzegorzBB commented 1 year ago

@zdohnal @tillkamppeter I also received an empty page like @soltysh. My command output can be found here: cups_filter_log.txt

tillkamppeter commented 1 year ago

Could you all attach the PPD file(s) of the affected print queues, from /etc/cups/ppd/? Please copy the files and rename them adding a .txt suffix to their original names, so that GitHub accepts them as attachments. Thanks.

GrzegorzBB commented 1 year ago

Hi @tillkamppeter, here you go: DCPJ125.txt

soltysh commented 1 year ago

And mine: DCP-J315W.ppd.txt

tillkamppeter commented 1 year ago

Thanks for the PPD files. The problem is caused when turning the former pstops CUPS filter into the ppdFilterPSToPS() filter function. At some places wrong functions for outputting the print data are used.

As this filter function is part of libppd, moving this issue to there ...

zdohnal commented 1 year ago

@soltysh @GrzegorzBB I might find the fix - can you try testing RPMs https://koji.fedoraproject.org/koji/taskinfo?taskID=101514696 ?

soltysh commented 1 year ago

Tried both printing the test page and the command from this comment without any luck :disappointed:

GrzegorzBB commented 1 year ago

Hi @zdohnal, unfortunately the problem is still there. New cups log below. cups_log_j125_job175.txt

zdohnal commented 1 year ago

Ok, thanks for letting me know - there are several hacks in PDFTOPS filter function specifically for Brother printers (because of its firmware bugs) and those hacks are applied if the manufacturer name matches with a substring from a specific make_model string, but make_model string doesn't contain the manufacturer in certain scenarios, which is a bug.

I'm working on https://bugzilla.redhat.com/show_bug.cgi?id=2192912 (although it is Utax printer) as well and the fix for this bug might be solution for it, so I thought it could help as well, but probably the reason why different functions are used is more deep than mismatched make_model.

In case the patch will work at least on the Utax printer in question, I'll create PR.

tillkamppeter commented 1 year ago

@zdohnal, what I have fixed now, is an actual bug in the ppdFilterPSToPS() filter function which got introduced by the conversion of the classic pstops CUPS filter into a filter function (see commit message). Independent of this naturally the non-application of the Brother workaround in the ppfFilterPDFToPS() filter function needs also to get fixed.

@GrzegorzBB @soltysh my fix for this bug should already solve your problem. For your specific bug, @zdohnal's fix for the Brother workarounds is not needed, that one is only relevant for PostScript printers.

soltysh commented 1 year ago

Thx @tillkamppeter, I'll wait for the updated built and will give it a try and report back if I encounter any problems :)

zdohnal commented 1 year ago

@soltysh @GrzegorzBB the fix will arrive into Fedora testing repos later today if you want to check the patch.

soltysh commented 1 year ago

I picked the build from https://koji.fedoraproject.org/koji/buildinfo?buildID=2207641 and it's working :tada: Thank you!

GrzegorzBB commented 1 year ago

I can also confirm, it is working. Thanku you @tillkamppeter and @zdohnal.