Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Sep 1997 13:12:05 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        multimedia@freebsd.org
Subject:   fxtv and pal...
Message-ID:  <199709131112.NAA06019@labinfo.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
forget who was who had problems with fxtv and pal modes... it seems to
work fine here, once you realize that all defaults are against you :)

The correct command here is

    ./fxtv -inputFormat pal -antennaFreqSet weurope -defaultInput tuner

(you cannot specify inputFormat or antennaFreqSet from the menus).

If you still have problems the following test program might help (who
said that source code is the best documentation ...). Run it in a
separate xterm, it lets you change things with simple commands such as
C27 (select channel 27)
T4 (tuner type 4 corresponds to weurope)
B60 (brightness 60)

	Cheers
	Luigi
----- tune.c ------
#include <stdio.h>
#include <stdlib.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <errno.h>

#define TUNER
#include <machine/ioctl_bt848.h>

int video;

main(int ac, char **av)
{
    int x, ch;
    char s[ 128 ];

    if ((video = open("/dev/tuner", O_RDONLY)) < 0) {
	fprintf(stderr, "open failed: %s\n", strerror(errno));
	goto bybye;
    }

    if (ac>1) {
        int i;
	do_fn("T4");
	for (i=88*16; i<800*16; i+=32) {
	    sprintf(s,"F%d", i);
	    do_fn(s);
	    do_fn("f");
	    sleep(2);
	}
    }
    while ( fgets( s, 100, stdin ) ) {
	do_fn(s);
    }
bybye:
        close(video);
        exit(0);
}

do_fn(char *s)
{
        int cmd = s[0];
	int x = atoi( s+1 );
	switch (cmd) {
	case 'K' : /* afc */
        case 'k' :
	    if (ioctl(video, cmd =='k'? BT848_CCBARS: BT848_SCBARS, &x) < 0)
		fprintf(stderr, "setafc ioctl failed: %s\n", strerror(errno));
	    else
		fprintf(stderr, "Current afc %d\n", x);
	    break;
	
	case 'A' : /* afc */
        case 'a' :
	    if (ioctl(video, cmd =='a'? TVTUNER_GETAFC: TVTUNER_SETAFC, &x) < 0)
		fprintf(stderr, "setafc ioctl failed: %s\n", strerror(errno));
	    else
		fprintf(stderr, "Current afc %d\n", x);
	    break;
	
	case 'X' : /* contrast */
        case 'x' :
	    if (ioctl(video, cmd =='x'? BT848_GCONT: BT848_SCONT, &x) < 0)
		fprintf(stderr, "setcontrast ioctl failed: %s\n", strerror(errno));
	    else
		fprintf(stderr, "Current contrast %d\n", x);
	    break;
	
	case 'B' : /* bright */
        case 'b' :
	    if (ioctl(video, cmd =='b'? BT848_GBRIG: BT848_SBRIG, &x) < 0)
		fprintf(stderr, "setbright ioctl failed: %s\n", strerror(errno));
	    else
		fprintf(stderr, "Current bright %d\n", x);
	    break;
	
	case 'T':
	case 't':
	    if (ioctl(video, cmd=='t'?TVTUNER_GETTYPE:TVTUNER_SETTYPE, &x) < 0)
		fprintf(stderr, "settype ioctl failed: %s\n", strerror(errno));
	    else
		fprintf(stderr, "Current type %d\n", x);
	    break;
	
	case 's' : /* get status */
	    if (ioctl(video, TVTUNER_GETSTATUS, &x) < 0)
		fprintf(stderr, "getchan ioctl failed: %s\n", strerror(errno));
	    else
		fprintf(stderr, "Current status %d\n", x);
	    break;

	case 'f' : /* get freq */
	case 'F' : /* set freq */
	    if (ioctl(video, cmd=='f'?TVTUNER_GETFREQ:TVTUNER_SETFREQ, &x) < 0)
		fprintf(stderr, "getfreq ioctl failed: %s\n", strerror(errno));
	    else
		fprintf(stderr, "Current freq %d (%8.3f MHz)\n", x,
			(double)x/16.0);
	    break;

	case 'c' : /* get channel */
	case 'C' : /* set channel */
	    if (ioctl(video, cmd=='c'?TVTUNER_GETCHNL:TVTUNER_SETCHNL, &x) < 0)
		fprintf(stderr, "getchan ioctl failed: %s\n", strerror(errno));
	    else
		fprintf(stderr, "Current chan %d\n", x);
	    break;

        }
}




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709131112.NAA06019>