Register
Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    May 2008
    Location
    Netherlands
    Posts
    21
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default Issue with DMX_SET_FILTER

    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");
    }

  2. #2
    Administrator
    Devilfish's Avatar
    Join Date
    Feb 2008
    Posts
    7,851
    Thanks Thanks Given 
    74
    Thanks Thanks Received 
    3,158
    Thanked in
    207 Posts

    Default

    C++ is not my strong point m8, maybe if you post the full error from the terminal I could maybe see something.

  3. #3
    Top Poster
    Join Date
    May 2008
    Posts
    140
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Code:
    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:

    Code:
    if (ioctl(fd,DMX_SET_FILTER,&sFP) < 0)
    {
    	perror("DMX SET SECTION FILTER");
    }
    FWIW, there's no C++ code here, just C.
    Last edited by kagon; 1st June, 2008 at 11:24 AM. Reason: Tabs.

  4. #4
    Administrator
    Devilfish's Avatar
    Join Date
    Feb 2008
    Posts
    7,851
    Thanks Thanks Given 
    74
    Thanks Thanks Received 
    3,158
    Thanked in
    207 Posts

    Default

    Quote Originally Posted by kagon View Post
    FWIW, there's no C++ code here, just C.
    that just goes to show how much I know

  5. #5
    Junior Member
    Join Date
    May 2008
    Location
    Netherlands
    Posts
    21
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default

    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...

  6. #6
    Top Poster
    Join Date
    May 2008
    Posts
    140
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Hrm, guess I'll have to setup my cross-compiling environment again. Will give your snippet a try and see what I get.

  7. #7
    Dreambox Guru osborne82's Avatar
    Join Date
    Mar 2008
    Location
    any dreambox development forum
    Posts
    133
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default

    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 )

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

    cheers

    osborne82

 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.