-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CUPS backend bug #14
Comments
@ra1nst0rm3d First, great work on fixing that BCD bug. It looks obvious now it has been pointed out, but it's amazing that nobody else caught it for over 9 years, maybe due to lack of opportunity to get really screwed over by the bug. I didn't really pay attention to it as well... The I don't think the LBP3000 I use has that bug that causes it to randomly switch to BCD, but I will still give it a go. I have assumed that LBP3000's don't randomly switch to BCD, but I may stand corrected. While we are still talking about buffers, I have been wanting to try adjusting the size of |
'bout BCD on LBP3k: Anyway, try this with LBP3k. This can work with all types of CAPT printers. 'bout bit-shifting by zero: Maybe, but we need hi & 0x0F anyway :) |
@ra1nst0rm3d I finally got to test your BCD fix on my LBP3000, and 🤬, it actually worked on one of the problem targets I have been working on, ZorinOS (see #4). I lack the knowledge to explain why it works, but it works. This time around, I tested it on the 64-bit version of ZorinOS 16.1. Without the BCD fix, the printer gets stuck. After applying the fix, well, it was able to communicate with the printer, like, 10 times in a row even after restarting the printer and the VM. Kudos to you and your dad! 🙇 Could this be the answer to the stuck printer problem we had for almost 8 years? We'll find out! A preliminary fix has been pushed to the mounaiban/0.1.4.1-RE branch, and I will be inviting the rest of the crew at agalakhov#7 to test it out. I might test this fix with the 32-bit version if I get the time and motivation. The version I used was as follows: static inline uint16_t BCD(uint8_t lo, uint8_t hi)
{
uint16_t a, b, c, d;
a = (hi >> 4) & 0x0F;
b = hi & 0x0F;
c = (lo >> 4) & 0x0F;
d = lo & 0x0F;
if (a > 9 || b > 9 || c > 9 || d > 9)
return WORD(lo, hi);
return a * 1000 + b * 100 + c * 10 + d * 1;
} |
Glad to hear it) |
Tested the BCD fix on Zorin OS 15.3 Lite (32-bit), but this time the printer remained stuck. 🤷 According to the CUPS error log |
Maybe, BCD() needs to be separated for 32-bit and 64-bit? |
Like this:
P.S Checked this with -m32, looks like real solution of our problem. |
Have you tried to uncomment these lines? |
@ra1nst0rm3d Which OS did you use? I tried the I didn't expect it to work, but I was hopeful enough to try it. 😄 In versions before 7709565, we have already been shifting by eight bits in As for uncommenting 153-156 in I might go through |
I'm using Arch |
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:
Simple, won't it? This implementation fixed buffer mismatch on LBP1120. But, my father detected bug in BCD(). True BCD() is here:
The text was updated successfully, but these errors were encountered: