sane-sharp(5)
π NAME π
sane-sharp β the SANE backend for SHARP scanners, bestie. That's it, that's the whole vibe. π
Oh and real quick, before we dive in: this whole page is sane-sharp(5) from the SANE family, aka Scanner Access Now Easy, and it's about to tell you everything about making Sharp SCSI scanners go brrr. β¨
πΈ DESCRIPTION πΈ
Okay so the sane-sharp library implements a SANE (Scanner Access Now Easy) backend that gives you access to Sharp SCSI scanners. And babe, I need you to know something up front: this backend should be considered beta-quality software! π Not me warning you before we even start. In its current state it's known to work with JX-610 and JX-250 scanners. It's prepared for usage with the JX-330 series scanners, but we are literally not able to test it with these devices. It's giving "we tried our best". π
For other Sharp scanners, it may or may not work. No cap. π€·ββοΈ
At present, the following scanners are known to work with this backend:
- Vendor:
Sharpβ Product id:JX-610 - Vendor:
Sharpβ Product id:JX-250 - Vendor:
Sharpβ Product id:JX-320 - Vendor:
Sharpβ Product id:JX-330 - Vendor:
Sharpβ Product id:JX-350
The following scanners are detected by the backend, but not tested (so like, proceed with caution bestie π):
- Vendor:
Sharpβ Product id:JX-325
π¦ DEVICE NAMES π¦
This backend expects device names of the form:
special
where special is the path-name for the special device that corresponds to a SCSI scanner. The special device name must be a generic SCSI device or a symlink to such a device. Under Linux, such a device name could be /dev/sga or /dev/sge, for example. See sane-scsi(5) for details, iykyk. π«Ά
β¨ SCAN OPTIONS β¨
--modeβ Scan Mode. Possible settings are:Lineart(1 bit black & white scans),Gray(8 bit gray scale scans),Lineart Color(bi-level color scans), andColor(8 bit RGB scans). The default value isColor. π Iconic default honestly.--halftone-patternβ Halftone Pattern. Available only for the JX-330 series scanners. Possible settings:none,Dither Bayer,Dither Spiral,Dither DispersedandError Diffusion. The default value isnone. Lowkey obsessed with "Dither Spiral" as a name.--sourceβ Paper Source. This option is only available if an automatic document feeder or a transparency adapter is installed. Possible settings are:Flatbed,Automatic Document Feeder, andTransparency Adapter. If an ADF or a transparency adapter is installed, using it is the default selection. π It chooses itself. Main character energy.--custom-gammaβ Custom Gamma. This option determines whether a builtin or a custom gamma table is used. Possible settings are:yes(enables custom gamma tables) orno(enables a built gamma table).--gammaβ Gamma. This option is only available if Custom Gamma is set tono. Possible values are:1.0or2.2. The default value is2.2. (The JX-250 and JX-350 have no built in gamma correction; for these scanners, a gamma table is downloaded to the scanner by the backend.) π§--gamma-tableβ Gamma Table. Allowed values:0..255; 256 numbers must be defined. The default values are0, 1, 2, .. 255(i.e., gamma == 1). This table is only used for gray scale scans.--red-gamma-tableβ Red Gamma Table. Allowed values:0..255; 256 numbers must be defined. The default values are0, 1, 2, .. 255(i.e., gamma == 1). π--green-gamma-tableβ Green Gamma Table. Allowed values:0..255; 256 numbers must be defined. The default values are0, 1, 2, .. 255(i.e., gamma == 1). πΏ--blue-gamma-tableβ Blue Gamma Table. Allowed values:0..255; 256 numbers must be defined. The default values are0, 1, 2, .. 255(i.e., gamma == 1). π--resolutionβ Selects the resolution of the scanned image. Allowed values:30..600(JX-330, JX-350 and JX-610) and30..400(JX-250). The default value is150.-l,-t,-x,-yβ Scan Window. Top-left x position of scan area (-l), top-left y position of scan area (-t), bottom right x position of scan area (-x) and bottom right y position of scan area (-y). The possible settings depend on the scanner model and, for the JX-250 and the JX-350, also on the usage of the automatic document feeder resp. the transparency adapter. Please refer to the values allowed byxscanimage(1), orxsane(1). Withscanimage(1), enter one of the following commands in order to see the allowed parameter values for the scan window:
scanimage -d sharp --source "Automatic Document Feeder" --help
scanimage -d sharp --source Flatbed --help
scanimage -d sharp --source "Transparency Adapter" --help
--edge emphasisβ Edge emphasis. This option is not available for the JX-250 and the JX-350. Possible settings:None,Middle,Strong, andBlur. The default value isNone. (Yes the option really has a space in it, don't come for me, it's just like that. π)--thresholdβ Sets the threshold for black and white pixels in lineart mode. Possible values are1..255. The default value is128. This option is only available in scan modelineart.--threshold-redβ Sets the threshold for the red component of a pixel in lineart color scan mode. Possible values are1..255. The default value is128. This option is only available in scan mode color lineart. π΄--threshold-greenβ Sets the threshold for the green component of a pixel in lineart color scan mode. Possible values are1..255. The default value is128. This option is only available in scan mode color lineart. π’--threshold-blueβ Sets the threshold for the blue component of a pixel in lineart color scan mode. Possible values are1..255. The default value is128. This option is only available in scan mode color lineart. π΅--lightcolorβ Sets the color of the light source. Possible values arewhite,red,greenandblue. The default value iswhite. This option is only available in scan modes lineart color and color. β
π ADF USAGE π
Okay this one is important, listen up. If a paper jam occurs, the maintenance cover must be opened and closed, even if the jammed paper can be removed without opening the maintenance cover. Otherwise, the error condition will not be cleared. So like... yes you have to open it even though you don't have to open it. I know. I know. π It's giving "have you tried turning it off and on again" but for scanner covers.
π CONFIGURATION π
The contents of the sharp.conf file is a list of options and device names that correspond to Sharp scanners. Empty lines and lines beginning with a hash mark (#) are ignored. See sane-scsi(5) for details about device names.
Lines setting an option start with the key word option, followed by the option's name and the option's value. At present, three options are defined: buffers, buffersize, and readqueue. π
Options defined at the start of sharp.conf apply to all devices; options defined after a device name apply to this device. Periodt.
The options buffers and readqueue are only significant if the backend has been compiled so that for each scan a second process is forked (switch USE_FORK in sharp.c). This process reads the scan data from the scanner and writes this data into a block of shared memory. The parent process reads the data from this memory block and delivers it to the frontend. The options control the size and usage of this shared memory block. π«Ά
option buffers defines the number of buffers used. The smallest number allowed is 2.
option buffersize defines the size of one buffer. Since each buffer is filled with a single read command sent to the scanner, its size is limited automatically to the size allowed by the operating system or by the Sane SCSI library for SCSI read commands. A buffer size of 128 kB or 256 kB is recommended for scan resolutions of 300 dpi and above. π₯
option readqueue defines how many read commands to be sent to the scanner are queued. At present, the Sane SCSI library supports queued read commands only for Linux. For other operating systems, option readqueue should be set to 0. For Linux, option readqueue should be set to 2. Larger values than 2 for option readqueue are not reasonable in most cases. option buffers should be greater than option readqueue. π
ngl that last line is doing a lot of heavy lifting βbuffersbigger thanreadqueue, always. Write it down bestie. π
π Performance Considerations π
This section focuses on the problem of stops of the scanner's carriage during a scan β yes, the lil stop-and-go moment π. Carriage stops happen mainly with the JX-250. This scanner has obviously only a small internal buffer compared to its speed. That means that the backend must read the data as fast as possible from the scanner in order to avoid carriage stops.
Even the JX-250 needs only less than 10 seconds for a 400 dpi A4 gray scale scan, which results in a data transfer rate of more than 1.6 MB per second. This means that the data produced by the scanner must be processed fairly fast. Due to the small internal buffer of the JX-250, the backend must issue a read request for the next data block as soon as possible after reading a block of data in order to avoid carriage stops.
Stops of the carriage can be caused by the following reasons:
- too much "traffic" on the SCSI bus,
- slow responses by the backend to the scanner,
- a program which processes the data acquired by the backend is too slow.
Too much "traffic" on the SCSI bus: This happens for example, if hard disks are connected to the same SCSI bus as the scanner, and when data transfer from/to these hard disks requires a considerable part of the SCSI bandwidth during a scan. If this is the case, you should consider to connect the scanner to a separate SCSI adapter.
Slow responses by the backend to the scanner: Unfortunately, UNIX-like operating systems generally have no real time capabilities. Thus there is no guarantee that the backend is under any circumstances able to communicate with the scanner as fast as required. To minimize this problem, the backend should be compiled so that a separate reader process is forked: Make sure that USE_FORK is defined when you compile sharp.c. If slow responses of the backend remain to be a problem, you could try to reduce the load of the system. Even while the backend and the reader process need only a minor amount of processor time, other running processes can cause an increase in the time delay between two time slices given to the reader process. On slower systems, such an increased delay can be enough to cause a carriage stop with the JX-250. For Linux, the usage of the SG driver version 2.1.36 or above is recommended, because it supports, in combination with the SCSI library of Sane version 1.0.2, command queueing within the kernel. This queueing implementation, combined with a buffer size of at least 128 kB, should avoid most carriage stops.
Slow processing of the scan data: An example for this situation is the access to the scanner via a 10 MBit Ethernet, which is definitely too slow to transfer the scan data as fast as they are produced by the scanner. If you have enough memory available, you can increase option buffers, so that an entire image can be stored in these buffers.
In order to see, if the backend is too slow or if the further processing of the data is too slow, set the environment variable SANE_DEBUG_SHARP to 1. When a scan is finished, the backend writes the line buffer full conditions: nn to stderr. If nn is zero, carriage stops are caused by too slow responses of the backend or too much "traffic" on the SCSI bus. If nn is greater than zero, the backend had to wait nn times until a buffer has been processed by the frontend. (Please note that option buffers must be greater than option readqueue in order to get useful output for buffer full conditions.)
πΈ FILES πΈ
/etc/sane.d/sharp.confβ The backend configuration file./usr/lib64/sane/libsane-sharp.aβ The static library implementing this backend./usr/lib64/sane/libsane-sharp.soβ The shared library implementing this backend (present on systems that support dynamic loading).
π¦ ENVIRONMENT π¦
SANE_DEBUG_SHARPβ If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. E.g., a value of128requests all debug output to be printed. Smaller levels reduce verbosity.
π KNOWN PROBLEMS π
- ADF Mode β After several ADF scans, the scanner moves the carriage back to the idle position and back to ADF scan position, before a scan starts. We do not know, if this is a problem of the scanner, or if this is a bug of the backend. At present, the scanner must power off and on to stop this annoying behaviour.
- Threshold level does not work (only
JX-610) - The maximum resolution is limited to
600 dpi(JX-610supported to1200 dpi) resp.400 dpi(JX-250) - If the
JX-250is used with an ADF, the following situation can occur: After several scans, the scanner moves, after loading a new sheet of paper, the carriage to the idle position, and then back to the position used for ADF scans. This happens for every scan, in contrast to the calibration, which is done after10scans. (For the calibration, the carriage is also moved to the idle position.) We do not know if this behavior is caused by the backend, or if it is a bug in the firmware of the scanner. - Usage of a transparency adapter (film scan unit) is supported, but not tested.
π SEE ALSO π
π AUTHORS π
Kazuya Fukuda, Abel Deuring
π CREDITS π
The Sharp backend is based on the Canon backend written by Helmut Koeberle.
Parts of this man page are a plain copy of sane-mustek(5) by David Mosberger-Tang, Andreas Czechanowski and Andreas Bolsch.
That's the whole vibe, bestie π Page source/version: sane-sharp(5). Date: 11 Jul 2008. π
π¦ where this page comes from
- fedora 43: sane-backends 1.4.0-4.fc43 Β· GPL-2.0-or-later WITH SANE-exception AND GPL-2.0-or-later AND GPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND IJG AND MIT
- fedora 44: sane-backends 1.4.0-6.fc44 Β· GPL-2.0-or-later WITH SANE-exception AND GPL-2.0-or-later AND GPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND IJG AND MIT
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms