Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Sep 2003 18:33:32 +0200 (CEST)
From:      Barry Bouwsma <freebsd-misuser@remove-NOSPAM-to-reply.NOSPAM.dyndns.dk>
To:        stable@freebsd.org
Cc:        Maxim Sobolev <sobomax@freebsd.org>
Subject:   Re: Soundcard (fm801) problems
Message-ID:  <200309241633.h8OGXWs02776@Mail.NOSPAM.DynDNS.dK>
References:  <20021122173219.GA37688@nevermind.kiev.ua> <20021216073933.GB95712@vega.vega.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[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 <sobomax@freebsd.org> wrote:

> > Date: Thu, 21 Nov 2002 23:14:29 +0100
> > From: Michael Riexinger <mailinglists@grindking.de>
> > 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: <Forte Media FM801 Audio Controller> 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: <unknown card> (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



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