pwc
[Top] [All Lists]

[pwc] QuickCam Orbit pan/tilt status fix

To:
Subject: [pwc] QuickCam Orbit pan/tilt status fix
From: Jay Gowdy <>
Date: Mon, 12 Dec 2005 14:51:37 -0800
The pwc driver was reporting an EPIPE error on all VIDIOCPWCMPTSTATUS ioctl's in all situations for my Logitech QuickCam Orbit using driver 10.0.9 under FC3 (kernel 2.6.12-1.1381_FC3).

Looking through the archives of this mailing list showed this same question had been asked roughly every month for the last year, so I figured I shouldn't ask it again. Using some educated guessing and semi-random changes, I found that the Logitech QuickCam Orbit does NOT obey the protocol for status as expected by the pwc driver. It does not return any "time_tilt" or "time_pan", but only a status byte (leading to the driver to ask for 5 bytes when only 1 will be delivered, evidentally leading to an EPIPE error). In addition, the single byte of status does not conform to the status byte as described in the documentation.

By replacing the routine pwc_mpt_get_status in pwc-ctrl.c of the 10.0.9 release with the following,

static inline int pwc_mpt_get_status(struct pwc_device *pdev, struct pwc_mpt_status *status)
{
        /* For a Logitech QuickCam Orbit, only the status byte is reported */

        int ret;
        unsigned char buf[1];
        
        ret = RecvControlMsg(GET_MPT_CTL, PT_STATUS_FORMATTER, 1);
        if (ret < 0)
                return ret;
        /* Note that the status byte also does not match the status byte as
           specified in the documentation.  Empirically, the top 5 bytes are 1
           when the pan/tilt is moving and 0 when not, so we shift it over to
           somewhat match the documentation, in which the bottom 3 bytes should
           be 1 when the command is successfully completed, and 0 when running.
           I don't know the relationship to timeouts and bits with this unknown
           protocol:  this is good enough for now. */
        status->status = (~(buf[0] >> 3)) & 0x7;
        status->time_pan = 0;
        status->time_tilt = 0;
        return 0;
}

I get something that works well enough for my purposes (i.e., I can monitor when the pan/tilt head is moving and when it is not).

Does this ioctl work properly on other pan/tilt heads, or is it just the QuickCam Orbit that is messed up this way?

  Thanks,

     Jay Gowdy
_______________________________________________
pwc mailing list

http://lists.saillard.org/mailman/listinfo/pwc

<Prev in Thread] Current Thread [Next in Thread>
  • [pwc] QuickCam Orbit pan/tilt status fix, Jay Gowdy <=
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