All of lore.kernel.org
 help / color / mirror / Atom feed
From: "lucaberto@libero.it" <lucaberto@libero.it>
To: linux-media@vger.kernel.org
Subject: 
Date: Tue, 15 Dec 2009 11:50:57 +0100 (CET)	[thread overview]
Message-ID: <32513776.2417971260874257455.JavaMail.defaultUser@defaultHost> (raw)

hello i have write i little c program for test :
here is the program:

#include

<stdio.h>
#include </usr/include/linux/dvb/frontend.h>
#include <stdlib.h>


#include <stdint.h>
#include <ctype.h>
#include <sys/ioctl.h>
#include

<sys/poll.h>
#include <unistd.h>
#include <error.h>
#include <errno.h>
#include

<sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>


#include <unistd.h>
#include <linux/dvb/dmx.h>
#include <linux/dvb/frontend.h>


#include <linux/dvb/dmx.h>

#define MIA "/dev/dvb/adapter0/frontend0"
#define

MD "/dev/dvb/adapter0/demux0"
//#define DVR "/dev/dvb/adapter0/dvr0"
#define

DVR_FILE "/home/lucak904/Scrivania/Luca/prog_c/sat/mio.dat"
#define BUFFY

(188*20)

main()

{
    struct dvb_frontend_info luca;
    struct

dvb_frontend_parameters parametri;
    struct dvb_frontend_parameters luca2;


    struct dmx_pes_filter_params filtri;

    parametri.frequency = 1197700;


    parametri.inversion = INVERSION_AUTO;
    parametri.u.qpsk.symbol_rate =

2750000;
    parametri.u.qpsk.fec_inner   = FEC_AUTO;


    fe_status_t status;


    int fd, min, max,chiudo_fd, chiudo_md, chiudo_dvr ,stato, pp, freq,

ritorno, sy_rate, tt, md,fec_inn, inv, dvr, dvr_out,len;
    uint8_t buf

[BUFFY];


if((fd = open(MIA,O_RDWR)) < 0){
                perror("FRONTEND

DEVICE: ");
                return -1;
    }
if (ioctl(fd, FE_SET_FRONTEND,

&parametri) < 0){
                perror("QPSK TUNE: ");
                return

-1;
    }
    if (ioctl(fd, FE_GET_FRONTEND ,&luca2) <0){
                
perror
("GET_INFO: ");
                return -1;
    }

printf("\nfreq :%d", 
luca2.
frequency);
    printf("\nsimbol_rate : %d", luca2.u.qpsk.symbol_rate);

   
printf("\ninversion : %d", luca2.inversion);
    printf("\nfec : %d", luca2.
u.
qpsk.fec_inner);


    if (ioctl(fd, FE_GET_INFO  ,&luca) <0){

               
perror("GET_INFO: ");
                return -1;
    }

printf
("\nfreq min:%
d", luca.frequency_min);
printf("\nfreq max:%d", luca.
frequency_max);

if
(ioctl(fd, FE_READ_STATUS  ,&status) <0){
                
perror
("FE_READ_STATUS: ");
                return -1;
    }

    // apro il 
demux


    printf("\nstato :%d", status);
    if((md = open(MD,
O_RDWR|O_NONBLOCK)) < 0)
{
                perror("DEMUX DEVICE: ");

                return -1;
    }


    //setto il demux

    filtri.pid = 1296;

    filtri.input =
DMX_IN_FRONTEND;
    filtri.output = DMX_OUT_TAP;
    filtri.
pes_type =
DMX_PES_OTHER;
    filtri.flags = DMX_IMMEDIATE_START;
    if (ioctl
(md,
DMX_SET_PES_FILTER, &filtri) < 0) {
            perror("DEMUX DEVICE: ");


            return -1;
    }

    //apro il dvr

    //if ((dvr = open(DVR,

O_RDONLY|O_NONBLOCK)) < 0) {
      //      perror("DVR DEVICE : ");
//       

/    return -1;
  //  }

    if ((dvr_out = open

("/home/lucak904/Scrivania/Luca/prog_c/sat/prova_scar.txt", O_WRONLY)) < 0) {


            perror(" DVR FILE : ");
            return -1;
    }


    if((len

= read(md,buf, BUFFY)) < 0){
        perror("non leggo");
    }
    else{


        write(dvr_out,buf,len);

    }

    chiudo_fd = close(fd);
   

chiudo_md = close(md);
    //chiudo_dvr = close(dvr);
}

It is just a test


every time i get Resource temporarily unavailable
For my understanding it means

that nothing is readed from demux device, wath is wrong , the pid and frequency

are ok the SNR is more than 70%

Thanks

Luca 

                 reply	other threads:[~2009-12-15 10:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32513776.2417971260874257455.JavaMail.defaultUser@defaultHost \
    --to=lucaberto@libero.it \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.