Cuse4BSD + Webcamd + FE_GET_EVENT ioctl

Joerg Pulz Joerg.Pulz at frm2.tum.de
Tue Mar 2 13:19:06 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Tue, 2 Mar 2010, Hans Petter Selasky wrote:

> On Tuesday 02 March 2010 10:35:36 Joerg Pulz wrote:
>> v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
>>
>
> Can you check if the video application you are using is setting the non-
> blocking flag on the file-handle?
>
>        flag = 1;
>        ret = fcntl(f, O_NONBLOCK, &flag);
>
> That will make the FE_GET_EVENT return immediately.

Hello Hans,

i verified this and i'm pretty sure O_NONBLOCK is set.

I've added this piece of code right before the FE_GET_EVENT ioctl:
- -----
      int flags = fcntl(fd_frontend, F_GETFL, 0);
      if (flags && O_NONBLOCK)
                 esyslog("INFO: fd_frontend O_NONBLOCK");
- -----
and the message was displayed in the log.

Here are the relevant code parts where the fd is opened:
- -----
int cDvbDevice::DvbOpen(const char *Name, int Adapter, int Frontend, int Mode, bool ReportError)
{
   cString FileName = DvbName(Name, Adapter, Frontend);
   int fd = open(FileName, Mode);
   if (fd < 0 && ReportError)
      LOG_ERROR_STR(*FileName);
   return fd;
}

<snip>

int fd_frontend = DvbOpen(DEV_DVB_FRONTEND, adapter, frontend, O_RDWR | O_NONBLOCK);
- -----

So for me it looks like O_NONBLOCK is set and used but it still hangs at 
the ioctl.

Any other ideas?

Kind regards
Joerg

- -- 
The beginning is the most important part of the work.
 				-Plato
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iD8DBQFLjRBCSPOsGF+KA+MRAv4ZAJ4x2UHbmjfZ2JskBo5zPGW070NLUQCgnJVz
mJtN1UM3KTCinW2da2oHgMc=
=37rk
-----END PGP SIGNATURE-----


More information about the freebsd-multimedia mailing list