[RFC, PATCH] gspca pac7302: add support for camera button

2009-11-15 Thread Németh Márton
From: Márton Németh nm...@freemail.hu

Add support for snapshot button found on Labtec Webcam 2200.

Signed-off-by: Márton Németh nm...@freemail.hu
---
Hi,

this is the first trial to add support for the snapshot button. This
code is working only before the streaming is started. When the streaming
is started the alternate number of the interface 0 is changed and the
interrupt URB is no longer usable. I guess the interrupt URB is to
be reconstructed every time when the alternate number is changed.

When I disconnect the device I get the following error:

uhci_hcd :00:1d.1: dma_pool_free buffer-32, f58ba168/358ba168 (bad dma)

I guess something is wrong in this patch with the cleanup routine.

Regards,

Márton Németh

---
diff -r 09c1284de47d linux/drivers/media/video/gspca/gspca.h
--- a/linux/drivers/media/video/gspca/gspca.h   Sat Nov 14 08:58:12 2009 +0100
+++ b/linux/drivers/media/video/gspca/gspca.h   Sun Nov 15 10:40:54 2009 +0100
@@ -138,6 +138,7 @@
struct module *module;  /* subdriver handling the device */
struct usb_device *dev;
struct file *capt_file; /* file doing video capture */
+   struct input_dev *input_dev;

struct cam cam; /* device information */
const struct sd_desc *sd_desc;  /* subdriver description */
@@ -147,6 +148,7 @@
 #define USB_BUF_SZ 64
__u8 *usb_buf;  /* buffer for USB exchanges */
struct urb *urb[MAX_NURBS];
+   struct urb *int_urb;

__u8 *frbuf;/* buffer for nframes */
struct gspca_frame frame[GSPCA_MAX_FRAMES];
diff -r 09c1284de47d linux/drivers/media/video/gspca/pac7302.c
--- a/linux/drivers/media/video/gspca/pac7302.c Sat Nov 14 08:58:12 2009 +0100
+++ b/linux/drivers/media/video/gspca/pac7302.c Sun Nov 15 10:40:54 2009 +0100
@@ -68,6 +68,7 @@

 #define MODULE_NAME pac7302

+#include linux/input.h
 #include media/v4l2-chip-ident.h
 #include gspca.h

@@ -1220,6 +1221,50 @@
 }
 #endif

+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 19)
+static void int_irq(struct urb *urb, struct pt_regs *regs)
+#else
+static void int_irq(struct urb *urb)
+#endif
+{
+   struct gspca_dev *gspca_dev = (struct gspca_dev *) urb-context;
+   int ret;
+   int i;
+   __u8 data0, data1;
+
+   printk(KERN_DEBUG int_irq()\n);
+   printk(KERN_DEBUG urb-status: %i\n, urb-status);
+   if (urb-status == 0) {
+   printk(KERN_DEBUG urb-actual_length: %u\n, 
urb-actual_length);
+   for (i = 0; i  urb-actual_length; i++) {
+   printk(KERN_DEBUG urb-transfer_buffer[%i]=0x%x\n,
+   i, ((__u8*)urb-transfer_buffer)[i]);
+   }
+   if (urb-actual_length == 2) {
+   data0 = ((__u8*)urb-transfer_buffer)[0];
+   data1 = ((__u8*)urb-transfer_buffer)[1];
+   if ((data0 == 0x00  data1 == 0x11) ||
+   (data0 == 0x22  data1 == 0x33) ||
+   (data0 == 0x44  data1 == 0x55) ||
+   (data0 == 0x66  data1 == 0x77) ||
+   (data0 == 0x88  data1 == 0x99) ||
+   (data0 == 0xaa  data1 == 0xbb) ||
+   (data0 == 0xcc  data1 == 0xdd) ||
+   (data0 == 0xee  data1 == 0xff)) {
+   input_report_key(gspca_dev-input_dev, 
KEY_CAMERA, 1);
+   input_sync(gspca_dev-input_dev);
+   input_report_key(gspca_dev-input_dev, 
KEY_CAMERA, 0);
+   input_sync(gspca_dev-input_dev);
+   } else
+   printk(KERN_DEBUG Unknown packet received\n);
+   }
+   ret = usb_submit_urb(urb, GFP_ATOMIC);
+   printk(KERN_DEBUG resubmit urb: %i\n, ret);
+   }
+
+}
+
+
 /* sub-driver description for pac7302 */
 static struct sd_desc sd_desc = {
.name = MODULE_NAME,
@@ -1254,19 +1299,132 @@
 };
 MODULE_DEVICE_TABLE(usb, device_table);

+static int init_camera_input(struct gspca_dev *gspca_dev, const struct 
usb_device_id *id)
+{
+   struct input_dev *input_dev;
+   int err;
+
+   printk(KERN_DEBUG allocating input device\n);
+   input_dev = input_allocate_device();
+   if (!input_dev)
+   return -ENOMEM;
+
+   //input_dev-name = Camera capture button;
+   //input_dev-phys = camera;
+   input_dev-id.bustype = BUS_USB;
+   input_dev-id.vendor = id-idVendor;
+   input_dev-id.product = id-idProduct;
+   input_dev-id.version = id-bcdDevice_hi;
+   //input_dev-id.version = id-bcdDevice_lo;
+
+   input_dev-evbit[0] = BIT_MASK(EV_KEY);
+   input_dev-keybit[BIT_WORD(KEY_CAMERA)] = BIT_MASK(KEY_CAMERA);
+   //input_dev-dev.parent = ;
+
+   printk(KERN_DEBUG registering 

Re: MSI StarCam 370i: The right way?

2009-11-15 Thread Dotan Cohen
 In the kernel you have (2.6.31) two drivers may try to handle your
 webcam: gspca_sonixj and sn9c102. If both are generated, the active
 driver changes at each webcam unplug/replug (you may know which driver
 is active looking at the last lines of 'dmesg').

 If the driver gspca_sonixj does not work, you may try its last version
 from LinuxTv.org (many bugs have been found since kernel 2.6.31).


Thank you Jean-Francois. Is unplug/replug the only way to switch
drivers? Apparently neither driver works, where is a good place to get
the snc102 driver to try as well? Googling snc102 linux driver did
not lead me to any place to download it.

Thanks!


-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/5] s2250: Change module structure

2009-11-15 Thread Hans Verkuil
On Tuesday 10 November 2009 20:21:37 Pete Eberlein wrote:
 From: Pete Eberlein p...@sensoray.com
 
 The s2250-board i2c module was converted to use v4l2-i2c-drv.h in
 preparation for its subdev conversion.  This change prevented the
 s2250-loader from being initialized within the same module due to
 the module_init and module_exit function definitions in v4l2-i2c-drv.h.

FYI: the v4l2-i2c-drv.h header is only needed if you have to support
kernels  2.6.26. If that is not the case, then the i2c driver can be
written as a regular i2c driver. See for example this driver:
linux/drivers/media/video/tvp514x.c.

However, I seem to remember that you told me that this driver is actually
used on pre-2.6.26 kernels, so then you have no choice but to use it.

 Therefore, s2250-loader is now its own module, and the header for
 exporting s2250-loader functions is no longer needed.
 
 The s2250 i2c module name was 2220-board in some places, and was
 changed to s2250.

Looks good.

Signed-off-by: Hans Verkuil hverk...@xs4all.nl

Regards,

Hans

 
 Priority: normal
 
 Signed-off-by: Pete Eberlein p...@sensoray.com
 
 diff -r 99e4a0cf6788 -r 5fe2031944d4 linux/drivers/staging/go7007/Makefile
 --- a/linux/drivers/staging/go7007/Makefile   Tue Nov 10 10:47:34 2009 -0800
 +++ b/linux/drivers/staging/go7007/Makefile   Tue Nov 10 10:54:51 2009 -0800
 @@ -5,7 +5,7 @@
  
  obj-$(CONFIG_VIDEO_GO7007) += go7007.o
  obj-$(CONFIG_VIDEO_GO7007_USB) += go7007-usb.o
 -obj-$(CONFIG_VIDEO_GO7007_USB_S2250_BOARD) += s2250.o
 +obj-$(CONFIG_VIDEO_GO7007_USB_S2250_BOARD) += s2250.o s2250-loader.o
  obj-$(CONFIG_VIDEO_GO7007_SAA7113) += wis-saa7113.o
  obj-$(CONFIG_VIDEO_GO7007_OV7640) += wis-ov7640.o
  obj-$(CONFIG_VIDEO_GO7007_SAA7115) += wis-saa7115.o
 @@ -17,7 +17,7 @@
  go7007-objs += go7007-v4l2.o go7007-driver.o go7007-i2c.o go7007-fw.o \
   snd-go7007.o
  
 -s2250-objs += s2250-board.o s2250-loader.o
 +s2250-objs += s2250-board.o
  
  # Uncomment when the saa7134 patches get into upstream
  #ifneq ($(CONFIG_VIDEO_SAA7134),)
 diff -r 99e4a0cf6788 -r 5fe2031944d4 
 linux/drivers/staging/go7007/go7007-driver.c
 --- a/linux/drivers/staging/go7007/go7007-driver.cTue Nov 10 10:47:34 
 2009 -0800
 +++ b/linux/drivers/staging/go7007/go7007-driver.cTue Nov 10 10:54:51 
 2009 -0800
 @@ -219,7 +219,7 @@
   modname = wis-ov7640;
   break;
   case I2C_DRIVERID_S2250:
 - modname = s2250-board;
 + modname = s2250;
   break;
   default:
   modname = NULL;
 diff -r 99e4a0cf6788 -r 5fe2031944d4 linux/drivers/staging/go7007/go7007-usb.c
 --- a/linux/drivers/staging/go7007/go7007-usb.c   Tue Nov 10 10:47:34 
 2009 -0800
 +++ b/linux/drivers/staging/go7007/go7007-usb.c   Tue Nov 10 10:54:51 
 2009 -0800
 @@ -425,7 +425,7 @@
   .num_i2c_devs= 1,
   .i2c_devs= {
   {
 - .type   = s2250_board,
 + .type   = s2250,
   .id = I2C_DRIVERID_S2250,
   .addr   = 0x43,
   },
 diff -r 99e4a0cf6788 -r 5fe2031944d4 
 linux/drivers/staging/go7007/s2250-board.c
 --- a/linux/drivers/staging/go7007/s2250-board.c  Tue Nov 10 10:47:34 
 2009 -0800
 +++ b/linux/drivers/staging/go7007/s2250-board.c  Tue Nov 10 10:54:51 
 2009 -0800
 @@ -20,10 +20,13 @@
  #include linux/usb.h
  #include linux/i2c.h
  #include linux/videodev2.h
 +#include media/v4l2-device.h
  #include media/v4l2-common.h
 -#include s2250-loader.h
 +#include media/v4l2-i2c-drv.h
  #include go7007-priv.h
 -#include wis-i2c.h
 +
 +MODULE_DESCRIPTION(Sensoray 2250/2251 i2c v4l2 subdev driver);
 +MODULE_LICENSE(GPL v2);
  
  #define TLV320_ADDRESS  0x34
  #define VPX322_ADDR_ANALOGCONTROL1   0x02
 @@ -575,7 +578,7 @@
   dec-audio = audio;
   i2c_set_clientdata(client, dec);
  
 - printk(KERN_DEBUG
 + printk(KERN_INFO
  s2250: initializing video decoder on %s\n,
  adapter-name);
  
 @@ -648,46 +651,20 @@
   return 0;
  }
  
 +#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 26)
  static struct i2c_device_id s2250_id[] = {
 - { s2250_board, 0 },
 + { s2250, 0 },
   { }
  };
 +MODULE_DEVICE_TABLE(i2c, s2250_id);
  
 -static struct i2c_driver s2250_driver = {
 - .driver = {
 - .name   = Sensoray 2250 board driver,
 - },
 - .probe  = s2250_probe,
 - .remove = s2250_remove,
 - .command= s2250_command,
 - .id_table   = s2250_id,
 +#endif
 +static struct v4l2_i2c_driver_data v4l2_i2c_data = {
 + .name = s2250,
 + .probe = s2250_probe,
 + .remove = s2250_remove,
 + .command = s2250_command,
 +#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 26)
 + .id_table = s2250_id,
 +#endif
  };
 -
 -static int __init s2250_init(void)
 -{
 - int r;
 -
 - r = s2250loader_init();
 - if 

Re: [PATCH 1/5] go7007: Add struct v4l2_device.

2009-11-15 Thread Hans Verkuil
Hi Peter,

Thanks for this patch series! It's looking much better now.

I did find one thing though in this patch:

On Tuesday 10 November 2009 20:21:27 Pete Eberlein wrote:
 From: Pete Eberlein p...@sensoray.com
 
 This adds a struct v4l2_device to the go7007 device struct and registers
 it during v4l2 initialization.  The v4l2_device registration overwrites
 the go-dev device_data, which is a struct usb_interface with intfdata set
 to the struct go7007.  This changes intfdata to point to the struct
 v4l2_device inside struct go7007, which is what v4l2_device_register will
 also set it to (and warn about non-null drvdata on register.)  Since usb
 disconnect can happen any time, this intfdata should always be present.
 
 Priority: normal
 
 Signed-off-by: Pete Eberlein p...@sensoray.com
 

...

 diff -r 19c0469c02c3 -r a603ad1e6a1c 
 linux/drivers/staging/go7007/go7007-v4l2.c
 --- a/linux/drivers/staging/go7007/go7007-v4l2.c  Sat Nov 07 15:51:01 
 2009 -0200
 +++ b/linux/drivers/staging/go7007/go7007-v4l2.c  Tue Nov 10 10:41:56 
 2009 -0800
 @@ -1827,7 +1827,7 @@
   go-video_dev = video_device_alloc();
   if (go-video_dev == NULL)
   return -ENOMEM;
 - memcpy(go-video_dev, go7007_template, sizeof(go7007_template));
 + *go-video_dev = go7007_template;
   go-video_dev-parent = go-dev;
   rv = video_register_device(go-video_dev, VFL_TYPE_GRABBER, -1);
   if (rv  0) {
 @@ -1837,6 +1837,8 @@
   }
   video_set_drvdata(go-video_dev, go);
   ++go-ref_count;
 + v4l2_device_register(go-dev, go-v4l2_dev);

Please check the return code here! 

You should have seen this warning when you compiled:

v4l/go7007-v4l2.c: In function 'go7007_v4l2_init':
v4l/go7007-v4l2.c:1840: warning: ignoring return value of 
'v4l2_device_register', declared with attribute warn_unused_result

 +
   printk(KERN_INFO %s: registered device video%d [v4l2]\n,
  go-video_dev-name, go-video_dev-num);
  
 @@ -1858,4 +1860,5 @@
   mutex_unlock(go-hw_lock);
   if (go-video_dev)
   video_unregister_device(go-video_dev);
 + v4l2_device_unregister(go-v4l2_dev);
  }
 

Other than that single warning it looks good!

Can you fix and repost this patch? Then I can prepare a pull request containing
all these changes.

Thanks,

Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tuner drivers

2009-11-15 Thread hermann pitton
Hi,

Am Sonntag, den 15.11.2009, 14:42 +0200 schrieb rul...@meta.ua:
 How to do that?:
 
 You are forced to use saa7134-alsa dma sound
 

a problem is that I can't tell for sure which analog TV standard you
currently use in the Ukraine, either it is still SECAM DK or you changed
to some PAL already.

Try to get the details, also about the sound system.

If it is still SECAM DK, you need to force the option secam=DK.

With audio_debug=1 you can see if the drivers finds the pilots, the
first sound carrier and the second carrier and also the stereo system in
use. This counts also for PAL standards.

This way you can already see if the driver can lock on the audio
carriers in dmesg without hearing anything yet.

Then saa7134-alsa should provide TV sound on your card.
http://linuxtv.org/wiki/index.php/Saa7134-alsa

Cheers,
Hermann





--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://linuxtv.org/hg/~awalls/cx18-yuv2

2009-11-15 Thread Andy Walls
Mauro,

Please pull from http://linuxtv.org/hg/~awalls/cx18-yuv2

for the following 9 changesets:

01/09: cx18: Rename struct cx18_mdl to struct cx18_mdl_ent
http://linuxtv.org/hg/~awalls/cx18-yuv2?cmd=changeset;node=0c3fc323e620

02/09: cx18: Rename struct cx18_queue.buffers to struct cx18_queue.depth
http://linuxtv.org/hg/~awalls/cx18-yuv2?cmd=changeset;node=d6c3b39db8ab

03/09: cx18: Rename mdl_offset to mdl_base_idx or free_mdl_idx as appropriate
http://linuxtv.org/hg/~awalls/cx18-yuv2?cmd=changeset;node=d2aaff136907

04/09: cx18: Add Memory Descriptor List (MDL) layer to buffer handling
http://linuxtv.org/hg/~awalls/cx18-yuv2?cmd=changeset;node=7543832d06b2

05/09: cx18: Fix YUV capture so that encoder passes a single frame per transfer
http://linuxtv.org/hg/~awalls/cx18-yuv2?cmd=changeset;node=f59481fcef0f

06/09: cx18: Adjust an MDL's final buffer size to force encoder transfer size
http://linuxtv.org/hg/~awalls/cx18-yuv2?cmd=changeset;node=a612183c386b

07/09: cx18: Adjust encoder VBI MDL size to be exactly frame's worth of VBI data
http://linuxtv.org/hg/~awalls/cx18-yuv2?cmd=changeset;node=0f7da532929c

08/09: cx18: Remove duplicate list traversal when processing incoming MDLs
http://linuxtv.org/hg/~awalls/cx18-yuv2?cmd=changeset;node=9221d72831d9

09/09: cx18: Bump version number due to significant buffer handling changes.
http://linuxtv.org/hg/~awalls/cx18-yuv2?cmd=changeset;node=6dddcc06660f


(Most of) These changes ensure the YUV stream presented to the
application will always provide whole frames, even though the cx18
driver may miss some buffer transfer notifications from the CX23418 due
to system interrupt response latency.


 cx18-driver.c  |   61 ++--
 cx18-driver.h  |   59 +---
 cx18-dvb.c |5 
 cx18-fileops.c |  132 ++-
 cx18-ioctl.c   |5 
 cx18-mailbox.c |   62 ++--
 cx18-mailbox.h |6 
 cx18-queue.c   |  394 ++---
 cx18-queue.h   |   67 ++---
 cx18-scb.h |4 
 cx18-streams.c |   98 +-
 cx18-streams.h |   10 -
 cx18-vbi.c |   35 -
 cx18-vbi.h |2 
 cx18-version.h |2 
 cx23418.h  |2 
 16 files changed, 682 insertions(+), 262 deletions(-)

Thanks,
Andy


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tuner drivers

2009-11-15 Thread rulet1
 Hi,

 Am Sonntag, den 15.11.2009, 14:42 +0200 schrieb rul...@meta.ua:
 How to do that?:

 You are forced to use saa7134-alsa dma sound


 a problem is that I can't tell for sure which analog TV standard you
 currently use in the Ukraine, either it is still SECAM DK or you changed
 to some PAL already.

 Try to get the details, also about the sound system.

 If it is still SECAM DK, you need to force the option secam=DK.

 With audio_debug=1 you can see if the drivers finds the pilots, the
 first sound carrier and the second carrier and also the stereo system in
 use. This counts also for PAL standards.

 This way you can already see if the driver can lock on the audio
 carriers in dmesg without hearing anything yet.

 Then saa7134-alsa should provide TV sound on your card.
 http://linuxtv.org/wiki/index.php/Saa7134-alsa

 Cheers,
 Hermann



 Where to put the option secam=DK on Ubuntu 9.10?




__
Настоящая украинская почта http://webmail.meta.ua/

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC 7/9 v2] v4l: add an image-bus API for configuring v4l2 subdev pixel and frame formats

2009-11-15 Thread Hans Verkuil
Hi Guennadi,

Apologies for the late reply, but better late than never :-)

On Thursday 12 November 2009 09:08:42 Guennadi Liakhovetski wrote:
 Hi Hans
 
 Thanks for the review
 
 On Wed, 11 Nov 2009, Hans Verkuil wrote:
 
  Hi Guennadi,
  
  OK, I've looked at this again. See my comments below.
  
  On Friday 30 October 2009 15:01:27 Guennadi Liakhovetski wrote:
   Video subdevices, like cameras, decoders, connect to video bridges over
   specialised busses. Data is being transferred over these busses in various
   formats, which only loosely correspond to fourcc codes, describing how 
   video
   data is stored in RAM. This is not a one-to-one correspondence, therefore 
   we
   cannot use fourcc codes to configure subdevice output data formats. This 
   patch
   adds codes for several such on-the-bus formats and an API, similar to the
   familiar .s_fmt(), .g_fmt(), .try_fmt(), .enum_fmt() API for configuring 
   those
   codes. After all users of the old API in struct v4l2_subdev_video_ops are
   converted, the API will be removed.
   
   Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de
   ---
drivers/media/video/Makefile|2 +-
drivers/media/video/v4l2-imagebus.c |  218 
   +++
include/media/v4l2-imagebus.h   |   84 ++
include/media/v4l2-subdev.h |   10 ++-
4 files changed, 312 insertions(+), 2 deletions(-)
create mode 100644 drivers/media/video/v4l2-imagebus.c
create mode 100644 include/media/v4l2-imagebus.h
   
   diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
   index 7a2dcc3..62d8907 100644
   --- a/drivers/media/video/Makefile
   +++ b/drivers/media/video/Makefile
   @@ -10,7 +10,7 @@ stkwebcam-objs  :=  stk-webcam.o stk-sensor.o

omap2cam-objs:=  omap24xxcam.o omap24xxcam-dma.o

   -videodev-objs:=  v4l2-dev.o v4l2-ioctl.o v4l2-device.o
   +videodev-objs:=  v4l2-dev.o v4l2-ioctl.o v4l2-device.o 
   v4l2-imagebus.o

# V4L2 core modules

   diff --git a/drivers/media/video/v4l2-imagebus.c 
   b/drivers/media/video/v4l2-imagebus.c
   new file mode 100644
   index 000..e0a3a83
   --- /dev/null
   +++ b/drivers/media/video/v4l2-imagebus.c
   @@ -0,0 +1,218 @@
   +/*
   + * Image Bus API
   + *
   + * Copyright (C) 2009, Guennadi Liakhovetski g.liakhovet...@gmx.de
   + *
   + * This program is free software; you can redistribute it and/or modify
   + * it under the terms of the GNU General Public License version 2 as
   + * published by the Free Software Foundation.
   + */
   +
   +#include linux/kernel.h
   +#include linux/module.h
   +
   +#include media/v4l2-device.h
   +#include media/v4l2-imagebus.h
   +
   +static const struct v4l2_imgbus_pixelfmt imgbus_fmt[] = {
   + [V4L2_IMGBUS_FMT_YUYV] = {
   + .fourcc = V4L2_PIX_FMT_YUYV,
   + .colorspace = V4L2_COLORSPACE_JPEG,
   + .name   = YUYV,
   + .bits_per_sample= 8,
   + .packing= V4L2_IMGBUS_PACKING_2X8_PADHI,
   + .order  = V4L2_IMGBUS_ORDER_LE,
   + }, [V4L2_IMGBUS_FMT_YVYU] = {
   + .fourcc = V4L2_PIX_FMT_YVYU,
   + .colorspace = V4L2_COLORSPACE_JPEG,
   + .name   = YVYU,
   + .bits_per_sample= 8,
   + .packing= V4L2_IMGBUS_PACKING_2X8_PADHI,
   + .order  = V4L2_IMGBUS_ORDER_LE,
   + }, [V4L2_IMGBUS_FMT_UYVY] = {
   + .fourcc = V4L2_PIX_FMT_UYVY,
   + .colorspace = V4L2_COLORSPACE_JPEG,
   + .name   = UYVY,
   + .bits_per_sample= 8,
   + .packing= V4L2_IMGBUS_PACKING_2X8_PADHI,
   + .order  = V4L2_IMGBUS_ORDER_LE,
   + }, [V4L2_IMGBUS_FMT_VYUY] = {
   + .fourcc = V4L2_PIX_FMT_VYUY,
   + .colorspace = V4L2_COLORSPACE_JPEG,
   + .name   = VYUY,
   + .bits_per_sample= 8,
   + .packing= V4L2_IMGBUS_PACKING_2X8_PADHI,
   + .order  = V4L2_IMGBUS_ORDER_LE,
   + }, [V4L2_IMGBUS_FMT_VYUY_SMPTE170M_8] = {
   + .fourcc = V4L2_PIX_FMT_VYUY,
   + .colorspace = V4L2_COLORSPACE_SMPTE170M,
   + .name   = VYUY in SMPTE170M,
   + .bits_per_sample= 8,
   + .packing= V4L2_IMGBUS_PACKING_2X8_PADHI,
   + .order  = V4L2_IMGBUS_ORDER_LE,
   + }, [V4L2_IMGBUS_FMT_VYUY_SMPTE170M_16] = {
   + .fourcc = V4L2_PIX_FMT_VYUY,
   + .colorspace = V4L2_COLORSPACE_SMPTE170M,
   + .name   = VYUY in SMPTE170M, 16bit,
   + .bits_per_sample= 16,
   + .packing  

Re: Tuner drivers

2009-11-15 Thread hermann pitton

Am Sonntag, den 15.11.2009, 17:15 +0200 schrieb rul...@meta.ua:
  Hi,
 
  Am Sonntag, den 15.11.2009, 14:42 +0200 schrieb rul...@meta.ua:
  How to do that?:
 
  You are forced to use saa7134-alsa dma sound
 
 
  a problem is that I can't tell for sure which analog TV standard you
  currently use in the Ukraine, either it is still SECAM DK or you changed
  to some PAL already.
 
  Try to get the details, also about the sound system.
 
  If it is still SECAM DK, you need to force the option secam=DK.
 
  With audio_debug=1 you can see if the drivers finds the pilots, the
  first sound carrier and the second carrier and also the stereo system in
  use. This counts also for PAL standards.
 
  This way you can already see if the driver can lock on the audio
  carriers in dmesg without hearing anything yet.
 
  Then saa7134-alsa should provide TV sound on your card.
  http://linuxtv.org/wiki/index.php/Saa7134-alsa
 
  Cheers,
  Hermann
 
 
 
  Where to put the option secam=DK on Ubuntu 9.10?
 

Don't have it, but would guess /etc/modprobe.d or use a
deprecated /etc/modprobe.conf and depmod -a or close all mixers using
saa7134, modprobe -vr saa7134-alsa and modprobe saa7134 secam=DK.

Hermann
 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[cron job] v4l-dvb daily build 2.6.22 and up: ERRORS, 2.6.16-2.6.21: ERRORS

2009-11-15 Thread Hans Verkuil
This message is generated daily by a cron job that builds v4l-dvb for
the kernels and architectures in the list below.

Results of the daily build of v4l-dvb:

date:Sun Nov 15 19:00:03 CET 2009
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   1:e341e9e85af2
gcc version: gcc (GCC) 4.3.1
hardware:x86_64
host os: 2.6.26

linux-2.6.22.19-armv5: WARNINGS
linux-2.6.23.12-armv5: WARNINGS
linux-2.6.24.7-armv5: WARNINGS
linux-2.6.25.11-armv5: WARNINGS
linux-2.6.26-armv5: WARNINGS
linux-2.6.27-armv5: WARNINGS
linux-2.6.28-armv5: WARNINGS
linux-2.6.29.1-armv5: WARNINGS
linux-2.6.30-armv5: WARNINGS
linux-2.6.31-armv5: WARNINGS
linux-2.6.32-rc6-armv5: ERRORS
linux-2.6.32-rc6-armv5-davinci: ERRORS
linux-2.6.27-armv5-ixp: WARNINGS
linux-2.6.28-armv5-ixp: WARNINGS
linux-2.6.29.1-armv5-ixp: WARNINGS
linux-2.6.30-armv5-ixp: WARNINGS
linux-2.6.31-armv5-ixp: WARNINGS
linux-2.6.32-rc6-armv5-ixp: ERRORS
linux-2.6.28-armv5-omap2: WARNINGS
linux-2.6.29.1-armv5-omap2: WARNINGS
linux-2.6.30-armv5-omap2: WARNINGS
linux-2.6.31-armv5-omap2: ERRORS
linux-2.6.32-rc6-armv5-omap2: OK
linux-2.6.22.19-i686: WARNINGS
linux-2.6.23.12-i686: WARNINGS
linux-2.6.24.7-i686: WARNINGS
linux-2.6.25.11-i686: WARNINGS
linux-2.6.26-i686: WARNINGS
linux-2.6.27-i686: WARNINGS
linux-2.6.28-i686: WARNINGS
linux-2.6.29.1-i686: WARNINGS
linux-2.6.30-i686: WARNINGS
linux-2.6.31-i686: WARNINGS
linux-2.6.32-rc6-i686: WARNINGS
linux-2.6.23.12-m32r: WARNINGS
linux-2.6.24.7-m32r: WARNINGS
linux-2.6.25.11-m32r: WARNINGS
linux-2.6.26-m32r: WARNINGS
linux-2.6.27-m32r: WARNINGS
linux-2.6.28-m32r: WARNINGS
linux-2.6.29.1-m32r: WARNINGS
linux-2.6.30-m32r: WARNINGS
linux-2.6.31-m32r: WARNINGS
linux-2.6.32-rc6-m32r: OK
linux-2.6.30-mips: WARNINGS
linux-2.6.31-mips: WARNINGS
linux-2.6.32-rc6-mips: ERRORS
linux-2.6.27-powerpc64: WARNINGS
linux-2.6.28-powerpc64: WARNINGS
linux-2.6.29.1-powerpc64: WARNINGS
linux-2.6.30-powerpc64: WARNINGS
linux-2.6.31-powerpc64: WARNINGS
linux-2.6.32-rc6-powerpc64: WARNINGS
linux-2.6.22.19-x86_64: WARNINGS
linux-2.6.23.12-x86_64: WARNINGS
linux-2.6.24.7-x86_64: WARNINGS
linux-2.6.25.11-x86_64: WARNINGS
linux-2.6.26-x86_64: WARNINGS
linux-2.6.27-x86_64: WARNINGS
linux-2.6.28-x86_64: WARNINGS
linux-2.6.29.1-x86_64: WARNINGS
linux-2.6.30-x86_64: WARNINGS
linux-2.6.31-x86_64: WARNINGS
linux-2.6.32-rc6-x86_64: ERRORS
sparse (linux-2.6.31): OK
sparse (linux-2.6.32-rc6): OK
linux-2.6.16.61-i686: ERRORS
linux-2.6.17.14-i686: ERRORS
linux-2.6.18.8-i686: WARNINGS
linux-2.6.19.5-i686: WARNINGS
linux-2.6.20.21-i686: WARNINGS
linux-2.6.21.7-i686: WARNINGS
linux-2.6.16.61-x86_64: ERRORS
linux-2.6.17.14-x86_64: ERRORS
linux-2.6.18.8-x86_64: WARNINGS
linux-2.6.19.5-x86_64: WARNINGS
linux-2.6.20.21-x86_64: WARNINGS
linux-2.6.21.7-x86_64: WARNINGS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.tar.bz2

The V4L2 specification failed to build, but the last compiled spec is here:

http://www.xs4all.nl/~hverkuil/spec/v4l2.html

The DVB API specification failed to build, but the last compiled spec is here:

http://www.xs4all.nl/~hverkuil/spec/dvbapi.pdf

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pull from http://jusst.de/hg/v4l-dvb

2009-11-15 Thread Jonas Kvinge
Manu Abraham wrote:

 Thanks for the feedback.
 
 I've been looking into the issue you mentioned as well, but still
 haven't reached
 the destination yet.
 

Has anyone tested if the S2-1600 has the same problems?

Jonas

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libv4l2: error dequeuing buf: Input/output error

2009-11-15 Thread bifferos

Hi all,

Can anyone give any clue as to why I might get this error 
when capturing from a PAC207 webcam?  It happens after a 6-7 
second delay when capturing.

I've seen this with 2.6.30.1, 2.6.30.5 and 2.6.32-rc7, however 
I can run the same camera on another (much faster) system using 
the same kernel(s) and same gspca driver and it works fine, 
making me think this is a timing issue.

I'm testing with the v4lgrab.c program, compiled statically 
against libv4l2.  A quick google indicates I'm not the only
one encountering the problem. 

thanks,
Biff.


  
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] soc-camera: tw9910: modify V/H outpit pin setting to use VALID

2009-11-15 Thread Kuninori Morimoto

Dear Guennadi

Thank you

 Oh, indeed. Ok, but can you add proper support for both high and low 
 polarities?

I think your order will be added in next patch.
Add polarities support
I will send it
OK ?

By the way.
Maybe I should ask you about it.

My question is that who select ACTIVE HI / LOW ?

-
unsigned long flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_MASTER |
SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_HIGH |
+   SOCAM_VSYNC_ACTIVE_LOW | SOCAM_HSYNC_ACTIVE_LOW |
SOCAM_DATA_ACTIVE_HIGH | priv-info-buswidth;
-

If I add above, and (for example) CEU - tw9910 case,
tw9910_query_bus_param will be used in
sh_mobile_ceu_set_bus_param.

Then, the answer from soc_camera_bus_param_compatible
have both xSYNC_ACTIVE_HIGH/LOW.
In this case, CEU behavior will be LOW,
though it have HIGH.
Please check it.

In my opinion, the answer from soc_camera_bus_param_compatible
should not have both ACTIVE HIGH/LOW.
This value will be used in tw9910_set_bus_param too.

I guess, to add your order, we needs more than 2 patches.

modify soc_camera_bus_param_compatible behavior
tw9910: Add polarities support

Best regards
--
Kuninori Morimoto
 
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


AverTV TwinStar support

2009-11-15 Thread Piero Terzulli
hi all,

I've recently bought an Avermedia Twinstar usb device and I'm trying
to make it work on linux.
Unfortunately, my system doesn't recognize it (i'm running sabayon
linux with 2.6.31 kernel).
Taking a look inside it seems the card  is based on a AF9035B-N2 chip,
maybe incompatible with the AF9015 driver.

Here is my lsusb output, hope it helps to get this device supported.

# lsusb
usb 1-6: new high speed USB device using ehci_hcd and address 5
usb 1-6: New USB device found, idVendor=07ca, idProduct=0825
usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-6: Product: A825
usb 1-6: Manufacturer: AVerMedia TECHNOLOGIES, Inc.
usb 1-6: SerialNumber: 3018704000300
usb 1-6: configuration #1 chosen from 1 choice


PS: at this this link afatech claims there is support for linux
http://www.ite.com.tw/EN/products_more.aspx?CategoryID=6ID=15,63


thanks for all the hard work

Pierangelo Terzulli
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: libv4l2: error dequeuing buf: Input/output error

2009-11-15 Thread Sean
There have been some improvements to gspca_main and gspca_pac207 
recently, as well as pac207 specific improvements in libv4l2. Are you 
using the latest v4l-dvb and libv4l2? I get some slowdown halfway when 
using capture-example.c and it seems to improve when I use the latest 
v4l-dvb and libv4l2 from mercurial. http://linuxtv.org/hg/v4l-dvb


Sean

bifferos wrote:

Hi all,

Can anyone give any clue as to why I might get this error 
when capturing from a PAC207 webcam?  It happens after a 6-7 
second delay when capturing.


I've seen this with 2.6.30.1, 2.6.30.5 and 2.6.32-rc7, however 
I can run the same camera on another (much faster) system using 
the same kernel(s) and same gspca driver and it works fine, 
making me think this is a timing issue.


I'm testing with the v4lgrab.c program, compiled statically 
against libv4l2.  A quick google indicates I'm not the only
one encountering the problem. 


thanks,
Biff.


  
--

To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://www.kernellabs.com/hg/~dheitmueller/misc-fixes-4

2009-11-15 Thread Devin Heitmueller
Hello Mauro,

Please pull from
http://www.kernellabs.com/hg/~dheitmueller/misc-fixes-4 for the
following:

cxusb: Fix hang on DViCO FusionHDTV DVB-T Dual Digital 4 (rev 1)

Thanks,

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] DM644x CCDC: Add 10bit BT support

