Bug 107719

Summary: Autodetect camera on startup
Product: [Applications] digikam Reporter: Dik Takken <kde>
Component: Import-Gphoto2Assignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: bobby.culture
Priority: NOR    
Version: 0.7.2   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dik Takken 2005-06-19 12:50:08 UTC
Version:           0.7.2 (using KDE KDE 3.4.1)
OS:                Linux

How about autodetecting connected cameras when Digikam is started? When Digikam detects a camera that is not on the list yet, it could display a nice 'new camera detected' dialog and add it to the list.
Comment 1 Renchi Raju 2005-06-19 20:00:38 UTC
try digikam --detect-camera
Comment 2 Dik Takken 2005-06-19 23:07:39 UTC
Ah, nice..

Unfortunately, this does not resolve this wish because:

* Most people don't start Digikam from commandline, I think
* The dialog does not offer to add the camera to the camera list
* I can't use this command option by default, it will complain whenever I start Digikam when not having a camera connected


Reopen please?
Comment 3 Renchi Raju 2005-06-19 23:24:50 UTC
> * Most people don't start Digikam from commandline, I think
(change your shortcut to include the option)

> * The dialog does not offer to add the camera to the camera list 
the camera is automatically added to the list

> * I can't use this command option by default, it will complain whenever I start > * Digikam when not having a camera connected

use the hotplug scripts provided here: it will fire up digikam with that option whenver a camera is connected.
http://digikam.free.fr/hotplug/howto.html

Comment 4 Dik Takken 2005-06-19 23:42:42 UTC
> use the hotplug scripts provided here

Thanks a lot, that looks cool.

Still, I don't think that modifying desktop files and installing hotplug scripts are things that we can ask all users to do. Things would be much more convenient if:

* Digikam would have a 'Check for connected camera on startup' GUI option
* Digikam would be silent when no camera is detected on startup, except maybe the first time when Digikam is started or when the list of known cameras is still empty.

These features can be made to work right out of the box. That's why I would like to request them in this report.
Comment 5 Renchi Raju 2005-06-19 23:50:46 UTC
reopening. this probably be best handled with hal/media support
Comment 6 Mohd Asif Ali Rizwaan 2005-08-25 20:20:21 UTC
> hal/media support

yes, hal/dbus/pmount detects my digital camera, I can see my camera in Kcontrol, Digikam should also look for camera in kcontrol's Periphera's->digital camera and use it. If more than 1 camera found then digikam should ask for which camera to use. thanks.
Comment 7 mark 2005-09-18 21:55:09 UTC
I ran into a variation of this today with 0.7.2, although from reading the Changelogs, it can't see that it has been addressed in 0.8.0 either.

I wanted digikam to open automatically when I put my Compact Flash card in the card reader, using MandrivaLinux. 

First, I added a new "Camera" in Digikam, since it wasn't detected automatically. 

Then, I knew by editting "/etc/dynamic/user-scripts/digicam.script", I could have Mandriva launch whatever command I wanted when it determined a digital camera card was present. 

I thought "digikam --detect-camera" would be the right thing to open digikam to the import photos screen. 

Here's the bug: "--detect-camera" failed to detect my camera, although there was an entry for it under "Camera" which works perfectly. 

I think the solution is for "--detect-camera" to at least check the existing entries for a working USB mass storage option before it tries any fancier auto-detection. 

Thanks!
Comment 8 caulier.gilles 2007-08-27 14:17:14 UTC
Arnd, Mik,

Sound like an old bug. Right ? Can be closed ?

Gilles
Comment 9 Arnd Baecker 2007-08-27 17:31:37 UTC
looks pretty old ...

Dik, any comment from you on this issue?
Comment 10 Mikolaj Machowski 2007-08-27 18:56:45 UTC
Well, I agree with Dik that current behavior of Digikam isn't good. IMO
#7 is good solution.
Comment 11 Dik Takken 2007-08-27 19:04:51 UTC
Well, I think the wish is still valid. Maybe HAL/Solid can be used to implement this wish.

When a camera is inserted, DigiKam should automagically show the 'download images' dialog. Currently, this requires some scripting to be done by the user (or distro packager) to make it work.
Comment 12 caulier.gilles 2007-08-27 19:12:05 UTC
Dik,

But it run exactly like this under Mandriva 2007 (using KDE3.5.x)

It connect my camera (Minolta Dynax 5D - USB Mass Storage) to m computer, i turn on it. KDE show a dialog to ask you what to you want to do (open in konqueror, open in digiKam, or nothing). Just use open in digiKam and camera interface will apears.

