I use PLI on my DM500+. I have created a development environment and was able to build a DM500+ image successfully. Now I tried to run some Linux DVB API test code. However every time the ioctl command with parameter DMX_SET_FILTER fails with the message: Invalid Argument. I have copy/pasted example code from the internet but every time get the same message! Any idea what is wrong? I suspect maybe issues with the demux device or the wrong dmx.h file?!?!
#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); //Filter for the PAT struct dmx_sct_filter_params flt; memset(&flt,0,sizeof(flt)); flt.filter.filter[0]=0; flt.filter.mask[0]=0xff; flt.timeout=1000; flt.pid=0; flt.flags=DMX_IMMEDIATE_START; if (ioctl(fd, DMX_SET_FILTER, &flt) < 0) perror("Error in filter"); }