[linux-dvb] Q: How to use frontend events

HTPC dvblist at rindeberg.se
Tue Aug 16 18:36:07 CEST 2005

Hello List!

I'm just starting to explore the DVB API and thought I'd start with the
very basics :-) I'm trying to tune my DVB-T card to a transponder and so
far I'm able to do the actual tuning but I have to resort to a busy-wait
loop to know when the tuning is complete (or failed due to timeout). I'm
doing something like this:

  dvb_frontend_parameters params;

  <fill params struct here>

  ioctl(fd, FE_SET_FRONTEND, &params);

  fe_status_t status;
  int j = 0;

  do {
    ioctl(fd, FE_READ_STATUS, &status);
  } while((j < 4) && ((status & FE_HAS_LOCK) == 0));

What I'd really like to do is to wait for an event (poll()) that tells
me that the tuning is complete (or that the card has timed out
trying...) The "examples" section in the API documentation does mention
a "completion event" but since the examples are outdated I don't know
how to use it, or even if it still exists.

So, to my question:

Could someone be kind enough to direct me to updated documentation or to
an example that uses these frontend events or, better still, post some
example code here?

Thanks in advance!

// Magnus

More information about the linux-dvb mailing list