Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

problem with usb camera

Hi,

I have some trouble with getting usb camera to work. I configured kernel with UsbHost following the document in http://nioswiki.jot.com//wikihome/operatingsystems/usbhost (http://nioswiki.jot.com//wikihome/operatingsystems/usbhost)

In kernel menuconfig,

turn on scsi device, scsi disk

turn on host-side usb, usb dev fs, your hcd, usb device eg mass storage.

File systems -->

DOS/FAT/NT Filesystems --->

[*] MSDOS fs support

[*] VFAT (Windows-95) fs support

(437) Default codepage for FAT

(iso8859-1) Default iocharset for FAT

Native Language Support -->

(iso8859-1) Default NLS Option

[*] Codepage 437 (United States, Canada)

[*] Simplified Chinese charset(CP936,GB2312)

Besides,I configured more other thing for my usb camera

Device Drivers -->

Multimedia devices-->

<*> video For Linux

USB support-->

<*> Support for Host-side USB

...................

[*] USB device filesystem

...................

<*> ISP1362 HCD support

...................

<*> USB Mass Storage support

....................

<* > USB OV511 Camera support

then make ,make linux image ,download the zImage into DE2 board. insert the usb camera,the kernel detect the camera as follow:

Uncompressing Linux... Ok, booting the kernel.

Linux version 2.6.16-uc0 (leewood@localhost.localdomain) (gcc version 3.4.6)# 28

PREEMPT Wed Aug 2 19:39:48 CST 2006

uClinux/Nios II

Altera Nios II support © 2004 Microtronix Datacom Ltd.

setup_arch: No persistant network settings signature at 008F0000

Built 1 zonelists

Kernel command line:

PID hash table entries: 64 (order: 6, 1024 bytes)

Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)

Memory available: 5552k/8192k RAM, 0k/0k ROM (1608k kernel code, 938k data)

Mount-cache hash table entries: 512

NET: Registered protocol family 16

SCSI subsystem initialized

usbcore: registered new driver usbfs

usbcore: registered new driver hub

io scheduler noop registered

io scheduler deadline registered (default)

i8042.c: i8042 controller self test timeout.

Serial: JTAG UART driver $Revision: 1.4 $

ttyJ0 at MMIO 0x81004000 (irq = 1) is a jtag_uart

dmfe_probe:eth0, 50000 Khz Nios

<DM9000> eth0 I/O: 80900090, VID: 90000a46

ADDR: 00:07:ed:00:00:00

dmfe_probe:eth1, 50000 Khz Nios

Linux video capture interface: v1.00

usbmon: debugfs is not available

driver isp1362-hcd, 2005-04-04

isp1362-hcd isp1362-hcd: ISP1362 Host Controller

isp1362_hc_reset:

Clock not ready after 20ms

isp1362-hcd isp1362-hcd: new USB bus registered, assigned bus number 1

isp1362-hcd isp1362-hcd: irq 4, io mem 0x80900080

isp1362_hc_start:

isp1362-hcd isp1362-hcd: ISP1362 Memory usage:

isp1362-hcd isp1362-hcd: ISTL: 2 * 256: 512 @ $0000:$0100

isp1362-hcd isp1362-hcd: INTL: 16 * ( 64+8): 1152 @ $0200

isp1362-hcd isp1362-hcd: ATL : 32 * ( 64+8): 2304 @ $0680

isp1362-hcd isp1362-hcd: USED/FREE: 3968 128

usb usb1: configuration# 1 chosen from 1 choice

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

ISP1362 Host Controller, irq 4

Initializing USB Mass Storage driver...

usbcore: registered new driver usb-storage

USB Mass Storage support registered.

usbcore: registered new driver ov511

drivers/usb/media/ov511.c: v1.64 for Linux 2.5 : ov511 USB Camera Driver

NET: Registered protocol family 2

IP route cache hash table entries: 128 (order: -3, 512 bytes)

TCP established hash table entries: 512 (order: -1, 2048 bytes)

TCP bind hash table entries: 512 (order: -1, 2048 bytes)

TCP: Hash tables configured (established 512 bind 512)

TCP reno registered

TCP bic registered

NET: Registered protocol family 1

NET: Registered protocol family 17

Freeing unused kernel memory: 688k freed (0x1c4000 - 0x26f000)

usb 1-2: new full speed USB device using isp1362-hcd and address 2

Shell invoked to run file: /etc/rc

Command: hostname uClinux

Command: mount -t proc proc /proc

Command: mount -t sysfs sysfs /sys

Command: mount -t usbfs none /proc/bus/usb

mount failed: No such file or directory

Command: mkdir /var/tmp

Command: mkdir /var/log

Command: mkdir /var/run

Command: mkdir /var/lock

Command: mkdir /var/empty

Command: ifconfig lo 127.0.0.1

Command: route add -net 127.0.0.0 netmask 255.0.0.0 lo

Command: ifconfig eth0 192.168.2.210

Command: route add default gw 192.168.2.1usb 1-2: configuration# 1 chosen from 1

choice

drivers/usb/media/ov511.c: USB OV511+ video device found

drivers/usb/media/ov511.c: model: Unknown

drivers/usb/media/ov511.c: Camera type (108) not recognized

drivers/usb/media/ov511.c: Please notify mark@alpha.dyndns.org of the name,