2009-11-15 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
Reviewed-by: Muralidharan Karicheri m-kariche...@ti.com
---
 drivers/media/video/davinci/dm644x_ccdc.c  |   17 +
 drivers/media/video/davinci/dm644x_ccdc_regs.h |8 
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/davinci/dm644x_ccdc.c 
b/drivers/media/video/davinci/dm644x_ccdc.c
index 2f19a91..9d601b4 100644
--- a/drivers/media/video/davinci/dm644x_ccdc.c
+++ b/drivers/media/video/davinci/dm644x_ccdc.c
@@ -394,7 +394,11 @@ void ccdc_config_ycbcr(void)
 * configure the FID, VD, HD pin polarity,
 * fld,hd pol positive, vd negative, 8-bit data
 */
-   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE | CCDC_SYN_MODE_8BITS;
+   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE;
+   if (ccdc_if_type == VPFE_BT656_10BIT)
+   syn_mode |= CCDC_SYN_MODE_10BITS;
+   else
+   syn_mode |= CCDC_SYN_MODE_8BITS;
} else {
/* y/c external sync mode */
syn_mode |= (((params-fid_pol  CCDC_FID_POL_MASK) 
@@ -413,8 +417,13 @@ void ccdc_config_ycbcr(void)
 * configure the order of y cb cr in SDRAM, and disable latch
 * internal register on vsync
 */
-   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
-CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);
+   if (ccdc_if_type == VPFE_BT656_10BIT)
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE | CCDC_CCDCFG_BW656_10BIT,
+   CCDC_CCDCFG);
+   else
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);

