darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.69k stars 1.14k forks source link

not noticing that a camera was disconnected, darktable lists it twice - and stalls when the user tries to use the first instance of the camera #4917

Closed jpellegrini closed 4 years ago

jpellegrini commented 4 years ago

The issue: In the lighttable view, if a camera is already detected, the cable is removed, reinserted and I click on "scan for devices", it will be listed a second time. and a third, fourth times, as many times as I repeat this. Also, if I try to use the "tethered shooting" buttin from the detected-and-removed device, darktable stalls (does not refresh the GUI at all).

To Reproduce:

  1. Go to the lighttable view
  2. Plug in a camera. I did it with a Nikon D3100 (which has limited USB interfacing, but can do tethered shooting)
  3. Click on "scan for devices", and the camera will show up
  4. Disconnect the cable
  5. Connect USB cable again
  6. Click on "scan for devices", and the camera will show up again (will be listed twice)
  7. Try to use the button "tethered shooting' from the first listing (from when the camera was detected for the first time)
  8. Go to the right panel and try to open camera settings. darktable will stall and not refresh the GUI, probably because it is trying to connect to the camera using the USB id that is not active anymore.

Expected behavior: I would expect darktable to notice that the camera is not connected anymore, so this would probably solve both problems: it would not stall trying to access the camera through a USB device that is not active anymore, and would also not list the same camera twice.

Platform:

oleastre commented 4 years ago

I confirm the same behaviour on Darktable >= 3.0.0 (maybe before 3.0.0, but I was not using darktable to directly import from my camera at that time). The problem is not limited to tethering, it also shows when importing images from the camera via USB. Camera in use: Nikon D90.

jenshannoschwalm commented 4 years ago

Yes, this is really a bug and unfortunately the current implementation of camera/card updates and propagated signals is broken since quite a time. I already have an idea about what is wrong and how it can be fixed, there are more issues around related to this.

@TurboGit Please assign me, i will track it down and after fully understanding & fixing will do a pr.

TurboGit commented 4 years ago

Done, TIA.