From owner-freebsd-stable@FreeBSD.ORG Wed Sep 24 09:34:13 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC68216A4B3; Wed, 24 Sep 2003 09:34:13 -0700 (PDT) Received: from dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NOSPAM.dyndns.dk (B76a1.pppool.de [213.7.118.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52FC443FBD; Wed, 24 Sep 2003 09:33:47 -0700 (PDT) (envelope-from bounce@NOSPAM.dyndns.dk) Received: from Mail.NOSPAM.DynDNS.dK (ipv6.NOSPAM.dyndns.dk [2002:d507:76a1:0:220:afff:fed4:dbcb]) (8.11.6/8.11.6-SPAMMERS-DeLiGHt) with ESMTP id h8OGXW402777 verified NO); Wed, 24 Sep 2003 18:33:34 +0200 (CEST) (envelope-from bounce@NOSPAM.dyndns.dk) Received: (from beer@localhost) by Mail.NOSPAM.DynDNS.dK (8.11.6/FNORD) id h8OGXWs02776; Wed, 24 Sep 2003 18:33:32 +0200 (CEST) (envelope-from bounce@NOSPAM.dyndns.dk) Date: Wed, 24 Sep 2003 18:33:32 +0200 (CEST) Message-Id: <200309241633.h8OGXWs02776@Mail.NOSPAM.DynDNS.dK> X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: beer set sender to bounce@NOSPAM.dyndns.dk using -f X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed from queue /tmp X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed by beer with -C /etc/mail/sendmail.cf-LOCAL From: Barry Bouwsma To: stable@freebsd.org References: <20021122173219.GA37688@nevermind.kiev.ua> <20021216073933.GB95712@vega.vega.com> cc: Maxim Sobolev Subject: Re: Soundcard (fm801) problems X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2003 16:34:14 -0000 [Remove hostname part of this IPv6-only address to reply via IPv4, or to eliminate the risk of a bounce, drop my address completely and I'll catch up from the list archives Real Soon Now] This is a really old message, but as far as I can see in recent 4.x code, the problem still remains -- in that the patch I wrote more than half a year ago is still needed to use my soundcard under recent 4.x. I still haven't caught up on the list archives, but grepping fm801 in all of 2003 stable turned up nothing, so perhaps this was the last word. Allow me to refresh your memory with a bit of context restored from top-posting: On Mon, 16 Dec 2002 09:39:33 +0200, Maxim Sobolev wrote: > > Date: Thu, 21 Nov 2002 23:14:29 +0100 > > From: Michael Riexinger > > Subject: Soundcard (fm801) problems > > > > I upgraded my STABLE from early October to yesterday's STABLE via > > cvsup. I compiled the kernel without modifying my configfile. The > > problem is now, that my Terratec 512i Soundcard (FM801 based) isn't > > recognized anymore. To verify that it isn't a hardware problem I > > downgraded (with cvsup) to 4.7-RELEASE-p2 and the card works again. Any > > suggestions? > > > Michael, > > I am really sorry that you have those problems - I suspect that they > are caused by the tuner-only fm801 card detection which I added > somewhere between 4.6.2-RELEASE and 4.7-RELEASE. Could you please > do the following to help me diagnose the problem: > > 1. cvsup back to RELENG_4 or RELENG_4_7; > 2. edit /sys/dev/sound/pci/fm801.c file, adding: > > printf("fm801 0x28 reg value is: %d\n", bus_space_read_1(st, sh, 0x28)); > > before "if (bus_space_read_1(st, sh, 0x28) == 0) {" line. > > After that, recompile your kernel, reinstall it and reboot as usually. > When the machine is up again, in the dmesg output look for the > line starting with "fm801 0x28 reg value is:" and send me number that > follows. I have the same soundcard, and I've had to add hacks to 4.7-upwards to get it to function under FreeBSD. At the ALSA website mentioned late in 2002 in a post to the multimedia mailing list, one can find four .doc or .pdf files concerning the FM801 sound chip. It seems that what is on the TerraTec card is a FM801-AU, which may be slightly different from the card described in the Linux.doc file on the site -- in particular, the 2/4/6-channel bits of one of the registers are not mentioned in Linux.doc, but are found in the PDF file. In my hack, I disabled the check you added -- well, to be precise, when it failed, I continued on anyway, and sound worked fine for me. The only problem (which is also a problem when using this card under NetBSD) is that in capturing audio, with my card I see a constant DC offset in the PCM data that is about +122 on a scale of -32768 to +32768. Apart from this, it seems to capture audio and play audio fine, other than noted below. My hack may have the info you asked for: [ dmesg output ] fm801 FOUND!!!!!1!!!11 fm801 NO SOUND?!?!?!?! Continuing anyway..... Bus_space_read is 128 pcm0: port 0xe000-0xe07f irq 9 at device 9.0 on pci0 [ snip ] pcm0: ac97 codec id 0x574d4c04 (Wolfson WM9704 (quad)) pcm0: ac97 codec features 18 bit DAC, 18 bit ADC, 6 bit master volume, Wolfson Microelectronics 3D Enhancement pcm0: ac97 primary codec extended features variable rate PCM, surround DAC, AMAP using shared irq9. pcm0: sndbuf_setmap 3db3000, 1000; 0xc15e9000 -> 3db3000 pcm0: sndbuf_setmap 3db5000, 1000; 0xc15eb000 -> 3db5000 pci0: (vendor=0x1319, dev=0x0802) at 9.1 [ ... ] @@ -735,6 +736,15 @@ * card (SF64-PCR) it was 0x80. */ if (bus_space_read_1(st, sh, 0x28) == 0) { +/* XXXX can also be 128 for TerraTec 512i card... */ + device_set_desc(dev, + "Forte Media FM801 Audio Controller"); + result = 0; + } +/* XXX */ else { + printf("fm801 NO SOUND?!?!?!?!\n"); + printf("Continuing anyway.....\n"); + printf("Bus_space_read is %d\n", bus_space_read_1(st, sh, 0x28) ); device_set_desc(dev, "Forte Media FM801 Audio Controller"); result = 0; If you want, I can see what data I can grab out of the other registers, if any of them might be different from the radio-only card on which you based your change, to restore sound function under 4.foo for this TerraTec card. As a side note, has anyone gotten the rear speaker output jacks to produce any sound? I've seen intriguing bits in the doc that supposedly allow one to copy 2ch to 4ch sound (seems to do nothing), as well as to set the output format to be 2ch (default), 4ch, or a pair of 6ch possibilities -- which only result in the normal output being doubled or trebled in playback speed/pitch, from the tests I've done. But I may well be missing something blindingly obvious, like playback levels or something. Thanks! And also, I don't have a S/PDIF-in device of any type to find out myself, so does the optical output of this card match the audio sent to the analog outputs? Thanks again! Barry Bouwsma