Автор Тема: Камеры в Linux. общие вопросы фото, web, видео, цифровых и др. камер.  (Прочитано 31713 раз)

Drool

  • Гость
Re: Помогите подключить камеру
« Ответ #45 : 26.04.2009 14:49:19 »
[ventrax@sunduk ~]$ su

Неправильно в рута переключаетесь:
http://www.altlinux.org/Su

ventrax

  • Гость
Re: Помогите подключить камеру
« Ответ #46 : 26.04.2009 15:56:50 »
[ventrax@sunduk ~]$ su -
Password:
[root@sunduk ~]# lsusb -v

Bus 002 Device 002: ID 0458:003a KYE Systems Corp. (Mouse Systems)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0458 KYE Systems Corp. (Mouse Systems)
  idProduct          0x003a
  bcdDevice            1.00
  iManufacturer           1 Genius
  iProduct                2 Optical Mouse
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 HID-compliant MOUSE
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      62
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              10
Device Status:     0x0000
  (Bus Powered)

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0001 1.1 root hub
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.25-std-def-alt8.M41.4 ohci_hcd
  iProduct                2 OHCI Host Controller
  iSerial                 1 0000:00:04.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval             255
Hub Descriptor:
  bLength              11
  bDescriptorType      41
  nNbrPorts            10
  wHubCharacteristic 0x0002
    No power switching (usb 1.0)
    Ganged overcurrent protection
  bPwrOn2PwrGood        1 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00 0x00
  PortPwrCtrlMask    0xff 0xff
 Hub Port Status:
   Port 1: 0000.0303 lowspeed power enable connect
   Port 2: 0000.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
   Port 5: 0000.0100 power
   Port 6: 0000.0100 power
   Port 7: 0000.0100 power
   Port 8: 0000.0100 power
   Port 9: 0000.0100 power
   Port 10: 0000.0100 power
Device Status:     0x0003
  Self Powered
  Remote Wakeup Enabled

Bus 001 Device 003: ID 04a9:3177 Canon, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x04a9 Canon, Inc.
  idProduct          0x3177
  bcdDevice            0.02
  iManufacturer           1 Canon Inc.
  iProduct                2 Canon Digital Camera
  iSerial                 3 D8599EF169A746F1A4E3B4A18F42B5DD
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         6 Imaging
      bInterfaceSubClass      1 Still Image Capture
      bInterfaceProtocol      1 Picture Transfer Protocol (PIMA 15470)
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               9
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.25-std-def-alt8.M41.4 ehci_hcd
  iProduct                2 EHCI Host Controller
  iSerial                 1 0000:00:04.1
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength              11
  bDescriptorType      41
  nNbrPorts            10
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00 0x00
  PortPwrCtrlMask    0xff 0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
   Port 5: 0000.0503 highspeed power enable connect
   Port 6: 0000.0100 power
   Port 7: 0000.0100 power
   Port 8: 0000.0100 power
   Port 9: 0000.0100 power
   Port 10: 0000.0100 power
Device Status:     0x0003
  Self Powered
  Remote Wakeup Enabled
[root@sunduk ~]#     .
                                           

Спасибо за подсказку и терпение.
« Последнее редактирование: 27.04.2009 12:22:00 от Skull »

Оффлайн Jinn

  • alt linux team
  • ***
  • Сообщений: 96
Re: Помогите подключить камеру
« Ответ #47 : 26.04.2009 17:30:10 »
Судя по вышенаписанному, камера должна была распознаться как USB PTP Class Camera,
однако этого не произошло. Правильные права на устройство не были назначены.
Спасибо за сигнал, буду посмотреть.
Кстати, если не трудно, кто-нибудь повесит напоминалку в багзиллу?

Что касается быстрого решения проблемы, можно из-под рута открыть в любом текстовом редакторе
файл /etc/udev/rules.d/90-libgphoto2.rules и по образу и подобию имеющихся
вставить туда следующие две строчки:

# Canon PowerShot A580 (PTP mode)
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="3177", MODE="0660", OWNER="root", GROUP="camera"

Это позволит сервису udev распознать камеру как Canon (idVendor=04a9) PowerShot A580 (idProduct=3177)
(это с ваших слов).

А из группы root пользователя лучше убрать.

ventrax

  • Гость
Re: Помогите подключить камеру
« Ответ #48 : 26.04.2009 18:34:46 »
Сделал так как написано выше, но результата нет - в списке digikam эта модель не появилась.

Оффлайн Jinn

  • alt linux team
  • ***
  • Сообщений: 96
Re: Помогите подключить камеру
« Ответ #49 : 26.04.2009 18:50:49 »
В списке выберите USB PTP Class Camera.
Должно заработать.

ventrax

  • Гость
Re: Помогите подключить камеру
« Ответ #50 : 26.04.2009 19:01:46 »
 Так я так и делал без исправления документа. Просто содержимое камеры можно увидеть только через рут. А хотелось бы чтоб оно автоматом, без всякого рута включалось и открывало. :)

