LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-23-2007, 02:30 AM   #1
ramesh6056
Member
 
Registered: May 2007
Posts: 89

Rep: Reputation: 15
Usb camera...


I am new to the Video4 linux. I am working PXA255 hybus arm platform.
I compiled the video4linux with in my kernel. Recently i got an
Logitech quickcam go camera. So i compiled the appropriate driver
spca5xx for the board kernel(2.4.18) and then inserted the module in the
board. After inserting the module i got the following message..
------------------------------------------------------------------
insmod spca5xx.o debug=4


usb.c: registered new driver spca5xx
drivers/usb/spca5xx.c: USB SPCA5XX camera found.Logitech QuickCam chat
(SPCA561A)
drivers/usb/spca5xx.c: [spca5xx_probe:5485] Camera type S561
drivers/usb/spca5xx.c: [spca50x_configure:3300] video_register_device
succeeded
drivers/usb/spca561.h: [spca561_config:741] Read from GLOBAL: USB Vendor
ID 0x046d
drivers/usb/spca561.h: [spca561_config:744] Read from GLOBAL: USB
Product ID 0x092f
drivers/usb/spca5xx.c: [spca50x_set_packet_size:1443] set real packet
size: 0, alt=0
drivers/usb/spca5xx.c: [spca5xx_getcapability:1767] maxw 352 maxh 288
minw 160 minh 120
drivers/usb/spca5xx.c: [spca50x_configure:3323] Spca5xx Configure
done !!
drivers/usb/spca5xx.c: [spca5xx_probe:5519] setting video device =
c336c2e0, spca50x = c3cbc000
drivers/usb/spca5xx.c: [create_proc_spca50x_cam:1248]
creating /proc/video/spca50x/video0
drivers/usb/spca5xx.c: [create_proc_spca50x_cam:1264]
creating /proc/video/spca50x/control0
drivers/usb/spca5xx.c: spca5xx driver 00.60.00.1 registered
-----------------------------------------------------------------------

It seems everything to be ok... But when i run simply like this..
-----------------------------------------------------------------------
cat /dev/video0

drivers/usb/spca5xx.c: [spca5xx_open:2406] opening
drivers/usb/spca5xx.c: [spca50x_alloc:2194] entered
drivers/usb/spca5xx.c: [spca50x_alloc:2213] frame[0] @ c8b10000
drivers/usb/spca5xx.c: [spca50x_alloc:2213] frame[1] @ c8c3c008
drivers/usb/spca5xx.c: [spca50x_alloc:2222] sbuf[0] @ c2a6c000
drivers/usb/spca5xx.c: [spca50x_alloc:2222] sbuf[1] @ c2a70000
drivers/usb/spca5xx.c: [spca50x_alloc:2227] leaving
drivers/usb/spca561.h: [spca561_init:497] Find spca561 USB Product ID
92f
drivers/usb/spca5xx.c: [spca5xx_setMode:1827] spca5xx set mode asked w
160 h 120 p 4
drivers/usb/spca5xx.c: [spca5xx_setMode:1900] Found code 3 method 0
drivers/usb/spca5xx.c: [spca5xx_setMode:1902] Soft Win width height 160
x 120
drivers/usb/spca5xx.c: [spca5xx_setMode:1904] Hard Win width height 160
x 120
drivers/usb/spca5xx.c: [spca50x_init_isoc:1585] *** Initializing capture
***
drivers/usb/spca5xx.c: [spca50x_set_packet_size:1443] set real packet
size: 1023, alt=7
drivers/usb/spca5xx.c: [spca50x_init_isoc:1594] setpacketsize 1023
drivers/usb/spca561.h: [spca561_setcontrast:693] Set Exposure 0x00 0x20
gain 0x03
qu_queue_active_urb: add urb to iso_list, start_frame = 0xc8, # Pkts =
0x10, err Cnt = 0x0
<6>drivers/usb/spca5xx.c: [spca5xx_open:2467] Open done
drivers/usb/spca5xx.c: [spca5xx_read:3119] 4096 bytes, noblock=0
drivers/usb/spca5xx.c: [spca5xx_read:3137] Waiting for a frame done
----------------------------------------------------------------------


