[Prev][Next][Index][Thread]

Re: cuseeme and nv



Hey, how goes it.  Well, i've made real progress here.  I have
successfully ported the quickcam drivers and utilities (i.e. qcam and
xqcam as well as libqcam.a) to bsdi.  When i talked to you before I had
done a port from some contribuyed source I had for freebsd.  It turns
out to have been an older driver, .4 i think.  I have now ported
qcam-0.91.  I am able to use qcam to do a
picture "grab" and also can use xqcam to get a local video window under
X.  The last problem of course is nv.  Hopefuly you can offer a
suggestion here.  When i use nv and select the qcam grabber and cuseeme
encoding, then hit send video, i get a thumbnail and i do start off by
getting succesful scanning.  Then nv freezes up.  When i run it through
my gdb debugger i see that qcam-lib.c is stuck in a loop.  Here is my
gdb output:

0x6a207 in qc_waithand (q=0x27fc00, val=1) at qcam-lib.c:468
468         while(! ((status = inb(q->port+1))&8))
(gdb) quit

Note that the only substancial change in code is to directly call inb or
outb instead of using the following:

int __inline__ read_lpstatus(const struct qcam *q) { return
inb(q->port+1); }
int read_lpcontrol(const struct qcam *q) { return inb(q->port+2); }
int read_lpdata(const struct qcam *q) { return inb(q->port); }
void write_lpdata(const struct qcam *q, int d) { outb(d,q->port); }
void write_lpcontrol(const struct qcam *q, int d) { outb(d,q->port+2); }

This is the code:

static int qc_command(const struct qcam *q, int command)
{
  int n1, n2;
  int cmd;
  outb(q->port,command);
  outb(q->port+2,6);
  n1 = qc_waithand(q,1);	<---- This is where the call comes from
  outb(q->port+2,0xe); 
  n2 = qc_waithand(q,0);
  cmd = (n1 & 0xf0) | ((n2 & 0xf0) >> 4);
#ifdef DEBUG
  if (cmd != command) {
    fprintf(stderr, "Command 0x%02x sent, 0x%02x echoed", command, cmd);
    n2 = inb(q->port); 
    cmd = (n1 & 0xf0) | ((n2 & 0xf0) >> 4);   
    if (cmd != command) fprintf(stderr, " (re-read does not help)\n");
    else fprintf(stderr, " (fixed on re-read)\n");
  }
#endif
  return cmd;
}


static int qc_waithand(const struct qcam *q, int val)
{
  int status;
    
  if (val)
    while(! ((status = inb(q->port+1))&8)) <---This is where we hang
        ;
  else
    while (((status = inb(q->port+1))&8))
        ;
  return status;
}


-- 
Don Joy
System Administrator
SooNet Corp