PDA

View Full Version : Issue with DMX_SET_FILTER



jansenjw
29th May, 2008, 10:48 PM
Hi

I am trying to build a filter on my DM500+. Somehow the IOCTL always returns the error code Invalid Argument

Any ideas what is wrong?

#include <fcntl.h>
#include "/data/dreambox/tuxbox-bb/build/tmp/work/linux-dm500plus-2.6.12-r1/linux-2.6.12/include/linux/dvb/dmx.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/poll.h>

int main(int argc,char* argv[])
{
int fd,ca,program_number,tfd;

if ((fd = open("/dev/dvb/card0/demux0",O_RDWR|O_NONBLOCK)) < 0)
{
perror("DEMUX DEVICE");
return -1;
}

printf("DMX Filter size: %d\n", DMX_FILTER_SIZE);

//step 1: search the PAT
struct dmx_sct_filter_params sFP;

memset(&sFP.filter.filter,0,DMX_FILTER_SIZE);
memset(&sFP.filter.mask,0,DMX_FILTER_SIZE);
sFP.filter.filter[0] = 0;
sFP.filter.mask[0] = 0xff;
sFP.timeout = 15000;
sFP.flags = 4;
sFP.pid = 0;

if (ioctl(fd,DMX_SET_FILTER,&sFP < 0))
perror("DMX SET SECTION FILTER");
}

Devilfish
29th May, 2008, 11:40 PM
C++ is not my strong point m8, maybe if you post the full error from the terminal I could maybe see something.

kagon
1st June, 2008, 11:22 AM
if (ioctl(fd,DMX_SET_FILTER,&sFP < 0))
{
perror("DMX SET SECTION FILTER");
}


&sFP < 0 -- Are you sure that's what you mean? Shouldn't it be:



if (ioctl(fd,DMX_SET_FILTER,&sFP) < 0)
{
perror("DMX SET SECTION FILTER");
}


FWIW, there's no C++ code here, just C.

Devilfish
1st June, 2008, 04:57 PM
FWIW, there's no C++ code here, just C.

:roflmao: that just goes to show how much I know lol

jansenjw
1st June, 2008, 08:18 PM
Hi

you were right, stupid typo, HOWEVER even when fixed the ioctl command still just returns the message "Invalid Argument". Anyone have experience with the multiplexer device on an openembedded Dreambox system? I get the feeling there is an issue with the device /dev/dvb/card0/demux0. This is the only difference from other examples I got from the Linux DVB API....

Hints would be very much appreciated...

kagon
3rd June, 2008, 10:39 AM
Hrm, guess I'll have to setup my cross-compiling environment again. Will give your snippet a try and see what I get.

osborne82
4th June, 2008, 08:18 AM
um strange error what steps got u to this error ? may help us identify it correctly :)
in anyevent your very welcome to come have a look round my dev forum (im sure itl be ok with devilfish if not soz m8 lol)

http://cablelinux.info/forum/wbb3/wbb/index.php?page=Index
note this is purly a development forum :)

cheers

osborne82