Giter VIP home page Giter VIP logo

captdriver's People

Contributors

aaa945260 avatar agalakhov avatar blmhemu avatar highwaystar avatar kp1533tm2 avatar missla avatar mounaiban avatar rezaxdi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

captdriver's Issues

Support LBP6000/LBP6018

Hey there,

I'm trying to make this driver work with LBP6000 printer, this printer uses same version of CAPT 3.0 as LBP3010 but it seems there should be some differences between the two. Here are list of the things I have done till now :

  1. Added LBP6000 to prn_lbp2900.c so I can test the current driver. Driver goes into processing stage for ever. You can see the attahced cups log file.

lbp6000_cups_error_r.log

  1. I have also setup wireshark with usbpcap on windows and captured data while printing.

So after comparing captured data with logs that i have from cups I find out that first there is a command that is never sent by cups driver which is a4a00400 but the response from printer is always a4a01400000c00000000000303010dfe00000000 and it never changes no matter what printer is doing so I guess it would be safe to skip it maybe ?

The rest of process completely seems to be same, all commands have same response in both captdriver and windows. What else should I be looking for ?

Complex pages are slow to start

Second Edition
NOTE: This is a completely re-written summary of the issue. Please check the post history under the "Edited" menu to review the original.

When printing a multi-page job, captdriver pauses before moving on to the next. This has been a known issue and has been tolerated on simple jobs. However, when complex pages that contain a lot of graphical details and gradient fills are involved, delays can become bothersome.

The printer can stall for upwards of a minute in such cases, making it feel like the driver has crashed. When printing multiple copies of the same page, the delays will happen multiple times.

Reproducing the problem

  1. Prepare the test PDF as described in this test procedure from the studycapt repository.

    • You should end up with a three-page PDF.

    • The first and last pages contain simple solid-filled shapes, while the second page should filled with many small radial gradient-filled ellipses, and render more slowly.

  2. Print the document with a PDF viewer.

    • If you are using Mozilla Firefox's built-in PDF viewer, pdf.js, you may get blurred pages if you attempt to print before the pages are ready.

The first page should print normally, but the second page stalls the job. The job should then complete within a few minutes.

Potential solutions
The following actions have been suggested, in order of the easiest to the hardest:

  • Cache all compressed pages before the job starts

    • The biggest gains in speed are expected on jobs that involve printing multiple copies of complex pages.

    • Memory use per job will increase

  • Discover and enable lower resolution modes. Currently, only 600dpi mode is supported.

    • Preliminary testing with GhostScript suggests that 300dpi saves about half the page rendering time compared to 600dpi
    • With captdriver, CUPS uses GhostScript to render pages, which seems to have linear time complexity with respect to raster pixel count
  • Write a GhostScript device driver that compresses the raster during instead of after the rendering process.

OpenBSD: "error: unknown type name 'u_int'" when compiling

Everything up until the make command worked fine. I installed required dependencies, and the configuation did not produce any errors.

$ make
Making all in src
  CC       rastertocapt.o
In file included from rastertocapt.c:30:
In file included from /usr/local/include/cups/raster.h:20:
In file included from /usr/local/include/cups/cups.h:28:
In file included from /usr/local/include/cups/ipp.h:18:
In file included from /usr/local/include/cups/http.h:39:
/usr/include/netinet/ip.h:49:2: error: unknown type name 'u_int'
        u_int     ip_hl:4,              /* header length */
        ^
/usr/include/netinet/ip.h:174:2: error: unknown type name 'u_int'
        u_int    ipt_flg:4,             /* flags, see below */
        ^