drivers/usb/media/ov511.c: manufacturer, model, and this number of your camera.

drivers/usb/media/ov511.c: Also include the output of the detection process.

Command: cat /etc/motdWelcome to

____ _ _

/ __| ||_|

_ _| | | | _ ____ _ _ _ _

| | | | | | || | _ \| | | |\ \/ /

| |_| | |__| || | | | | |_| |/

| ___\____|_||_|_| |_|\____|\_/\_/

| |

|_|

For further information check:

http://www.uclinux.org/ (http://www.uclinux.org/)

Execution Finished, Exiting

Sash command shell (version 1.1.1)

/> drivers/usb/media/ov511.c: Sensor is an OV7620

drivers/usb/media/ov511.c: Device at usb-isp1362-hcd-2 registered to minor 0

Then i ran app "vidcat" :

/> mknod /dev/video0 c 81 0

/> chmod 666 /dev/video0

/> vidcat -h

vidcat: invalid option -- h

VidCat, Version 0.7.2

Usage: vidcat <options>

-b make a raw PPM instead of an ASCII one

-d <device> video device (default: /dev/video)

-f {ppm|jpeg|png|yuv4mpeg} output format of the image

-g greayscale instead of color

-i {tv|comp1|comp2|s-video} which input channel to use

-l loop on, doesn&#39;t make sense in most cases

-n {pal|ntsc|secam} select video norm

-o <file> write output to file instead of stdout

-p c|g|y|Y videopalette to use

-q <quality> only for jpeg: quality setting (1-100, default: 80)

-s NxN define size of the output image (default: 320x240)

Example: vidcat | xsetbg stdin

/> vidcat -d /dev/video0 -p c -o test.jpg

Isochronous transfers not supported

drivers/usb/media/ov511.c: init isoc: usb_submit_urb(0) ret -28

Isochronous transfers not supported

drivers/usb/media/ov511.c: init isoc: usb_submit_urb(0) ret -28

Isochronous transfers not supported

drivers/usb/media/ov511.c: init isoc: usb_submit_urb(0) ret -28

Isochronous transfers not supported

drivers/usb/media/ov511.c: init isoc: usb_submit_urb(0) ret -28

Isochronous transfers not supported

drivers/usb/media/ov511.c: init isoc: usb_submit_urb(0) ret -28

Can&#39;t open device /dev/video0

/>

Is the problem driver or app?

Pls help me.Thx.

--leewood

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    Is there nobody to use Usb camera on DE2 board?

    In ISP1362 DateSheet ,it said that ISP1362 support all four type of USB transfers:control,bulk,interrupt,ISOCHRONOUS., and it also support transfer at full-speed and low-speed(not high speed). But the ISOCHRONOUS transfers are defined only for full-speed and high-speed. So it means that in ISO transfer type,we can only use full-speed.

    In isp1362-hcd.c, line 1307 (function isp1362_urb_enqueue):

    if (type == PIPE_ISOCHRONOUS) {
      ERR("Isochronous transfers not supported\n");
      return -ENOSPC;
        }

    So when i run test app:

    #include <stdlib.h># include <stdio.h># include <sys/types.h># include <sys/stat.h># include <fcntl.h># include <unistd.h>
    int main()
    {
        char devname = "/dev/video0";
        printf("Begin device open test......\n");
        printf("Device name: %s\n", devname);
        int hf = open(devname, O_RDWR);
        if(hf < 0)
        {
      perror("Device open test ERROR! : ");
      exit(1);
        }
        close(hf);
        printf("Device open test OK!\n");
        return 0;
    }

    The error message like this:

    />devopen
    Begin device open test.......
    Isochronous transfers not supported
    deriver/usb/media/ov511.c:init isoc: usb_submit_urb<0> ret -28
    Device open test ERROR! : : No space left on device
    />

    So i mask the code:

    //if (type == PIPE_ISOCHRONOUS) {
      //ERR("Isochronous transfers not supported\n");
      //return -ENOSPC;
        //}

    Then the erro message like this:

    />devopen
    Begin device open test.......
    Device name: /dev/video0
    start_iso_transfers:Not enough ISO buffer space for 1023 byte PTD

    So I puzzled .......if ISP1362 support ISOCHRONOUS transfer, Why the error happened? Is it because the urb->dev->speed ?

    Is there anyone facing the same problem? Pls give me some advice.

    Thanks

    leewood
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I met the same problem,if you have some advices,would you please tell me!!

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Excuse me!

    I just want to known where you get the isp1362 driver programmer?I douted that the isp1362 driver programmer which generate the problem.and i want to know which usb camera you use? ....the webeyev2000 ,v3000.

    i realy want to chang a type of camera,but i don&#39;t known which camer support the chip of SE401,IBM xirlink,SN9C10x,STV680,konica webcam...

    Would you please connect with me ,we can comunicate with each other.

    My email: dms2002711@163.com

    QQ: 524159169
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Leewood,

    sorry for late reply. I had been very busy.

    I did not know isp1362 well. I am better on isp1761.

    They should be similar.

    You are right. It is possible to use isp1362 for isochronous transfer.

    Most of the code are there.

    There might be some bugs. You may look at the other chipset to find out how they work for iso.

    You can find out the error from the source.

    I think NPX (philips semi) have the driver. Maybe you can check with them.

    Hippo