Mailing List archive

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

[linux-dvb] Re: insmod saa7146_core.o debug = 3 for WinTV-NOVA-t



On Wed, Jul 17, 2002 at 09:14:08AM +0200, Alexander Nasonov wrote:
> My program prints "Resource temporarily unavailable" because
> the DmxDevBufferRead function returns -EWOULDBLOCK before
> while loop. This happens because both src->pread and src->pwrite
> are zeros. src->data and src->size seems to be ok.
> The result is the same if I open dvr0 (with DMX_OUT_TS_TAP flag
> of cause).

If you open the device with O_NONBLOCK, read() will return
EWOULDBLOCK (== EAGAIN) if there's no data.
Since your example code does the read()s immediately after
starting the filter, there can be no data. The sleep(1)
in your code will almost certainly overflow the buffer, so
the other read()s will get EBUFFEROVERFLOW (769, defined in
dmx.h).

Your code was:

   fd = open("/dev/dvb/adapter0/demux0", O_RDWR | O_NONBLOCK);
   ...
   if(ioctl(fd, DMX_SET_PES_FILTER, &pesfilter) < 0)
   {...}

   for(i = 0; i < 7; ++i)
   {
      br = read(fd, buf, 188);
      if(br == -1)
         perror("read(\"/dev/dvb/adapter0/demux0\")");
      else
         printf("%d bytes read\n", br);
   
      sleep(1);
   }


Regards,
Johannes


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index