Before running any tool like gqcam, spcaview...i want to confirm whether
my camera is detected properly or not. Is their any way that i can
check it by simple commands...

i tried vcat but it for v4l2. There is a patching work required...


Please help me in solving this issue...
 
Old 10-23-2007, 03:18 AM   #2
4kfooler
LQ Newbie
 
Registered: Oct 2007
Posts: 3

Rep: Reputation: 0
something very funny
 
Old 10-23-2007, 11:21 PM   #3
ramesh6056
Member
 
Registered: May 2007
Posts: 89

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by 4kfooler View Post
something very funny
means?? I don't get you??
 
Old 10-24-2007, 04:19 AM   #4
kinetic
Member
 
Registered: Aug 2007
Location: Fort Collins, Colorado
Distribution: Gentoo
Posts: 64

Rep: Reputation: 17
don't listen to him. he only has 2 posts.

HES A n0000b!!!!!!!!

lolz. anyway, why don't you just test to see if it works with mplayer or something? no need to be a know-it-all-command-line-juggernaut
 
Old 10-25-2007, 12:47 AM   #5
ramesh6056
Member
 
Registered: May 2007
Posts: 89

Original Poster
Rep: Reputation: 15
Hi...thanks for your reply...

I think the tool is not the problem...It is problem with the driver itself...

when i insert the module with insmod i am getting the following kernel
messages...(i included this in the post)

drivers/usb/spca5xx.c: USB SPCA5XX camera found.Logitech QuickCam chat
(SPCA561A)

The above line clearly mentions that the Logitech QuickCam chat is
detecting the camera...

Moreover i don't have an lspci or lsusb command incorporated on my
board...but i mounted the usbdevfs on /proc/bus/usb....

and done cat /proc/bus/usb/devices---got the following message on the
camera detection part...
-----------------------------------------------------------------------
S: Product=Camera USB Hub
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
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 1
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 0.00
-----------------------------------------------------------------------

I am in to the driver code spca5xx.c today...there was a line like this
where the driver code stops executing..
------------------------------------------------------------------------

if ((rc = wait_event_interruptible(spca50x->wq,
spca50x->frame[0].grabstate ==
FRAME_DONE
|| spca50x->frame[1].grabstate ==
FRAME_DONE))) {

up(&spca50x->lock);
return rc;
}

------------------------------------------------------------------------
when it executes the wait_event_interruptible...it hangs on over
there...
I think the condition is not satisfied...Googled it and collected little
information about wait_event_interruptible, which will make the task
process to go to sleep untill the condition is satisfied...

The frames were never read..and it remains in the unused state...Ithink
there may be seperate thread which may be reading the frame...

I am in the process of finding it...Any idea you can think of this??
 
Old 10-25-2007, 11:57 PM   #6
ramesh6056
Member
 
Registered: May 2007
Posts: 89

Original Poster
Rep: Reputation: 15
Usb camera problem...

Hi...all

I found the reason for the problem... I got little information about the URB- Usb Request Block. which is the structure where all the data trasfer happens...

There was a line on my driver like this below...

urb->complete = spca50x_isoc_irq;

I think it means when the urb buffer is filled i.e., when the urb->status is 0 (Completed the usb transfer from camera) then the spca50x_isoc_irq function is called.

But this urb->complete is never happening..I mean the urb->status is never up. When i print the urb->status, it is -115. which means the Urb is still pending(untill now no error)...

Does anyone knows why the camera is not filling the urb block???Any idea??
 
Old 11-23-2007, 04:26 AM   #7
abhijit_naik27
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Rep: Reputation: 0
Hello Ramesh,
I need help from you.I am using SPCA5xx web cam driver. My target details are as follows,
Processor- IXP425 big endian
Architecture- ARM5VT
Kernel- 2.4.20mvl(From Montavista)
Can you give the procedure you followed to cross compiling SPCA5xx for your board?
Thanks in Advance.
 
Old 11-24-2007, 12:03 AM   #8
ramesh6056
Member
 
Registered: May 2007
Posts: 89

Original Poster
Rep: Reputation: 15
Camera...

Quote:
Originally Posted by abhijit_naik27 View Post
Hello Ramesh,
I need help from you.I am using SPCA5xx web cam driver. My target details are as follows,
Processor- IXP425 big endian
Architecture- ARM5VT
Kernel- 2.4.20mvl(From Montavista)
Can you give the procedure you followed to cross compiling SPCA5xx for your board?
Thanks in Advance.

Donwload the source, change the makefile present over there...

Since the kernel is 2.4..remove the 2.6 part in the Makefile ...

I modified like this ..........
---------------------------------------------------------------

VERSION = 00.60.00.1
CVSVERSION = "$Experimental work Michel Xhaard && Reza Jelveh 03/02/2004"
DEFINES =

###
# The following flags enable experimental features.
# By default, these are enabled for development versions of the driver, and
# disabled for release versions.

# Optional: Enable driver debugging
DEFINES += -DSPCA50X_ENABLE_DEBUG

# Optional: Enable direct register read/write for PAC207 development
#DEFINES += -DSPCA5XX_ENABLE_REGISTERPLAY

###
# The following flags enable features that aren't yet implemented, and
# therefore are disabled by default.

# Optional: Enable compression
DEFINES += -DSPCA50X_ENABLE_COMPRESSION

###
# Rest of Makefile follows here. You probably won't need to touch this.

# Setup defines
DEFINES += -DCONFIG_USB_SPCA5XX_MODULE=1 -DMODULE -D__KERNEL__
DEFINES += -DVID_HARDWARE_SPCA5XX=0xFF -DSPCA5XX_VERSION=\"$(VERSION)\"


#############################################################################
# For Linux 2.4 users.
# Change the following lines according to your system configuration.
# It is important to configure your particular source tree ("make dep") before
# compiling this module!
#############################################################################
###
# This makefile will build the spca50x driver module external to the kernel
# source tree. It makes it easier to swap kernels.


KERNEL_VERSION = "2.4.18-rmk7-pxa1-xhyper255"
#Put the name of your kernel here... uname -r on your target gives this... your kernel source directory also should have the
same name

###
# Location of the header files (most importantly the config files)
# for the kernel you want to build the module against.
# This should be correct for the currently installed kernel on your machine.
KINCLUDE = /home/rameshchandra/Ramesh/temp/2.4.18-rmk7-pxa1-xhyper255/include
#RAMESHath of your kernel source.
KERNEL_ACFILE = $(KINCLUDE)/linux/autoconf.h
KERNEL_MODVERSIONSFILE = $(KINCLUDE)/linux/modversions.h
MODULE_INSTALLDIR = /home/rameshchandra/Ramesh/Mywork/Cameraresearch/Logitechspca5xx/myinstalls
#RAMESH:check whether the appropriate file is present in your kernel
# Detect module versioning support
ifneq ($(strip $(shell grep 'define CONFIG_MODVERSIONS 1' $(KERNEL_ACFILE))),)
DEFINES += -DMODVERSIONS -include $(KERNEL_MODVERSIONSFILE)
endif# Detect SMP support
ifneq ($(strip $(shell grep 'define CONFIG_SMP 1' $(KERNEL_ACFILE))),)
DEFINES += -D__SMP__ -DSMP
endif

# Setup the tools
CC = /usr/local/hybus-arm-linux-R1.1/bin/arm-linux-gcc
LD = /usr/local/hybus-arm-linux-R1.1/bin/arm-linux-ld

# Setup compiler warnings
WARNINGS = -Wall -Wpointer-arith
WARNINGS += -Wcast-align -Wwrite-strings -Wstrict-prototypes
WARNINGS += -Wuninitialized -Wreturn-type -Wunused -Wparentheses

# Setup compiler flags
CFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe
#CFLAGS += -mpreferred-stack-boundary=2
CFLAGS += -I$(KINCLUDE) -Idrivers/usb

# Setup link flags
LDFLAGS = --strip-debug -r

----------------------------------------------------------------
In the warning flags keep what i wrote... other wise it will show some errors...

Hope this helps you... CC and LD you must know...are the cross-compiler..point it to your toolchain...

i think you know about these...

then save the make file and then give make...

spca5xx should be compiled for the target.. But still no answer for my question...No one replying in this forum...??
spca5xx works well in system but not in boards...i don't know what is the reason may be low-level cypress drivers for usb may be problem...

Hope atleast you will tell me when you get success in the board..
Please let me know it...
 
