This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Device Notifier does not show my camera

Tags: None
(comma "," separated)
User avatar
yecril71pl
Registered Member
Posts
16
Karma
0
OS
When I connect my camera (I have two different ones) to the computer, there is no notification. The camera is neither in Places nor in the Device Notifier. It is visible in System Settings and accessible via <URL: camera:/ >but I have to add this place by hand. Is it just me or is it a problem in KDE?
Also, the Add New Device Shortcut dialog box allows me to select a camera for the target device but then it looks for the camera device to be mounted among the file systems :o
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
With each camera connected to the computer, please try running the following command to see if it is being recognised by the device backend, which is likely UDisks / UDisks2.
Code: Select all
solid-hardware query 'IS Camera'


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
franku
Registered Member
Posts
33
Karma
0
OS
I have the same problem with my Canon PowerShot SX120 IS. If i turn on the camera, the device notifier does'nt show the actions of Digikam, Gwenview or Dolphin. The kio-slave (camera:/) works well, and download the Fotos manually with Digikam works also. The camera is recognized by gphoto2 but not by solid-hardware:
Code: Select all
solid-hardware listen
just prints nothing if i turn on the camera. But udev does:

Code: Select all
udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[5077.662572] add      /devices/pci0000:00/0000:00:02.1/usb2/2-8 (usb)
KERNEL[5077.662655] add      /devices/pci0000:00/0000:00:02.1/usb2/2-8/2-8:1.0 (usb)
UDEV  [5077.681178] add      /devices/pci0000:00/0000:00:02.1/usb2/2-8 (usb)
UDEV  [5077.693035] add      /devices/pci0000:00/0000:00:02.1/usb2/2-8/2-8:1.0 (usb)


A
Code: Select all
gphoto --summary
could be found here.

Do i need a specific ptp-udev-rule for this camera? Join a mtp-device (mediaplayer) will show up the device notifier. I've tried to figure out how the interaction of udev, udisks, solid, devicenotifier and deviceactions works, but i miss the point.

I am using an daily updatet arch-linux.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Please find your camera in the output of "solid-hardware list" and then provide the output of "solid-hardware details <udi of camera>"


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
franku
Registered Member
Posts
33
Karma
0
OS
Thanks for your reply :-)

I turn on the Camera, but the camera isn't listed in the output from "solid-hardware list". But there are two failures:
Code: Select all
solid-hardware list                                                             
Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath)                             
Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath)
[some udis]

Don't know if this belongs to my issue.

Edit:
The output from "udiskctl dump" doesn't show the camera to.
franku
Registered Member
Posts
33
Karma
0
OS
Hmmm...

I've made a udev-rule with the gphoto-helper skript "/usr/lib64/libgphoto2/print-camera-list":
Code: Select all
/usr/lib64/libgphoto2/print-camera-list udev-rules version 175 group video mode 0666 > 90-gphoto.rules


It makes a rules-file with all devices gphoto be aware of (snippet with the rule for my camera):
Code: Select all
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="31e0", ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", MODE="0666", GROUP="video"


I played with this rule and verfy it with the hwdb-file under /lib/udev/hwdb.d/20-gphoto.conf. So i changed it to:

Code: Select all
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="31e0", ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="PTP"
(arch-linx has no video-group and GPHOTO2_DRIVER has to be PTP)

Now the device notifier appears with approriate Options (download Fotos with Gwenview/Digikam/open with filemanger)... but it shows two Cameras :o

solid-hardware listen shows two actions too:
Code: Select all
$ solid-hardware listen
Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath)
Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath)
Listening to add/remove events:
Device Added:
udi = '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb2/2-7'
Device Added:
udi = '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb2/2-7/2-7:1.0'


So i rebuild the udev hwdb, to be sure the hwdb.bin contains all the rules from /lib/udev/hwdb.d/. But without my udev-rule the device-notifier do not came up and solid do not recognize the new attached camera.

Any ideas, of whats going wrong here?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
This explains a bit - KDE/Solid is reliant upon UDev, UDisks, etc. to provide correct/detailed information on devices attached to the system.

It is likely that your UDev rule is too wide in scope, which is why you're seeing it twice. To help track down this, please ensure the adjustments are in place, then run the following and provide it's output:
Code: Select all
solid-hardware query "Camera.supportedDrivers == 'gphoto'"


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
franku
Registered Member
Posts
33
Karma
0
OS
With my udev-rule i got this:
Code: Select all
$ solid-hardware query "Camera.supportedDrivers == 'gphoto'"
Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath)
Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath)
udi = '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb1/1-7/1-7:1.0'
udi = '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb1/1-7'


