Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 16 Apr 2014, 20:47
All times are UTC - 4
 Forum index » Advanced Topics » Hardware » Printers
How to Use Dynamic PPD's in CUPS
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [15 Posts]  
Author Message
rcrsn51


Joined: 05 Sep 2006
Posts: 8547
Location: Stratford, Ontario

PostPosted: Tue 21 Apr 2009, 08:34    Post subject:  How to Use Dynamic PPD's in CUPS  

Users of CUPS 1.1.23 are familiar with the concept of a static PPD file. Just to be clear, a Postscript Printer Description file is not a printer driver. It is a text file that contains configuration data used by the corresponding driver to process a print job.

Printer drivers can be found in several places. The most basic drivers are compiled inside Ghostscript, which is the main engine of the Linux printing process. If your printer uses one of these drivers, you must get the matching PPD file from linuxprinting.org. You then save the file in /usr/share/cups/model and install the printer.

In Puppy 4.0, BarryK implemented Gutenprint drivers. The printer wizard /usr/sbin/cups_shell generates the set of Gutenprint PPD's and stores them in a subfolder of /usr/share/cups/model. Once a printer is installed, all the PPD's are deleted to save space. This works because the selected PPD is transfered to a permanent location in /etc/cups/ppd.

If a printer uses the HPIJS driver, the PET installer stores a large collection of PPD's in /usr/share/ppd. There is a symlink in /usr/share/cups/model that points to this folder so CUPS can find them.

When you add a printer, CUPS shows you two lists titled Make and Model. These lists are generated by CUPS from all the PPDs that it can find on your system. However, having an appropriate PPD does not guarantee that you also have the necessary driver required by your printer.

In CUPS 1.2, dynamic PPD's were introduced. These files are generated on-the-fly so there is no need to have a permanent store of static PPD's on your hard drive.

In Puppy 4.2, the Gutenprint PPD's are now dynamic. When CUPS is launched, it starts a daemon called cups-driverd. It looks for static PPD's in the usual places, then goes to /usr/lib/cups/driver and finds the Gutenprint PPD generating program. The individual PPD's are created from XML data located in /usr/share/gutenprint/5.2. If you look at the cups_shell script in Puppy 4.2, you will notice how the cups-genppd.5.x program is no longer invoked to make static PPD's.

This brings us to HPIJS. In addition to downloading its static PPD's, the HPIJS installer also saves the file /usr/share/cups/drv/hp/hpijs.drv. This is the database for building dynamic HPIJS PPD's. So in Puppy 4.2 with CUPS 1.4b, you can delete all the static PPD's in /usr/share/ppd and CUPS will still add a printer. But if you look in /usr/lib/cups/driver, there is no corresponding PPD generator program! This is because the 1.4b cups-driverd daemon contains the code needed to construct dynamic HPIJS PPD's.

But what if you want to downgrade to the stable CUPS 1.3.9? In that case, you need to manually install the HPIJS PPD generator. It comes from the CUPS Driver Development Kit and is contained in the cupsddk-1.2.3-i486.pet attached to this document. Here is how to get it working:

Go here and follow the steps for setting up CUPS 1.3.9. This will include installing the HPIJS PET from the Puppy Package Manager and applying the Foomatic -U patch.

Go to /usr/share/ppd and delete the hp folder containing the static PPD's.

Install the cupsddk-1.2.3-i486.pet. Now when you look in /usr/lib/cups/driver, you will see a program called "drv". This is the HPIJS PPD generator.

Go to the /tmp folder and check its properties. The permissions must be set to all-writable.

Restart CUPS and install a printer.
cupsddk-1.2.3-i486.pet
Description 
pet

 Download 
Filename  cupsddk-1.2.3-i486.pet 
Filesize  186.12 KB 
Downloaded  733 Time(s) 

Last edited by rcrsn51 on Thu 14 May 2009, 10:05; edited 8 times in total
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Tue 21 Apr 2009, 10:03    Post subject:  

Can you think of a downside to doing it this way?
_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Tue 21 Apr 2009, 10:31    Post subject:  

Worked perfectly. Operation gave back 2MB of pupsave space. /tmp permissions were already correct on my system. Thanks for this, it makes things a bit easier to understand. For me, printing on 4.2 has gone from being poor to being excellent. Heck, I can even cancel a job now!
I am using an HP Photosmart C4380 wifi printer.

_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 8547
Location: Stratford, Ontario

PostPosted: Tue 21 Apr 2009, 13:30    Post subject:  

Glad to help.
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Tue 21 Apr 2009, 14:00    Post subject:  

Question please: if I continue with the static drivers, can I go in to /usr/ppd, and delete all the drivers EXCEPT the one specific to my printer? Just curious. Seems from what you say that I can........
_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 8547
Location: Stratford, Ontario

PostPosted: Tue 21 Apr 2009, 14:16    Post subject:  

Once you have installed a printer, its PPD file is transferred to the folder /etc/cups/ppd and given the name that you selected to define the printer. So you can delete ALL the PPD files in /usr/share/ppd.

