From jbryant@argus.tfs.net Thu Jun 17 06:17:49 1999
Return-Path: <jbryant@argus.tfs.net>
Received: from argus.tfs.net (host1-63.birch.net [216.212.1.63])
	by hub.freebsd.org (Postfix) with ESMTP id 22FF414FD7
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 17 Jun 1999 06:17:38 -0700 (PDT)
	(envelope-from jbryant@argus.tfs.net)
Received: (from jbryant@localhost)
	by argus.tfs.net (8.9.3/8.8.5) id IAA29074;
	Thu, 17 Jun 1999 08:17:34 -0500 (CDT)
Message-Id: <199906171317.IAA29074@argus.tfs.net>
Date: Thu, 17 Jun 1999 08:17:34 -0500 (CDT)
From: jbryant@tfs.net
Sender: jbryant@argus.tfs.net
Reply-To: jbryant@tfs.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: Fix for FM Radio tuner ioctl on WinTV-Theatre cards
X-Send-Pr-Version: 3.2

>Number:         12258
>Category:       kern
>Synopsis:       Tuning the FM radio on new -Theatre series cards from Hauppage requires that the entered frequency be 5.6 MHz low.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 17 06:20:00 PDT 1999
>Closed-Date:    Fri Oct 1 23:43:19 PDT 1999
>Last-Modified:  Fri Oct  1 23:51:01 PDT 1999
>Originator:     Jim Bryant
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
self
>Environment:

	Any PCI machine with the Hauppauge WinTV Theatre card.  4.0-current, and probably all earlier versions.

>Description:

	To tune a FM radio station on these cards, one must tune 5.6MHz low.  For example, to get 98.90 [The Rock], you have to tune 93.30.  The -Theatre series cards are new, and are using the 'next-generation' chips, and it may be likely that all future cards will require the fix presented here.

>How-To-Repeat:

	See description.

>Fix:
	
	Apply the following kludge to /usr/src/sys/pci/brooktree848.c, then add 'options BKTR_HAUPPAUGE_THEATRE_FM' to your kernel config.  rebuild your kernel, and reboot.  This fix should suffice until the driver maintainer wakes up and reads his two day old email and comes up with a more elegant solution.

--- brooktree848.pre-hack.c     Wed Jun 16 14:55:36 1999
+++ brooktree848.c      Wed Jun 16 14:53:06 1999
@@ -3382,7 +3382,12 @@
            */
 
             if(bktr->bt848_tuner == ALPS_TSCH5) {
+
+#ifdef BKTR_HAUPPAUGE_THEATRE_FM
+              temp=((int)*(unsigned long *)arg + 3565) * 32;
+#else
               temp=((int)*(unsigned long *)arg + 4125) * 32;
+#endif
               temp=temp/100 + (temp%100 >= 50 ? 1 : 0) +RADIO_OFFSET;
             } else {
               temp=(int)*(unsigned long *)arg/5-407  +RADIO_OFFSET;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: roger 
State-Changed-When: Fri Oct 1 23:43:19 PDT 1999 
State-Changed-Why:  

Fixed in bktr driver release 1.74, 17th September 1999. 

The PR author said in the PR report: 
This fix should suffice until the driver maintainer wakes up and reads his two day old email 

Well, for the record, I was away on vacation at the time. I happened to be on a remote 
Scottish Island called North Uist, with no internet connection. 
The nearest Internet Cafe is reachable by the Ferry. A 1 hour crossing, which only runs once a day. :-) 
>Unformatted:
