Skip to content
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

Investigating Duplex Issues #26

Open
QORTEC opened this issue Jan 17, 2025 · 1 comment
Open

Investigating Duplex Issues #26

QORTEC opened this issue Jan 17, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@QORTEC
Copy link
Member

QORTEC commented Jan 17, 2025

Due to issues #11 and #22, I've tested printing on both pdewacht and Owl-Maintain:

Operating System Solus 4.6
Desktop Environment KDE 6.2.5
Firefox Version 134.0 (64-bit)
CUPS Version 2.4.11

pdewacht:
brlaser Version: v6
brlaser Commit: 23117fe
Built Locally: Yes
$ eopkg info brlaser
Installed package:
Name                : brlaser, version: 6, release: 0
Summary             : Open-source CUPS driver for monochrome Brother laser printers
Description         : brlaser is an open-source CUPS driver designed specifically for Brother monochrome laser printers and multi-function devices
Licenses            : GPL-2.0-or-later
Component           : drivers.printer
Dependencies        : glibc libgcc cups libstdc++ ghostscript 
Distribution        : Solus, Dist. Release: 1
Architecture        : x86_64, Installed Size: 257.00 KB
Reverse Dependencies: 

Results:

Run Cups Setting Firefox Setting Result Pages
P1 Duplex Off Duplex Off Long 1-2
P2 Duplex Off Duplex Long Short 3-4
P3 Duplex Off Duplex Short Short 5-6
P4 Duplex Long Duplex Off Long 7-8
P5 Duplex Long Duplex Long Short 9-10
P6 Duplex Long Duplex Short Short 11-12
P7 Duplex Short Duplex Off Long 13-14
P8 Duplex Short Duplex Long Short 15-16
P9 Duplex Short Duplex Short Short 17-18

When printing with this driver, all the printed pages resulted in either Duplex Long-edge or Duplex Short-edge. I was unable to print non-duplex.

The printer would print Duplex Long-edge only when the Firefox Two-Sided printing setting was Off, while the other settings (Flip on long edge/Flip on short edge) would print Duplex Short-edge.


Owl-Maintain:
brlaser Version: v6.2.6
brlaser Commit: 0ee2128
Built Locally: No
$ eopkg info brlaser
Installed package:
Name                : brlaser, version: 6.2.6, release: 4
Summary             : Open-source CUPS driver for monochrome Brother laser printers
Description         : brlaser is an open-source CUPS driver designed specifically for Brother monochrome laser printers and multi-function devices
Licenses            : GPL-2.0-or-later
Component           : drivers.printer
Dependencies        : libstdc++ cups glibc libgcc ghostscript 
Distribution        : Solus, Dist. Release: 1
Architecture        : x86_64, Installed Size: 666.00 KB
Reverse Dependencies: 
Run Cups Setting Firefox Setting Result Pages
OM1 Duplex Off Duplex Off Off 1-4
OM2 Duplex Off Duplex Long Long 5-6
OM3 Duplex Off Duplex Short Short 7-8
OM4 Duplex Long Duplex Off Off 9-12
OM5 Duplex Long Duplex Long Long 13-14
OM6 Duplex Long Duplex Short Short 15-16
OM7 Duplex Short Duplex Off Off 17-20
OM8 Duplex Short Duplex Long Long 22-22
OM9 Duplex Short Duplex Short Short 22-24

When printing with this driver, the printing settings in Firefox were respected.


Code related to Simplex/Duplex:

Duplex was introduced in commit 7e59e61 on May 1, 2017. Initial Printer: `DCP-7065DN`

Issues:

  • Incomplete printing when using PCL &l1S

Workaround:

  • Set duplex to &l2S (job.cc)
  • Set Duplex to Rotated (brlaser.drv)
  • Result: &l2S and Rotated functionally mimics &l1S but with extra steps/processing.

Notes:

  • PCL &l1S for printing Duplex Long-edge
  • PCL &l2S for printing Duplex Short-edge
  • Duplex Rotated When printing Duplex Long-edge; the 2nd page will be rotated page 180 degrees
