pwc
[Top] [All Lists]

[pwc] VIDIOCPWCMPTRESET

To:
Subject: [pwc] VIDIOCPWCMPTRESET
From: "Gilles GIGAN" <>
Date: Thu, 12 Jun 2008 16:08:37 +1000
Hi all,
In the intialisation section of my application, I reset the pan & tilt of a Logitech QuickCam Sphere (046d:08b5) using ioctl(VIDIOCPWCMPTRESET). Sometimes during the reset, the webcam stays stuck after panning to one of its exteme position (the tilt doesnt and comes back to the center). On the Motion wiki, in the PWC API section (http://www.lavrsen.dk/twiki/bin/view/PWC/ApplicationProgrammingInterface#VIDIOCPWCMPTSTATUS),  I read that "When setting the angle or doing a reset, you have to poll the status regularly until the command completes or returns an error.". So I added a call to ioctl(VIDIOCPWCMPTSTATUS). This is what the section looks like:

int i=3;
if(ioctl(c->fd, VIDIOCPWCMPTRESET, &i)>=0) {
   while(((ret=ioctl(c->fd,  VIDIOCPWCMPTSTATUS, &s))>=0) && (s.status==0)) {
      fprintf(stderr, "PWC: ret = %d, status=%d\n", ret, s.status);
      usleep(500*1000);
      CLEAR(s);
   }
   fprintf(stderr, "PWC: ret = %d, status=%d\n", ret, s.status);
}

I added the two fprintf statments to see what was happening, and ioctl(VIDIOCPWCMPTSTATUS) always returns -1. The while loop is never executed.
Does anyone know why ioctl(VIDIOCPWCMPTSTATUS) fails, and how to prevent a pan/tilt reset to leave the webcam stuck at one end ?
Thanks
Gilles
_______________________________________________
pwc mailing list

http://lists.saillard.org/mailman/listinfo/pwc
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU