Logitech c270 webcam and pi

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Logitech c270 webcam and pi

Postby lowsider » Wed Jun 27, 2012 7:39 pm

hullo there you sexy arch users,
do you have a few minutes to sort out this linux noobie's webcam troubles?
of course you do! You're awesome!

i have a logitech c270 webcam plugged into my raspberry pi (running arch), via a powered usb hub.
so far i've been unable to get this thing to work and i'm hating life and being generally grouchy around my girlfriend. maybe someone here can help?

some things that might help you (oh savvy linux gods that you are), help me fix my problem. :)

i've used the power of the pacman to update my new arch system using pacman -Syu

I can see the device at /dev/video0

running "lsusb" gives me
$this->bbcode_second_pass_code('', '
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 005: ID 046d:0825 Logitech, Inc. Webcam C270
')

I'm using motion to try and play with the webcam. running motion gives me the following:
$this->bbcode_second_pass_code('', '
[root@alarmpi ~]# motion
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Unknown config option "sql_log_image"
[0] Unknown config option "sql_log_snapshot"
[0] Unknown config option "sql_log_mpeg"
[0] Unknown config option "sql_log_timelapse"
[0] Unknown config option "sql_query"
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3489124 LIBAVFORMAT_BUILD 3481700
[0] Thread 1 is from /etc/motion/motion.conf
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Thread 1 started
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-bcm2708_usb-1.2.2"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-bcm2708_usb-1.2.2"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-bcm2708_usb-1.2.2"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-bcm2708_usb-1.2.2"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-bcm2708_usb-1.2.2"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Video signal lost - Adding grey image
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-bcm2708_usb-1.2.2"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-bcm2708_usb-1.2.2"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-bcm2708_usb-1.2.2"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument
')

Thanks in advance for taking at look at this.
I appreciate any help or direction you guys might be able to offer.
lowsider
 
Posts: 3
Joined: Wed Jun 27, 2012 3:51 pm

Re: Logitech c270 webcam and pi

Postby hydro » Wed Jun 27, 2012 8:09 pm

The webcam worked fine with motion on my dockstar, but since a few weeks I have similar problems. My workaround is to first capture a single dummy picture using fswebcam before starting motion.
$this->bbcode_second_pass_code('', '
fswebcam -r 320x240 -d /dev/video0 -v /dev/null
')
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: Logitech c270 webcam and pi

Postby lowsider » Wed Jun 27, 2012 9:01 pm

+_+
soo.. running fswebcam failed... (output i got back below) but... strangely enough it appears that motion now works! :shock:

I'm at work, but i'll post an update later...

$this->bbcode_second_pass_code('', '
[root@alarmpi ~]# fswebcam -r 320x240 -d /dev/video0 -v /dev/null
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
src_v4l2_get_capability,87: /dev/video0 information:
src_v4l2_get_capability,88: cap.driver: "uvcvideo"
src_v4l2_get_capability,89: cap.card: "UVC Camera (046d:0825)"
src_v4l2_get_capability,90: cap.bus_info: "usb-bcm2708_usb-1.2.2"
src_v4l2_get_capability,91: cap.capabilities=0x04000001
src_v4l2_get_capability,92: - VIDEO_CAPTURE
src_v4l2_get_capability,103: - STREAMING
No input was specified, using the first.
src_v4l2_set_input,181: /dev/video0: Input 0 information:
src_v4l2_set_input,182: name = "Camera 1"
src_v4l2_set_input,183: type = 00000002
src_v4l2_set_input,185: - CAMERA
src_v4l2_set_input,186: audioset = 00000000
src_v4l2_set_input,187: tuner = 00000000
src_v4l2_set_input,188: status = 00000000
src_v4l2_set_pix_format,541: Device offers the following V4L2 pixel formats:
src_v4l2_set_pix_format,554: 0: [0x56595559] 'YUYV' (YUV 4:2:2 (YUYV))
src_v4l2_set_pix_format,554: 1: [0x47504A4D] 'MJPG' (MJPEG)
Using palette MJPEG
src_v4l2_set_mmap,693: mmap information:
src_v4l2_set_mmap,694: frames=4
src_v4l2_set_mmap,741: 0 length=51200
src_v4l2_set_mmap,741: 1 length=51200
src_v4l2_set_mmap,741: 2 length=51200
src_v4l2_set_mmap,741: 3 length=51200
--- Capturing frame...
verify_jpeg_dht,94: Inserting DHT segment into JPEG frame.
gd-jpeg: JPEG library reports unrecoverable error: Not a JPEG file: starts with 0xbd 0xa8
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to '/dev/null'.
')
lowsider
 
Posts: 3
Joined: Wed Jun 27, 2012 3:51 pm

Re: Logitech c270 webcam and pi

Postby hydro » Thu Jun 28, 2012 8:55 am

Yes, at first fswebcam fails, but if you run it a second time it will succeed (you may want to direct output to a file rather than >/dev/null).
Btw. I found another workaround here. This also works:
$this->bbcode_second_pass_code('', '
[ -z "$PID" ] && LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so /usr/bin/motion 1>/dev/null 2>&1
')
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: Logitech c270 webcam and pi

Postby lowsider » Thu Jun 28, 2012 2:31 pm

Thanks again hydro!

I've been trying to fix this on my own for over a week.

This sorted me right out. :D
lowsider
 
Posts: 3
Joined: Wed Jun 27, 2012 3:51 pm

Re: Logitech c270 webcam and pi

Postby reinaldoaf » Wed Sep 19, 2012 2:40 pm

Hi I have one power pack cam, and when I start motion server have a problem
I can´t understand what is the problem.

tks
$this->bbcode_second_pass_code('', '

ts7500:~# LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so && /usr/bin/motion
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.9 Started
[0] ffmpeg LIBAVCODEC_BUILD 3355136 LIBAVFORMAT_BUILD 3409664
[0] Thread 1 is from /etc/motion/motion.conf
[1] Thread 1 started
[1] cap.driver: "uvcvideo"
[0] motion-httpd/3.2.9 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] cap.card: "USB2.0_Camera"
[1] cap.bus_info: "usb-str8100-ehci-1"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] Test palette YUYV (320x240)
[1] Using palette YUYV (320x240) bytesperlines 640 sizeimage 153600 colorspace 00000008
[1] found control 0x00980900, "Brightness", range 0,255
[1] "Brightness", default 125, current 125
[1] found control 0x00980901, "Contrast", range 0,100
[1] "Contrast", default 65, current 65
[1] found control 0x00980902, "Saturation", range 0,200
[1] "Saturation", default 168, current 168
[1] found control 0x00980903, "Hue", range -180,180
[1] "Hue", default 0, current 0
[1] found control 0x00980910, "Gamma", range 40,100
[1] "Gamma", default 50, current 50
[1] mmap information:
[1] frames=4
[1] 0 length=153600
[1] 1 length=153600
[1] 2 length=153600
[1] 3 length=153600
[1] Using V4L2
[1] Started stream webcam server in port 8081
[1] File of type 8 saved to: /tmp/motion/01-19700101000607.swf
Segmentation fault
')
reinaldoaf
 
Posts: 5
Joined: Wed Sep 19, 2012 2:37 pm

Re: Logitech c270 webcam and pi

Postby WarheadsSE » Wed Sep 19, 2012 2:56 pm

Install strace & re-run

Using gdb, you might even be able to find exactly where it is segfaulting ;)
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Logitech c270 webcam and pi

Postby reinaldoaf » Wed Sep 19, 2012 6:55 pm

maybe no work

$this->bbcode_second_pass_code('', '

ts7500:/usr/src# LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so && gdb motion
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnu"...
(no debugging symbols found)
(gdb) q
ts7500:/usr/src#
')
reinaldoaf
 
Posts: 5
Joined: Wed Sep 19, 2012 2:37 pm

Re: Logitech c270 webcam and pi

Postby WarheadsSE » Wed Sep 19, 2012 7:01 pm

"run"
"bt"
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Logitech c270 webcam and pi

Postby xenoxaos » Wed Sep 19, 2012 7:04 pm

I would try removing any of the video capturing in the config file. I've never had any luck with getting motion to grab video (it just takes too damn long to encode anyway) It typically has no issues with grabbing jpg frames and saving them.
Arch Linux ARM exists and continues to grow through community support, please donate today!
xenoxaos
Developer
 
Posts: 323
Joined: Thu Jan 06, 2011 1:45 am

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 10 guests