Explicit Simplex in commit d209bac on Mar 14, 2023. Initial Printer: `HL-L2350DW`

Issues:

  • The HL-L2350DW would continue to duplex even when disabled, however the reverse side is unreadable with artifacts
  • The HL-2270DW also continues to duplex even when disabled, except both sides are printed correctly (Note Test Runs P1, P4 & P7)

Workaround:

  • Set &l0S (job.cc)

Notes:

  • PCL &l0S for printing Simplex aka (one-sided)
Tumble was introduced in commit b93c4ad on Mar 14, 2023. Initial Printer: `HL-2300D`

Notes:

  • PCL &l1S for printing Duplex Long-edge
  • PCL &l2S for printing Duplex Short-edge

This commit does not take into account the CUPS drv Duplex Rotated setting.
This results in #22, where Duplex Long-edge actually prints Duplex Short-edge.
This results in #11, where the reverse side is unreadable with artifacts.


After investigating this issue; I've found that the Duplex Rotated setting in brlaser.drv is not being honoured on Solus. :/
This is causing the driver to appear as if it is functioning correctly; however the actual "correct" behaviour would be consistent with Issues #22 or #11.

I've confirmed that this "unexpected" behaviour is not unique to my printer (HL-2270DW). Testing the driver on Fedora resulted in an output consistent with Issue #22.

Also, I've found that the drivers behaviour is identical in both LibreOffice and Firefox; therefore it's unlikely a application specific issue.

@QORTEC QORTEC added the bug Something isn't working label Jan 17, 2025
@QORTEC QORTEC self-assigned this Jan 17, 2025
@QORTEC
Copy link
Member Author

QORTEC commented Jan 21, 2025

Update:

  • With the release of brlaser v6.2.7, Solus no longer duplexes correctly.
  • Solus only honours the duplex PLC settings found in job.cc, ignoring the Duplex Rotated setting in brlaser.drv.
  • Currently Solus only prints in Simplex or Duplex Short-edge.

Workaround:

  • Revert commit fb46385.
  • Optionally:
    • Replace Duplex rotated with Duplex normal:
      This change will not have a functional impact. However, if CUPS starts respecting the duplex settings in brlaser.drv, this change will minimize disruption for most users.

CUPS .drv (PPD):
/usr/share/cups/drv/brlaser.drv

{
  ModelName "HL-2270DW series"
  Attribute "NickName" "" "Brother HL-2270DW series, $USING"
  Attribute "1284DeviceID" "" "MFG:Brother;CMD:PJL,PCL,PCLXL;MDL:HL-2270DW series;CLS:PRINTER;CID:Brother Laser Type1;"
  Resolution k 1 0 0 0 "300dpi/300 DPI"
  Duplex rotated
  PCFileName "br2270d.ppd"
}

Duplex rotated: When printing Duplex Long-edge, the reverse side will be rotated 180 degrees.

Reference: Docs

This results in the following behavior:

  • Duplex Long-edge -> Duplex Short-edge
  • Duplex Short-edge -> Duplex Long-edge

CUPS Filter:
src/job.cc

if (page_params_.duplex || page_params_.tumble) {
    fputs("\033&l2S", out_);
} else {
    fputs("\033&l0S", out_);
}
  • PCL &l2S is used for printing Duplex Short-edge.
  • PCL &l1S is used for printing Duplex Long-edge.
  • PCL &l0S is used for printing Simplex (one-sided).

Reference: PDF (pages 48–49).


Code Path/Logic:

  • For Duplex Long-edge:
    1. Rotate the reverse side by 180 degrees.
    • Resulting output is now Short-edge.
    1. Set the printer to &l2S (Duplex Short-edge).
    • Resulting output is now Long-edge.
  • For Duplex Short-edge:
    1. Set the printer to &l2S (Duplex Short-edge).
    • Resulting output is Short-edge.
  • For Duplex Off:
    1. Set the printer to &l0S (Simplex).
    • Resulting output is one-sided printing.

Reason for the current Long-edge approach:

  • There was an issue printing with &l1S in the past.
  • I cannot test the affected printer to verify if the issue still persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant