sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.31k stars 189 forks source link

No or black video on Win10 using iMac built-in FaceTime HD-Webcam / Airgapped Hardware Wallet dialog slow #1225

Closed schmonet closed 8 months ago

schmonet commented 9 months ago

Hi @craigraw,

first of all, thanks a lot for the nice wallet-app. Looking foreward to use it 👍

I have another camera-issue running Sparrow 1.8.1 under Win 10 Pro x64 22H2 on IMac Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz 3.70 GHz (Bootcamp native install). I am using the buit-in FaceTime HD-Camera that works in all other apps i have (Kamera, Zoom, Browser ...)

After opening the scan-option under Airgapped Hardware Wallet, Sparrow behaves slow/unresponsive in both modes using HD or non HD option, whil only in HD option i get a black preview in the window.

Log says:

2024-01-12 10:00:15,017 ERROR [atomic-processor-1] c.s.s.c.WebcamScanDevice [null:-1] Timeout when requesting image!
2024-01-12 10:00:20,589 ERROR [frames-refresher-[0]] c.s.s.c.WebcamScanDevice [null:-1] Timeout when requesting image!

Don't find any config file in C:\Users\User\AppData\Local\Sparrow\runtime neither at runtime, now after wallet was closed.

any suggestions how i could proceed? Thanks!

craigraw commented 8 months ago

This appears to be a driver issue, although I'm not sure of what is causing it. One thing you might try is another webcam (potentially using your phone as a webcam) as a way to isolate the error. Are you able to check if it works under macOS?

schmonet commented 8 months ago

Thanks @craigraw for getting back. Sure, here are some test results for you:

So, yes you are probably right, that we have a driver issue with the FaceTime HD Camera (built in) only on Windows 10 64Bit, on two different OS-installations. On the Laptop i have some more detailed Logs:

2024-01-15 11:36:46,396 ERROR [JavaFX Application Thread] c.s.s.c.WebcamView [null:-1] Failed to start web cam
com.github.sarxos.webcam.WebcamException: Cannot execute task
    at com.github.sarxos.webcam.capture@0.3.13-SNAPSHOT/com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(Unknown Source)
    at com.github.sarxos.webcam.capture@0.3.13-SNAPSHOT/com.github.sarxos.webcam.WebcamProcessor.process(Unknown Source)
    at com.github.sarxos.webcam.capture@0.3.13-SNAPSHOT/com.github.sarxos.webcam.WebcamTask.process(Unknown Source)
    at com.github.sarxos.webcam.capture@0.3.13-SNAPSHOT/com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.open(Unknown Source)
    at com.github.sarxos.webcam.capture@0.3.13-SNAPSHOT/com.github.sarxos.webcam.Webcam.open(Unknown Source)
    at com.sparrowwallet.sparrow@1.8.1/com.sparrowwallet.sparrow.control.WebcamService$1.call(Unknown Source)
    at com.sparrowwallet.sparrow@1.8.1/com.sparrowwallet.sparrow.control.WebcamService$1.call(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$6(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$7(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.github.sarxos.webcam.WebcamException: Cannot start native grabber!
    at com.sparrowwallet.sparrow@1.8.1/com.sparrowwallet.sparrow.control.WebcamScanDevice.open(Unknown Source)
    at com.github.sarxos.webcam.capture@0.3.13-SNAPSHOT/com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.handle(Unknown Source)
    at com.github.sarxos.webcam.capture@0.3.13-SNAPSHOT/com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(Unknown Source)
    ... 3 common frames omitted
schmonet commented 8 months ago

I have to add that currently i have no other app (than sparrow) on the same Win 10 installations both iMac and Macbook (Intel) which is NOT working with the Built-In FaceTime cameras. I have no problems using the same camera in Window Camera-app, Zoom, Teams, Chrome, Firefox. I assume the issue is depending on com.github.sarxos.webcam which may not be used in those other apps?

craigraw commented 8 months ago

Thanks for the detailed info. While sarxos provides the Java wrapper, the actual driver is provided by OpenIMAJ (https://github.com/openimaj/openimaj/).

I'm a little unsure of what to suggest tbh. It may be worth uninstalling and then reinstalling the camera driver in Device Manager.

schmonet commented 8 months ago

ok, thanks @craigraw after uninstalling the FaceTime driver in device manager on Win 10 and searching for new hadware, the driver is automatically re-installed. After this, sparrow can successfully access the camera to get a valid picture, but unfortunatelly only with having the Use HD Capture feature disabled. I tried Seedsigner with the non HD mode (whatever resolution that is supposed to be), but the QR-code cannot be scanned successfully by sparrow.

Consequently sparrow log says:

2024-01-16 20:41:39,388 ERROR [JavaFX Application Thread] c.s.s.c.FileImportPane [null:-1] Error importing QR
com.sparrowwallet.sparrow.io.ImportException: Could not determine keystore from import

In the Windows camera app i found, that changing the resolution between 720p30 and 1080p30 does not change the effective resolution of the image captured by the camera. besides, going to even lower resolutions like 480p will crop the image to achieve the selected resolution. And .it seems to stick to some fixed focus, no autofocus to get the QR-code clear.

I will try on Mac OS, if the resolution also as bad as under windows, but i assume it is the same. This is really crappy quality for a 1,8 kEUR iMac. Very dissapointing.

I will update here, when i tested under Mac OSX.

schmonet commented 8 months ago

ok, tested under Mac OSX. Although both HD and non HD-Modes work in Sparrow on the FaceTim HD camera. But the effective usable resolution remains unusable for scanning QR codes in both modes. As long as there is no contrast autofocus available, the fixed focus set to logner distances cannot work for scanning the small seedsigner i.e. raspberry display.

schmonet commented 8 months ago

ok, here's my last post for today. I tried DroidCam on both my Android Samsung S10 and on the Win 10 PC running sparrow. Was hoping to use USB-C connection for transfering the smartphone camera picture to the PC, but that didn't work. As usual only WLAN/IP works.

Using the auto focus of the DroidCam app on the Samsung S10 the QR-Code was recognized by Sparrow in seconds from a perfectly sharp picture. Wanted to avoid having this additional complexity and device-in-the middle (all connected to the internet) but it seems i have to live with it, as Apple FaceTime "HD" camera is just simply garbage and hope that SeedSigner workflow is save regardless of the additional device.

Nevertheless thanks @craigraw for your support.

craigraw commented 8 months ago

Thanks for all the feedback. Although you probably know this already, I just tested with a Macbook Pro on non-HD resolution, and the SeedSigner import worked immediately. So it really does look like a problem with iMac camera. Disappointing for such an expensive machine as you say.

Closing this off.