zc301摄像头驱动以及在S3C2410中使用serfox和spcaview
(2)完整版驱动。spca5xx-20060402.tar.gz。修改makefile。
##########modified by ly44770################
#ifneq ($(shell uname -r | cut -d. -f1,2), 2.4)
#ifneq ($(KERNELRELEASE),) # We were called by kbuild
#CFLAGS += $(DEFINES)
#obj-m += spca5xx.o
#spca5xx-objs := drivers/usb/spca5xx.o drivers/usb/spcadecoder.o
#else # We were called from command line
#KERNEL_VERSION = `uname -r`
#KERNELDIR := /lib/modules/$(KERNEL_VERSION)/build
#PWD := $(shell pwd)
#MODULE_INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/media/
# Targets, dont change!
#default:
# @echo Building SPCA5XX driver for 2.5/2.6 kernel.
# @echo Remember: you must have read/write access to your kernel source tree.
# $(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) CC=$(CC) modules
#install:
# mkdir -p $(MODULE_INSTALLDIR)
# rm -f $(MODULE_INSTALLDIR)spca50x.ko
# rm -f $(MODULE_INSTALLDIR)et61x.ko
# install -c -m 0644 spca5xx.ko $(MODULE_INSTALLDIR)
# /sbin/depmod -ae
#uninstall:
# rm -f $(MODULE_INSTALLDIR)/spca5xx.ko
# /sbin/depmod -aq
#endif
#else # kernel version test
###############modified end########################
上边这一大段通通注释掉。
#KERNEL_VERSION = `uname -r`这句改成:
KERNEL_VERSION = 2.4.27
这几个变量根据自己的需要修改如下:
KINCLUDE = /weili/linux-2.4/include
KERNEL_ACFILE = $(KINCLUDE)/linux/autoconf.h
KERNEL_MODVERSIONSFILE = $(KINCLUDE)/linux/modversions.h
#MODULE_INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/
CC = arm-linux-gcc
LD = arm-linux-ld
#CFLAGS += -mpreferred-stack-boundary=2 这个注释掉,否则编译通不过,:-)。
#CFLAGS += -I$(KINCLUDE) -Idrivers/usb
CFLAGS += -I/weili/linux-2.4/include -Idrivers/usb
别忘了这句注释掉:
#endif # End kernel version test
make,生成spca5xx.o,insmod,查看/dev目录下出现了/v4l/video0,驱动成功。
二、在S3C2410中使用serfox和spcaview
1、移植视频采集程序servfox
移植此程序比较简单的,下载servfox-R1_1_3后 ,http://mxhaard.free.fr/spca50x/embedded/Servfox/servfox-R1_1_3.tar.gz解压后,会发现在其目录中会有一个Makefile.arm文件,将此文件修改成Makefile,再make就可生成我们要用到的serfox程序了,将 此程序上传到我们的板中,运行就行了。另外在运行servfox前,可能要运行"mknod /dev/video0 c 81 0"这步,不写"mknod /dev/video0 c 81 0"这步,有可能出现 ERROR opening V4L interface错误。但我就没出现这个问题。
# servfox -d /dev/video0 -s 320x240 -w 7070
在服务器端运行servfox,图像大小为320x240,端口号为 7070。
2、客户端spcaview
下载spcaview-20061208,http://mxhaard.free.fr/spca50x/Download/spcaview-20061208.tar.gz
make生成目标文件,在PC上,spcaview –w 10.60.38.55:7070就可以看到摄像头采集来的图片了。Servfox和spcaview还有很多选项,可以通过spcaview –h 和servfox –h查阅,
注意的是:spcaview中-w使用的IP为实验台的IP,所以在开发板执行serfox之前要配置一下IP,ifconfig eth0 10.60.38.55,并且运行spcaview的主机的IP要与开发板在同一网段。
另附:
(1)spcaview的命令参数
Spcaview version: 1.1.7 date: 06:11:2006 (C)mxhaard@magic.fr
usage: spcaview [-h -d -n -c -v -j -z -g -l -s -m -a -f -b -t -p] [-i inputfile
| -o outputfile]
-h print this message
-d /dev/videoX use videoX device
-n norme 0->pal 2->secam 1->ntsc
-c input channels 0..9 exclude 4 and 5
-v disable video output for raw recording
-j disable video output and userspace decoding
-z compress yuv420p video output with DPSH encoder
-g use read method for grab instead mmap
-l default 320x480 use input size 640x480
-s widthxheight use specified input size
-m widthxheight use specified ouput size
-a default 0 -> nosound 1-> microphone 2-> mixer output
-f video format default yuv others options are r16 r24 r32 yuv jpg
-b enable automatic brightness adjustment
-t print statistics
-p x getPicture every x seconds
-p x && -o getPicture every x seconds and record in outfile
-w Address:Port read from Address xxx.xxx.xxx.xxx:Port
-N x take a x pictures and exit if p is not set p = 1 second
(2)serfox的命令参数
zc301摄像头驱动S3C2410serfoxspcavie 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)