Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Aug 1997 12:19:55 -0600
From:      Steve Passe <smp@csn.net>
To:        Kyle Mestery <mestery@winternet.com>
Cc:        Amancio Hasty <hasty@rah.star-gate.com>, Kenneth Merry <ken@gt.ed.net>, freebsd-multimedia@FreeBSD.ORG
Subject:   Re: Problem with my Wincast, fxtv 
Message-ID:  <199708171819.MAA07175@Ilsa.StevesCafe.com>
In-Reply-To: Your message of "Sun, 17 Aug 1997 12:12:54 CDT." <Pine.GSO.3.96.970817120641.10650A-100000@tundra.winternet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

Well, if your feeling adverturous perhaps you should write a simple channel
scanner.  its something the driver could use.

b4 doing that, try turning on AFC (auto freq control)  I think fxtv has a menu
item for that, but if not, use ioctl TVTUNER_SETAFC.  this will cause the
tuner code to adjust the selected frequency within a +-5 mHz range while
polling the hardware for a "centered" signal.

---
if that doesn't help a crude userland auto scan would be something like:
******************** THE FOLLOWING IS ALL THEORY ***********************

#define AFC_BITS		0x07
#define AFC_FREQ_MINUS_125	0x00
#define AFC_FREQ_MINUS_62	0x01
#define AFC_FREQ_CENTERED	0x02
#define AFC_FREQ_PLUS_62	0x03
#define AFC_FREQ_PLUS_125	0x04

#define BOTTOM	(unsigned long)(55.25 * 16)
#define TOP	(unsigned long)(655.25 * 16)

int afcon = 1;
unsigned long freq, freq2, status;
int fd;

fd = open( ... );

if ( ioctl( fd, TVTUNER_SETAFC, &afcon ) < 0 ) {
	ERROR;
}

for ( freq = BOTTOM; freq < TOP; freq += (6.0 * 16) )
{
	printf( "\ntrying freq: %f", (double)((double)freq / 16.0) );
	if ( ioctl( fd, TVTUNER_SETFREQ, &freq ) < 0 ) {
		ERROR;
	}
	if ( ioctl( fd, TVTUNER_GETFREQ, &freq2 ) < 0 ) {
		ERROR;
	}

	if ( ioctl( fd, TVTUNER_GETSTATUS, &status ) < 0 ) {
		ERROR;
	}
	if ( !(status & 0x40) ) {
		printf( ", no lock (?)\n" );
		sleep( 1 );
		continue;
	}

/** XXX not sure about the / 16 */
	printf( "\nafc picked freq: %f", (double)((double)freq2 / 16.0) );

	printf( ", hit return to continue..." );
	gets();
}
--
Steve Passe	| powered by
smp@csn.net	|            Symmetric MultiProcessor FreeBSD





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