SimulPiscator / AirSane

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

Mopria Android Crashes with AirSANE #15

Closed markosjal closed 5 years ago

markosjal commented 5 years ago

Testing with Mopria Android , the program crashes and closes. Wireshark reveals that It Sent ScannerStatus.xml just before the crash. So it looks like possibly someting in ScannerrStatus.xml is causing the crash.

Since Mopria is involved in defining these standards it seems compatibility should be a priority

SimulPiscator commented 5 years ago

I've been testing AirSane against the current version of the Mopria Scanner App, and found it working.

markosjal commented 5 years ago

It crashes on me . You might try the test backend and see if it crashes there.

SimulPiscator commented 5 years ago

Thanks, it crashes for me with the test backend as well. I experimented for a while and found that the crash is related to the fact that the test backend provides a resolution range rather than discrete resolutions. I guess Mopria is just not aware of resolution ranges, and crashes for this reason. MacOS 10.14 is happy with the resolution range, so I think it's a bug in Mopria.

markosjal commented 5 years ago

there was something I saw in ScannerCapabilities that seemed not right and when on test backend I saw something like

I think I have seen profiles, but not with the name option. As for the ranges I did not notice that nor where it came from but I do now see 1 1200 1 I think though it is a sure bet that if the test back-end causes a crash other back-ends are likely to as well. I would not guess that the proiblem is unique to the test back-end, but then again most scanners do not allow the definition of ANY DPI rather it is in steps. 75, 300, 600, 1200, etc. Is there a way one can force the ScannerCapabilities xml for testing? That would also help to diagnose what is causing the Mopria Crash being able to tie it down to one specific thing. There may be another use for that in sometimes people may not want documes scanned at any resoulton otherthan say 600 DPI , by editing the xml they could effectively turn off other resolutions. The additional reason might be to keep some clients happy on some back-ends I am not sure that I have seen these resolution ranges in any other XML after looking at many.
SimulPiscator commented 5 years ago

You are right, resolution ranges are unusual but supported by SANE. Also, telling from the disassembled AirScanScanner.app, resolution ranges are defined in the way as written by AirSane.

Of course you are free to modify the AirSane source code in any way that helps you with your debugging purposes.

markosjal commented 5 years ago

When I saw the "profiles" section of the ScannerCapabilities it seemed off. I do not do this kind of code , so I am useless to modify it. Please take into consideration my suggestion to be able to override the Scanner Capabilites xml. In that way one can more easily diagnose thse problem .

SimulPiscator commented 5 years ago

I modified the program so scan resolutions are always reported as a discrete set, rather than a range. This fixed mopria crashes for me.