2 errors generated.
*** Error 1 in src (Makefile:401 'rastertocapt.o': @echo "  CC      " rastertocapt.o;depbase=`echo rastertocapt.o | sed 's|[^/]*$|.deps/&|;s...)
*** Error 1 in /home/unix/soft/captdriver (Makefile:435 'all-recursive': @fail=;  if (target_option=k; case ${target_option-} in  ?) ;;  *) ...)

Canon LBP2900 on FreeBSD: no such file or directory

I'm setting up a Cannon LBP2900 on a jail in FreeBSD (actually TrueNAS). Using the 0.1.4.2-GxB branch, I was able to compile and install the driver, add the printer and PPD, then I tried printing a test page and CUPS webgui says no such file or directory.

Checking /var/logs/cups/error_logs and saw this:
E [20/Jul/2023:10:42:38 +0700] LBP2900: File \"/usr/local/libexec/cups/filter/rastertocapt\" not available: No such file or directory

I was able to confirm that rastertocapt is available in /usr/local/libexec/cups/filter/:

root@cups:~ # ls -la /usr/local/libexec/cups/filter/
total 185
drwxr-xr-x   2 root  wheel      10 Jul 20 10:58 .
drwxr-xr-x  10 root  wheel      10 Jul 20 10:22 ..
-rwxr-xr-x   1 root  wheel   13424 Jul  8 08:18 commandtops
-rwxr-xr-x   1 root  wheel    7856 Jul  8 08:18 gziptoany
-rwxr-xr-x   1 root  wheel   51440 Jul  8 08:18 pstops
-rwxr-xr-x   1 root  wheel  127288 Jul 20 10:57 rastertocapt
-rwxr-xr-x   1 root  wheel   21144 Jul  8 08:18 rastertoepson
-rwxr-xr-x   1 root  wheel   16896 Jul  8 08:18 rastertohp
-rwxr-xr-x   1 root  wheel   19624 Jul  8 08:18 rastertolabel
-rwxr-xr-x   1 root  wheel   14312 Jul  8 08:18 rastertopwg

I was not able to add the printer via lpadmin as shown in the guide as it only says no match.

Free LBP6000 to a good home

I'm a big fan of your work. I managed to set up my LBP6000 printer on a Raspberry Pi, but after about two weeks, it stopped working properly. It seems like I need to print a blank page from a Windows computer (or an emulated one) to trigger printing from the Raspberry Pi again. I've decided to switch to a newer Brother printer, even though it's larger than my compact LBP6000.

I'll keep the LBP6000 until April 1st, then I plan to sell it to someone who uses Windows. If you're interested, please contact me, and I'll be happy to ship you the printer so it can be used for driver development.

LBP3010 "CAPT: no pages in job"

When trying to print something on my LBP3010 I get this error message: "CAPT: no pages in job"!
What should I do, do you need more information?

LBP3010/3100 only prints A4 pages

Captdriver is already capable of printing multiple page sizes, but this functionality is not yet enabled on the LBP3010, and its variants, LBP3015, 3018, 3100, 3015 and 3018 due to a lack of testers. At time of writing, only A4 printing is supported.

If you have any of the above printers and have some spare time to verify support, please respond to this message. Thanks in advance for your help!

UPDATE: Support for multiple page sizes appears to have been added to the original version as of fdb2321 in the original repo. If you had success with non-A4 page sizes with your LBP3010/3100-family device with the latest version of Galakhov's driver, please leave a message here.

Please note that this issue will be resolved by rebasing this fork to sync with the original, and thus inheriting its updates.

Support LBP6200d

The title says it all... 🖨️

The LBP6200d is a CAPT personal printer with the distinct feature of having a page flipper for automatic two-side printing (two-sided printing is normally only available on multi-user workgroup printers).

Not to be mistaken for the LBP6020, which is the concern of issue #22.

Support LBP6020

I am trying to add support for the LBP6020 printer. So far all I have done is add the line register_printer("LBP6020", lbp6000_ops.ops, EXPERIMENTAL); to prn_lbp2900.c, in hope that it would magically make the printer work. Unfortunately it does not appear to be sufficient.

The last four lines of the CUPS error_log file are:

W [21/Oct/2022:20:36:40 +0200] [Job 12] support of LBP6020 is experimental
E [21/Oct/2022:20:41:19 +0200] [Job 12] Unable to send data to printer.
E [21/Oct/2022:20:41:20 +0200] [Job 12] CAPT: bad reply from printer, expected A8 A0 xx xx xx xx, got
W [21/Oct/2022:20:41:20 +0200] [Job 12] Backend returned status 1 (failed)

I do not have much experience in reverse engineering printer protocols, but next on my TODO list is some experiments with Wireshark.

LBP2900 Cannot Print from Zorin OS (x86 32-bit)

This is a supplementary issue to accompany #3, which may or may not be related. Other printers may be affected as well. Please check #3 for the full story.

Any user with an LBP3010 (including regional variants 3018 or 3050) or LBP3000 with difficulties getting captdriver to work on 32-bit x86 (i686) flavours of Zorin OS is welcome to comment here as well.

CUPS backend bug

One of your high-priority problems in wiki is CUPS backend bugs. I think, I has fix for this in my repo: just checkout capt_command.c on my repo.

There is diff:

//		while (1) {
//		if (WORD(capt_iobuf[2], capt_iobuf[3]) == capt_iosize)
//			break;
//		if (BCD(capt_iobuf[2], capt_iobuf[3]) == capt_iosize)
//			break;
//		if (cmd == CAPT_NOP || cmd == CAPT_IDENT || cmd == CAPT_CHKJOBSTAT) {
//			capt_recv_buf(capt_iosize, BCD(capt_iobuf[2], capt_iobuf[3]));
//			continue;
//		}
//		/* block at 64 byte boundary is not the last one */
//		if (WORD(capt_iobuf[2], capt_iobuf[3]) > capt_iosize && capt_iosize % 64 == 6) {
//			capt_recv_buf(capt_iosize, WORD(capt_iobuf[2], capt_iobuf[3]) - capt_iosize);
//			continue;
//		}
//		/* we should never get here */
//		fprintf(stderr, "ERROR: CAPT: bad reply from printer, "
//				"expected size %02X %02X, got %02X %02X\n",
//				capt_iobuf[2], capt_iobuf[3], LO(capt_iosize), HI(capt_iosize));
//		capt_debug_buf("ERROR", capt_iosize);
//		exit(1);
//	}

	if(WORD(capt_iobuf[2], capt_iobuf[3]) > 6 || BCD(capt_iobuf[2], capt_iobuf[3]) > 6) {
		capt_recv_buf(capt_iosize, BCD(capt_iobuf[2], capt_iobuf[3]));
	}

Simple, won't it? This implementation fixed buffer mismatch on LBP1120. But, my father detected bug in BCD(). True BCD() is here:

static inline uint16_t BCD(uint8_t lo, uint8_t hi)
{
	uint16_t a, b, c, d;
//      a = (hi >> 8) & 0x0F;
	a = (hi >> 4) & 0x0F;
	b = (hi >> 0) & 0x0F;
//      c = (lo >> 8) & 0x0F;
	c = (lo >> 4) & 0x0F;
	d = (lo >> 0) & 0x0F;
	if (a > 9 || b > 9 || c > 9 || d > 9)
		return WORD(lo, hi);
	return a * 1000 + b * 100 + c * 10 + d * 1;
}

Canon LBP-2900 prints with low density

Hi, first of all, thanks for the hard work on supporting obscure hardware! :)

I've got the driver working Ubuntu 23.10 x86_64 (running in Proxmox) (as a side note on Alpine 3.19 armhf (Raspberry Pi W) I've run into this issue: #8).

The problem I have though is that all prints via CUPS and captdriver have less density (black text is gray) compared to printing via MacOS or Windows drivers with the printer attached directly via USB. I can observe this behavior for both vector PDFs or documents printed from LibreOffice.

I've had a quick look into CUPS options and captdriver source code, but haven't found any knobs to turn. Did I miss something obvious?

Thanks in advance!

LBP2900 cannot print from Raspbian 10 armhf (32-bit)

When trying to print with an LBP2900 from Raspbian 10 armhf, the printer gets stuck in a loop. Other versions of Raspbian may be affected as well.

CUPS debug logs reveal that the loop is a status check command (code 0xE0A0) gone wrong, with endlessly-repeating entries like:

D [24/Apr/2020:16:29:19 ] [Job 4] CAPT: send A0 E0 04 00
D [24/Apr/2020:16:29:19 ] [Job 4] Read 4 bytes of print data...
D [24/Apr/2020:16:29:19 ] [Job 4] CUPS_SC_CMD_DRAIN_OUTPUT received from driver...
D [24/Apr/2020:16:29:19 ] [Job 4] Wrote 4 bytes of print data...
D [24/Apr/2020:16:29:19 ] [Job 4] CAPT: waiting for 6 bytes
D [24/Apr/2020:16:29:19 ] [Job 4] Read 6 bytes of back-channel data...
D [24/Apr/2020:16:29:19 ] [Job 4] CAPT: waiting for 6 bytes
D [24/Apr/2020:16:29:19 ] [Job 4] Read 6 bytes of back-channel data...
D [24/Apr/2020:16:29:19 ] [Job 4] CAPT: recv A0 E0 0C 00 00 8A 00 00 0F 00 00 00
I [24/Apr/2020:16:29:20 ] Expiring subscriptions...

See this comment (18797c4#r38716893) in the original conversation for details.

Print job stuck at "Rendering completed" status

Hi!
Thanks for your job.
Please, help me.
The cups were stuck after status: "Rendering completed". This is the rasbian on raspberry 3 b+ (Raspbian GNU/Linux 10 Linux octopi 5.10.52-v7+ #1441 SMP Tue Aug 3 18:10:09 BST 2021 armv7l GNU/Linux)
But your repo was perfect worked on my notebook with ubuntu x86_64.

D [25/Oct/2021:15:11:13 +0100] [Job 39] CAPT: rastertocapt: start job
D [25/Oct/2021:15:11:13 +0100] [Job 39] CAPT: send  A1 A1 04 00
D [25/Oct/2021:15:11:13 +0100] [Job 39] Read 4 bytes of print data...
D [25/Oct/2021:15:11:13 +0100] [Job 39] CUPS_SC_CMD_DRAIN_OUTPUT received from driver...
D [25/Oct/2021:15:11:13 +0100] [Job 39] Wrote 4 bytes of print data...
D [25/Oct/2021:15:11:13 +0100] [Job 39] CAPT: waiting for 6 bytes
D [25/Oct/2021:15:11:13 +0100] [Job 39] Read 6 bytes of back-channel data...
D [25/Oct/2021:15:11:13 +0100] [Job 39] CAPT: waiting for 50 bytes
D [25/Oct/2021:15:11:13 +0100] [Job 39] Read 50 bytes of back-channel data...
D [25/Oct/2021:15:11:13 +0100] [Job 39] CAPT: recv  A1 A1 38 00 00 0B 31 2A 01 01 F0 FF 40 00 04 00
D [25/Oct/2021:15:11:13 +0100] [Job 39] CAPT: 41 00 01 00 D0 02 00 00 6F 08 00 00 E4 0D 00 00
D [25/Oct/2021:15:11:13 +0100] [Job 39] CAPT: 00 00 00 00 FA 02 00 00 F6 04 00 00 28 3C 32 32
D [25/Oct/2021:15:11:13 +0100] [Job 39] CAPT: 58 02 58 02 15 03 02 00
D [25/Oct/2021:15:11:13 +0100] [Job 39] Rendering completed
D [25/Oct/2021:15:11:13 +0100] cupsdMarkDirty(---J-)
D [25/Oct/2021:15:11:13 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [25/Oct/2021:15:11:13 +0100] [Job 39] Set job-printer-state-message to "Rendering completed", current level=INFO
D [25/Oct/2021:15:11:13 +0100] cupsdMarkDirty(----S)
D [25/Oct/2021:15:11:13 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [25/Oct/2021:15:11:13 +0100] cupsdMarkDirty(----S)
D [25/Oct/2021:15:11:13 +0100] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] JobProgress
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Notifier] PrinterStateChanged
D [25/Oct/2021:15:11:13 +0100] [Notifier] state=3
D [25/Oct/2021:15:11:13 +0100] [Job 39] PID 1118 (/usr/lib/cups/filter/gstoraster) exited with no errors.
D [25/Oct/2021:15:11:14 +0100] [Job 39] CAPT: send  A0 E0 04 00
I [25/Oct/2021:15:11:14 +0100] Expiring subscriptions...
D [25/Oct/2021:15:11:14 +0100] [Job 39] Read 4 bytes of print data...
D [25/Oct/2021:15:11:14 +0100] [Job 39] CUPS_SC_CMD_DRAIN_OUTPUT received from driver...
D [25/Oct/2021:15:11:14 +0100] [Job 39] Wrote 4 bytes of print data...
D [25/Oct/2021:15:11:14 +0100] [Job 39] CAPT: waiting for 6 bytes
D [25/Oct/2021:15:11:14 +0100] [Job 39] Read 6 bytes of back-channel data...
D [25/Oct/2021:15:11:14 +0100] [Job 39] CAPT: recv  A0 E0 06 00 88 00
D [25/Oct/2021:15:11:14 +0100] [Job 39] CAPT: send  A2 A3 04 00
...

MF3010 support [UFRII]

Is it possible to add MF3010 support?

lsusb :

Bus 003 Device 004: ID 04a9:2759 Canon, Inc. MF3010

grep 'CAPT:' /var/log/cups/error_log :

D [03/Apr/2022:09:05:50 +0000] [Job 1] CAPT: rastertocapt started
D [03/Apr/2022:09:05:50 +0000] [Job 1] CAPT: printer ID string MFG:Canon;MDL:MF3010;CMD:LIPSLX,CPCA;CLS:PRINTER;DES:Canon MF3010;PESP:V1;
D [03/Apr/2022:09:05:50 +0000] [Job 1] CAPT: detected printer \'MF3010\'
E [03/Apr/2022:09:05:50 +0000] [Job 1] CAPT: unknown printer \'MFG:Canon;MDL:MF3010;CMD:LIPSLX,CPCA;CLS:PRINTER;DES:Canon MF3010;PESP:V1;\'
D [03/Apr/2022:09:05:50 +0000] [Job 1] Set job-printer-state-message to "CAPT: unknown printer \'MFG:Canon;MDL:MF3010;CMD:LIPSLX,CPCA;CLS:PRINTER;DES:Canon MF3010;PESP:V1;\'", current level=ERROR

Printer MF3228 encoded data [CCITT G4/CARPS]

Pls help understand encoded data printer MF3228

White pages encoded:
ff ff ff … 00 08 80 A4 300dpi, length 426 bytes
ff ff ff … 00 08 80 A4 600dpi, length 846 bytes
ff ff ff … 00 08 80 A5 300dpi, length 298 bytes

duplicate \xff bytes omitted

Black fill pages:
64 05 74 a0 f8 ff … ff 01 10 00 01 A4 300dpi, length 854 bytes
64 05 7c 40 01 93 ff … ff 1f 00 01 10 A4 600dpi, length 1701 bytes
64 05 da 60 F5 ff … ff 01 10 00 01 A5 300dpi, length 598 bytes

Left vertical black line. Origin top left corner.
All samples with format A4, 300 dpi. Width 2360px, height 3384px
Offset of the printable area relative to the left side (the origin) is 5.165mm.
Pixel width is approximately 0.085mm.
I printed samples with the Inkscape.

example data for width 5.165mm, 1px
64 d5 ff … ff 0f 80 00 08 data length 1274 bytes

hex bytes pixels width, mm end bytes
64 d5 01100100 11010101 1px 5.165 0f 80 00 08
64 fd 01100100 11111101 2px 5.25 07 40 00 04
64 ed 01100100 11101101 3px 5.335 07 40 00 04
64 f5 01100100 11110101 4px 5.42 0f 80 00 08
64 e5 01100100 11100101 5px 5.505 1f 00 01 10
64 a5 01100100 10100101 6px 5.59 1f 00 01 10
64 c5 01100100 11000101 7px 5.675 3f 00 02 20
64 45 01100100 01000101 8px 5.76 7f 00 04 40
64 45 ef 01100100 01000101 11101111 9px 5.843 7f 00 04 40
64 85 fc 01100100 10000101 11111100 10px 5.93 00 08 80
64 85 fe 01100100 10000101 11111110 11px 6.015 00 08 80
64 85 ff 01100100 10000101 11111111 12px 6.1 00 08 80
64 05 66 b0 fe 01100100 00000101 01100110 10110000 11111110 - 35mm 01 10 00 01
64 05 16 20 f9 01100100 00000101 00010110 00100000 11111001 - 42mm 01 10 00 01
64 05 36 60 f2 01100100 00000101 00010110 00100000 11111001 - 52.2mm 02 20 00 02
64 05 6e 30 f3 01100100 00000101 01101110 00110000 11110011 - 105mm 03 20 00 02
64 05 04 fa 01100100 00000101 00000100 11111010 - 157.5mm 03 20 00 02

left_vertical_black_line

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.