2010-09-17 03:37:48     camera capture on bf561-ezkit

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-09-17 03:37:48     camera capture on bf561-ezkit

Rui Guo (CHINA)

Message: 93550   

 

Hi,

 

I work on bf561-ezkit with a analog video camera. But I can not capture frames by camera(the camera works well on other machine). My work environment is as below:

 

(1)uclinux-dist: svn trunk(version 9818, could be the newest one by now)

 

(2)bf561-ezkit board: switch SW2 and SW5 are at default settings.(sw5-on,on,on,on;sw2-off,off,off,off,on).

 

(3)ADV7183B driver can find the chip: uclinux shows

 

"ADV7183B: detected client on address 0x20

ADV7183B: V4L driver Blackfin CMOS Camera now ready"

 

and there is a "video0" file under "/dev" directionary.

 

When I connect the camera to the board via ADVIN(the red port) and run a v4l program, it can open /dev/video0 but can not get any "capbility" information. Then I run an opencv program to capture , it shows "HIGHGUI ERROR: V4L: Pixel format of incoming image is unsupported by OpenCV".

 

It appears that the camera is not detected and there is no video data being put into ADV7183B at all,that is, video camera does not work. BUT it can work well when just connectted to a monitor without any config.

 

any ideas?

 

Thanks a lot.

 

ps:

 

v4l program:

 

int main()

{

  int cameraFd;

 

  cameraFd = open("/dev/video0", O_RDWR, 0);

  if(cameraFd < 0){

    perror("open file");

    return -1;

  }

  printf("fd = %d\n", cameraFd);   //fd = 3

 

  v4l2_std_id std;

  int ret;

  do{

    ret = ioctl(cameraFd, VIDIOC_QUERYSTD, &std);

  }while (ret == -1 && errno == EAGAIN);

  switch(std){

    case V4L2_STD_NTSC:

      printf("V4L2_STD_NTSC\n");

      break;

    case V4L2_STD_PAL:

      printf("V4L2_STD_PAL\n");

      break;

    default:

      printf("std = %d\n");               //std = 0

      break;

  }

 

  return 0;

}

 

opencv program:

 

static CvMemStorage *storage=0;

static CvHaarClassifierCascade *cascade=0;

 

int main(int argc,char **argv)

{

  CvCapture *capture =0;

  IplImage *frame,*frame_copy=0;

 

  storage=cvCreateMemStorage(0);

  capture=cvCaptureFromCAM(0);

  frame = cvQueryFrame(capture);

 

  return 0;

}

QuoteReplyEditDelete

 

 

2010-09-17 13:50:27     Re: camera capture on bf561-ezkit

Mike Frysinger (UNITED STATES)

Message: 93565   

 

you might want to first verify the i2c connection.  enable the i2c-tools package and then see if you can read/write/dump the ADV7183B's registers.

QuoteReplyEditDelete

 

 

2010-09-17 23:04:20     Re: camera capture on bf561-ezkit

Rui Guo (CHINA)

Message: 93571   

 

you might want to first verify the i2c connection.  enable the i2c-tools package and then see if you can read/write/dump the ADV7183B's registers.

 

---

 

Hi, Mike

 

I enable the i2c-tools package, the result is:

 

root:/> i2cdetect 0

WARNING! This program can confuse your I2C bus, cause data loss and worse!

I will probe file /dev/i2c-0.

I will probe address range 0x03-0x77.

Continue? [Y/n]

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

 

----> I do not know what does "UU" mean, it means normal or abnormal?whatever, continue...

 

root:/> i2cset 0x00 0x20 0x00 0x23

Error: Could not set address to 0x20: Device or resource busy

 

any ideas?

 

Thanks.

QuoteReplyEditDelete

 

 

2010-09-17 23:06:16     Re: camera capture on bf561-ezkit

Rui Guo (CHINA)

Message: 93572   

 

more,sorry

 

root:/> i2cset 0x00 0x21 0x00 0x23

WARNING! This program can confuse your I2C bus, cause data loss and worse!

I will write to device file /dev/i2c-0, chip address 0x21, data address

0x00, data 0x23, mode byte.

Continue? [Y/n]

Error: Write failed

QuoteReplyEditDelete

 

 

2010-09-18 03:06:09     Re: camera capture on bf561-ezkit

Mike Frysinger (UNITED STATES)

Message: 93573   

 

like the man page says:

       · "UU". Probing was skipped, because this address is currently in use by a driver.

 

so disable/unload the driver first

QuoteReplyEditDelete

 

 

2010-09-18 06:10:24     Re: camera capture on bf561-ezkit

Rui Guo (CHINA)

Message: 93611   

 

like the man page says:

       · "UU". Probing was skipped, because this address is currently in use by a driver.

 

so disable/unload the driver first

 

---

 

I didn't modify/add/delete anything before compiling kernel(svn trunk).

 

Would it be a problem or even a bug if conflicting to other driver?

 

what kind of driver would use the same address?

Attachments

    Outcomes