Kernel version :2.6.22.6
Crosstool :arm-linux-gcc-3.4.5% e' c8 ]9 I1 z
Board :FS2410
System :Fedora 8
Source :gspcav1-20071224、servfox-R1_1_3、spcaview-20061208
Author :http://viviwei.cublog.cn
一、移植gspcav1-20071224
gspcav1-20071224下载地址:http://www.slackware.com/~alien/ ... av1-20071224.tar.gz& O& ^! e% l* n' U
FS2410开发板上移植的是Linux-2.6.22.6内核,USB及CS8900A均能工作,由于linux-2.6.22.6/drivers/usb 目录下没有 media 目录,故移植步骤如下:5 N1 T, [8 K5 M x
a) 在 linux-2.6.22.6/drivers/usb 目录下新建 media 目录,将gspcav1-20071224.tar.gz copy 到 media 下并解压。为了使media 编译进内核,需修改linux-2.6.22.6/drivers/usb 目录下的Kconfig、Makefile 文件。
[linux@weijing usb]$ pwd
/work/kernel/linux-2.6.22.6/drivers/usb
[linux@weijing usb]$ vi Kconfig
添加3 v, W1 Y8 P: N5 F; o& ], ?
source "drivers/usb/media/Kconfig"
[linux@weijing usb]$ vi Makefile Q: }+ [. ]8 h, |/ P
添加0 V3 m( R0 l: C; }
obj-$(CONFIG_USB_SPCA5XX) += media/$ ~$ g' U1 Z# {; T8 |5 k
b) 为添加 gspcav1-20071224 编译选项,在 media 下新建 Kconfig、Makefile 文件。
[linux@weijing media]$ pwd
/work/kernel/linux-2.6.22.6/drivers/usb/media* f* f2 i8 w: r) \
[linux@weijing media]$ vi Kconfig
#4 W' K% X5 }4 m/ M! V4 h
# USB Multimedia device configuration$ @' R# ~2 |, D" ?* ^
#
comment "USB Multimedia devices"; Y- ?: Y% C# F% \4 W
depends on USB
config USB_SPCA5XX$ B/ g$ J& F/ W( B5 S# W- f0 z% s$ j
tristate "USB SPCA5XX Sunplus/Vimicro/Sonix jpeg Cameras" k+ t+ S# J4 i* @1 o
depends on USB && VIDEO_DEV
---help---( c# @. x- Y- C: e- V; J M
Say Y or M here if you want to use one of these webcams:
The built-in microphone is enabled by selecting USB Audio support.7 c$ l. m+ q7 k7 d' ]
This driver uses the Video For Linux API. You must say Y or M to
"Video For Linux" (under Character Devices) to use this driver.
Information on this API and pointers to "v4l" programs may be found6 d- E0 }6 ~, h3 @3 g# F5 p
at <Documentation/video4linux/API.html>.
To compile this driver as a module, choose M here: the
module will be called spca5xx.
[linux@weijing media]$ vi Makefile
#; D& K; k1 q @+ X: ]5 {# [, @
# Makefile for USB Media drivers$ _0 }0 ]$ `* q; R
#
obj-$(CONFIG_USB_SPCA5XX) += gspcav1-20071224/! O1 D# |! E6 U: P' W3 {. V/ s
c) 修改 gspcav1-20071224 的 Makefile
[linux@weijing gspcav1-20071224]$ pwd7 R, x d0 D7 {$ d! l/ h3 x* U
/work/kernel/linux-2.6.22.6/drivers/usb/media/gspcav1-20071224
[linux@weijing gspcav1-20071224]$ vi Makefile V9 }$ m: W1 g
gspca-objs := gspca_core.o decoder/gspcadecoder.o6 { _* m0 j' R+ @
obj-$(CONFIG_USB_SPCA5XX) += gspca.o
clean:
rm -f *.[oas] .*.flags *.ko .*.cmd .*.d .*.tmp *.mod.c / a9 a' ^7 x7 z7 I
rm -rf .tmp_versions
d) 编译内核
(1)Multimedia devices --->
Video For Linux, \8 a6 r/ E& q1 n& W( S6 \% k
(2) USB support --->7 o5 l5 y5 n0 Q+ ]
Support for Host-side USB
--- USB Host Controller Drivers
OHCI HCD support# m f# D- e8 ]) @5 y
(3)--- USB Multimedia devices
USB SPCA5XX Sunplus/Vimicro/Sonix jpeg Cameras
此时,可能会提示 gspca_core.c 的一些轻微错误,稍作修改即可:* B6 K& G: T1 X; m
//static const char gspca_version[] = GSPCA_VERSION;
static const char gspca_version[] = "00.60.00";
把新生成的 uImage 烧进开发板,重启,插上中星微芯片的摄像头,命令行出现5 X8 U/ ^" P$ a' X3 T6 w
# usb 1-1: new full speed USB device using s3c2410-ohci and address 2
usb 1-1: configuration #1 chosen from 1 choice
drivers/usb/media/gspcav1-20071224/gspca_core.c: USB GSPCA camera found.(ZC3XX)
说明移植的驱动已经能识别设备,设备名所在路径 /dev/video0。
二、servfox
服务器端程序用是servfox,通过它可以在PC上看到开发板采集来的图像,从这里下载
http://mxhaard.free.fr/spca50x/embedded/Servfox/servfox-R1_1_3.tar.gz
下载,解压,进入其目录,发现没有一个makefile.arm,还有一个makefile.386,将makefile.arm改名为makefile,然后输入命令 make,生成 servfox 可实行文件,copy 到开发板运行之:
# ./servfox -d /dev/video0 -g -s 640x480 -w 7070
servfox version: 1.1.3 date: 11:12:2005 (C) mxhaard@magic.fr e1 Q! _/ i" C& ~
wrong spca5xx device & {+ B$ ~ D; o1 n$ W" s& D+ h0 r- `$ V
Waiting .... for connection. CTrl_c to stop !!!!
Got connection from 192.168.1.2
三、spcaview
客户端程序使用的是spcaview,下载地址为:
http://mxhaard.free.fr/spca50x/Download/spcaview-20061208.tar.gz
这个程序在PC 上运行,直接解压编译,生成 spcaview 可实行文件,运行如下:
[root@weijing spcaview-20061208]# ./spcaview -g -w 192.168.1.17
Spcaview version: 1.1.7 date: 06:11:2006 (C) mxhaard@magic.fr
ERROR Set default port to 7070 / q7 H" e7 Z. w8 D; D% ?
using Server 192.168.1.17 Port 7070
bright 32768 contrast 32768
| 欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) | Powered by Discuz! X3.2 |