Some colors printed wrong (hpcups, big-endian platform, 3.13.8)

Bug #675936 reported by Nenad Peric
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
HPLIP
Confirmed
Undecided
Unassigned

Bug Description

The color-wheel (testpage.ps.gz) printout has some of the colors wrong.

The printer is HP OfficeJet 6000 (E609a), platform is big endian (Freescale MPC8347E), kernel is 2.6.30.9, HPLIP version 3.10.6, CUPS version 1.3.11. The HPLIP driver used is hpcups.

No hp-check utility installed, sorry.

The problem seems to be in Mode10.cpp, more specifically, ShortDelta is wrongly calculated for big endian platforms. The supplied patch fixes the calculation for big endian, it should also work on little endian, however, this has not been tested.

After the supplied patch, the color-wheel prints OK.

Revision history for this message
Nenad Peric (nenad-peric) wrote :
Revision history for this message
Nenad Peric (nenad-peric) wrote :
Revision history for this message
Yash (yashwant-k-sahu) wrote :

I think last line should be

instead of
+ db = ((lastPixel & 0x0F0)) - ((lastUpperPixel & 0x0F0));

It should be
+ db = ((lastPixel & 0x0FF)) - ((lastUpperPixel & 0x0FF));

Please test it and let me know your result.

Thanks and Regards
Yashwant

Revision history for this message
JoergAtHPLIP (hplip-worldwartweb) wrote :

Hello,

I've exactly the same problem, on my ARM based QNAP TS119 NAS. I'am using CUPS 1.4.5 with HPLIP 3.10.9 and a HP Deskjet 5550.

I just tried the patch (both versions with 0x0F0 and 0x0FF), but none of them changed anything for me.

Do you now which binary files are influenced by Mode10.cpp, I would like to check that really the new version was installed. Because 'make install' does not do the whole installation on my platform and I always had to do various manual copy operations. But I'am not aware of any old file in the moment.

Best Regards,
Jörg

Revision history for this message
Nenad Peric (nenad-peric) wrote :

Yash:
Sorry about that, you are 100% right, it should be:
+ db = ((lastPixel & 0x0FF)) - ((lastUpperPixel & 0x0FF));

The printout looks the same as in "AfterPatch150.png", at least to the naked eye.

Revision history for this message
Nenad Peric (nenad-peric) wrote :

JoergAtHPLIP:
AFAIK "Mode10.cpp" is part of the "hpcups" filter, so you might want to check that one.

Revision history for this message
Nenad Peric (nenad-peric) wrote :

Added fix suggested by Yash.

Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

Thanks Nenad Peric for the patch.
can you please let us know "autoconf" package's version installed on your machine and the processor details?

Thanks,
Naga Samrat Chowdary, Narla

Revision history for this message
JoergAtHPLIP (hplip-worldwartweb) wrote :

Hello,

I compiled everything again, and checked that hpcups is really replaced by the patched version, but unfortunately it doesn't solves my problem.
I also printed a testpage again and found out that the my failure looks different. I also have a completely wrong Color Wheel and color failures in the hp logo, but it's not the same failure as in your picture.
I think my problem is something different. Maybe an other Big Endian Problem.

Best Regards,
Jörg

Revision history for this message
Nenad Peric (nenad-peric) wrote :

The "autoconf" package version is 2.63

Processor is basically a PowerPC 603e with larger caches.
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC8347E&fsrch=1&sr=3

Revision history for this message
Yash (yashwant-k-sahu) wrote :

I moved the fix to appropriate place at prnt/hpcups/CommonDefinitions.h, as it will be applicable to many printing classes
Nenad please apply the patch and let me know the result, I will apply the patch in our trunk it everything is fine

Joerg, I hope you are using hpcups print path for hpijs also I will apply similar fix. Please try with this new patch as I have moved the fix to more appropriate place.

Revision history for this message
Yash (yashwant-k-sahu) wrote :
Revision history for this message
JoergAtHPLIP (hplip-worldwartweb) wrote :

Hi Yash,

unfortunately, this patch doesn't solved my color problem too, and I'm using hpcups and not hpijs. Seems my color problem is something different.

Best Regards,
Jörg

Revision history for this message
Yash (yashwant-k-sahu) wrote :

Jorg, Can you please log a new bug regrading this with error bitmaps and log files.

Revision history for this message
Yash (yashwant-k-sahu) wrote :

Nenad can you please test it and confirm, I will add this is in trunk.

Revision history for this message
Nenad Peric (nenad-peric) wrote :

Yash, I will try the patch, but I can not do it before monday as I'm currently away.

Revision history for this message
Nenad Peric (nenad-peric) wrote :

Hi Yash,

I finally got around to try the CommonDefinitions patch.

Unfortunately, the results are not good. The printout is completely red, as if the paper is actually red. The only other visible color is black (color wheel, gray ramp, degree radial lines and all text).

Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

Peric,
Can you please run the following command (on original source code and without apply any patch) and let us know the results.

tar -xvf hplip-3.10.9.tar.gz
cd hplip-3.10.9
./configure --prefix=/usr
make
sudo make install

Thanks,
Naga Samrat Chowdary, Narla

Revision history for this message
Nenad Peric (nenad-peric) wrote :

Narla,

I can not use the exact configure line you specified because I have to cross compile the code, but it is in the same ball park. The scanned printout without any patch applied is in my first attachment labeled "Before the patch".

Revision history for this message
Thomas (t-wolf-ch) wrote :

I just ran into the same bug. Again on a big-endian platform (Freescale QuoriQ e500v2; Linux Kernel 2.6.32.12, CUPS 1.5.4, hpcups 3.13.7). HP OfficeJet 4500 G510n-z (a pcl3gui2 printer) showed the same symptoms when printing from this platform.

The problem is indeed in Mode10.cpp, and Nenad's patch for this is spot-on.

Mode10 uses an endian-agnostic encoding of RGB as a single uint32_t. Using in Mode10::ShortDelta() the endian-dependent macros GetRed, GetGreen, GetBlue is therefore just wrong and fails on big-endian platforms. It works by chance on little-endian platforms because the Mode10 internal encoding corresponds to that.

Unfortunately I discovered this bug report here only after having spent considerable time to debug, track down, and fix this myself. I arrived at the exact same fix as Nenad.

The patch for CommonDefinitions.h is wrong, not needed, and should not be used. Other parts of the code depend on the macros being endian-dependent, in particular ErnieFilter.cpp.

I am a bit surprised that such a glaring bug with an obvious fix is still not fixed in the latest hpcups? (3.13.7 at this time)

Revision history for this message
Thomas (t-wolf-ch) wrote :

Looking at the hplip 3.13.8 sources (appears they were published this morning; what a coincidence) this problem also still exists in hplip 3.13.8.

Changed in hplip:
status: New → Confirmed
summary: - Some colors printed wrong (hpcups)
+ Some colors printed wrong (hpcups, big-endian platform, 3.13.8)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.