Web lists-archives.org

[Spca50x-devs] gstreamer v4lsrc negotiation for Flexcam 100 camera




Hi spca5xx gurus,

I know this isn't a gstreamer forum, but I think the problem I'm having is during the format negotiation between gstreamer's "v4lsrc" element and the spca5xx v4l driver.  My understanding is that I should be able to do:

   $ gst-launch-0.10 v4lsrc device=/dev/video0 ! xvimagesink

... and it will negotiate a proper format from my PC cam (details below) and a display window.  However, no matter what I do I always get the familiar "Could not negotiate format" error (shown as "VIDIOCMCAPTURE: invalid format ([some number])" in /var/log/messages).  I had a similar problem when trying to access spca5xx from sane-based applications, but was able to fix it by specifying mode=Color.  Unfortunately I haven't found a way to specify this mode in gstreamer.

I tried using filtered caps similar to this:

   $ gst-launch-0.10 v4lsrc device=/dev/video0 ! video/x-raw-yuv,format:fourcc=I420 ! xvimagesink

... but it seems like filtered caps are designed to filter down from existing capabilities, and not to force the v4lsrc device to a specific mode.

I'm posting here in case there is a problem with the negotiation process that you should be aware of.  If, instead, spca5xx is negotiating properly and I just don't understand gstreamer well enough to make it work then I apologize for posting to the wrong forum.  In any event, does anyone have any ideas what I can try next?

Thanks,
Mike

Problem details follow:
------------------------------------------------------------
## When executing "$ gst-launch-0.10 v4lsrc device=/dev/video0 ! xvimagesink" ##
  written to stdout:
    Setting pipeline to PAUSED ...
    ERROR: Pipeline doesn't want to pause.
    ERROR: from element /pipeline0/v4lsrc0: Could not negotiate format
    Additional debug info:
    gstbasesrc.c(1635): gst_base_src_start (): /pipeline0/v4lsrc0:
    Check your filtered caps, if any
    Setting pipeline to NULL ...
    FREEING pipeline ...

  written to /var/log/messages:
    Apr 11 22:30:00 kernel: [snip]/drivers/usb/spca561.h: [spca561_init:469] Find spca561 USB Product ID 561
    Apr 11 22:30:00 kernel: [snip]/drivers/usb/spca5xx.c: VIDIOCMCAPTURE: invalid format (7)
    Apr 11 22:30:00 kernel: [snip]/drivers/usb/spca5xx.c: VIDIOCMCAPTURE: invalid format (9)
    Apr 11 22:30:00 kernel: [snip]/drivers/usb/spca5xx.c: VIDIOCMCAPTURE: invalid format (14)
    Apr 11 22:30:00 kernel: [snip]/drivers/usb/spca5xx.c: VIDIOCMCAPTURE: invalid format (13)
    Apr 11 22:30:00 kernel: [snip]/drivers/usb/spca5xx.c: VIDIOCMCAPTURE: invalid format (16)
    Apr 11 22:30:00 kernel: [snip]/drivers/usb/spca5xx.c: VIDIOCMCAPTURE: invalid format (11)
    Apr 11 22:30:00 kernel: [snip]/drivers/usb/spca5xx.c: VIDIOCMCAPTURE: invalid format (6)

  ** Note that it never tries format (15) which should work (where 15 == VIDEO_PALETTE_YUV420P)

## Camera ##
   Description: Acuvue Advance (?) mail-in offer USB PC camera (my words)
   Recognized as "Flexcam 100 Camera"

## My Environment ##
   Kernel: 2.6.16-1.2080_FC5
   OS:     Fedora Core 5
   CPU:    Intel(R) Pentium(R) 4 Mobile CPU 2.00GHz
   Driver version: spca5xx-20060402.tar.gz
   Viewer version: spcaview-20051127.tar.gz
   gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)
   gstreamer: gstreamer-0.10.4-1, gstreamer-plugins-base-0.10.5-1 (v4lsrc)

## USB Device Listing ##
   ... snip ...
   T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
   D:  Ver= 1.10 Cls=ff(vend.) Sub=ff Prot=00 MxPS= 8 #Cfgs=  1
   P:  Vendor=04fc ProdID=0561 Rev= 0.00
   S:  Manufacturer=Sunplus Technology Co., Ltd.
   S:  Product=Generic Digital camera
   C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
   I:  If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
   I:  If#= 0 Alt= 1 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 128 Ivl=1ms
   I:  If#= 0 Alt= 2 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 880 Ivl=1ms
   I:  If#= 0 Alt= 3 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 512 Ivl=1ms
   I:  If#= 0 Alt= 4 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 640 Ivl=1ms
   I:  If#= 0 Alt= 5 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 768 Ivl=1ms
   I:  If#= 0 Alt= 6 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 896 Ivl=1ms
   I:  If#= 0 Alt= 7 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS=1023 Ivl=1ms
   I:  If#= 0 Alt= 8 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 544 Ivl=1ms
   I:  If#= 0 Alt= 9 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 656 Ivl=1ms
   I:  If#= 0 Alt=10 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 704 Ivl=1ms
   I:  If#= 0 Alt=11 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 864 Ivl=1ms
   I:  If#= 0 Alt=12 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 960 Ivl=1ms
   I:  If#= 0 Alt=13 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=spca5xx
   E:  Ad=81(I) Atr=01(Isoc) MxPS= 845 Ivl=1ms
   ... snip ...