From owner-freebsd-bugs Wed Jan 8 8:40:11 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B243437B401 for ; Wed, 8 Jan 2003 08:40:08 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D51243ED8 for ; Wed, 8 Jan 2003 08:40:07 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h08Ge7NS067361 for ; Wed, 8 Jan 2003 08:40:07 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h08Ge7CS067360; Wed, 8 Jan 2003 08:40:07 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2EAD437B401 for ; Wed, 8 Jan 2003 08:37:04 -0800 (PST) Received: from wrzx35.rz.uni-wuerzburg.de (wrzx35.rz.uni-wuerzburg.de [132.187.3.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFDC143E4A for ; Wed, 8 Jan 2003 08:37:02 -0800 (PST) (envelope-from q@coyote.dnsalias.net) Received: from wrzx34.rz.uni-wuerzburg.de (wrzx34.rz.uni-wuerzburg.de [132.187.3.34]) by wrzx35.rz.uni-wuerzburg.de (8.8.8/8.8.8/uniwue-MM-1.05) with ESMTP id RAA253202 for ; Wed, 8 Jan 2003 17:36:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by virusscan.rz.uni-wuerzburg.de (Postfix) with ESMTP id 182CA6756D for ; Wed, 8 Jan 2003 17:31:42 +0100 (CET) Received: from wrzx07.rz.uni-wuerzburg.de (wrzx07.rz.uni-wuerzburg.de [132.187.1.7]) by wrzx34.rz.uni-wuerzburg.de (Postfix) with ESMTP id 6C82067563 for ; Wed, 8 Jan 2003 17:31:41 +0100 (CET) Received: from spamchecker (localhost [127.0.0.1]) by spamcheck.rz.uni-wuerzburg.de (Postfix) with ESMTP id C4A484650 for ; Wed, 8 Jan 2003 17:31:35 +0100 (CET) Received: from coyote.dnsalias.net (gb-007.galgenberg.net [132.187.222.7]) by wrzx07.rz.uni-wuerzburg.de (Postfix) with ESMTP id 219B9464B for ; Wed, 8 Jan 2003 17:31:35 +0100 (CET) Received: (from q@localhost) by coyote.dnsalias.net (8.12.6/8.12.6/Submit) id h08GVZY2053340; Wed, 8 Jan 2003 17:31:35 +0100 (CET) Message-Id: <200301081631.h08GVZY2053340@coyote.dnsalias.net> Date: Wed, 8 Jan 2003 17:31:35 +0100 (CET) From: Ulrich Spoerlein To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/46872: Make sound work on TV-cards with MSDP3415D-B3 chip Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46872 >Category: kern >Synopsis: Make sound work on TV-cards with MSDP3415D-B3 chip >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jan 08 08:40:01 PST 2003 >Closed-Date: >Last-Modified: >Originator: Ulrich Spoerlein >Release: FreeBSD 4.7-STABLE i386 >Organization: >Environment: System: FreeBSD coyote.dnsalias.net 4.7-STABLE FreeBSD 4.7-STABLE #1: Mon Nov 18 09:46:38 CET 2002 root@coyote.dnsalias.net:/usr/obj/usr/src/sys/COYOTE i386 % dmesg|grep bktr bktr0: mem 0xd7000000-0xd7000fff irq 7 at device 11.0 on pci0 bktr0: Hauppauge Model 44354 C221 bktr0: Detected a MSP3415D-B3 at 0x80 bktr0: Hauppauge WinCast/TV, Philips FR1216 PAL FM tuner, msp3400c stereo, remote control. >Description: Ok, this problem is a bit more complex. The above is a WinTV Stereo FM card purchased in Germany. It has the MSP34154D-B3 chip, responsible for Stereo sound on FM-Radio and TV. But sadly, nearly all TV applications are unable to initialize the sound-chip (fxtv works, when 'internal audio' is selected), although the initialization looks right (i triple-checked with the documentation available on that chip). There is one work-around for getting sound: Start a radio application (xmradio), then start for example xawtv and switch the channel. Voila, sound. The ugly thing is, this won't work if you're trying to capture with ffmpeg or mencoder. After trying nearly all ways of initializing this chip, i just copied the initialization from the FM Tuner to the TV Tuner part and ... it works every time. >How-To-Repeat: Buy one of these cards (i think the german cards are special) and try for yourself :) >Fix: Ok, this Fix is not very nice. I abused slow_msp_audio, but i didn't want to add another field to the bktr struct. I changed the auto_detect value, because the specs say: Results exceeding 0x07ff indicate an active autodetect --- bktr.patch begins here --- --- sys/dev/bktr/bktr_audio.c 1 Nov 2000 09:36:14 -0000 1.2.2.4 +++ sys/dev/bktr/bktr_audio.c 10 Dec 2002 12:48:35 -0000 @@ -482,7 +482,7 @@ msp_dpl_write(bktr, bktr->msp_addr, 0x10, 0x0030,0x2003);/* Enable Auto format detection */ msp_dpl_write(bktr, bktr->msp_addr, 0x10, 0x0020,0x0020);/* Standard Select Reg. = BTSC-Stereo*/ - msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x000E,0x2403);/* darned if I know */ + msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x000e,0x2403);/* FM prescale */ msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0320);/* Source select = (St or A) */ /* & Ch. Matrix = St */ msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0000,0x7300);/* Set volume to 0db gain */ @@ -500,8 +500,15 @@ msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008, 0x0220); /* SCART | STEREO */ msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0013, 0x0100); /* DSP In = MONO IN */ } - - + /* MSP3415D-B3 SPECIAL CASE Use same calls as setting up the FM Tuner */ + /* (for Hauppauge 44xxx card with Tuner Type 0x15) */ + else if( bktr->slow_msp_audio == 3){ + msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0000, 0x7300); /* 0 db volume */ + msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x000d, 0x7f00); /* scart prescale */ + msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008, 0x0220); /* SCART | STEREO */ + msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0013, 0x0200); /* DSP In = SC2_IN_L/R */ + } + /* MSP3410/MSP3415 - countries with mono, stereo using 2 FM channels and NICAM */ /* FAST sound scheme */ else if (bktr->slow_msp_audio == 0) { @@ -524,7 +531,7 @@ DELAY(100000); auto_detect = msp_dpl_read(bktr, bktr->msp_addr, 0x10, 0x007e); loops++; - } while (auto_detect > 0xff && loops < 50); + } while (auto_detect > 0x07ff && loops < 500); if (bootverbose)printf ("%s: Result of autodetect after %dms: %d\n", bktr_name(bktr), loops*10, auto_detect); --- sys/dev/bktr/bktr_card.c 1 Nov 2000 09:36:14 -0000 1.9.2.4 +++ sys/dev/bktr/bktr_card.c 10 Dec 2002 12:48:36 -0000 @@ -995,11 +995,12 @@ case 0x15: select_tuner( bktr, PHILIPS_FR1216_PAL ); + bktr->slow_msp_audio = 3; goto checkDBX; case 0x2a: - bktr->msp_use_mono_source = 1; select_tuner( bktr, PHILIPS_FR1216_PAL ); + bktr->msp_use_mono_source = 1; goto checkDBX; default : --- bktr.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message