Old 12-07-2007, 06:54 AM   #9
abhijit_naik27
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Rep: Reputation: 0
Hello Ramesh,
Sorry for delay in reply. I am successful in compiling SPCA5xx v0.57 for Xscale. I have DMVC 1300K (camera is not listed in supporting list) Philips camera. When I connected the camera, it gave the error. Log is as below.

Quote:
usb.c: USB disconnect on device 00:03.1-2 address 2
hub.c: new USB device 00:03.1-2, assigned address 3
usb.c: USB device descriptor short read (expected 18, got 8)
hub.c: new USB device 00:03.1-2, assigned address 4
Unable to handle kernel paging request at virtual address 00001511

mm = c0249380 pgd = c0004000
*pgd = 00000000, *pmd = 00000000
Internal error: Oops: 0
CPU: 0
pc : [<cd2d517c>] lr : [<20000093>] Tainted: PF
sp : c7f7ded8 ip : 20000013 fp : c7f7df30
r10: cd2b0010 r9 : cd2b0000 r8 : cd2f15b4
r7 : 00001511 r6 : 00000001 r5 : c7f7e958 r4 : cd2f15d4
r3 : 00000019 r2 : 60000013 r1 : 60000093 r0 : c7f75200
Flags: nzCv IRQs off FIQs on Mode SVC_32 Segment kernel
Control: 39FF Table: 068F8000 DAC: 0000001D
Process khubd (pid: 8, stack limit = 0xc7f7c3a0)
Stack: (0xc7f7ded8 to 0xc7f7e000)
dec0: cd2f15d4 c7f7e958
dee0: 00000000 c7f75200 cd2f15b4 00000001 00000000 c0152e50 00000002 c7f75224
df00: c02801b0 00000001 c7f75200 00000001 00000002 00000030 000000c8 00000004
df20: 00000001 c7f7df50 c7f7df34 c01531e0 c0152c54 00000000 c7f75200 00000008
df40: c0280208 c7f7df70 c7f7df54 c01551e4 c0153194 00000008 c7f75200 c7f75400
df60: 00000001 c7f7dfa4 c7f7df74 c0156bcc c0155060 c7f7dfa4 c416c660 00000002
df80: c7f75400 c416c660 00000001 c0249610 690541c1 0001acf8 c7f7dfc8 c7f7dfa8
dfa0: c0156db8 c0156a00 00010101 c7f7c000 c0280218 c7f7dfcc c0288718 c7f7dff4
dfc0: c7f7dfcc c0156fb0 c0156c50 00000000 c7f7c000 00000000 00000000 00000000
dfe0: c41d8000 c02ac6b8 00000000 c7f7dff8 c0024cb4 c0156f68 01020000 20011110
Backtrace:
Function entered at [<c0152c48>] from [<c01531e0>]
Function entered at [<c0153188>] from [<c01551e4>]
r7 = C0280208 r6 = 00000008 r5 = C7F75200 r4 = 00000000
Function entered at [<c0155054>] from [<c0156bcc>]
r6 = 00000001 r5 = C7F75400 r4 = C7F75200
Function entered at [<c01569f4>] from [<c0156db8>]
Function entered at [<c0156c44>] from [<c0156fb0>]
r7 = C0288718 r6 = C7F7DFCC r5 = C0280218 r4 = C7F7C000
Function entered at [<c0156f5c>] from [<c0024cb4>]
r6 = C02AC6B8 r5 = C41D8000 r4 = 00000000

Regarding USB problem, I have seen the issue with with ARM in FAQ section. This may help you to debug the problem. http://www.cs.umu.se/~c00ahs/exjobb/philips/faq.html#I7


All The Best

Last edited by abhijit_naik27; 12-07-2007 at 06:56 AM.
 
  


Reply

Tags
spca5xx



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Logitech STX Camera | sytem startup camera active problem delta function Slackware 0 08-06-2006 04:23 PM
usb camera 2.6.9 Ipolit Debian 4 03-24-2005 10:02 PM
help with usb camera ? synapse Slackware 2 03-19-2004 03:00 PM
USB camera zokik Linux - Hardware 10 05-02-2003 02:07 PM
Logitech USB Camera ?? Tuzinor Linux - Hardware 7 12-08-2002 09:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration