Bienvenido: Ingresar
location: Diferencias para "HowTo/BUC2203LinuxInst"
Diferencias entre las revisiones 7 y 22 (abarca 15 versiones)
Versión 7 con fecha 2012-09-10 20:57:18
Tamaño: 8729
Comentario:
Versión 22 con fecha 2012-10-03 16:43:56
Tamaño: 2187
Comentario:
Los textos eliminados se marcan así. Los textos añadidos se marcan así.
Línea 1: Línea 1:
#acl BecariosGrupo:read,write,revert All:read
Línea 2: Línea 4:
La cámara anda joia :D.  
Línea 7: Línea 9:
Este driver tiene el inconveniente de que, detecta la cámara como una cámara de color y no monocromo. Por ello va haber que aplicar un parche al código fuente. Dentro de los tipos de cámaras soportados por este driver, la BUC2203 se monta con el driver euvccam en espacio de usuario. Este driver es el que hay que modificar para que funcione. Este driver tiene el inconveniente de que detecta la cámara como una cámara de color y no monocromo. Por ello hay que aplicar un parche al código fuente. Dentro de los tipos de cámaras soportados por este driver, la BUC2203 se monta con el driver euvccam en espacio de usuario. Este driver es el que hay que modificar para que funcione.
Línea 13: Línea 15:
 > mkdir unicap && cd unicap/
Línea 16: Línea 17:
 Instalar los siguientes paquetes extras:
 {{{
 > apt-get install gtk-doc-tools libxv-dev libgconf2-dev libglade2-dev
}}}
Línea 18: Línea 22:
 * Aplicar el siguiente parche:
   {{{
      === modified file 'libunicap/cpi/euvccam/euvccam_devspec.c'
--- libunicap/cpi/euvccam/euvccam_devspec.c 2011-07-24 07:31:50 +0000
+++ libunicap/cpi/euvccam/euvccam_devspec.c 2012-09-10 20:23:57 +0000
@@ -266,6 +266,154 @@
       enumerate_func: NULL,
    },
 };
+static euvccam_property_t properties_8201_mono[] =
+{
+ {
+ {
+ identifier: "Shutter",
+ category: "Exposure",
+ unit: "s",
+ relations: NULL,
+ relations_count: 0,
+ {value: 0},
+ {range: { min: 0.0001, max: 0.25 } },
+ stepping: 0.0001,
+ type: UNICAP_PROPERTY_TYPE_RANGE,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL | UNICAP_FLAGS_AUTO,
+ property_data: NULL,
+ property_data_size: 0,
+ },
+
+ get_func: euvccam_device_get_exposure,
+ set_func: euvccam_device_set_exposure,
+ enumerate_func: NULL,
+ },
+ {
+ {
+ identifier: "Gain",
+ category: "Exposure",
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ {value: 0},
+ {range: { min: 16, max: 63 } },
+ stepping: 1.0,
+ type: UNICAP_PROPERTY_TYPE_RANGE,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL | UNICAP_FLAGS_AUTO,
+ property_data: NULL,
+ property_data_size: 0,
+ },
+
+ get_func: euvccam_device_get_gain,
+ set_func: euvccam_device_set_gain,
+ enumerate_func: NULL,
+ },
+ {
+ {
+ identifier: "Frame Rate",
+ category: "Video",
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ {value: 0},
+ {range: { min: 0, max: 0 } },
+ stepping: 1.0,
+ type: UNICAP_PROPERTY_TYPE_VALUE_LIST,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0,
+ },
+
+ get_func: euvccam_device_get_frame_rate,
+ set_func: euvccam_device_set_frame_rate,
+ enumerate_func: euvccam_device_enumerate_frame_rate,
+ },
+ {
+ {
+ identifier: N_("trigger"),
+ category: N_("device"),
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ {menu_item: TRIGGER_FREE_RUNNING},
+ {menu: { menu_items: trigger_menu,
+ menu_item_count: sizeof( trigger_menu ) / sizeof( char * ) } },
+ stepping: 0.0,
+ type: UNICAP_PROPERTY_TYPE_MENU,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0
+ },
+
+ get_func: euvccam_device_get_trigger,
+ set_func: euvccam_device_set_trigger,
+ enumerate_func: euvccam_device_enumerate_trigger,
+ },
+ {
+ {
+ identifier: N_("software trigger"),
+ category: N_("device"),
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ stepping: 0.0,
+ type: UNICAP_PROPERTY_TYPE_FLAGS,
+ flags: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0
+ },
+
+ get_func: euvccam_device_get_software_trigger,
+ set_func: euvccam_device_set_software_trigger,
+ enumerate_func: euvccam_device_enumerate_software_trigger,
+ },
+#if 0
+ {
+ {
+ identifier: N_("reset sensor"),
+ category: N_("device"),
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ stepping: 0.0,
+ type: UNICAP_PROPERTY_TYPE_FLAGS,
+ flags: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0
+ },
+
+ get_func: euvccam_device_get_reset_mt9v024,
+ set_func: euvccam_device_set_reset_mt9v024,
+ },
+#endif
+ {
+ {
+ identifier: "IIC Command",
+ category: "Device",
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ {value: 0},
+ {range: { min: 5, max: 120 } },
+ stepping: 1.0,
+ type: UNICAP_PROPERTY_TYPE_DATA,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0,
+ },
+
+ get_func: euvccam_device_read_iic,
+ set_func: euvccam_device_write_iic,
+ enumerate_func: NULL,
+ },
+};
 
 static euvccam_property_t properties_8206[] =
 {
@@ -1166,6 +1314,89 @@
       
 };
 
+static double format_8201_mono_framerates[] = { 87, 60, 30, 25, 15, 7.5, 5};
+static int format_8201_mono_framerate_map[] = { 7, 6, 0, 1, 2, 3, 4};
+
+static struct euvccam_video_format_description formats_8201_mono[] =
+{
+ {
+ 1,
+ 3,
+ { identifier: "Y800 320x240",
+ size: {0,0,320,240},
+ min_size: { 0,0,320,240 },
+ max_size: { 0,0,320,240 },
+ h_stepping: 0,
+ v_stepping: 0,
+ sizes: NULL,
+ size_count: 0,
+ bpp: 8,
+ buffer_size: 320 * 240,
+ fourcc: FOURCC( 'Y', '8', '0', '0' ),
+ flags: 0,
+ buffer_types: UNICAP_BUFFER_TYPE_SYSTEM | UNICAP_BUFFER_TYPE_USER,
+ system_buffer_count: EUVCCAM_SYSTEM_BUFFER_COUNT,
+ buffer_type: 0
+ },
+ N_ELEMENTS( format_8201_mono_framerates ),
+ format_8201_mono_framerates,
+ format_8201_mono_framerate_map,
+ 320 * 240,
+ NULL,
+ EUVCCAM_FORMAT_IS_PARTIAL_SCAN,
+ },
+ {
+ 1,
+ 2,
+ { identifier: "Y800 640x480",
+ size: {0,0,640,480},
+ min_size: { 0,0,640,480 },
+ max_size: { 0,0,640,480 },
+ h_stepping: 0,
+ v_stepping: 0,
+ sizes: NULL,
+ size_count: 0,
+ bpp: 8,
+ buffer_size: 640 * 480,
+ fourcc: FOURCC( 'Y', '8', '0', '0' ),
+ flags: 0,
+ buffer_types: UNICAP_BUFFER_TYPE_SYSTEM | UNICAP_BUFFER_TYPE_USER,
+ system_buffer_count: EUVCCAM_SYSTEM_BUFFER_COUNT,
+ buffer_type: 0
+ },
+ N_ELEMENTS( format_8201_mono_framerates ),
+ format_8201_mono_framerates,
+ format_8201_mono_framerate_map,
+ 640 * 480,
+ NULL,
+ },
+ {
+ 1,
+ 1,
+ { identifier: "Y800 744x480",
+ size: {0,0,744,480},
+ min_size: { 0,0,744,480 },
+ max_size: { 0,0,744,480 },
+ h_stepping: 0,
+ v_stepping: 0,
+ sizes: NULL,
+ size_count: 0,
+ bpp: 8,
+ buffer_size: 744 * 480,
+ fourcc: FOURCC( 'Y', '8', '0', '0' ),
+ flags: 0,
+ buffer_types: UNICAP_BUFFER_TYPE_SYSTEM | UNICAP_BUFFER_TYPE_USER,
+ system_buffer_count: EUVCCAM_SYSTEM_BUFFER_COUNT,
+ buffer_type: 0
+ },
+ N_ELEMENTS( format_8201_mono_framerates ),
+ format_8201_mono_framerates,
+ format_8201_mono_framerate_map,
+ 744 * 480,
+ NULL,
+ },
+};
+
 
 static double format_8202_framerates[] = { 87, 60, 30, 25, 15, 7.5, 5};
 static int format_8202_framerate_map[] = { 7, 6, 0, 1, 2, 3, 4};
@@ -2147,14 +2378,24 @@
 
 struct euvccam_devspec euvccam_devspec[] =
 {
+ /*Lo que había originalmente*/
+ /*{*/
+ /*0x8201,*/
+ /*0, */
+ /*0,*/
+ /*N_ELEMENTS( formats_8201 ),*/
+ /*formats_8201,*/
+ /*N_ELEMENTS( properties_8201 ),*/
+ /*properties_8201,*/
+ /*},*/
    {
       0x8201,
       0,
       0,
- N_ELEMENTS( formats_8201 ),
- formats_8201,
- N_ELEMENTS( properties_8201 ),
- properties_8201,
+ N_ELEMENTS( formats_8201_mono ),
+ formats_8201_mono,
+ N_ELEMENTS( properties_8201_mono ),
+ properties_8202_mono,
    },
    {
       0x8202,

   }}}
 * para aplicar el parche creamos un archivo llamado "parcheBUC2203.patch" que contenga lo anterior y ejecutamos la siguiente instrucción.
 * Descargar y aplicar el siguiente parche [[attachment:parcheBUC2203_v01.patch]],
 * y ejecutar la siguiente instrucción:
