4 ms·
WebAssembly+WebUSB port of the SANE scanner library
- dvh 3y agoMany years ago friend gave me broken SCSI scanner. It always said "paper jammed". I thought I just short or remove the paper sensor but it wasn't simple kind of sensor, there were two and from the delay it decided whether the paper was jammed or not. So I downloaded the source code of SANE, find the offending error message, commented it out and scanner worked without issue.
- AshamedCaptain 3y agoI had one of these stupid AMD graphics cards (I think from the Evergreen generation) where the GPU/memory clocks would be locked in at the highest frequency whenever you had a second monitor plugged in. Apparently some sort of graphical glitches would be possible otherwise. In their infinite wisdom, AMD decided it was worth an extra 20W of baseline power consumption to avoid these glitches. (I am told they still do this as of today). So I went the radeon kernel driver, and simply commented out that part. Never had a single glitch for the entire lifetime of the card, but oh god I did enjoy the silent fan-free operation. And people wonder why I'm a staunch fanatic of free software.
- chaxor 3y agohttps://gifrific.com/wp-content/uploads/2014/03/Why-Does-it-Say-Paper-Jam-Office-Space.gif https://gifrific.com/wp-content/uploads/2014/03/Why-Does-it-...
- jmillikin 3y agoIMO one of the biggest opportunities for WASM is printer and scanner drivers. These things have historically been distributed as native code, so the usability of the hardware on various OSes and architectures is spotty[0]. WASM is close enough to a native binary (fast, not source[1]) to be accepted by hardware vendors, but is inherently architecture-independent and in principle could be built to an OS-indendent API. Imagine sharing the exact same drivers for tens of thousands of devices across Windows, Mac, Linux, and every other OS that might exist in the future! The same applies to webcams, screensavers (with WebGL/WebGPU), audio processing plugins, and any other software that doesn't come bundled into the OS and doesn't have a UI as such. The utility of WebASM for non-Web use cases is incredible. [0] My scanner is by Epson, who have good Linux support, but the driver was built against an ancient GNU libc that's no longer distributed by Debian/Ubuntu. And it's amd64, so I can't use a RaspberryPi as a scan server. [1] I prefer open source when available, but hardware vendors often have cultural or contractual blocks against open-sourcing their drivers.
- gregsadetsky 3y agoI was just asking about this in a thread about a driver for an old webcam here yesterday! [0] Absolutely agreed, it really seems like a fascinating possibility. What’s your take on how WASM drivers (meant to run in a web browser) could integrate at the OS level? For instance, if you wanted all installed desktop softwares to be able to print via the WASM printer driver? [0] https://news.ycombinator.com/item?id=35745652 https://news.ycombinator.com/item?id=35745652
- RReverser 3y agoBrowser ports can't integrate at OS level, they're intentionally separated today, but given that e.g. Node.js has WebUSB support (https://github.com/node-usb/node-usb https://github.com/node-usb/node-usb), I guess you could make a layer that exposes such Wasm drivers as native to the OS. Could be a fun experiment.
- jmillikin 3y agoApplication software would still go through the OS native printing APIs. Office or Chrome don't directly interact with the vendor's driver. As for browser API compatibility, I don't see much point to it since they're mostly designed with the assumption of a JS host. Ideally a WASM driver would export low-level functions to translate from (for example) PostScript to USB packets. Then the underlying native driver (Linux kernel module, Windows dll, etc) runs the WASM and handles all the IO, calling exported WASM functions as needed.
- Brian_K_White 3y agoI don't see any reason why wasm can't just become another native format. wasm spec is fully defined and public, and we even already have source for browsers. What prevents developing a wrapper or shim that runs any wasm as if it were any other native executable? You might be legally prevented from redistributing the wasm, so maybe you can't bundle it right into a .deb or.rpm, but it's trivial in that case to just download on the fly if not exist and re-use after that. You may want it to check for updates all the time anyway.
- NoZebra120vClip 3y agoI just purchased a Chromebook, and it won't detect the scanner of my HP multifunction. Is this software my salvation?
- RReverser 3y agoChromebook is probably the perfect target for those kinds of ports. Definitely worth giving a try, hopefully SANE supports it.
- goncalomb 3y agoThis is the list of possible supported devices right now (USB only): http://www.sane-project.org/sane-backends.html http://www.sane-project.org/sane-backends.html But HP is a special case, they provide their own backend (hpaio, open-source) for SANE that is not integrated into sane-wasm ATM. http://www.sane-project.org/lists/sane-backends-external.html#S-HPAIO http://www.sane-project.org/lists/sane-backends-external.htm... If your device is on this list, it's NOT supported right now! But I do want to add hpaio soon, I also have access to an OfficeJet to test.
- dwaite 3y agoThis is interesting, however to pour a bit of water on the opportunities here: - CUPS has existed for over 20 years - Java has existed for over 25 years However, I still not use CUPS or similar systems on Windows. And Java-based (or other VM-based) printer drivers have never been a thing AFAIK, on any platform. There are however platform independent device support at a lower level, e.g. OpenFirmware and EFI. This is usually not leveraged post-boot.
- goncalomb 3y agoHi. I'm the port author. I'm not really active here on HN, but thanks for all the clicks.
- amaccuish 3y agoNow the IPP-Anywhere / driverless IPP, AirPrint, and driverless scanning is a thing, I think this is sadly too late. Go to the Drivers page on Brother's website, and for any recent macOS version, the answer is, "just use AirPrint".