mounaiban / captdriver

Driver for Canon CAPT printers
GNU General Public License v3.0
89 stars 16 forks source link

Canon LBP 2900 Printer driver for OpenWrt 18.06.9, r8077-7cbbab7246 (on a TP-Link MR-3020 v1 /w 32MB RAM) #38

Open mohit0121 opened 3 months ago

mohit0121 commented 3 months ago

Would you be kind enough in helping me with a tiny size of this driver, I need to install it on my TPLINK MR-3020 router that has a flash memory of 4 MB only.

mounaiban commented 1 month ago

Hi @mohit0121, thanks for your interest, but this driver is likely unable to work with MR-3020s due to a lack of RAM.

Based on what I know, in short, Captdriver compresses the print data only after your app (spreadsheet, word processor, etc...) has rendered the page to an uncompressed raster. In other words, your print server will have to hold both the uncompressed raster and the compressed raster in memory for every page printed.

If we were to get this driver to work on a memory-constrained system, we would have to compress the page as it is rasterised. This is enabled by creating a GhostScript device (plugin) and deploying it on the device running the user app sending the print requests. This is part of our master plan, but we are yet to find time to get this done. :confused:

So when the app requests a print, CUPS delegates the rasterisation process to the GhostScript device, producing only compressed rasters. Your server will then only ever have to handle the much more space-efficient compressed data and shuttle it to the device.

The Math

An A4 page is roughly 8.3 x 11.7 US inches. At 600dpi, this amounts to 4980 x 7020 px. [Our PPD file]() is set up to render at one bit per pixel, this takes up 34,959,600 px ÷ 8 bits == 4,369,950 bytes (4.16 MiB?), which is pretty fair, but could be more efficient.

In contrast, a typical Hi-SCoA compressed rasterised word processor document is hardly 90K.

You might be mentioning the MR-3020 v1, which has 4MB Flash and 32MB RAM, according to the OpenWrt Wiki.

Thus, a single 1bpp page is over 1/8 the RAM of the device. The discussion on the topic Installing latest OpenWrt on old hardware on the OpenWrt forums suggests that running OpenWrt on 32MB is really pushing it. I am not sure if there will be enough RAM left for CUPS and the uncompressed rasters.

Note

This issue has been previously discussed in #7.

References

Resolution. Apple CUPS PPD Compiler Driver Information File Reference. https://www.cups.org/doc/ref-ppdcfile.html#Resolution

mohit0121 commented 4 weeks ago

Dear @mounaiban Thank you for your response.

I was wondering, what if, I attach a USB Powered Hub along with a USB drive (32 GB) and then do a installation of the said driver, will it work? Like so >> https://openwrt.org/docs/guide-user/additional-software/extroot_configuration

mounaiban commented 4 weeks ago

@mohit0121 extroot seems to be intended to increase available storage memory (Flash), which is helpful, but I think you also need more RAM.

In theory, you might be able to create swap space on external storage devices to free up RAM. However, I don't think OpenWrt has any support for swap space out of the box. You will likely need to undertake some deep customisations to enable this feature. Please be aware that using swap space, if this feature can even be enabled, is only advisable on flash memory devices designed for frequent writing (aka "SSDs").

mohit0121 commented 3 weeks ago

Thank you so much for your quick response. Does this mean, we’re out of luck? ☹ any other alternatives?

mounaiban commented 3 weeks ago

Thank you so much for your quick response. Does this mean, we’re out of luck? ☹ any other alternatives?

Until we implement the Ghostscript device, that's pretty much the case...