Hotplug tool is used for that (using HAL). The camera is automaticly detected. I never set my camera in digiKam configuration.

What do you want anymore ?

Gilles

Comment 13 Gerhard Kulzer 2007-08-28 12:07:34 UTC
It's the same behaviour here as Gilles describes. I run Debian unstable, hal 0.5.9.1, udev 0.114. The 'open in konqueror, open in digiKam, or nothing' dialog turns up when connecting a camera or a card reader. Even if digikam is already running, it changes to the application and opens the camera GUI.

I'm happy with this mode of operation.

Comment 14 caulier.gilles 2007-08-28 13:17:19 UTC
Note about KDE4 implementation: Marcel have interfaced digiKam with KDE4-Solid technology to detect camera and removable media automaticily. The future is already here...

http://solid.kde.org

I propose to close this bug. Arnd, what do you think about ?

Gilles
Comment 15 Mikolaj Machowski 2007-08-28 16:57:35 UTC
Works only for UMS, not PTP. But OK, in worst case it will be reopened
after release of version for KDE4.
Comment 16 caulier.gilles 2007-08-28 17:11:31 UTC
Mik,

No. Here all work fine too with Gphoto2 camera dirvers which include PTP Mode. I have the chance to have the great Minolta Dynax 5D which can be toogled from UMS to PTP and vis-versa. I have too an old Olympus C3000Z camera which run exclusively with a Gphoto2 driver (not PTP, not UMS)

Perhaps this depand of version of libgphoto2 installed on your computer.

Gerhard, like you have a Canon camera which can be only used in PTP mode, can you confirm this ?

Gilles
Comment 17 Dik Takken 2007-08-28 18:19:35 UTC
Ok, I can confirm it's working when the KDE media daemon is running.

I assume that Solid will take care of launching apps when inserting hardware in KDE4? Or will there be a seperate daemon that uses Solid for this purpose?
Comment 18 caulier.gilles 2007-08-28 18:24:58 UTC
Marcel, 

You know Solid framework better than me. It always use a deamon to run ?

Gilles
Comment 19 Marcel Wiesweg 2007-08-28 19:36:03 UTC
This is the current situation with KDE4 Solid support:

1) Detecting USB mass storage devices and card readers is implemented
2) Actually Kevin Ottens had the same suggestion as this bug report: Make camera detection fully dynamic. After some discussion, and me fighting with the gphoto2 API, there is now a method added in Solid which will allow us to autodetect gphoto2 cameras and call use them with gphoto2. (Due to inconsistencies in the gphoto2 API, this will not be perfect, but there is no way to distinguish two generic PTP cameras plugged in at the same time with gphoto2)
This support waits to be implemented (by me)
3) At least for serial port cameras, the permanent "Add camera manually" will stay. We need to find a way to store last-access information for all other cameras.
4) According to Kevin, the autostarting of apps on plugging of new hardware will be similar to the KDE3 way, but is not ready yet.
Comment 20 caulier.gilles 2007-08-28 19:48:59 UTC
Marcel,

Thanks for these infos.

About point 2): If you will work on camera gui, please wait than i port current code from KDialog to KXmlGuiWindow. Code still under dev. on my computer. I will commits this change during this week. Only cameragui.cpp/.h will be changed. Only KDE4 will include these changes. I have started to fix KDE3 in this way. It's work,  but the code become faster dirty. I prefer to fix only KDE4 and debug hack unstable branch.

About point 3): I have a methodology written in a paper to identify picture already downloaded without to use the DB. I will explain this method in B.K.O on the right file. But i would more information about how to get the UUID of storage media with Solid like you said here:

http://dot.kde.org/1188193687/1188207971/1188210510/1188228162/

Gilles
Comment 21 Gerhard Kulzer 2007-08-28 22:23:52 UTC
reply to #16: yes, it works with PTP canon as described above.

Gerhard
Comment 22 caulier.gilles 2007-08-30 09:59:19 UTC
Arnd,

Agree to close this file ?

Gilles
Comment 23 Arnd Baecker 2007-08-30 10:14:37 UTC
Yes, closing this bug. 
If necessary, it could be re-opened as Mikolaj suggested above.
Comment 24 Bobby 2008-12-20 14:53:49 UTC
What about a camera being automatically detected when plugged in? If I plug in my Canon IXUS then nothing happens. If I do the same on KDE 3.5 then I get a response immidiately.

Start Digikam add camera etc., too boring for a modern DE.
Comment 25 Dik Takken 2008-12-20 16:46:16 UTC
Bobby, please file a seperate bug report with "Solid" in stead of DigiKam. Solid is the part of KDE4 that handles hardware.