SimulPiscator / AirSane

Publish SANE scanners to MacOS, Android, and Windows via Apple AirScan.
GNU General Public License v3.0
243 stars 26 forks source link

Failing on second use #93

Closed HenrikSolver closed 1 year ago

HenrikSolver commented 1 year ago

Thanks for developing this program. I have an issue. Everything works fine first time after starting airsaned, any attempt after fails with airsaned[5009]: libpng error: Invalid IHDR data, aborting or airsaned[4518]: JpegEncoder: bit depth unsupported, aborting.

Airdsaned built from 956ce1e5fba837ba8449b938841a4b88f2746120 runs on Ubuntu 20.04.5 Scanner is a Brother DCP-9020CDW Clients: tried with mac book air, chromebook and the webinterface with the same result.

I'm happy to help with debugging if needed.

HenrikSolver commented 1 year ago

Adding a log file with debug information Second (failing) scan starts at okt 16 16:34:18

okt 16 16:32:48 spencer systemd[1]: Starting AirSane Imaging Service...
okt 16 16:33:03 spencer systemd[1]: Started AirSane Imaging Service.
okt 16 16:33:03 spencer airsaned[6336]: git commit: 956ce1e (branch master, rev 246)
okt 16 16:33:03 spencer airsaned[6336]: build date: 2022-10-16T08:50:30Z
okt 16 16:33:03 spencer airsaned[6336]: start time is 21031.3
okt 16 16:33:03 spencer airsaned[6336]: reading device options from '/etc/airsane/options.conf'
okt 16 16:33:03 spencer airsaned[6336]: enumerating local devices...
okt 16 16:33:03 spencer airsaned[6336]: sane_init(nullptr, nullptr)
okt 16 16:33:03 spencer airsaned[6336]: sane_get_devices() ...
okt 16 16:33:08 spencer airsaned[6336]: ... sane_get_devices() -> SANE_Status Success
okt 16 16:33:08 spencer airsaned[6336]: sane_exit()
okt 16 16:33:08 spencer airsaned[6336]: found: brother4:net1;dev0 (Brother Scanner)
okt 16 16:33:08 spencer airsaned[6336]: stable unique name: brother4:Brother Scanner:1
okt 16 16:33:08 spencer airsaned[6336]: uuid: 9dda9386-f76c-554e-a150-c5e47b92b9dc
okt 16 16:33:08 spencer airsaned[6336]: sane_init(nullptr, nullptr)
okt 16 16:33:11 spencer airsaned[6336]: sane_open(brother4:net1;dev0) -> 0x7f23f0215fb0
okt 16 16:33:11 spencer airsaned[6336]: [source] := "FlatBed"
okt 16 16:33:11 spencer airsaned[6336]: [source] := "Automatic Document Feeder(left aligned)"
okt 16 16:33:11 spencer airsaned[6336]: sane_close(0x7f23f0215fb0)
okt 16 16:33:11 spencer airsaned[6336]: sane_exit()
okt 16 16:33:11 spencer airsaned[6336]: published as 'Brother Scanner'
okt 16 16:33:11 spencer airsaned[6336]: end time is 21039.9
okt 16 16:33:11 spencer airsaned[6336]: startup took 8.58203 secconds
okt 16 16:33:11 spencer airsaned[6336]: listening on 127.0.0.1:8090
okt 16 16:33:11 spencer airsaned[6336]: listening on 192.168.0.153:8090
okt 16 16:33:11 spencer airsaned[6336]: listening on 192.168.123.1:8090
okt 16 16:33:11 spencer airsaned[6336]: listening on [::1]:8090
okt 16 16:33:11 spencer airsaned[6336]: listening on [fe80::c9df:15bc:3827:7a45]:8090
okt 16 16:33:29 spencer airsaned[6336]: document format requested: image/png
okt 16 16:33:29 spencer airsaned[6336]: document format used: image/png
okt 16 16:33:29 spencer airsaned[6336]: job kind: single
okt 16 16:33:29 spencer airsaned[6336]: using grayscale gamma of 0.555555
okt 16 16:33:29 spencer airsaned[6336]: requesting grayscale from backend
okt 16 16:33:29 spencer airsaned[6336]: sane_init(nullptr, nullptr)
okt 16 16:33:35 spencer airsaned[6336]: sane_open(brother4:net1;dev0) -> 0x7f23e8195bc0
okt 16 16:33:35 spencer airsaned[6336]: [source] := "FlatBed"
okt 16 16:33:35 spencer airsaned[6336]: [mode] := "True Gray" -> reload options
okt 16 16:33:35 spencer airsaned[6336]: [resolution] := 200dpi
okt 16 16:33:35 spencer airsaned[6336]: [tl-x] := 0mm
okt 16 16:33:35 spencer airsaned[6336]: [tl-y] := 0mm
okt 16 16:33:35 spencer airsaned[6336]: [br-x] := 210mm
okt 16 16:33:35 spencer airsaned[6336]: [br-y] := 297mm
okt 16 16:33:35 spencer airsaned[6336]: sane_start(0x7f23e8195bc0) with options:
okt 16 16:33:35 spencer airsaned[6336]: [br-x] = 209.981mm
okt 16 16:33:35 spencer airsaned[6336]: [br-y] = 296.973mm
okt 16 16:33:35 spencer airsaned[6336]: [brightness] = 0%
okt 16 16:33:35 spencer airsaned[6336]: [contrast] = 0%
okt 16 16:33:35 spencer airsaned[6336]: [mode] = "True Gray"
okt 16 16:33:35 spencer airsaned[6336]: [resolution] = 200dpi
okt 16 16:33:35 spencer airsaned[6336]: [source] = "FlatBed"
okt 16 16:33:35 spencer airsaned[6336]: [tl-x] = 0mm
okt 16 16:33:35 spencer airsaned[6336]: [tl-y] = 0mm
okt 16 16:33:48 spencer airsaned[6336]: sane_read(0x7f23e8195bc0): End of file reached
okt 16 16:33:48 spencer airsaned[6336]: images completed: 1
okt 16 16:33:48 spencer airsaned[6336]: sane_cancel(0x7f23e8195bc0)
okt 16 16:33:48 spencer airsaned[6336]: sane_cancel(0x7f23e8195bc0)
okt 16 16:33:48 spencer airsaned[6336]: sane_close(0x7f23e8195bc0)
okt 16 16:33:48 spencer airsaned[6336]: sane_exit()
okt 16 16:34:18 spencer airsaned[6336]: document format requested: image/png
okt 16 16:34:18 spencer airsaned[6336]: document format used: image/png
okt 16 16:34:18 spencer airsaned[6336]: job kind: single
okt 16 16:34:18 spencer airsaned[6336]: using grayscale gamma of 0.555555
okt 16 16:34:18 spencer airsaned[6336]: requesting grayscale from backend
okt 16 16:34:18 spencer airsaned[6336]: sane_init(nullptr, nullptr)
okt 16 16:34:19 spencer airsaned[6336]: sane_open(brother4:net1;dev0) -> SANE_Status Invalid argument
okt 16 16:34:19 spencer airsaned[6336]: sane_exit()
okt 16 16:34:19 spencer airsaned[6336]: libpng warning: Image width is zero in IHDR
okt 16 16:34:19 spencer airsaned[6336]: libpng warning: Image height is zero in IHDR
okt 16 16:34:19 spencer airsaned[6336]: libpng warning: Invalid bit depth in IHDR
okt 16 16:34:19 spencer airsaned[6336]: libpng error: Invalid IHDR data, aborting
SimulPiscator commented 1 year ago

Does it work when you use it with scanimage multiple times?

HenrikSolver commented 1 year ago

Yes, Never any problem to use a xsane or gnome document scanner to scan. But I have built and installed airsaned on another ubuntu computer now, and it works without any issues. The only obvious difference is that the first one is connected with WiFi and the last (working) is connected with cable.

SimulPiscator commented 1 year ago

okt 16 16:34:19 spencer airsaned[6336]: sane_open(brother4:net1;dev0) -> SANE_Status Invalid argument

From your protocol, one can see that sane_open() is unable to connect to the scanner, as if it has maybe changed its address? AirSane is unloading SANE each time it gets a scanner's capabilities, or actually scans, so there cannot be a "memory" involved that would explain that it fails the second time each.

HenrikSolver commented 1 year ago

Indeed. There seems to be some issue with network configuration, configuring sane to use the IP address of the scanner instead of the hostname solves the issue. Thanks for the support.