This is what happens automatically in Puppy 4.1.x with static Gutenprint PPD's via the cups_shell script. In the case of HPIJS, you would have to reinstall the PET package to get the static PPD's back if you needed to change printers. But if you have the dynamic PPD generator in play, they would always be available.
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Mon 27 Apr 2009, 09:42    Post subject:  

I ran this on one of my 4.2 systems, basically just installing the hpjis package, then deleting /ppd. I updated the filter with -U, and installed my printer via the wizard, keeping CUPS 1.4b2, but installed the fixed config file. So far so good, but printing is def slower than 1.3.9. Interestingly, the interface for CUPS is also olive colored, which I guess comes from the .config file Very Happy
So question: The -U mod is key in making this work. Is there a situation in 4.2 where making that mod would cause problems? Could it be done by default in the iso? Do you think hpijs minus ppds should also be in the default .iso?
ps: 1.4b2 finds my network printer automatically, though I chose to install it manually. Will have a go later today at accepting the 'found' printer, which previously failed to work. 1.3.9 cannot do this, so I guess when the bugs get ironed out, 1.4 will be easier for beginners.

_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 8547
Location: Stratford, Ontario

PostPosted: Mon 27 Apr 2009, 10:08    Post subject:  

The -U patch is being applied to the file foomatic-rip-hplip which is part of the HPIJS PET. The file does not exist in the standard ISO.

Since the file is only used by HPIJS/HPLIP devices, I can't see any downside to patching it.

The better solution is for the maintainer of the HPIJS package in the repository to apply the patch there. In fact, it may be possible to compile HPIJS to eliminate the need for this file altogether and use the new version of Foomatic in Puppy 4.

However, in the same way that Gutenprint is now included in Puppy, it would make sense to add HPIJS with dynamic PPD's. But I expect that such an addition would put Puppy over the magic 100 MB mark, so there might be some resistance.

Your observation about printing being slower in 1.4b2 than in 1.3.9 is interesting. Most of the problems I have observed were related to adding/modifying/deleting a printer, not when it was in actual use.
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 8547
Location: Stratford, Ontario

PostPosted: Mon 27 Apr 2009, 12:11    Post subject:  

As a test, I compiled a version of HPIJS that has dynamic-only PPD's and doesn't use foomatic-rip-hplip.

I ran it in Puppy 4.2.1 downgraded to CUPS 1.3.10 with the "drv" add-on installed to enable dynamic PPD's. It works fine and doesn't need any -U patching.

The current hpijs-static PET from the repository is 2737 KB. My dynamic-only PET is 577K. Uncompressed, it adds about 2 MB to the size of Puppy.

There may be a caveat to this. It looks like HPIJS must be compiled against the specific version of CUPS with which it will be eventually run. But if it was included with Puppy, that wouldn't matter.

Last edited by rcrsn51 on Mon 27 Apr 2009, 13:00; edited 2 times in total
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Mon 27 Apr 2009, 12:37    Post subject:  

Certainly if it were included at .iso it would dramatically widen the number of printers that would set up trouble free. I ran the auto-detect install process and it found my printer, and after installation it prints just fine (1.4b2). So far so good. Will try abusing it and doing stupid things to check on how robust it is.................
_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Mon 27 Apr 2009, 15:41    Post subject:  

Proving very robust. Deleting/installing printers, deleting jobs, installing auto-detected printers, modifying printers all trouble free with no log in rqd. Cool.
_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 8547
Location: Stratford, Ontario

PostPosted: Mon 27 Apr 2009, 15:50    Post subject:  

I'm curious. After you have modified/deleted printers, what happens when you add a new one? What does your list of Manufacturers look like? Because mine repeatedly gets scrambled/duplicated. This is with 1.4b2.

Also, a Modify operation will always hang up on my system.
Quote:
the interface for CUPS is also olive colored

Are you sure that you're running CUPS 1.4b2?
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Mon 27 Apr 2009, 17:00    Post subject:  

rcrsn51 wrote:
I'm curious. After you have modified/deleted printers, what happens when you add a new one? What does your list of Manufacturers look like? Because mine repeatedly gets scrambled/duplicated. This is with 1.4b2.

Also, a Modify operation will always hang up on my system.
Quote:
the interface for CUPS is also olive colored

Are you sure that you're running CUPS 1.4b2?

Definitely 1.4b2. Even if the listing at the top of the window were somehow wrong, the interface and especially the options are different from 1.3.9. Yes the list gets scrambled/duplicated also the available drivers are listed twice. The system does not hang after/during modify process though.

_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 8547
Location: Stratford, Ontario

PostPosted: Mon 27 Apr 2009, 19:23    Post subject:  

Now I see where the olive colour comes from. I'm betting that you installed 1.3.9, then uninstalled it to get back to 1.4b2. The background colour is an artifact.
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Tue 28 Apr 2009, 01:09    Post subject:  

rcrsn51 wrote:
Now I see where the olive colour comes from. I'm betting that you installed 1.3.9, then uninstalled it to get back to 1.4b2. The background colour is an artifact.

Correct. Wonder if any other effects of that are being felt.

_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [15 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Hardware » Printers
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0676s ][ Queries: 13 (0.0044s) ][ GZIP on ]