Línea 302: Línea 26:
 > patch -p1 < /dondeestaelparche/parcheBUC2203.patch  > patch -p1 < /dondeestaelparche/parcheBUC2203_v0x.patch
 > ./autogen.sh
Línea 307: Línea 32:

 * Luego compilar e instalar libucil y libunicapgtk:
 {{{
 > cd unicap/libucil/
 > ./autogen.sh
 > ./configure
 > make
 > make install
 > cd unicap/libunicapgtk
 > ./autogen.sh
 > ./configure
 > make
 > make install
}}}

 * Para comprobar que la cámara funciona se puede compilar e instalar el programa ucview:
 {{{
 > bzr clone lp:ucview
 > cd ucview/trunk/ucview
 > ./configure
 > make
 > make install
}}}
 * Luego ejecutamos:
 {{{
 > ucview
}}}
 * Y debe andar :D ja

== zumachen ==
 * Ver lo de los framerates (???)
 * Ver que pasa si se conecta una camara color con el ID 8201
 * Reportar la falla a los de unicap

Instalación y uso de la cámara DMK BUC2203 en Debian

La cámara CMOS DMK BUC2203 soporta los formatos Y800 (ByN) en resoluciones de 320*240/640*480/744*480. Las especificaciones se las puede encontrar en la pagina del fabricante( ImagingSource).

El driver de linux para la cámara es desarrollado por Unicap.

Este driver tiene el inconveniente de que detecta la cámara como una cámara de color y no monocromo. Por ello hay que aplicar un parche al código fuente. Dentro de los tipos de cámaras soportados por este driver, la BUC2203 se monta con el driver euvccam en espacio de usuario. Este driver es el que hay que modificar para que funcione.

El paso a paso

Hay que descargar los archivos fuentes del driver, una forma es haciendo un clon del repositorio bazar:

  •  > apt-get install bzr
     > bzr clone lp:unicap 
    Instalar los siguientes paquetes extras:
     > apt-get install gtk-doc-tools libxv-dev libgconf2-dev libglade2-dev

Para hacer andar la cámara con este driver hay que realizar las siguientes modificaciones.

  • Descargar y aplicar el siguiente parche parcheBUC2203_v01.patch,

  • y ejecutar la siguiente instrucción:
     > cd unicap/libunicap/
     > patch -p1 < /dondeestaelparche/parcheBUC2203_v0x.patch
     > ./autogen.sh
     > ./configure 
     > make 
     > make install
  • Luego compilar e instalar libucil y libunicapgtk:
     > cd unicap/libucil/
     > ./autogen.sh
     > ./configure
     > make 
     > make install
     > cd unicap/libunicapgtk
     > ./autogen.sh
     > ./configure 
     > make 
     > make install
  • Para comprobar que la cámara funciona se puede compilar e instalar el programa ucview:
     > bzr clone lp:ucview 
     > cd ucview/trunk/ucview
     > ./configure
     > make
     > make install
  • Luego ejecutamos:
     > ucview
  • Y debe andar :D ja

zumachen

  • Ver lo de los framerates (???)
  • Ver que pasa si se conecta una camara color con el ID 8201
  • Reportar la falla a los de unicap

None: HowTo/BUC2203LinuxInst (última edición 2014-08-06 17:33:27 efectuada por GastonAraguas)