/*
 * configure the horizontal line offset. This should be a
@@ -429,7 +438,6 @@ void ccdc_config_ycbcr(void)

ccdc_sbl_reset();
dev_dbg(dev, \nEnd of ccdc_config_ycbcr...\n);
-   ccdc_readregs();
 }

 static void ccdc_config_black_clamp(struct ccdc_black_clamp *bclamp)
@@ -822,6 +830,7 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param 
*params)
case VPFE_BT656:
case VPFE_YCBCR_SYNC_16:
case VPFE_YCBCR_SYNC_8:
+   case VPFE_BT656_10BIT:
ccdc_hw_params_ycbcr.vd_pol = params-vdpol;
ccdc_hw_params_ycbcr.hd_pol = params-hdpol;
break;
diff --git a/drivers/media/video/davinci/dm644x_ccdc_regs.h 
b/drivers/media/video/davinci/dm644x_ccdc_regs.h
index 6e5d053..b18d166 100644
--- a/drivers/media/video/davinci/dm644x_ccdc_regs.h
+++ b/drivers/media/video/davinci/dm644x_ccdc_regs.h
@@ -135,11 +135,19 @@
 #define CCDC_SYN_MODE_INPMOD_SHIFT 12
 #define CCDC_SYN_MODE_INPMOD_MASK  3
 #define CCDC_SYN_MODE_8BITS(7  8)
+#define CCDC_SYN_MODE_10BITS   (6  8)
+#define CCDC_SYN_MODE_11BITS   (5  8)
+#define CCDC_SYN_MODE_12BITS   (4  8)
+#define CCDC_SYN_MODE_13BITS   (3  8)
+#define CCDC_SYN_MODE_14BITS   (2  8)
+#define CCDC_SYN_MODE_15BITS   (1  8)
+#define CCDC_SYN_MODE_16BITS   (0  8)
 #define CCDC_SYN_FLDMODE_MASK  1
 #define CCDC_SYN_FLDMODE_SHIFT 7
 #define CCDC_REC656IF_BT656_EN 3
 #define CCDC_SYN_MODE_VD_POL_NEGATIVE  (1  2)
 #define CCDC_CCDCFG_Y8POS_SHIFT11
+#define CCDC_CCDCFG_BW656_10BIT(1  5)
 #define CCDC_SDOFST_FIELD_INTERLEAVED  0x249
 #define CCDC_NO_CULLING0x00ff
 #endif
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC, PATCH] gspca pac7302: add support for camera button

2009-11-15 Thread Németh Márton
Hi,
Hans de Goede wrote:
 Hi,
 
 Thanks for working on this! I think it would be great if we could
 get support for camera buttons in general into gspca.
 
 I've not looked closely at your code yet, have you looked at
 the camera button code in the gspca sn9c20x.c driver? Also I would really

As you proposed I had a look on sn9c20x. It seems that sn9c20x uses register 
read
via USB control message. The pac7302 uses interrupt endpoint. So it looks like
quite different to me. Currently I see the common point in the connection
to input subsystem only.

 like to see as much of the button handling code as possible go into
 the gspca core. AFAIK many many camera's use an usb interrupt ep for this, so
 I would like to see the setting up and cleanup of this interrupt ep be in
 the core (as said before see the sn9c20x driver for another driver which
 does such things).

Unfortunately I do not know how the USB descriptors of other webcams look like.
I have access to two webcams which are handled by gspca:

 1. Labtec Webcam 2200 (USB ID 093a:2626):

Interface Number: 0
Name: (none)
Alternate Number: 0
Class: ff(vend.)
Sub Class: ff
Protocol: ff
Number of Endpoints: 6

[...]

Endpoint Address: 83
Direction: in
Attribute: 3
Type: Int.
Max Packet Size: 2
Interval: 50ms

This endpoint handles the capture button.

 2. Trust 610 LCD pow...@m Zoom (USB ID 06d6:0031)

Interface Number: 1
Name: (none)
Alternate Number: 0
Class: ff(vend.)
Sub Class: 00
Protocol: 00
Number of Endpoints: 3

[...]

Endpoint Address: 84
Direction: in
Attribute: 3
Type: Int.
Max Packet Size: 1
Interval: 1ms

I don't know what this interrupt endpoint is useful for.

Comparing these two endpoints shows the common and different points:
Common: interface class, endpoint direction, endpoint type.
Different: interface number, sub class, protocol, endpoint address, max
   packet size, interval.

Maybe the second example is not a good one because I don't know whether
the interrupt endpoint is used for buttons or not.

Do you have access to webcams equipped with button? Could you please
send the device descriptor (lsusb -v) about these devices in order
the common points can be identified for interrupt endpoints?

Regards,

Márton Németh

 On 11/15/2009 09:47 AM, Németh Márton wrote:
 From: Márton Némethnm...@freemail.hu

 Add support for snapshot button found on Labtec Webcam 2200.

 Signed-off-by: Márton Némethnm...@freemail.hu
 ---
 Hi,

 this is the first trial to add support for the snapshot button. This
 code is working only before the streaming is started. When the streaming
 is started the alternate number of the interface 0 is changed and the
 interrupt URB is no longer usable. I guess the interrupt URB is to
 be reconstructed every time when the alternate number is changed.

 When I disconnect the device I get the following error:

 uhci_hcd :00:1d.1: dma_pool_free buffer-32, f58ba168/358ba168 (bad dma)

 I guess something is wrong in this patch with the cleanup routine.

 Regards,

  Márton Németh

 ---
 diff -r 09c1284de47d linux/drivers/media/video/gspca/gspca.h
 --- a/linux/drivers/media/video/gspca/gspca.hSat Nov 14 08:58:12 
 2009 +0100
 +++ b/linux/drivers/media/video/gspca/gspca.hSun Nov 15 10:40:54 
 2009 +0100
 @@ -138,6 +138,7 @@
  struct module *module;  /* subdriver handling the device */
  struct usb_device *dev;
  struct file *capt_file; /* file doing video capture */
 +struct input_dev *input_dev;

  struct cam cam; /* device information */
  const struct sd_desc *sd_desc;  /* subdriver description */
 @@ -147,6 +148,7 @@
   #define USB_BUF_SZ 64
  __u8 *usb_buf;  /* buffer for USB exchanges */
  struct urb *urb[MAX_NURBS];
 +struct urb *int_urb;

  __u8 *frbuf;/* buffer for nframes */
  struct gspca_frame frame[GSPCA_MAX_FRAMES];
 diff -r 09c1284de47d linux/drivers/media/video/gspca/pac7302.c
 --- a/linux/drivers/media/video/gspca/pac7302.c  Sat Nov 14 08:58:12 
 2009 +0100
 +++ b/linux/drivers/media/video/gspca/pac7302.c  Sun Nov 15 10:40:54 
 2009 +0100
 @@ -68,6 +68,7 @@

   #define MODULE_NAME pac7302

 +#includelinux/input.h
   #includemedia/v4l2-chip-ident.h
   #include gspca.h

 @@ -1220,6 +1221,50 @@
   }
   #endif

 +#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 19)
 +static void