The Command "solid-hardware details udi=" works only for the first udi:
Code: Select all
$ solid-hardware details udi='/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb1/1-7/1-7:1.0'
Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath)
Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath)
udi = 'udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb1/1-7/1-7:1.0'
  parent = ''  (string)
  vendor = ''  (string)
  product = ''  (string)
  description = ''  (string)


With the second udi, no output returns and i have to use "CTRL+c" to get a command line back.

Hope this will help.
franku
Registered Member
Posts
33
Karma
0
OS
Something mysterious: Seems that "solid-hardware details [udi]" works not correct, because it shows nothing, but "solid-hardware list details did.

Code: Select all
$ solid-hardware list details
[...]
udi = '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb2/2-7'                                           
  parent = '/org/kde/solid/udev'  (string)                                                                         
  vendor = 'Canon Inc.'  (string)                                                                                 
  product = 'Canon Digital Camera'  (string)                                                                       
  description = 'Camera'  (string)                                                                                 
  Block.major = 189  (0xbd)  (int)                                                                                 
  Block.minor = 138  (0x8a)  (int)                                                                                 
  Block.device = '/dev/bus/usb/002/011'  (string)                                                                 
  Camera.supportedProtocols = {'ptp'}  (string list)                                                               
  Camera.supportedDrivers = {'gphoto'}  (string list)                                                             

udi = '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb2/2-7/2-7:1.0'                                   
  parent = '/org/kde/solid/udev'  (string)                                                                         
  vendor = ''  (string)                                                                                           
  product = ''  (string)                                                                                           
  description = 'Camera'  (string)                                                                                 
  Camera.supportedProtocols = {'ptp'}  (string list)                                                               
  Camera.supportedDrivers = {'gphoto'}  (string list)


vs:
Code: Select all
$ solid-hardware details udi='/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb2/2-7/2-7:1.0'
Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath)
Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath)
udi = 'udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb2/2-7/2-7:1.0'
  parent = ''  (string)
  vendor = ''  (string)
  product = ''  (string)
  description = ''  (string)

$ solid-hardware details udi='/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb2/2-7'
Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath)
Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath)
udi = 'udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb2/2-7'
  parent = ''  (string)
  vendor = ''  (string)
  product = ''  (string)
  description = ''  (string)


I am shure the camera did not turn off, while examining the commands. For safety i test this two times. As you could see, my last comment in my previous post was not right. Maybe i did it wrong this early, early morning o)

Anyway, i've done it. My udev-rule is enhanced with
Code: Select all
ATTR{serial}=="72AD2F443FDE4157BEFE3DA9BD933CD1"
complete rule:
Code: Select all
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="31e0", ATTR{serial}=="72AD2F443FDE4157BEFE3DA9BD933CD1", ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="PTP"
and is stored as "/etc/udev/rules.d/90-canon.rules"

The additional condition was found in the output "udevadm info --query=all --attribute-walk --name='[busname of device]'". Maybe there are other conditions to minimize the scope so that the device isn't shown twice in the devicemanager. Hints therefore are welcome.

Thanks bcooksley for care about my problem :)

Why does solid not recognize the ptp-device, while mtp-devices are recognized? It's because there is no udev-rule for ptp-devices?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Not a problem. In my experience, PTP devices are usually detected - it is likely your distribution is missing the necessary rules, either for PTP devices in general or just your camera (which might behave unusually).

In regards to the solid-hardware command, try the following:
Code: Select all
solid-hardware details '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:02.1/usb2/2-7'


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
franku
Registered Member
Posts
33
Karma
0
OS
bcooksley wrote: In my experience, PTP devices are usually detected - it is likely your distribution is missing the necessary rules, either for PTP devices in general or just your camera (which might behave unusually).

I could not say, if ptp-devices are generally not recognized. I am using arch-linux, maybe i ask in an arch-related forum.

Your last command works as expected.

I edited my udev rule, because i found a little mistake: The key name "ATTRS" matches against the upwards device, while "ATTR" (without the S) matches against the device directly. So i changed "ATTRS" with "ATTR", delete the serialnumber and the devicemanager shows only one camera :-)

Code: Select all
ATTR{idVendor}=="04a9", ATTR{idProduct}=="31e0", ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="PTP"


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar