Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: tech patch
Alessio Sangalli wrote:
>
> Hi, I've made a little patch to display signal strength and
> snr and the
> bitrate of the current channel.
> I expect problems with DVB boards
> other than
> version 1.3, as we discussed it some time ago, reading signal
> strength
> and snr.
>
Hi, i tried your patch with my 2.1 Card and as you said it only shows 0
However i looked into the Multidec sources and fount the following
function:
VES_TYPE seems to be always -1 and VES_FALGS always 0,
But i'm not exactly an c programmer so it might be wrong.
void Get_Signal_Infos(unsigned char *Sync , unsigned int
*Quality,unsigned int *BitErrorRate )
{
unsigned int q,e;
unsigned char s;
unsigned char vstatus;
unsigned int bq,be,bs;
char Text[255];
if ( VES_TYPE == 1 ) {
s=readreg(ves_addr,ves_flags,0x0e);
q = readreg(ves_addr,ves_flags,0x1c);
e = readreg(ves_addr,ves_flags,0x15) |
(readreg(ves_addr,ves_flags,0x16)<<8) |
(readreg(ves_addr,ves_flags,0x17)<<16);
bs=s;
bq=q;
be=e;
*Sync=s;
q=255-q;
e=e/4110;
if ( e > 255 ) e=255;
e=255-e;
*Quality=q;
*BitErrorRate=e;
if ((s&0x0f)==0x0f) System_in_Sync=0;
} else if ( VES_TYPE == 2 ) {
e = readreg(ves_addr,ves_flags, 0x15);;
q=(readreg(ves_addr,ves_flags,0x24)<<8)|readreg(ves_addr,ves_flags,0x25)
;
vstatus=readreg(ves_addr,ves_flags, 0x1b);
if ( vstatus != 0x98 ) {
writereg(ves_addr,ves_flags, 0x14, 0x80 | ves_bclk);
writereg(ves_addr,ves_flags, 0x12, 0x39 );
vstatus=readreg(ves_addr,ves_flags, 0x1b);
};
bs=vstatus;
bq=255-(q/46);
be=e;
if ((vstatus&0x98)==0x98) s=0x1f;
else if ((vstatus&0x80)==0x80) s=0x03;
else s=0x00;
*Sync=s;
*Quality=bq;
*BitErrorRate=e;
if ((s&0x0f)==0x0f) System_in_Sync=0;
}else if (VES_TYPE == 0 ) {
s=readreg(ves_addr,ves_flags,0x11);
q = 0;
e = readreg(ves_addr,ves_flags,0x14) |
(readreg(ves_addr,ves_flags,0x15)<<8) |
(readreg(ves_addr,ves_flags,0x16)<<16);
bs=s;
bq=q;
be=e;
*Sync=s;
q=255-q;
e=e/649;
if ( e > 255 ) e=255;
e=255-e;
*Quality=q;
*BitErrorRate=e;
if ((s&0x0f)==0x0f) System_in_Sync=0;
}
sprintf(Text,"SAA7146 Get_Signal_Infos VES_Type:%d Q:%d S:%d
E:%d",VES_TYPE,bs,bq,be);
Write_Log(Text);
}
Hope you can use this
CU Ulrich
Home |
Main Index |
Thread Index