Оффлайн Jinn

  • alt linux team
  • ***
  • Сообщений: 96
Re: Помогите подключить камеру
« Ответ #51 : 26.04.2009 19:11:57 »
Ну дык сейчас должно работать без рута.
Покажите на всякий вывод команды
ls -lR /dev/bus/usb
при включенной камере.

ventrax

  • Гость
Re: Помогите подключить камеру
« Ответ #52 : 26.04.2009 20:29:59 »
 Без рута не работает. Пришлось опять пользователя рутом делать

Оффлайн ruslandh

  • Поспешай не торопясь !
  • Модератор глобальный
  • *****
  • Сообщений: 32 361
  • Учиться .... Телепатами не рождаются, ими ....
Re: Помогите подключить камеру
« Ответ #53 : 26.04.2009 20:38:48 »
А в какие группы входит пользователь ?
Т.е. для доступа к устройствам надо входить в группу root

Оффлайн Jinn

  • alt linux team
  • ***
  • Сообщений: 96
Re: Помогите подключить камеру
« Ответ #54 : 26.04.2009 21:45:25 »
Давайте проверим, все ли правильно.
Дайте сюда вывод команд (от пользователя) :

groups
ls -lR /dev/bus/usb   (камера должна быть включена)
grep 3177 /etc/udev/rules.d/90-libgphoto2.rules

ventrax

  • Гость
Re: Помогите подключить камеру
« Ответ #55 : 26.04.2009 21:59:01 »
Password:
[root@sunduk ~]# ls -lR /dev/bus/usb
/dev/bus/usb:
total 0
drwxr-xr-x 2 root root 80 Apr 26 20:56 001
drwxr-xr-x 2 root root 80 Apr 26  2009 002

/dev/bus/usb/001:
total 0
crw-rw-r-- 1 root root   189, 0 Apr 26  2009 001
crw-rw---- 1 root camera 189, 2 Apr 26 20:56 003

/dev/bus/usb/002:
total 0
crw-rw-r-- 1 root root 189, 128 Apr 26  2009 001
crw-rw-r-- 1 root root 189, 129 Apr 26  2009 002
[root@sunduk ~]#



Password:
[root@sunduk ~]# grep 3177 /etc/udev/rules.d/90-libgphoto2.rules
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="3177", MODE="0660", OWNER="root", GROUP="camera"
[root@sunduk ~]#


Вот

ventrax

  • Гость
Re: Помогите подключить камеру
« Ответ #56 : 26.04.2009 22:10:51 »
 Вот еще

[ventrax@sunduk ~]$ ls -lR /dev/bus/usb
/dev/bus/usb:
итого 0
drwxr-xr-x 2 root root 80 Апр 26 20:56 001
drwxr-xr-x 2 root root 80 Апр 26  2009 002

/dev/bus/usb/001:
итого 0
crw-rw-r-- 1 root root   189, 0 Апр 26  2009 001
crw-rw---- 1 root camera 189, 2 Апр 26 20:56 003

/dev/bus/usb/002:
итого 0
crw-rw-r-- 1 root root 189, 128 Апр 26  2009 001
crw-rw-r-- 1 root root 189, 129 Апр 26  2009 002
[ventrax@sunduk ~]$ grep 3177 /etc/udev/rules.d/90-libgphoto2.rules
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="3177", MODE="0660", OWNER="root", GROUP="camera"
[ventrax@sunduk ~]$

Оффлайн Jinn

  • alt linux team
  • ***
  • Сообщений: 96
Re: Помогите подключить камеру
« Ответ #57 : 27.04.2009 07:34:07 »
Ну тут нормально, устройство создается с нужными правами.

Еще раз прошу показать вывод команды  groups , она выдаст список групп,
куда входит пользователь.
Также возможно, в digikam надо сделать автоопределение камеры.
И скажите, какой у Вас дистрибутив?

Оффлайн ruslandh

  • Поспешай не торопясь !
  • Модератор глобальный
  • *****
  • Сообщений: 32 361
  • Учиться .... Телепатами не рождаются, ими ....
Re: Помогите подключить камеру
« Ответ #58 : 27.04.2009 10:06:35 »
Конкретно интересует - входит-ли пользователь в группу camera, вместо groups можно ещё использовать команду id - она выдаёт аналогичную информацию.


ventrax

  • Гость
Re: Помогите подключить камеру
« Ответ #59 : 27.04.2009 19:20:15 »
[ventrax@sunduk ~]$ groups
ventrax root wheel uucp proc cdrom floppy cdwriter audio radio camera xgrp scanner
[ventrax@sunduk ~]$ id
uid=500(ventrax) gid=500(ventrax) группы=500(ventrax),0(root),10(wheel),14(uucp),19(proc),22(cdrom),71(floppy),80(cdwriter),81(audio),83(radio),102(camera),422(xgrp),424(scanner)
[ventrax@sunduk ~]$

Дистрибутив Alt Linux 4.1 desktop