Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] WebCam and ZoneMinder
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Thu Oct 28, 2010 6:47 am    Post subject: [Solved] WebCam and ZoneMinder Reply with quote

I am following the instructions at http://en.gentoo-wiki.com/wiki/Webcam to install my MSI 370i StarCam.
I have my kernel configured.
Everything seems to be in place but v4l-info complains about no /dev/video0

Any suggestions on where I am going wrong?

Plugging in the WebCam in, whilst booted gives the following /var/log/messages
Code:

Oct 28 17:11:12 pearcely kernel: [ 2169.550436] hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0020
Oct 28 17:11:12 pearcely kernel: [ 2169.550445] ehci_hcd 0000:00:1d.7: GetStatus port 5 status 001803 POWER sig=j CSC CONNECT
Oct 28 17:11:12 pearcely kernel: [ 2169.550453] hub 2-0:1.0: port 5, status 0501, change 0001, 480 Mb/s
Oct 28 17:11:12 pearcely kernel: [ 2169.654272] hub 2-0:1.0: debounce: port 5: total 100ms stable 100ms status 0x501
Oct 28 17:11:12 pearcely kernel: [ 2169.705471] ehci_hcd 0000:00:1d.7: port 5 full speed --> companion
Oct 28 17:11:12 pearcely kernel: [ 2169.705477] ehci_hcd 0000:00:1d.7: GetStatus port 5 status 003801 POWER OWNER sig=j CONNECT
Oct 28 17:11:12 pearcely kernel: [ 2169.705481] hub 2-0:1.0: port 5 not reset yet, waiting 50ms
Oct 28 17:11:12 pearcely kernel: [ 2169.705495] usb usb7: wakeup_rh (auto-start)
Oct 28 17:11:13 pearcely kernel: [ 2169.756270] ehci_hcd 0000:00:1d.7: GetStatus port 5 status 003002 POWER OWNER sig=se0 CSC
Oct 28 17:11:13 pearcely kernel: [ 2169.756289] hub 7-0:1.0: state 7 ports 2 chg 0000 evt 0002
Oct 28 17:11:13 pearcely kernel: [ 2169.756295] uhci_hcd 0000:00:1d.2: port 1 portsc 0093,00
Oct 28 17:11:13 pearcely kernel: [ 2169.756301] hub 7-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
Oct 28 17:11:13 pearcely kernel: [ 2169.860273] hub 7-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
Oct 28 17:11:13 pearcely kernel: [ 2169.962030] usb 7-1: new full speed USB device using uhci_hcd and address 3
Oct 28 17:11:13 pearcely kernel: [ 2170.098506] usb 7-1: skipped 4 descriptors after interface
Oct 28 17:11:13 pearcely kernel: [ 2170.098509] usb 7-1: skipped 2 descriptors after interface
Oct 28 17:11:13 pearcely kernel: [ 2170.098512] usb 7-1: skipped 1 descriptor after endpoint
Oct 28 17:11:13 pearcely kernel: [ 2170.103493] usb 7-1: default language 0x0409
Oct 28 17:11:13 pearcely kernel: [ 2170.108493] usb 7-1: udev 3, busnum 7, minor = 770
Oct 28 17:11:13 pearcely kernel: [ 2170.108496] usb 7-1: New USB device found, idVendor=0c45, idProduct=60c0
Oct 28 17:11:13 pearcely kernel: [ 2170.108499] usb 7-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
Oct 28 17:11:13 pearcely kernel: [ 2170.108501] usb 7-1: Product: USB camera
Oct 28 17:11:13 pearcely kernel: [ 2170.108582] usb 7-1: usb_probe_device
Oct 28 17:11:13 pearcely kernel: [ 2170.108586] usb 7-1: configuration #1 chosen from 1 choice
Oct 28 17:11:13 pearcely kernel: [ 2170.111497] usb 7-1: adding 7-1:1.0 (config #1, interface 0)
Oct 28 17:11:13 pearcely kernel: [ 2170.111569] usb 7-1: adding 7-1:1.1 (config #1, interface 1)
Oct 28 17:11:13 pearcely kernel: [ 2170.111605] snd-usb-audio 7-1:1.1: usb_probe_interface
Oct 28 17:11:13 pearcely kernel: [ 2170.111609] snd-usb-audio 7-1:1.1: usb_probe_interface - got id
Oct 28 17:11:13 pearcely kernel: [ 2170.142771] usb 7-1: adding 7-1:1.2 (config #1, interface 2)
Oct 28 17:11:13 pearcely kernel: [ 2170.142796] drivers/usb/core/inode.c: creating file '003'
Oct 28 17:11:13 pearcely kernel: [ 2170.142819] hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0020
Oct 28 17:11:13 pearcely kernel: [ 2170.142826] hub 7-0:1.0: state 7 ports 2 chg 0000 evt 0002
Oct 28 17:11:13 pearcely pcscd: hotplug_libhal.c:320:get_driver() Looking a driver for VID: 0x0C45, PID: 0x60C0
Oct 28 17:11:13 pearcely pcscd: hotplug_libhal.c:320:get_driver() Looking a driver for VID: 0x0C45, PID: 0x60C0
Oct 28 17:11:13 pearcely pcscd: hotplug_libhal.c:320:get_driver() Looking a driver for VID: 0x0C45, PID: 0x60C0


Code:
dmseg
<snip>
[ 1357.928263] Linux video capture interface: v2.00
[ 1357.940886] usbcore: registered new interface driver uvcvideo
[ 1357.940888] USB Video Class driver (v0.1.0)

Code:

# lsusb
Bus 006 Device 004: ID 413c:3010 Dell Computer Corp. Optical Wheel Mouse
Bus 006 Device 003: ID 413c:2010 Dell Computer Corp.
Bus 006 Device 002: ID 413c:1003 Dell Computer Corp.
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 002: ID 0c45:60c0 Microdia PC Camera with Mic (SN9C105)
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
root@pearcely:zoneminder

Code:

# lsmod
Module                  Size  Used by
uvcvideo               45874  0
videodev               29410  1 uvcvideo
v4l1_compat            10548  2 uvcvideo,videodev
lm90                    7548  0
coretemp                4066  0
snd_pcm_oss            28134  0
snd_mixer_oss          10513  1 snd_pcm_oss
snd_seq_dummy           1154  0
snd_seq_oss            20981  0
snd_seq_midi_event      4750  1 snd_seq_oss
snd_seq                37232  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
vboxnetflt             12153  1
vboxnetadp              5150  0
vboxdrv               148986  3 vboxnetflt,vboxnetadp
snd_hda_codec_analog    51431  1
snd_hda_intel          17505  0
nvidia               9971484  40
snd_usb_audio          67426  3
snd_hda_codec          55567  2 snd_hda_codec_analog,snd_hda_intel
snd_usb_lib            13192  1 snd_usb_audio
snd_rawmidi            14829  1 snd_usb_lib
snd_hwdep               4478  2 snd_usb_audio,snd_hda_codec
snd_seq_device          4681  4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd_pcm                54381  5 snd_pcm_oss,snd_hda_intel,snd_usb_audio,snd_hda_codec
i2c_i801                6503  0
snd_timer              14279  3 snd_seq,snd_pcm
snd_page_alloc          5901  2 snd_hda_intel,snd_pcm

Code:
root@pearcely:zoneminder
# modinfo uvcvideo
filename:       /lib/modules/2.6.34-gentoo-r12/kernel/drivers/media/video/uvc/uvcvideo.ko
version:        v0.1.0
license:        GPL
description:    USB Video Class driver
author:         Laurent Pinchart <laurent.pinchart@skynet.be>
srcversion:     DD0D2B0ECB05BF794B6AF5A
alias:          usb:v*p*d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v1C4Fp3000d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v1B3Bp2951d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v19ABp1000d00*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v19ABp1000d01[0-1]*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v19ABp1000d012[0-6]dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v18ECp3290d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v18ECp3288d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v18CDpCAFEd*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v1871p0306d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v17EFp480Bd*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v174Fp8A34d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v174Fp8A33d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v174Fp8A31d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v174Fp8A12d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v174Fp5931d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v174Fp5212d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v0E8Dp0004d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v0AC8p3420d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v0AC8p3410d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v0AC8p332Dd*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v05E3p0505d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v05ACp8501d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v058Fp3820d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v046Dp08C7d*dc*dsc*dp*icFFisc01ip00*
alias:          usb:v046Dp08C6d*dc*dsc*dp*icFFisc01ip00*
alias:          usb:v046Dp08C5d*dc*dsc*dp*icFFisc01ip00*
alias:          usb:v046Dp08C3d*dc*dsc*dp*icFFisc01ip00*
alias:          usb:v046Dp08C2d*dc*dsc*dp*icFFisc01ip00*
alias:          usb:v046Dp08C1d*dc*dsc*dp*icFFisc01ip00*
alias:          usb:v045Ep0723d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v045Ep00F8d*dc*dsc*dp*ic0Eisc01ip00*
alias:          usb:v0458p706Ed*dc*dsc*dp*ic0Eisc01ip00*
depends:        videodev,v4l1-compat
vermagic:       2.6.34-gentoo-r12 SMP preempt mod_unload PENTIUM4
parm:           clock:Video buffers timestamp clock
parm:           nodrop:Don't drop incomplete frames (uint)
parm:           quirks:Forced device quirks (uint)
parm:           trace:Trace level bitmask (uint)
parm:           timeout:Streaming control requests timeout (uint)
root@pearcely:zoneminder

Code:
# /etc/modules.autoload.d/kernel-2.6:  kernel modules to load when system boots.
#
# Note that this file is for 2.6 kernels.
#
# Add the names of modules that you'd like to load when the system
# starts into this file, one per line.  Comments begin with # and
# are ignored.  Read man modules.autoload for additional details.

# For example:
# aic7xxx
vboxdrv
vboxnetadp
vboxnetflt
# webcam
uvcvideo

Code:

[I] sys-fs/udev
     Available versions:  114 115-r1 119 124-r1 124-r2 141 ~141-r1 146-r1!t 149 151-r4 ~162 ~163 **9999 {(+)devfs-compat (-)extras old-hd-rules selinux test}
     Installed versions:  151-r4(11:11:31 23/07/10)(-devfs-compat -extras -old-hd-rules -selinux -test)
     Homepage:            http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
     Description:         Linux dynamic and persistent device naming support (aka userspace devfs)


kernel configuration
Code:

# grep -i v4l .config
CONFIG_VIDEO_V4L2_COMMON=m
# CONFIG_VIDEO_ALLOW_V4L1 is not set
CONFIG_VIDEO_V4L1_COMPAT=y
CONFIG_VIDEO_V4L2=m
CONFIG_V4L_USB_DRIVERS=y
root@pearcely:linux
# grep -i usb .config | grep -v 'not set'
# USB Network Adapters
CONFIG_I2C_TINY_USB=m
# USB-based Watchdog Cards
CONFIG_V4L_USB_DRIVERS=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_USB_GSPCA=m
CONFIG_USB_GSPCA_SN9C20X=m
CONFIG_USB_GSPCA_SN9C20X_EVDEV=y
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m
# USB Input Devices
CONFIG_USB_HID=y
CONFIG_USB_HIDDEV=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
CONFIG_USB_DEBUG=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
# Miscellaneous USB options
CONFIG_USB_DEVICEFS=y
CONFIG_USB_MON=y
# USB Host Controller Drivers
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=y
# USB Device Class drivers
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
# also be needed; see USB_STORAGE Help for more info
CONFIG_USB_STORAGE=y
CONFIG_USB_LIBUSUAL=y
# USB Imaging devices
# USB port drivers
# USB Miscellaneous drivers
root@pearcely:linux

_________________
...Lyall


Last edited by lyallp on Thu Dec 02, 2010 4:57 am; edited 3 times in total
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Thu Oct 28, 2010 10:54 am    Post subject: Reply with quote

I had a similar problem, and experimented with the different drivers. Turns out that the driver that I thought was recommended for my hardware, didn't work with it, so in the end I settled on some older deprecated driver. Not much to go on for you, but hopeful helps a little bit.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Thu Oct 28, 2010 11:35 am    Post subject: Reply with quote

May have found the problem.
I did not use the correct driver.
I found the USB Device ID in /usr/src/linux/Documentation/video4linux/gspca.txt
and it indicates that I should be using sonixj driver, not sn9c20x (which I had selected).
I will try it out tomorrow.
_________________
...Lyall
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Fri Oct 29, 2010 12:01 am    Post subject: Reply with quote

Improvement but still no joy.

For ZoneMinder to build, I needed to ensure my /etc/make.conf MAKEOPTS had '-j1', not my usual '-j4', ZoneMinder does not parallel build, apparently.

ZoneMinder also would not compile unless I did
Code:
 export CPPFLAGS="-D__STDC_CONSTANT_MACROS" ; emerge zoneminder


ZoneMinder also needs lots of shared memory, so had to add
Code:
#edit:fixed previously wrong prefix of sys.
kernel.shmmax=4194304000
kernel.shmall=2048000
to /etc/sysctl.conf (probably overkill with these numbers)

ZoneMinder required /etc/php/apache2-php5/php.ini to have
Code:
short_open_tag = On
or there are syntax errors in the cgi code.

For the WebCam (an MSI StarCam 370i)

v4l-info now shows the camera but mplayer won't play. :( with a consequence that ZoneMinder doesn't work either

Getting closer though.



Code:
root@pearcely:kernel
# v4l-info

### v4l2 device info [/dev/video0] ###
general info
    VIDIOC_QUERYCAP
   driver                  : "sonixj"
   card                    : "USB camera"
   bus_info                : "usb-0000:00:1d.2-2"
   version                 : 2.9.0
   capabilities            : 0x5000001 [VIDEO_CAPTURE,READWRITE,STREAMING]

standards

inputs
    VIDIOC_ENUMINPUT(0)
   index                   : 0
   name                    : "sonixj"
   type                    : CAMERA
   audioset                : 0
   tuner                   : 0
   std                     : 0x0 []
   status                  : 0x0 []

video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
   index                   : 0
   type                    : VIDEO_CAPTURE
   flags                   : 1
   description             : "JPEG"
   pixelformat             : 0x4745504a [JPEG]
    VIDIOC_G_FMT(VIDEO_CAPTURE)
   type                    : VIDEO_CAPTURE
   fmt.pix.width           : 640
   fmt.pix.height          : 480
   fmt.pix.pixelformat     : 0x4745504a [JPEG]
   fmt.pix.field           : NONE
   fmt.pix.bytesperline    : 640
   fmt.pix.sizeimage       : 230990
   fmt.pix.colorspace      : JPEG
   fmt.pix.priv            : 0

controls
    VIDIOC_QUERYCTRL(BASE+0)
   id                      : 9963776
   type                    : INTEGER
   name                    : "Brightness"
   minimum                 : 0
   maximum                 : 65535
   step                    : 1
   default_value           : 32768
   flags                   : 0
    VIDIOC_QUERYCTRL(BASE+1)
   id                      : 9963777
   type                    : INTEGER
   name                    : "Contrast"
   minimum                 : 0
   maximum                 : 127
   step                    : 1
   default_value           : 63
   flags                   : 0
    VIDIOC_QUERYCTRL(BASE+2)
   id                      : 9963778
   type                    : INTEGER
   name                    : "Saturation"
   minimum                 : 0
   maximum                 : 40
   step                    : 1
   default_value           : 25
   flags                   : 0
    VIDIOC_QUERYCTRL(PRIVATE_BASE+0)
   id                      : 134217728
   type                    : BOOLEAN
   name                    : "Infrared"
   minimum                 : 0
   maximum                 : 1
   step                    : 1
   default_value           : 0
   flags                   : 0

### video4linux device info [/dev/video0] ###
general info
    VIDIOCGCAP
   name                    : "USB camera"
   type                    : 0x1 [CAPTURE]
   channels                : 1
   audios                  : 0
   maxwidth                : 640
   maxheight               : 480
   minwidth                : 48
   minheight               : 32

channels
    VIDIOCGCHAN(0)
   channel                 : 0
   name                    : "sonixj"
   tuners                  : 0
   flags                   : 0x0 []
   type                    : CAMERA
   norm                    : 0

tuner
ioctl VIDIOCGTUNER: Invalid argument

audio
    VIDIOCGAUDIO
   audio                   : 0
   volume                  : 0
   bass                    : 0
   treble                  : 0

picture
    VIDIOCGPICT
   brightness              : 32768
   hue                     : 0
   colour                  : 40959
   contrast                : 32509
   whiteness               : 32768
   depth                   : 8
   palette                 : unknown

buffer
ioctl VIDIOCGFBUF: Invalid argument

window
    VIDIOCGWIN
   x                       : 0
   y                       : 0
   width                   : 640
   height                  : 480
   chromakey               : 0
   flags                   : 0

root@pearcely:kernel
#

Code:
pearcely:~
# mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:noaudio -fps 15
MPlayer SVN-r29796-4.4.3 (C) 2000-2009 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
 comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: USB camera
 Capabilites:  video capture  read/write  streaming
 supported norms:
 inputs: 0 = sonixj;
 Current input: 0
 Current format: unknown (0x4745504a)
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: Cannot get fps
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Unsupported PixelFormat -1
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
Audio: no sound
FPS forced to be 15.000  (ftime: 0.067).
Starting playback...
v4l2: select timeout ??% ??,?% 0 0
v4l2: select timeout ??% ??,?% 0 0
V:   0.0   5/  5 ??% ??% ??,?% 0 0

MPlayer interrupted by signal 2 in module: video_read_frame
v4l2: select timeout ??% ??,?% 0 0
v4l2: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 1 frames dropped.

Exiting... (Quit)
pearcely:~

/var/log/messages output
Code:
Oct 29 10:25:22 pearcely kernel: [ 3619.631065] uhci_hcd 0000:00:1d.2: release dev 3 ep81-ISO, period 1, phase 0, 807 us
Oct 29 10:25:22 pearcely kernel: [ 3619.632061] uhci_hcd 0000:00:1d.2: release dev 3 ep83-INT, period 64, phase 0, 12 us
Oct 29 10:25:22 pearcely kernel: [ 3619.633131] gspca: found int in endpoint: 0x83, buffer_len=1, interval=100
Oct 29 10:25:22 pearcely kernel: [ 3619.633139] uhci_hcd 0000:00:1d.2: reserve dev 3 ep83-INT, period 64, phase 0, 12 us

mplayer config includes v4l v4l2 and dvb
Code:
root@pearcely:kernel
# eix media-video/mplayer
[I] media-video/mplayer
     Available versions:  1.0_rc4_p20091026-r1 ~1.0_rc4_p20100506 ~1.0_rc4_p20100612 **9999 {3dnow 3dnowext +X +a52 +aac aalib +alsa altivec amr aqua +ass bidi bindist bl bluray bs2b +cddb +cdio cdparanoia cpudetection custom-cpuopts debug dga +dirac directfb doc +dts +dv dvb +dvd +dvdnav dxr3 +enca +encode esd external-ffmpeg +faac +faad fbcon ftp ggi gif -gmplayer gsm +iconv ipv6 jack joystick jpeg jpeg2k kernel_linux ladspa libcaca lirc +live lzo mad md5sum +mmx mmxext mng +mp3 nas +network nut openal +opengl +osdmenu oss png pnm pulseaudio pvr +quicktime radio +rar +real +rtc rtmp samba +schroedinger sdl +shm +speex sse sse2 ssse3 svga teletext tga +theora +toolame +tremor +truetype +twolame +unicode v4l v4l2 vdpau video_cards_mga video_cards_nvidia video_cards_s3virge video_cards_tdfx video_cards_vesa vidix +vorbis vpx win32codecs +x264 xanim xinerama +xscreensaver +xv +xvid xvmc zoran}
     Installed versions:  1.0_rc4_p20091026-r1(14:34:06 13/10/10)(X a52 aac alsa ass bindist cddb cdio cdparanoia dga dirac directfb dts dv dvb dvd dvdnav enca encode faac faad gif iconv ipv6 joystick jpeg kernel_linux libcaca live mad mmx mmxext mp3 network opengl osdmenu oss png quicktime radio rar real rtc samba schroedinger sdl shm speex sse sse2 svga tga theora toolame tremor truetype twolame unicode v4l v4l2 video_cards_nvidia vorbis win32codecs x264 xanim xinerama xscreensaver xv xvid xvmc -3dnow -3dnowext -aalib -altivec -amr -bidi -bl -bs2b -cpudetection -custom-cpuopts -debug -doc -dxr3 -esd -fbcon -ftp -ggi -gmplayer -jack -ladspa -lirc -lzo -md5sum -mng -nas -nut -openal -pnm -pulseaudio -pvr -ssse3 -teletext -vdpau -video_cards_mga -video_cards_s3virge -video_cards_tdfx -vidix -zoran)
     Homepage:            http://www.mplayerhq.hu/
     Description:         Media Player for Linux
<snip>
root@pearcely:kernel
#

_________________
...Lyall


Last edited by lyallp on Fri Nov 12, 2010 3:07 am; edited 1 time in total
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Fri Nov 12, 2010 1:07 am    Post subject: Reply with quote

Ok, I got desperate.
I set every USB video driver in the kernel to Module.
Now,
Code:
# v4l-info

### v4l2 device info [/dev/video0] ###
general info
    VIDIOC_QUERYCAP
        driver                  : "sn9c102"
        card                    : "SN9C1xx PC Camera"
        bus_info                : "usb-0000:00:1d.2-2"
        version                 : 1.1.47
        capabilities            : 0x5000001 [VIDEO_CAPTURE,READWRITE,STREAMING]

standards

inputs
    VIDIOC_ENUMINPUT(0)
        index                   : 0
        name                    : "Camera"
        type                    : CAMERA
        audioset                : 0
        tuner                   : 0
        std                     : 0x0 []
        status                  : 0x0 []

video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
        index                   : 0
        type                    : VIDEO_CAPTURE
        flags                   : 0
        description             : "bayer rgb"
        pixelformat             : 0x31384142 [BA81]
    VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
        index                   : 1
        type                    : VIDEO_CAPTURE
        flags                   : 1
        description             : "JPEG"
        pixelformat             : 0x4745504a [JPEG]
    VIDIOC_G_FMT(VIDEO_CAPTURE)
        type                    : VIDEO_CAPTURE
        fmt.pix.width           : 640
        fmt.pix.height          : 480
        fmt.pix.pixelformat     : 0x31384142 [BA81]
        fmt.pix.field           : NONE
        fmt.pix.bytesperline    : 640
        fmt.pix.sizeimage       : 307200
        fmt.pix.colorspace      : SRGB
        fmt.pix.priv            : 8

controls

Different driver, but still no joy with mplayer.
Code:
# mplayer tv:// -tv driver=v4l2:device=/dev/video0:noaudio -fps 15
MPlayer SVN-r29796-4.4.4 (C) 2000-2009 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
 comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: SN9C1xx PC Camera
 Capabilites:  video capture  read/write  streaming
 supported norms:
 inputs: 0 = Camera;
 Current input: 0
 Current format: unknown (0x31384142)
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: Cannot get fps
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
==========================================================================
Cannot find codec matching selected -vo and video format 0x31384142.
==========================================================================

v4l2: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 0 frames dropped.

Exiting... (End of file)

I tried various drivers for -vo (see -vo help), to no avail.
_________________
...Lyall
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Thu Nov 25, 2010 5:06 am    Post subject: Reply with quote

Got webcam to work using Mplayer https://forums.gentoo.org/viewtopic-t-854027-highlight-.html

Now trying to get webcam to work in ZoneMinder.

I have tweaked the ZoneMinder /etc/conf.d/zoneminder script as follows :-
Code:
ZM_SCRIPT=/usr/bin/zmpkg.pl

# Commands for starting and stopping the server

if [ -x /usr/lib/libv4l/v4l1compat.so ]
then
    preload="env LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so "
fi
CMD_START="${preload}${ZM_SCRIPT} start"
CMD_STOP="${preload}${ZM_SCRIPT} stop"
unset preload

but when I fiddle with zones in ZoneMinder, I do not see what the camera is seeing (using mplayer).

Suggestions welcomed :-)
_________________
...Lyall
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Thu Dec 02, 2010 4:30 am    Post subject: Reply with quote

Cam configured by using lsusb to find the manufacturer and device codes.
Code:
pearcely:~
# lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 002: ID 0c45:60c0 Microdia PC Camera with Mic (SN9C105)
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 003: ID 413c:2010 Dell Computer Corp.
Bus 006 Device 002: ID 413c:1003 Dell Computer Corp.
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 004: ID 413c:3010 Dell Computer Corp. Optical Wheel Mouse
pearcely:~
#

Searched for using
Code:
grep -i 60c0 /usr/src/linux/Documentation/video4linux/*

which pointed me to sn9c102.txt
Followed instructions on configuring that module.
Added sn9c102 to /etc/modules.autoload.d/kernel-2.6
Made sure I had both 'v4l' and 'v4l2' in my USE setting in /etc/make.conf
Did an 'emerge --newuse --verbose --with-bdeps y --update --deep world'
rebooted, just to be sure I had not borked my boot (which happens if I forget to emerge nvidia-drivers and virtualbox-modules)
Tested using
Code:
 mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0


Re-emerged ZoneMinder, just in case (temporarily changing my /etc/make.conf MAKEOPTS to '-j1' because zoneminder does not build well with parallel builds, apparently)

Code:
# export CPPFLAGS="-D__STDC_CONSTANT_MACROS" ; emerge zoneminder


I had to put
Code:
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so; export LD_PRELOAD
in my apache2 /etc/conf.d/apache2
I had tried simply putting it in the zoneminder service startup script, to no avail.

ZoneMinder required /etc/php/apache2-php5/php.ini to have
Code:
short_open_tag = On
or there are syntax errors in the cgi code.


Restarted apache and browsed to the zoneminder page.

Now, I can see the webcam stream! (configured as 320x240 PAL RGB24)
_________________
...Lyall
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum