From nobody@FreeBSD.org  Fri Dec 26 12:36:23 2003
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9223816A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 26 Dec 2003 12:36:23 -0800 (PST)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A87E843D49
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 26 Dec 2003 12:36:22 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.10/8.12.10) with ESMTP id hBQKaMdL077714
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 26 Dec 2003 12:36:22 -0800 (PST)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.10/8.12.10/Submit) id hBQKaMnJ077713;
	Fri, 26 Dec 2003 12:36:22 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200312262036.hBQKaMnJ077713@www.freebsd.org>
Date: Fri, 26 Dec 2003 12:36:22 -0800 (PST)
From: ojo <ojo@force.sk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: No sound for ATI TV Wonder (stereo)
X-Send-Pr-Version: www-2.0

>Number:         60599
>Category:       kern
>Synopsis:       [bktr] [partial patch] No sound for ATI TV Wonder (stereo)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-multimedia
>State:          suspended
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 26 12:40:23 PST 2003
>Closed-Date:    
>Last-Modified:  Sat Mar 01 20:18:47 UTC 2008
>Originator:     ojo
>Release:        5.2rc2
>Organization:
>Environment:
FreeBSD ojo.ojo.sk 5.2-RC2 FreeBSD 5.2-RC2 #0: Mon Dec 22 07:23:48 GMT 2003
root@wv1u.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
I have got problem with make a TV card sound works. Card is ATI TV Wonder (stereo, not VE - mono).

The input is TV cable signal (not composite or svideo). Video works just fine, but sound does not. Under Linux sound works, but as far as I remember, there was a still problem under FreeBSD. I tried fxtv and xawtv, no sound at all.

I loaded modules this way:
# kldload snd_emu10k1
# kldload bktr
# sysctl -a|grep bt
hw.bt848.card: -1
hw.bt848.tuner: -1
hw.bt848.reverse_mute: -1
hw.bt848.format: -1
hw.bt848.slow_msp_audio: -1

// no video, no sound

# sysctl hw.bt848.tuner=5 
hw.bt848.tuner: -1 -> 5

// video ok, no sound

# dmesg
pcm0: <Creative EMU10K1> port 0xc400-0xc41f irq 11 at device 11.0 on pci0
pcm0: <SigmaTel STAC9708/11 AC97 Codec>
bktr_mem: memory holder loaded
bktr0: <BrookTree 878> mem 0xef001000-0xef001fff irq 11 at device 12.0 on pci0
bktr0: Warning - card vendor 0x1002 (model 0x0001) unknown.
bktr0: Detected a MSP3410D-C5 at 0x80
bktr0: Pinnacle/Miro TV, Temic NTSC tuner, msp3400c stereo.
bktr0: Warning - card vendor 0x1002 (model 0x0001) unknown.
bktr0: Detected a MSP3410D-C5 at 0x80

>How-To-Repeat:
      
>Fix:
      
>Release-Note:
>Audit-Trail:

From: ojo@force.sk
To: freebsd-gnats-submit@FreeBSD.org, ojo@force.sk
Cc:  
Subject: Re: misc/60599: No sound for ATI TV Wonder (stereo)
Date: Fri, 26 Dec 2003 21:44:03 +0100

 And under Linux it acts like:
 
 # dmesg
 
 i2c-core.o: i2c core module
 i2c-algo-bit.o: i2c bit algorithm module
 Linux video capture interface: v1.00
 bttv: driver version 0.7.108 loaded
 bttv: using 4 buffers with 2080k (8320k total) for capture
 bttv: Bt8xx card found (0).
 bttv0: Bt878 (rev 17) at 00:0c.0, irq: 11, latency: 32, mmio: 0xef001000
 bttv0: detected: ATI TV Wonder [card=63], PCI subsystem ID is 1002:0001
 bttv0: using: ATI TV-Wonder [card=63,autodetected]
 i2c-core.o: adapter bt848 #0 registered as adapter 0.
 bttv0: using tuner=19
 bttv0: i2c: checking for MSP34xx @ 0x80... found
 i2c-core.o: driver i2c msp3400 driver registered.
 msp34xx: init: chip=MSP3410D-C5 +nicam +simple
 msp3410: daemon started
 i2c-core.o: client [MSP3410D-C5] registered to adapter [bt848 #0](pos. 0).
 bttv0: i2c: checking for TDA9875 @ 0xb0... not found
 bttv0: i2c: checking for TDA7432 @ 0x8a... not found
 i2c-core.o: driver i2c TV tuner driver registered.
 tuner: chip found @ 0xc0
 tuner: type set to 19 (Temic PAL* auto (4006 FN5))
 i2c-core.o: client [Temic PAL* auto (4006 FN5)] registered to adapter [bt848 #0](pos. 1).
 bttv0: PLL: 28636363 => 35468950 .. ok
 bttv0: registered device video0
 bttv0: registered device vbi0

From: Justin Hibbits <jrh29@po.cwru.edu>
To: ojo@force.sk, freebsd-gnats-submit@FreeBSD.org
Cc: freebsd-current@freebsd.org
Subject: Re: kern/60599: [sound] No sound for ATI TV Wonder (stereo)
Date: Thu, 12 Aug 2004 11:26:55 -0400

 --Apple-Mail-5-200582066
 Content-Type: multipart/mixed; boundary=Apple-Mail-4-200582057
 
 
 --Apple-Mail-4-200582057
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=US-ASCII;
 	format=flowed
 
 The following patch adds ATI TV Wonder autoconfiguration.  It was 
 posted to current@ before, but I cleaned up the patch(es), making them 
 this unified diff.
 
 Hopefully someone can figure out the audio part now, I'll keep working 
 on it.
 
 -Justin
 --
 "And now, if you'll excuse me, I'm in the middle of 15 things, all 
 annoying" -- Lt. Cmdr Susan Ivanova, Babylon 5
 
 --Apple-Mail-4-200582057
 Content-Transfer-Encoding: 7bit
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="bktr.patch"
 Content-Disposition: attachment;
 	filename=bktr.patch
 
 --- bktr_card.c	Thu Aug 12 11:17:06 2004
 +++ /local/src/sys/dev/bktr/bktr_card.c	Thu Aug 12 09:15:58 2004
 @@ -32,7 +32,7 @@
   */
  
  #include <sys/cdefs.h>
 -__FBSDID("$FreeBSD: /repoman/r/ncvs/src/sys/dev/bktr/bktr_card.c,v 1.24 2004/08/08 01:23:39 sanpei Exp $");
 +__FBSDID("$FreeBSD: src/sys/dev/bktr/bktr_card.c,v 1.23 2003/12/08 07:59:18 obrien Exp $");
  
  /*
   * This is part of the Driver for Video Capture Cards (Frame grabbers)
 @@ -368,6 +368,20 @@
  	   { 0x02, 0x00, 0x00, 0x00, 1 },	/* audio MUX values */
  	   0x18e0 },				/* GPIO mask */
  
 +        {  CARD_TVWONDER,                       /* the card id */
 +          "ATI TV Wonder",              /* the 'name' */
 +           NULL,                                /* the tuner */
 +           0,                                   /* the tuner i2c address */
 +           0,                                   /* dbx is optional */
 +           0,
 +	   0,
 +           0,                                   /* EEProm type */
 +           0,                                   /* EEProm size */
 +	   /* Tuner, Extern, Intern, Mute, Enabled */
 +//	   { 0x1002, 0x1002, 0x3003, 0x3003, 0x3003 },	/* audio MUX values */
 +//	   0x300f },				/* GPIO mask */
 +	   { 0x1002, 0x1002, 0x3003, 0x3003, 0x3003 },	/* audio MUX values */
 +	   0x300f },				/* GPIO mask */
  };
  
  struct bt848_card_sig bt848_card_signature[1]= {
 @@ -569,6 +583,7 @@
  #define PCI_VENDOR_FLYVIDEO_2	0x1852
  #define PCI_VENDOR_PINNACLE_ALT	0xBD11
  #define PCI_VENDOR_IODATA	0x10fc
 +#define PCI_VENDOR_ATI	0x1002
  
  #define MODEL_IODATA_GV_BCTV3_PCI	0x4020
  
 @@ -713,6 +728,12 @@
  		    bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
  		    goto checkTuner;
  		}
 +		if (subsystem_vendor_id == PCI_VENDOR_ATI) {
 +                    bktr->card = cards[ (card = CARD_TVWONDER) ];
 +		    bktr->card.eepromAddr = eeprom_i2c_address;
 +		    bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
 +                    goto checkTuner;
 +                }
  
                  /* Vendor is unknown. We will use the standard probe code */
  		/* which may not give best results */
 @@ -1131,6 +1152,11 @@
  	    goto checkDBX;
  	    break;
  
 +	case CARD_TVWONDER:
 +	    select_tuner( bktr, PHILIPS_NTSC ); /* ALPS_TSCH6, in fact. */
 +	    goto checkDBX;
 +	    break;
 +
  	} /* end switch(card) */
  
  
 @@ -1274,6 +1300,10 @@
  
  	/* Enable PLL mode for Video Highway Xtreme users */
  	if (card == CARD_VIDEO_HIGHWAY_XTREME)
 +		bktr->xtal_pll_mode = BT848_USE_PLL;
 +
 +	/* Enable PLL mode for Video Highway Xtreme users */
 +	if (card == CARD_TVWONDER)
  		bktr->xtal_pll_mode = BT848_USE_PLL;
  
  
 --- bktr_card.h	Thu Aug 12 11:17:06 2004
 +++ /local/src/sys/dev/bktr/bktr_card.h	Thu Aug 12 08:41:55 2004
 @@ -1,4 +1,4 @@
 -/* $FreeBSD: /repoman/r/ncvs/src/sys/dev/bktr/bktr_card.h,v 1.7 2004/08/08 01:23:39 sanpei Exp $ */
 +/* $FreeBSD: src/sys/dev/bktr/bktr_card.h,v 1.6 2003/02/02 17:46:00 orion Exp $ */
  
  /*
   * This is part of the Driver for Video Capture Cards (Frame grabbers)
 @@ -76,9 +76,10 @@
  #define CARD_ASKEY_DYNALINK_MAGIC_TVIEW	14
  #define CARD_LEADTEK		15
  #define CARD_TERRATVPLUS	16
 -#define	CARD_IO_BCTV3		17
 -#define	CARD_AOPEN_VA1000	18
 -#define	Bt848_MAX_CARD		19
 +#define CARD_IO_BCTV3		17
 +#define CARD_AOPEN_VA1000	18
 +#define CARD_TVWONDER		19
 +#define Bt848_MAX_CARD		20
  
  #define CARD_IO_GV		CARD_IO_BCTV2
  
 
 --Apple-Mail-4-200582057--
 
 --Apple-Mail-5-200582066
 content-type: application/pgp-signature; x-mac-type=70674453;
 	name=PGP.sig
 content-description: This is a digitally signed message part
 content-disposition: inline; filename=PGP.sig
 content-transfer-encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (Darwin)
 
 iD8DBQFBG4xEqt29EJDZlM4RAoxPAJ905NY++KwRJnprYyHK5YSCpkZ/rwCdFvpf
 au4UmWmHpO9f64u4+ZXNW1c=
 =etld
 -----END PGP SIGNATURE-----
 
 --Apple-Mail-5-200582066--
 

From: ojo@force.sk
To: freebsd-gnats-submit@FreeBSD.org, ojo@force.sk
Cc:  
Subject: Re: kern/60599: [sound] No sound for ATI TV Wonder (stereo)
Date: Sun, 15 Aug 2004 10:14:24 +0200

 Sorry. This patch does not work for me. :-(
 (FreeBSD 5.2.1)

From: Justin Hibbits <jrh29@po.cwru.edu>
To: ojo@force.sk, freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/60599: [sound] No sound for ATI TV Wonder (stereo)
Date: Sun, 15 Aug 2004 20:17:36 -0400

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 It probably doesn't work against 5.2.1, but it does patch against 
 - -CURRENT, only 2 files touched (bktr_card.c and bktr_card.h).  It 
 autoconfigures, but no audio, and can't figure out how to get audio.
 
 - -Justin
 - --
 "And now, if you'll excuse me, I'm in the middle of 15 things, all 
 annoying" -- Lt. Cmdr Susan Ivanova, Babylon 5
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (Darwin)
 
 iD8DBQFBH/0nqt29EJDZlM4RAm8BAJ99dkaP/ovNhkE1QP9knCQVqg86XACgpFwC
 K9EoZu3JU4Ac3p2lU0jWstw=
 =McmL
 -----END PGP SIGNATURE-----
 
Responsible-Changed-From-To: freebsd-bugs->sound 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Aug 22 07:16:17 GMT 2004 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60599 
Responsible-Changed-From-To: sound->freebsd-multimedia 
Responsible-Changed-By: arved 
Responsible-Changed-When: Tue Jun 14 13:37:36 GMT 2005 
Responsible-Changed-Why:  
This is not really sound(4), but bktr(4) related. 
sound@ has already enough PRs, so over to more suitable-multimedia 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60599 
State-Changed-From-To: open->feedback 
State-Changed-By: netchild 
State-Changed-When: Wed Dec 28 19:24:36 UTC 2005 
State-Changed-Why:  
This is not sound related, it's bktr related. 

The bktr driver doesn't offers sound capabilities, you have to 
route the sound with a cable through a soundcard. 

Is the bktr patch still needed in -current or 6.x? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60599 
State-Changed-From-To: feedback->suspended 
State-Changed-By: linimon 
State-Changed-When: Sat Mar 1 20:17:29 UTC 2008 
State-Changed-Why:  
It does not sound like this is being actively worked on. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60599 
>Unformatted:
