Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] [linux-dvb]It's is bad value to Signal strength of PCTV-SAT card.
My Card is pinnacle PCTV-SAT.
I'm watching TV over Windows XP.
But I don't watching TV over Linux.
if(( ioctl(front, FE_READ_SIGNAL_STRENGTH, &strength)) < 0){
perror("STRENGTH: ");
close(front);
return -1;
}
printf("strength : %x\n",strength);
strength ===>> ffffcaca
and status : 1,3,5 or 7
snr < 2f0e
ber => 0
////////////////////////////////
Fedora Core2 Test3 ( Kernel 2.6.5 )
LNB : Ku-Band
Sat. : koreasat3 (116.0E)
//My sample source
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdint.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 <sys/poll.h>
#define DMX "/dev/dvb/adapter0/demux0"
#define FRONT "/dev/dvb/adapter0/frontend0"
#define SEC "/dev/dvb/adapter0/sec0"
/* tune qpsk */
/* freq: frequency of transponder */
/* vpid, apid, tpid: PIDs of video, audio and teletext TS packets */
/* diseqc: DiSEqC address of the used LNB */
/* pol: Polarisation */
/* srate: Symbol Rate */
/* fec. FEC */
/* lnb_lof1: local frequency of lower LNB band */
/* lnb_lof2: local frequency of upper LNB band */
/* lnb_slof: switch frequency of LNB */
main()
{
int ret;
struct dmx_pes_filter_params pesFilterParams;
struct dvb_frontend_parameters frp;
struct pollfd pfd[1];
int demux0, front;
int vpid, apid, tpid;
fe_status_t status;
uint32_t ber;
int16_t snr, strength;
int lnb_lof1 = 10750;
int lnb_lof2 = 10750;
int lnb_slof = 0;
int frequency = 12370000;
int symbolrate = 24079000;
vpid = 1202;
apid = 1200;
fe_code_rate_t fec = FE_CAN_FEC_5_6;
if((front = open(FRONT,O_RDWR)) < 0){
perror("FRONTEND DEVICE: ");
return -1;
}
/*
if ((demux0=open(DMX, O_RDWR|O_NONBLOCK)) < 0){
perror("DEMUX DEVICE: ");
return -1;
}
*/
if (frequency < lnb_slof) {
frp.frequency = (frequency - lnb_lof1);
} else {
frp.frequency = (frequency - lnb_lof2);
}
frp.inversion = INVERSION_AUTO;
frp.u.qpsk.symbol_rate = symbolrate;
frp.u.qpsk.fec_inner = fec;
if (ioctl(front, FE_SET_FRONTEND, &frp) < 0){
perror("QPSK TUNE: ");
close(front);
return -1;
}
//wait...
sleep(3);
if((ret = ioctl(front, FE_READ_STATUS, &status)) < 0){
perror("STATUS: ");
close(front);
return -1;
}
printf("status : %x\n",status);
if((ret = ioctl(front, FE_READ_BER, &ber)) < 0){
perror("BER: ");
close(front);
return -1;
}
printf("ber : %x\n",ber);
if((ret = ioctl(front, FE_READ_SNR, &snr)) < 0){
perror("SNR: ");
close(front);
return -1;
}
printf("snr : %x\n",snr);
if((ret = ioctl(front, FE_READ_SIGNAL_STRENGTH, &strength)) < 0){
perror("STRENGTH: ");
close(front);
return -1;
}
printf("strength : %x\n",strength);
/*
printf("Getting QPSK event\n");
if ( ioctl(front, FE_GET_EVENT, &event) == -EOVERFLOW){
perror("qpsk get event");
return -1;
}
*/
/*
pesFilterParams.pid = vpid;
pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_DECODER;
pesFilterParams.pes_type = DMX_PES_VIDEO;
pesFilterParams.flags = DMX_IMMEDIATE_START;
if (ioctl(demux0, DMX_SET_PES_FILTER, &pesFilterParams) < 0){
perror("set_vpid");
return -1;
}
pesFilterParams.pid = apid;
pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_DECODER;
pesFilterParams.pes_type = DMX_PES_AUDIO;
pesFilterParams.flags = DMX_IMMEDIATE_START;
if (ioctl(demux2, DMX_SET_PES_FILTER, &pesFilterParams) < 0){
perror("set_apid");
return -1;
}
*/
close(front);
}
--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index