checking tuner lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi list,

I own a palmodded tivo ( replaced the ntsc tuner with a pal tuner )
it worked perfectly until i moved to a new place, now the sound regularly
stops and the video becomes shaky. To make a long story short:
i think the issue is that the frequencies are slightly different here
i think i found a tool that checks the video lock on the tuner ( code pasted
below )
the output should be 0x81000000 if video lock is good according to the
source of yet another
program.
I mostly get 0x89000000 0x33000000 and sometimes 0x8100000
Could anyone confirm that the program is correct in saying if the tune lock
is ok or not?
the tuner is a philips 4006fh5 datasheet available upon request.

cheers

Tim

code follows:


#include <stdio.h>
#include <stdlib.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#define IICREADNOSUB 5
#define IICWRITENOSUB 6
#define IICREADMSP 3
#define IICWRITE 2
#define IICREAD 1
struct iic {
unsigned char module;
unsigned char subaddress;
unsigned char len;
unsigned char *data;
};
static int i2c_fd;
static int iicRead(int module, int subaddress, unsigned char *data, int len)
{
struct iic iic = {module, subaddress, len, data};
return ioctl(i2c_fd, IICREAD, &iic);
}
static int iicReadNoSubAddr(int module, unsigned char *data, int len)
{
struct iic iic = {module, 0, len, data};
return ioctl(i2c_fd, IICREADNOSUB, &iic);
}
static int iicWrite(int module, int subaddress, unsigned char *data, int
len)
{
struct iic iic = {module, subaddress, len, data};
return ioctl(i2c_fd, IICWRITE, &iic);
}
static int iicw1(int module, int subaddress, unsigned char v)
{
return iicWrite(module, subaddress, &v, 1);
}
static unsigned char iicr1(int module, int subaddress)
{
unsigned char v;
iicRead(module, subaddress, &v, 1);
return v;
}
int main(int argc, char *argv[])
{
int bus, ret;
unsigned v=0;
if (argc < 2) {
printf("iicdump <bus>\n");
exit(1);
}
i2c_fd = open("/dev/i2c", O_RDWR);
if (i2c_fd == -1) {
perror("/dev/i2c");
exit(1);
}
bus = strtol(argv[1], NULL, 0);
ret = iicReadNoSubAddr(bus, &v, 4);
printf("ret=%d v=0x%x\n", ret, v);
return 0;
}





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux