From owner-freebsd-multimedia@FreeBSD.ORG Sun Apr 20 07:28:51 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 569F737B401 for ; Sun, 20 Apr 2003 07:28:51 -0700 (PDT) Received: from gouda.acatysmoof.com (adsl-64-170-164-211.dsl.lsan03.pacbell.net [64.170.164.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8843143FB1 for ; Sun, 20 Apr 2003 07:28:48 -0700 (PDT) (envelope-from alex@acatysmoof.com) Received: from acatysmoof.com (localhost [127.0.0.1])h3KEm1VP061766; Sun, 20 Apr 2003 07:48:02 -0700 (PDT) (envelope-from alex@acatysmoof.com) From: "Alex Teslik" To: "Louis A. Mamakos" Date: Sun, 20 Apr 2003 06:48:01 -0800 Message-Id: <20030420143115.M90329@acatysmoof.com> In-Reply-To: <200304192149.h3JLnS1L000742@whizzo.transsys.com> References: <20030417172622.M63834@acatysmoof.com> <200304192149.h3JLnS1L000742@whizzo.transsys.com> X-Mailer: Open WebMail 1.90 20030218 X-OriginatingIP: 64.170.164.211 (alex) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 cc: list-freebsd-multimedia Subject: Compiliing gphoto2 cvs on FreeBSD. -- WAS: Re: gphoto2 with Canon Powershot S45? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2003 14:28:51 -0000 Hi Louie, I didn't give up and managed to get it working. I didn't have to make many hacks. However, what I did I'm sure is definitely a hack job. I'm no autoconf or Makefile guy for sure. So no flames please and Caveat Emptor... With that said, you can find step by step instructions on how to compile the latest gphoto2 cvs on FreeBSD 4-8-RELEASE on my website here: http://www.acatysmoof.com/posting/freebsd-stuff/gphoto2-cvs.html Mabye the developers can look at the steps I had to take and come up with fixes to help it compile "out of the box". Anyway, it works great now for me with my S45 (and I suspect would work great with any other camera currently supported)! HTH, Alex ---------- Original Message ----------- From: "Louis A. Mamakos" To: "Alex Teslik" Sent: Sat, 19 Apr 2003 17:49:28 -0400 Subject: Re: gphoto2 with Canon Powershot S45? > I gave up hacking on gphoto2, and went with a USB CF reader instead. Not > quite the answer you were hoping to hear, I suspect. > > louie ------- End of Original Message ------- From owner-freebsd-multimedia@FreeBSD.ORG Sun Apr 20 11:48:56 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB9F737B401 for ; Sun, 20 Apr 2003 11:48:56 -0700 (PDT) Received: from c0mailgw08.prontomail.com (c0mailgwalt.prontomail.com [207.183.238.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AE7143F3F for ; Sun, 20 Apr 2003 11:48:54 -0700 (PDT) (envelope-from DerekYoung@easy.com) Received: from c0web105 (c0mailgwalt.prontomail.com [207.183.238.110]) h3KIikF14623; Sun, 20 Apr 2003 11:44:46 -0700 X-Version: easygroup 6.3.3.2329.0 X-SenderIP: 172.132.52.37 X-SenderID: 24844284 From: "Derek Young" Message-Id: <41D37A65D8A9EA24687A8774ADFF84BE@DerekYoung.easy.com> Date: Sun, 20 Apr 2003 13:48:17 -0500 X-Priority: Normal Content-Type: text/plain; charset=iso-8859-1 To: cdillon@wolves.k12.mo.us X-Mailer: Web Based Pronto Mime-Version: 1.0 Content-Transfer-Encoding: 7bit cc: freebsd-multimedia@freebsd.org Subject: Re: Re: Re: Create Extigy X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2003 18:48:57 -0000 The FreeBSD uaudio module was made for NetBSD and I don't think has been maintained much since it was ported. However I am tracking STABLE so maybe current people have something that has been modified in over a year. The Extigy is not even picked up or noticed by the uaudio module. I also have a eDio brand sound device which uaudio picks up and apparently works for. Untill you send anything at all to dsp and you get a kernel panic... page not present blah blah blah. Heh. Derek This message was sent from the free private e-mail service by easy.com, the portal site owned by Stelios and the easyGroup. This email service is available to all members of the public to use for personal reasons only. Not all subscribers to this e-mail service are representatives of an easyGroup company. From owner-freebsd-multimedia@FreeBSD.ORG Sun Apr 20 14:56:07 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D105B37B40D; Sun, 20 Apr 2003 14:56:07 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E01243FD7; Sun, 20 Apr 2003 14:56:07 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.9/8.12.9) with ESMTP id h3KLu2ZW056590; Sun, 20 Apr 2003 14:56:02 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.9/8.12.9/Submit) id h3KLtwBF056585; Sun, 20 Apr 2003 14:55:58 -0700 (PDT) Date: Sun, 20 Apr 2003 14:55:57 -0700 From: "David O'Brien" To: Orion Hodson Message-ID: <20030420215557.GD55790@dragon.nuxi.com> References: <200302212221.h1LMLg8J099151@puma.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302212221.h1LMLg8J099151@puma.icir.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: multimedia@FreeBSD.org cc: Dag-Erling Smorgrav Subject: Re: looking for developer for Terratec EWS88MT multitrack card and ALSA q: X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2003 21:56:08 -0000 On Fri, Feb 21, 2003 at 02:21:42PM -0800, Orion Hodson wrote: > The project has had two drivers submitted for Audigy support in the > past couple of weeks. I've been holding off looking at them as cg's > really the man for the job. However, as I've found out today cg's > been ill of late and has plenty of things going on externally at > present. So how do we move forward? > Submission #1: > http://chibis.persons.gfk.ru/audigy I've tested this one, as at first I thought it was the more complete and commit ready. I can play mp3's thru my Audigy[1] with this one. I've done a lot of work to turn it into a committable patch. It does more to head in the [right?] direction of separating PCM and MIDI. > Submission #2: > http://www.freebsd.org/cgi/getmsg.cgi?fetch=664373+686499+/usr/local/www/db/text/2003/freebsd-hackers/20030216.freebsd-hackers+raw Upon a second look, this patch is much smaller and appears that it might even offer support that #1 doesn't have above, but does not change the driver's architecture. I am willing to remove the gratuitous changes in this patch and test it. There is a 3rd patch at http://chibis.persons.gfk.ru/audigy/audigy_pack.tgz. However this person took it upon himself to totally reformat our emu10k1.c file in addition to embellishing it. It will take a lot of grunt work to figure out what the actual changes are. I quick look at it seems it might be between between #1 and #2 above (though closer to #2). I am very much not a sound guy, I just happen to be a committer with an Audigy he'd like to be useful. I'd really like some consensus on how to move forward with this. -- -- David (obrien@FreeBSD.org) From owner-freebsd-multimedia@FreeBSD.ORG Sun Apr 20 17:17:15 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2710B37B401; Sun, 20 Apr 2003 17:17:15 -0700 (PDT) Received: from puma.icir.org (puma.icir.org [192.150.187.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 82A7343F75; Sun, 20 Apr 2003 17:17:14 -0700 (PDT) (envelope-from hodson@puma.icir.org) Received: from puma.icir.org (localhost [127.0.0.1]) by puma.icir.org (8.12.8p1/8.12.3) with ESMTP id h3L0HCnR040596; Sun, 20 Apr 2003 17:17:12 -0700 (PDT) (envelope-from hodson@puma.icir.org) Message-Id: <200304210017.h3L0HCnR040596@puma.icir.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.3 To: "David O'Brien" From: Orion Hodson In-Reply-To: Your message of "Sun, 20 Apr 2003 14:55:57 PDT." <20030420215557.GD55790@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 20 Apr 2003 17:17:12 -0700 Sender: hodson@icir.org cc: sound@FreeBSD.org cc: multimedia@FreeBSD.org cc: Orlando Bassotto cc: Dag-Erling Smorgrav Subject: Audigy [ was Re: ... Terratec EWS88MT ... ] X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 00:17:15 -0000 /-- "David O'Brien" wrote: | On Fri, Feb 21, 2003 at 02:21:42PM -0800, Orion Hodson wrote: | > The project has had two drivers submitted for Audigy support in the | > past couple of weeks. I've been holding off looking at them as cg's | > really the man for the job. However, as I've found out today cg's | > been ill of late and has plenty of things going on externally at | > present. | | So how do we move forward? Orlando Bassotto, one of the Audigy code submitters, has taken on the task of combining the contributions. The latest patch is available at: http://mad.ieo-research.it/freebsd/drivers/emu10k1/ If you have the h/w, I'm sure he'd appreciate testers and feedback. This h/w really requires some architectural enhancements in the sound driver framework to support audio stream routing and the mixer. We don't have those yet, but cg is working on designs for newpcm2 that should address this (it's pretty hard with the OSS mixer interface). It would be good to have at least basic pcm support for the audigy in the tree for the upcoming 5.1 fork (assuming it's not too high risk). - Orion From owner-freebsd-multimedia@FreeBSD.ORG Sun Apr 20 17:48:00 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49E5D37B401; Sun, 20 Apr 2003 17:48:00 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id F251E43FA3; Sun, 20 Apr 2003 17:46:22 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.9/8.12.9) with ESMTP id h3L0k6ZW067898; Sun, 20 Apr 2003 17:46:10 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.9/8.12.9/Submit) id h3L0k0f5067897; Sun, 20 Apr 2003 17:46:00 -0700 (PDT) Date: Sun, 20 Apr 2003 17:45:59 -0700 From: "David O'Brien" To: Orion Hodson Message-ID: <20030421004559.GA67656@dragon.nuxi.com> References: <20030420215557.GD55790@dragon.nuxi.com> <200304210017.h3L0HCnR040596@puma.icir.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: <200304210017.h3L0HCnR040596@puma.icir.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: sound@FreeBSD.org cc: multimedia@FreeBSD.org cc: Orlando Bassotto cc: Dag-Erling Smorgrav Subject: Re: Audigy [ was Re: ... Terratec EWS88MT ... ] X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@NUXI.com List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 00:48:00 -0000 --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Apr 20, 2003 at 05:17:12PM -0700, Orion Hodson wrote: > /-- "David O'Brien" wrote: > | On Fri, Feb 21, 2003 at 02:21:42PM -0800, Orion Hodson wrote: > | > The project has had two drivers submitted for Audigy support in the > | > past couple of weeks. I've been holding off looking at them as cg's > | > really the man for the job. However, as I've found out today cg's > | > been ill of late and has plenty of things going on externally at > | > present. > | > | So how do we move forward? > > Orlando Bassotto, one of the Audigy code submitters, has taken on the task of > combining the contributions. The latest patch is available at: > > http://mad.ieo-research.it/freebsd/drivers/emu10k1/ I don't want to seem ungrateful for this work, but the problem is, it currently isn't committable. This work is based off of emu10k1.c rev 1.28 from 2002/11/26. Also the diffs should be as minimal as possible. Things like this shouldn't be in the diff: -#define EMU10K1_PCI_ID 0x00021102 -#define EMU10K2_PCI_ID 0x00041102 +#define EMU10K1_PCI_ID 0x00021102 +#define EMU10K2_PCI_ID 0x00041102 emu_rdptr(struct sc_info *sc, int chn, int reg) { - u_int32_t ptr, val, mask, size, offset; + u_int32_t ptr, val, mask, size, offset; These changes are gratiutious. Also emu10k1tone.h is undocumented where it comes from. Until cg has a chance to be active in emu10k1 development again, I'd perfer to see something that doesn't abstract out bits from emu10k1.c into new headers as it makes the diffs larger, and harder to review by those less knowledgeable as cg. At least I'm willing to shepard this work into the CVS repo in such a form. I hope the goal is to get this work committed into the FreeBSD CVS repository. Attached is emu10k-01-March-2003-cvs.tar.bz2 in a reviewable and committable fashion. -- David --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="audigy1.diff" Index: sys/dev/sound/pci/emu10k1.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pci/emu10k1.c,v retrieving revision 1.36 diff -u -r1.36 emu10k1.c --- sys/dev/sound/pci/emu10k1.c 20 Apr 2003 08:37:29 -0000 1.36 +++ sys/dev/sound/pci/emu10k1.c 20 Apr 2003 09:05:38 -0000 @@ -27,14 +27,26 @@ #include #include #include +#include #include #include #include +#include +#include "mixer_if.h" SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.36 2003/04/20 08:37:29 obrien Exp $"); -/* -------------------------------------------------------------------- */ +#define EMUPAGESIZE 4096 /* don't change */ +#define MAXREQVOICES 8 +#define MAXPAGES (32768 * 64 / EMUPAGESIZE) /* WAVEOUT_MAXBUFSIZE * NUM_G / EMUPAGESIZE */ +#define RESERVED 0 +#define NUM_MIDI 16 +#define NUM_G 64 /* use all channels */ +#define NUM_FXSENDS 4 + +#define TMEMSIZE 256*1024 +#define TMEMSIZEREG 4 #define EMU10K1_PCI_ID 0x00021102 #define EMU10K2_PCI_ID 0x00041102 @@ -42,6 +54,11 @@ #define EMU_CHANS 4 #undef EMUDEBUG +#define ENABLE 0xffffffff +#define DISABLE 0x00000000 +#define ENV_ON 0x80 +#define ENV_OFF 0x00 + struct emu_memblk { SLIST_ENTRY(emu_memblk) link; void *buf; @@ -87,11 +104,23 @@ struct sc_info *parent; }; +struct sc_waveio { + u_int32_t send_routing[1]; + u_int32_t send_routing2[1]; + u_int32_t send_dcba[3]; + u_int32_t send_hgfe[3]; +}; + +#define ROUTE_PCM0 0 +#define SEND_MONO 0 +#define SEND_LEFT 1 +#define SEND_RIGHT 2 + /* device private data */ struct sc_info { device_t dev; u_int32_t type, rev; - u_int32_t tos_link:1, APS:1; + u_int32_t tos_link:1, APS:1, is_audigy:1; bus_space_tag_t st; bus_space_handle_t sh; @@ -101,6 +130,20 @@ void *ih; struct mtx *lock; + struct ac97_info *codec; + + struct sc_waveio waveio; + unsigned int mchannel_fx; + unsigned int dsp_zero; + unsigned int code_base; + unsigned int code_size; + unsigned int gpr_base; + unsigned int num_gprs; + unsigned int input_base; + unsigned int output_base; + unsigned int opcode_shift; + unsigned int high_operand_shift; + unsigned int bufsz; int timer, timerinterval; int pnum, rnum; @@ -132,7 +175,9 @@ static void emu_wr(struct sc_info *, int, u_int32_t, int); /* -------------------------------------------------------------------- */ +static struct sc_info *ctl_sc_info; +/* Recording formats supported: */ static u_int32_t emu_rfmt_ac97[] = { AFMT_S16_LE, AFMT_STEREO | AFMT_S16_LE, @@ -149,12 +194,14 @@ 0 }; +/* Recording capabilites */ static struct pcmchan_caps emu_reccaps[3] = { {8000, 48000, emu_rfmt_ac97, 0}, {8000, 8000, emu_rfmt_mic, 0}, {48000, 48000, emu_rfmt_efx, 0}, }; +/* Playback formats */ static u_int32_t emu_pfmt[] = { AFMT_U8, AFMT_STEREO | AFMT_U8, @@ -163,10 +210,28 @@ 0 }; +/* Playback capabilites */ static struct pcmchan_caps emu_playcaps = {4000, 48000, emu_pfmt, 0}; static int adcspeed[8] = {48000, 44100, 32000, 24000, 22050, 16000, 11025, 8000}; +/* Mixer */ + +#define MIXER_FX 1 +#define MIXER_AC97 2 + +#define MIXER_PLAYBACKOUNLY 0 +#define MIXER_CANRECORD 0 + +struct emu10k1mixer_entry { + unsigned mixer_source:2; + unsigned is_recording:1; +}; + +static const struct emu10k1mixer_entry emu10k1mixer[SOUND_MIXER_NRDEVICES] = { + [SOUND_MIXER_VOLUME] = {MIXER_FX, MIXER_PLAYBACKOUNLY} +}; + /* -------------------------------------------------------------------- */ /* Hardware */ static u_int32_t @@ -239,10 +304,11 @@ static void emu_wrefx(struct sc_info *sc, unsigned int pc, unsigned int data) { - emu_wrptr(sc, 0, MICROCODEBASE + pc, data); + emu_wrptr(sc, 0, sc->code_base + pc, data); } /* -------------------------------------------------------------------- */ +static void emumix_set_fxvol(struct sc_info *sc, unsigned gpr, int32_t vol); /* ac97 codec */ /* no locking needed */ @@ -259,7 +325,92 @@ emu_wrcd(kobj_t obj, void *devinfo, int regno, u_int32_t data) { struct sc_info *sc = (struct sc_info *)devinfo; + u_int32_t left, right; + + if (sc->is_audigy){ + /* + * hack to always get AC97 sound on Audigy + * should be converted to some kind of AC97 chip emulation + * and present EMU10K2 chip capabilites throuth + * AC97 "extended capabilites" register + */ + switch (regno) { + case 0x02: /* MAIN OUT */ + /* + * MAIN OUT volume on AC97 is alwayz zero + * because AC97 is not connected to outs + * use emumix_setfxvol to set MAIN OUT volume + */ + left = (data & 0x3f00) >> 8; + right = data & 0x003f; + if (data & 0x8000) + left = right = 0x1f; /* mute */ + if (left == 0 && right==0x3f) + break; + left = 100 - left * 100 / (0x1f); /* 4 bit */ + right = 100 - right * 100 / (0x1f); + /* 0x12/0x13 are MAIN volume, controlled by vol */ + emumix_set_fxvol(sc, 0x12, left); + emumix_set_fxvol(sc, 0x13, right); + break; + case 0x18: /* PCM OUT VOL */ + /* + * PCM volume on AC97 should stay muted, + * use emumix_setfxvol to set PCM volume from FX0 + * If PCM volume is muted, then front PCM output is done + * by better 6-ch Philips chip + */ + left = (data & 0x3f00)>>8; + right = data & 0x003f; + if (data & 0x8000) + left=right=0x1f; /* mute */ + if (left == 0 && right==0x3f) + break; + left = 100 - left * 100 / (0x1f); /* 4 bit */ + right = 100 - right * 100 / (0x1f); + /* 0x10/0x11 are PCM controls */ + emumix_set_fxvol(sc, 0x10, left); + emumix_set_fxvol(sc, 0x11, right); + /* */ + data = 0x8000; + break; + case 0x1a: + /* + * PCM recording source is set to "stereo mix" + * (labeled "vol" in mixer) + */ + data = 0x0505; + break; + case 0x1c: /* RECORD GAIN */ + /* + * Record gain on AC97 should stay zero to get AC97 sound + * on AC97_[RL] connectors on EMU10K2 chip + * AC97 on Audigy is not directly connected to any output, + * only to EMU10K2 chip + * Use this control to set AC97 mix volume inside EMU10K2 + * chip + */ + left = (data & 0x3f00)>>8; + right = data & 0x003f; + /* + * rec control is recrding VOLUME, not attenuation + * and 0 IS 0% and 15 IS 100% + */ + if (data & 0x8000) + left = right = 0; /* mute */ + if (left == 0 && right==0x3f) + break; + left = left * 100 / 15; /* 4 bit */ + right = right * 100 / 15; + /* 0x14/0x15 are AC97 controls */ + emumix_set_fxvol(sc, 0x14, left); + emumix_set_fxvol(sc, 0x15, right); + /* */ + data = 0x0000; + break; + }; + }; emu_wr(sc, AC97ADDRESS, regno, 1); emu_wr(sc, AC97DATA, data, 2); return 0; @@ -272,6 +423,80 @@ }; AC97_DECLARE(emu_ac97); +/* Mix */ +/* ------------------------------------------------------------------------- */ + +static int +emumix_init(struct snd_mixer *m) +{ + u_int32_t i, v; + + for (i = v = 0; i < SOUND_MIXER_NRDEVICES; i++) { + if (emu10k1mixer[i].mixer_source) v |= 1 << i; + } + mix_setdevs(m, v); + + for (i = v = 0; i < SOUND_MIXER_NRDEVICES; i++) { + if (emu10k1mixer[i].is_recording) v |= 1 << i; + } + mix_setrecdevs(m, v); + return 0; +} + +static void +emumix_set_fxvol(struct sc_info *sc, unsigned gpr, int32_t vol) +{ + static const int scale = 16; + static const int32_t log2lin[4] = { /* attenuation (dB) */ + 0x7fffffff, /* 0.0 */ + 0x7fffffff * 0.840896415253715, /* 1.5 */ + 0x7fffffff * 0.707106781186548, /* 3.0 */ + 0x7fffffff * 0.594603557501361, /* 4.5 */ + }; + + vol = (100 - vol) * scale / 100; + vol = (vol >= scale) ? 0 : (log2lin[vol & 3] >> (vol >> 2)); + emu_wrptr(sc, 0, sc->gpr_base + gpr, vol); + + return; +} + +static int +emumix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) +{ +#if 0 + struct sc_info *sc = mix_getdevinfo(m); + + if (emu10k1mixer[dev].is_stereo) { + emumix_set_fxvol(sc, sc->gpr_base + emu10k1mixer[dev].gpr, left); + emumix_set_fxvol(sc, sc->gpr_base + emu10k1mixer[dev].gpr+1, right); + } else { + mono = (left>>1) + (right>>1); + emumix_set_fxvol(sc, sc->gpr_base + emu10k1mixer[dev].gpr, mono); + }; +#endif + return 0; +} + +static int +emumix_setrecsrc(struct snd_mixer *m, u_int32_t src) +{ +#if 0 + struct sc_info *sc = mix_getdevinfo(m); +#endif + + return src; +} + +static kobj_method_t emu_mix_methods[] = { + KOBJMETHOD(mixer_init, emumix_init), + KOBJMETHOD(mixer_set, emumix_set), + KOBJMETHOD(mixer_setrecsrc, emumix_setrecsrc), + { 0, 0 } +}; +MIXER_DECLARE(emu_mix); + + /* -------------------------------------------------------------------- */ /* stuff */ static int @@ -487,7 +712,8 @@ emu_vwrite(struct sc_info *sc, struct emu_voice *v) { int s; - int l, r, x, y; + int i; + unsigned int routing[8],amounts[8]; u_int32_t sa, ea, start, val, silent_page; s = (v->stereo ? 1 : 0) + (v->b16 ? 1 : 0); @@ -495,22 +721,44 @@ sa = v->start >> s; ea = v->end >> s; - l = r = x = y = v->vol; + for (i = 0; i < 8; i++) { + routing[i]=i; + amounts[i]=0xff; + }; if (v->stereo) { - l = v->ismaster ? l : 0; - r = v->ismaster ? 0 : r; + if (v->ismaster) { + amounts[0] = amounts[2] = amounts[4] = amounts[6] = 0; + } else { + amounts[1] = amounts[3] = amounts[5] = amounts[7] = 0; + }; + emu_wrptr(sc, v->vnum, CPF, CPF_STEREO_MASK); + } else { + emu_wrptr(sc, v->vnum, CPF, 0); } - emu_wrptr(sc, v->vnum, CPF, v->stereo ? CPF_STEREO_MASK : 0); val = v->stereo ? 28 : 30; val *= v->b16 ? 1 : 2; start = sa + val; - emu_wrptr(sc, v->vnum, FXRT, 0xd01c0000); + if (sc->is_audigy) { + emu_wrptr(sc, v->vnum, A_FXRT1, + routing[3] << 24 | routing[2] << 16 | routing[1] << 8 + | routing[0] << 0); + emu_wrptr(sc, v->vnum, A_FXRT2, + routing[7] << 24 | routing[6] << 16 | routing[5] << 8 + | routing[4] << 0); + emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, + amounts[7] << 24 | amounts[6] << 26 | amounts[5] << 8 + | amounts[4] << 0); + } else { + emu_wrptr(sc, v->vnum, FXRT, + (routing[3] << 12 | routing[2] << 8 | routing[1] << 4 + | routing[0] << 0) << 16); /*0xd01c0000*/ + } - emu_wrptr(sc, v->vnum, PTRX, (x << 8) | r); - emu_wrptr(sc, v->vnum, DSL, ea | (y << 24)); - emu_wrptr(sc, v->vnum, PSST, sa | (l << 24)); + emu_wrptr(sc, v->vnum, PTRX, amounts[3] << 8 | amounts[2] << 0); + emu_wrptr(sc, v->vnum, DSL, ea | amounts[1] << 24); + emu_wrptr(sc, v->vnum, PSST, sa | amounts[0] << 24); emu_wrptr(sc, v->vnum, CCCA, start | (v->b16 ? 0 : CCCA_8BITSELECT)); emu_wrptr(sc, v->vnum, Z1, 0); @@ -599,12 +847,13 @@ static void emu_vdump(struct sc_info *sc, struct emu_voice *v) { - char *regname[] = { "cpf", "ptrx", "cvcf", "vtft", "z2", "z1", "psst", "dsl", - "ccca", "ccr", "clp", "fxrt", "mapa", "mapb", NULL, NULL, - "envvol", "atkhldv", "dcysusv", "lfoval1", - "envval", "atkhldm", "dcysusm", "lfoval2", - "ip", "ifatn", "pefe", "fmmod", "tremfrq", "fmfrq2", - "tempenv" }; + char *regname[] = { + "cpf", "ptrx", "cvcf", "vtft", "z2", "z1", "psst", "dsl", + "ccca", "ccr", "clp", "fxrt", "mapa", "mapb", NULL, NULL, + "envvol", "atkhldv", "dcysusv", "lfoval1", + "envval", "atkhldm", "dcysusm", "lfoval2", + "ip", "ifatn", "pefe", "fmmod", "tremfrq", "fmfrq2", "tempenv" + }; int i, x; printf("voice number %d\n", v->vnum); @@ -621,7 +870,7 @@ } #endif -/* channel interface */ +/* playback channel interface */ static void * emupchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) { @@ -757,7 +1006,7 @@ }; CHANNEL_DECLARE(emupchan); -/* channel interface */ +/* recording channel interface */ static void * emurchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) { @@ -775,7 +1024,7 @@ ch->num = sc->rnum; switch(sc->rnum) { case 0: - ch->idxreg = ADCIDX; + ch->idxreg = sc->is_audigy ? A_ADCIDX : ADCIDX; ch->basereg = ADCBA; ch->sizereg = ADCBS; ch->setupreg = ADCCR; @@ -889,9 +1138,11 @@ ch->run = 1; emu_wrptr(sc, 0, ch->sizereg, sz); if (ch->num == 0) { - val = ADCCR_LCHANENABLE; + val = sc->is_audigy ? A_ADCCR_LCHANENABLE + : ADCCR_LCHANENABLE; if (ch->fmt & AFMT_STEREO) - val |= ADCCR_RCHANENABLE; + val |= sc->is_audigy ? A_ADCCR_RCHANENABLE + : ADCCR_RCHANENABLE; val |= emu_recval(ch->spd); emu_wrptr(sc, 0, ch->setupreg, 0); emu_wrptr(sc, 0, ch->setupreg, val); @@ -1147,8 +1398,8 @@ static void emu_addefxop(struct sc_info *sc, int op, int z, int w, int x, int y, u_int32_t *pc) { - emu_wrefx(sc, (*pc) * 2, (x << 10) | y); - emu_wrefx(sc, (*pc) * 2 + 1, (op << 20) | (z << 10) | w); + emu_wrefx(sc, (*pc) * 2, (x << sc->high_operand_shift) | y); + emu_wrefx(sc, (*pc) * 2 + 1, (op << sc->opcode_shift) | (z << sc->high_operand_shift) | w); (*pc)++; } @@ -1156,84 +1407,220 @@ emu_initefx(struct sc_info *sc) { int i; - u_int32_t pc = 16; + u_int32_t pc = 0; + +/* code size is in bytes... we write 4-byte (2-word) instructions */ + for (i = 0; i < ((sc->code_size)>>2); i++) { + if (sc->is_audigy) { + emu_addefxop(sc, ACC3, DSP_CONST(0x0), DSP_CONST(0x0), + DSP_CONST(0x0), DSP_CONST(0x0), &pc); + } else { + emu_addefxop(sc, ACC3, DSP_CONST(0x0), DSP_CONST(0x0), + DSP_CONST(0x0), DSP_CONST(0x0), &pc); + } + }; + + pc = 0; + + for (i = 0; i < sc->num_gprs; i++) + emu_wrptr(sc, 0, sc->gpr_base + i, 0); - for (i = 0; i < 512; i++) { - emu_wrefx(sc, i * 2, 0x10040); - emu_wrefx(sc, i * 2 + 1, 0x610040); - } - - for (i = 0; i < 256; i++) - emu_wrptr(sc, 0, FXGPREGBASE + i, 0); - - /* FX-8010 DSP Registers: - FX Bus - 0x000-0x00f : 16 registers - Input - 0x010/0x011 : AC97 Codec (l/r) - 0x012/0x013 : ADC, S/PDIF (l/r) - 0x014/0x015 : Mic(left), Zoom (l/r) - 0x016/0x017 : APS S/PDIF?? (l/r) - Output - 0x020/0x021 : AC97 Output (l/r) - 0x022/0x023 : TOS link out (l/r) - 0x024/0x025 : ??? (l/r) - 0x026/0x027 : LiveDrive Headphone (l/r) - 0x028/0x029 : Rear Channel (l/r) - 0x02a/0x02b : ADC Recording Buffer (l/r) - Constants - 0x040 - 0x044 = 0 - 4 - 0x045 = 0x8, 0x046 = 0x10, 0x047 = 0x20 - 0x048 = 0x100, 0x049 = 0x10000, 0x04a = 0x80000 - 0x04b = 0x10000000, 0x04c = 0x20000000, 0x04d = 0x40000000 - 0x04e = 0x80000000, 0x04f = 0x7fffffff - Temporary Values - 0x056 : Accumulator - 0x058 : Noise source? - 0x059 : Noise source? - General Purpose Registers - 0x100 - 0x1ff - Tank Memory Data Registers - 0x200 - 0x2ff - Tank Memory Address Registers - 0x300 - 0x3ff - */ - - /* Operators: - 0 : z := w + (x * y >> 31) - 4 : z := w + x * y - 6 : z := w + x + y - */ - - /* Routing - this will be configurable in later version */ - - /* GPR[0/1] = FX * 4 + SPDIF-in */ - emu_addefxop(sc, 4, 0x100, 0x12, 0, 0x44, &pc); - emu_addefxop(sc, 4, 0x101, 0x13, 1, 0x44, &pc); - /* GPR[0/1] += APS-input */ - emu_addefxop(sc, 6, 0x100, 0x100, 0x40, sc->APS ? 0x16 : 0x40, &pc); - emu_addefxop(sc, 6, 0x101, 0x101, 0x40, sc->APS ? 0x17 : 0x40, &pc); - /* FrontOut (AC97) = GPR[0/1] */ - emu_addefxop(sc, 6, 0x20, 0x40, 0x40, 0x100, &pc); - emu_addefxop(sc, 6, 0x21, 0x40, 0x41, 0x101, &pc); - /* RearOut = (GPR[0/1] * RearVolume) >> 31 */ - /* RearVolume = GRP[0x10/0x11] */ - emu_addefxop(sc, 0, 0x28, 0x40, 0x110, 0x100, &pc); - emu_addefxop(sc, 0, 0x29, 0x40, 0x111, 0x101, &pc); - /* TOS out = GPR[0/1] */ - emu_addefxop(sc, 6, 0x22, 0x40, 0x40, 0x100, &pc); - emu_addefxop(sc, 6, 0x23, 0x40, 0x40, 0x101, &pc); - /* Mute Out2 */ - emu_addefxop(sc, 6, 0x24, 0x40, 0x40, 0x40, &pc); - emu_addefxop(sc, 6, 0x25, 0x40, 0x40, 0x40, &pc); - /* Mute Out3 */ - emu_addefxop(sc, 6, 0x26, 0x40, 0x40, 0x40, &pc); - emu_addefxop(sc, 6, 0x27, 0x40, 0x40, 0x40, &pc); - /* Input0 (AC97) -> Record */ - emu_addefxop(sc, 6, 0x2a, 0x40, 0x40, 0x10, &pc); - emu_addefxop(sc, 6, 0x2b, 0x40, 0x40, 0x11, &pc); - emu_wrptr(sc, 0, DBG, 0); + if (sc->is_audigy) { + /* GPRs: + 0x00...0x0f - inputs + 0x10...0x1f - volumes + 0x20...0x2f - outs + */ + + emu_wrptr(sc, 0, sc->gpr_base + 0x10, 0x7fffffff); /* PCM */ + emu_wrptr(sc, 0, sc->gpr_base + 0x11, 0x7fffffff); + emu_wrptr(sc, 0, sc->gpr_base + 0x12, 0x7fffffff); /* VOL */ + emu_wrptr(sc, 0, sc->gpr_base + 0x13, 0x7fffffff); + emu_wrptr(sc, 0, sc->gpr_base + 0x14, 0x7fffffff); /* AC97 ("rec" label) */ + emu_wrptr(sc, 0, sc->gpr_base + 0x15, 0x7fffffff); + + /* Routing and volume - this should be configurable in later version */ + + /* GPR[0/1] = FX * controlled by PCM control */ + emu_addefxop(sc, MACS, GPR(0x0), DSP_CONST(0x0), PCM0_L, + GPR(0x10), &pc); + emu_addefxop(sc, MACS, GPR(0x1), DSP_CONST(0x0), PCM0_R, + GPR(0x11), &pc); + /* GPR[2/3] = AC97 * conrolled by AC97 "rec" control */ + emu_addefxop(sc, MACS, GPR(0x2), DSP_CONST(0x0), IN_AC97_L, + GPR(0x14), &pc); + emu_addefxop(sc, MACS, GPR(0x3), DSP_CONST(0x0), IN_AC97_R, + GPR(0x15), &pc); + + /* Main Vol * controlled by VOL control */ + emu_addefxop(sc, ACC3, GPR(0x22), DSP_CONST(0x0), GPR(0x0), + GPR(0x2), &pc); + emu_addefxop(sc, ACC3, GPR(0x23), DSP_CONST(0x0), GPR(0x1), + GPR(0x3), &pc); + emu_addefxop(sc, MACS, GPR(0x20), DSP_CONST(0x0), GPR(0x22), + GPR(0x12), &pc); + emu_addefxop(sc, MACS, GPR(0x21), DSP_CONST(0x0), GPR(0x23), + GPR(0x13), &pc); + + /* FrontOut (AC97) = GPR[10/11] */ + + emu_addefxop(sc, ACC3, OUTP(0x0), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x1), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* TOS out = GPR[0/1] */ + emu_addefxop(sc, ACC3, OUTP(0x2), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x3), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* */ + + emu_addefxop(sc, ACC3, OUTP(0x4), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x5), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* Mute Out3 */ + emu_addefxop(sc, ACC3, OUTP(0x6), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x7), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* RearVolume = GRP[0x10/0x11] */ + emu_addefxop(sc, ACC3, OUTP(0x8), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x9), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* Center / Sub */ + emu_addefxop(sc, ACC3, GPR(0x2A), DSP_CONST(0x0), GPR(0x0), + GPR(0x1), &pc); + emu_addefxop(sc, ACC3, OUTP(0xA), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x2A), &pc); + emu_addefxop(sc, ACC3, OUTP(0xB), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* */ + emu_addefxop(sc, ACC3, OUTP(0xC), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0xD), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* */ + emu_addefxop(sc, ACC3, OUTP(0xE), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0xF), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* */ + emu_addefxop(sc, ACC3, OUTP(0x10), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x11), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* AC97 Rec ? */ + emu_addefxop(sc, ACC3, OUTP(0x12), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x13), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* */ + emu_addefxop(sc, ACC3, OUTP(0x14), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x15), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* ??? */ + emu_addefxop(sc, ACC3, OUTP(0x16), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x17), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* */ + emu_addefxop(sc, ACC3, OUTP(0x18), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x19), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* */ + emu_addefxop(sc, ACC3, OUTP(0x1A), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x1B), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* */ + emu_addefxop(sc, ACC3, OUTP(0x1C), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x1D), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + /* */ + emu_addefxop(sc, ACC3, OUTP(0x1E), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x20), &pc); + emu_addefxop(sc, ACC3, OUTP(0x1F), DSP_CONST(0x0), + DSP_CONST(0x0), GPR(0x21), &pc); + + emu_wrptr(sc,0,A_DBG,0); + } else { + /* FX-8010 DSP Registers: + FX Bus + 0x000-0x00f : 16 registers + Input + 0x010/0x011 : AC97 Codec (l/r) + 0x012/0x013 : ADC, S/PDIF (l/r) + 0x014/0x015 : Mic(left), Zoom (l/r) + 0x016/0x017 : APS S/PDIF?? (l/r) + Output + 0x020/0x021 : AC97 Output (l/r) + 0x022/0x023 : TOS link out (l/r) + 0x024/0x025 : ??? (l/r) + 0x026/0x027 : LiveDrive Headphone (l/r) + 0x028/0x029 : Rear Channel (l/r) + 0x02a/0x02b : ADC Recording Buffer (l/r) + Constants + 0x040 - 0x044 = 0 - 4 + 0x045 = 0x8, 0x046 = 0x10, 0x047 = 0x20 + 0x048 = 0x100, 0x049 = 0x10000, 0x04a = 0x80000 + 0x04b = 0x10000000, 0x04c = 0x20000000, 0x04d = 0x40000000 + 0x04e = 0x80000000, 0x04f = 0x7fffffff + Temporary Values + 0x056 : Accumulator + 0x058 : Noise source? + 0x059 : Noise source? + General Purpose Registers + 0x100 - 0x1ff + Tank Memory Data Registers + 0x200 - 0x2ff + Tank Memory Address Registers + 0x300 - 0x3ff + */ + + /* Operators: + 0 : z := w + (x * y >> 31) + 4 : z := w + x * y + 6 : z := w + x + y + */ + + /* Routing - this will be configurable in later version */ + + /* GPR[0/1] = FX * 4 + SPDIF-in */ + emu_addefxop(sc, 4, 0x100, 0x12, 0, 0x44, &pc); + emu_addefxop(sc, 4, 0x101, 0x13, 1, 0x44, &pc); + /* GPR[0/1] += APS-input */ + emu_addefxop(sc, 6, 0x100, 0x100, 0x40, sc->APS ? 0x16 : 0x40, + &pc); + emu_addefxop(sc, 6, 0x101, 0x101, 0x40, sc->APS ? 0x17 : 0x40, + &pc); + /* FrontOut (AC97) = GPR[0/1] */ + emu_addefxop(sc, 6, 0x20, 0x40, 0x40, 0x100, &pc); + emu_addefxop(sc, 6, 0x21, 0x40, 0x41, 0x101, &pc); + /* RearOut = (GPR[0/1] * RearVolume) >> 31 */ + /* RearVolume = GRP[0x10/0x11] */ + emu_addefxop(sc, 0, 0x28, 0x40, 0x110, 0x100, &pc); + emu_addefxop(sc, 0, 0x29, 0x40, 0x111, 0x101, &pc); + /* TOS out = GPR[0/1] */ + emu_addefxop(sc, 6, 0x22, 0x40, 0x40, 0x100, &pc); + emu_addefxop(sc, 6, 0x23, 0x40, 0x40, 0x101, &pc); + /* Mute Out2 */ + emu_addefxop(sc, 6, 0x24, 0x40, 0x40, 0x40, &pc); + emu_addefxop(sc, 6, 0x25, 0x40, 0x40, 0x40, &pc); + /* Mute Out3 */ + emu_addefxop(sc, 6, 0x26, 0x40, 0x40, 0x40, &pc); + emu_addefxop(sc, 6, 0x27, 0x40, 0x40, 0x40, &pc); + /* Input0 (AC97) -> Record */ + emu_addefxop(sc, 6, 0x2a, 0x40, 0x40, 0x10, &pc); + emu_addefxop(sc, 6, 0x2b, 0x40, 0x40, 0x11, &pc); + + emu_wrptr(sc, 0, DBG, 0); + } } /* Probe and attach the card */ @@ -1260,6 +1647,13 @@ emu_wrptr(sc, 0, SOLEL, 0); emu_wrptr(sc, 0, SOLEH, 0); + /* init phys inputs and outputs */ + if (sc->is_audigy) { + emu_wrptr(sc, 0, SPBYPASS, 0x00); + emu_wrptr(sc, 0, AC97SLOT, + 0x40 | AC97SLOT_CNTR | AC97SLOT_LFE | 0x02 | 0x01); + }; + /* init envelope engine */ for (ch = 0; ch < NUM_G; ch++) { emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); @@ -1267,7 +1661,6 @@ emu_wrptr(sc, ch, VTFT, 0xffff); emu_wrptr(sc, ch, CVCF, 0xffff); emu_wrptr(sc, ch, PTRX, 0); - emu_wrptr(sc, ch, CPF, 0); emu_wrptr(sc, ch, CCR, 0); emu_wrptr(sc, ch, PSST, 0); @@ -1292,6 +1685,17 @@ emu_wrptr(sc, ch, ATKHLDV, 0); emu_wrptr(sc, ch, ENVVOL, 0); emu_wrptr(sc, ch, ENVVAL, 0); + emu_wrptr(sc, ch, CPF, 0); + + if (sc->is_audigy) { + emu_wrptr(sc, ch, 0x4c, 0x0); + emu_wrptr(sc, ch, 0x4d, 0x0); + emu_wrptr(sc, ch, 0x4e, 0x0); + emu_wrptr(sc, ch, 0x4f, 0x0); + emu_wrptr(sc, ch, A_FXRT1, 0x3f3f3f3f); + emu_wrptr(sc, ch, A_FXRT2, 0x3f3f3f3f); + emu_wrptr(sc, ch, A_SENDAMOUNTS, 0x0); + } sc->voice[ch].vnum = ch; sc->voice[ch].slave = NULL; @@ -1365,13 +1769,93 @@ * Lock Sound Memory = 0 * Auto Mute = 1 */ - tmp = HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE; + tmp = HCFG_AUDIOENABLE | HCFG_AUTOMUTE; if (sc->rev >= 6) tmp |= HCFG_JOYENABLE; + if (sc->is_audigy) + tmp |= HCFG_CODECFORMAT_I2S | HCFG_GPOUT0 | HCFG_JOYENABLE; + else + tmp |= HCFG_LOCKTANKCACHE_MASK; emu_wr(sc, HCFG, tmp, 4); +#if 0 + if (0) { /* enable IR for SB Live */ + tmp = emu_rd(sc,HCFG,4); + emu_wr(sc, HCFG, tmp | HCFG_GPOUT2, 4); + DELAY(500); + emu_wr(sc, HCFG, tmp | HCFG_GPOUT1 | HCFG_GPOUT2, 4); + DELAY(500); +/* emu_wr(sc, HCFG, tmp, 4); */ + } +#endif + + tmp = emu_rd(sc, HCFG, 4); + device_printf(sc->dev, "Card Configuration ( 0x%08x )\n",tmp); + device_printf(sc->dev, + "Card Configuration ( & 0xff000000 ) : %s%s%s%s%s%s%s%s\n", + (tmp&0x80000000 ? "[Legacy MPIC] " : ""), + (tmp&0x40000000 ? "[0x40] " : ""), + (tmp&0x20000000 ? "[0x20] " : ""), + (tmp&0x10000000 ? "[0x10] " : ""), + (tmp&0x08000000 ? "[0x08] " : ""), + (tmp&0x04000000 ? "[0x04] " : ""), + (tmp&0x02000000 ? "[0x02] " : ""), + (tmp&0x01000000 ? "[0x01]" : "")); + device_printf(sc->dev, + "Card Configuration ( & 0x00ff0000 ) : %s%s%s%s%s%s%s%s\n", + (tmp&0x00800000 ? "[0x80] " : ""), + (tmp&0x00400000 ? "[0x40] " : ""), + (tmp&0x00200000 ? "[Legacy INT] " : ""), + (tmp&0x00100000 ? "[0x10] " : ""), + (tmp&0x00080000 ? "[0x08] " : ""), + (tmp&0x00040000 ? "[Codec4] " : ""), + (tmp&0x00020000 ? "[Codec2] " : ""), + (tmp&0x00010000 ? "[I2S Codec]" : "")); + device_printf(sc->dev, + "Card Configuration ( & 0x0000ff00 ) : %s%s%s%s%s%s%s%s\n", + (tmp&0x00008000 ? "[0x80] " : ""), + (tmp&0x00004000 ? "[GPINPUT0] " : ""), + (tmp&0x00002000 ? "[GPINPUT1] " : ""), + (tmp&0x00001000 ? "[GPOUT0] " : ""), + (tmp&0x00000800 ? "[GPOUT1] " : ""), + (tmp&0x00000400 ? "[GPOUT2] " : ""), + (tmp&0x00000200 ? "[Joystick] " : ""), + (tmp&0x00000100 ? "[0x01]" : "")); + device_printf(sc->dev, + "Card Configuration ( & 0x000000ff ) : %s%s%s%s%s%s%s%s\n", + (tmp&0x00000080 ? "[0x80] " : ""), + (tmp&0x00000040 ? "[0x40] " : ""), + (tmp&0x00000020 ? "[0x20] " : ""), + (tmp&0x00000010 ? "[AUTOMUTE] " : ""), + (tmp&0x00000008 ? "[LOCKSOUNDCACHE] " : ""), + (tmp&0x00000004 ? "[LOCKTANKCACHE] " : ""), + (tmp&0x00000002 ? "[MUTEBUTTONENABLE] " : ""), + (tmp&0x00000001 ? "[AUDIOENABLE]" : "")); + + if (sc->is_audigy) { + tmp = emu_rd(sc, A_IOCFG, 2); + device_printf(sc->dev, "Audigy Card Configuration ( 0x%04x )\n", + tmp); + device_printf(sc->dev, + "Connectors attached: %s%s%s%s%s%s%s%s\n", + (tmp&0x8000 ? "[Rear Speakers] " : ""), + (tmp&0x4000 ? "[Front Speakers] " : ""), + (tmp&0x2000 ? "[0x20] " : ""), + (tmp&0x1000 ? "[0x10] " : ""), + (tmp&0x0800 ? "[0x08] " : ""), + (tmp&0x0400 ? "[0x04] " : ""), + (tmp&0x0200 ? "[0x02] " : ""), + (tmp&0x0100 ? "[AudigyDrive Phones]" : "")); + emu_wrptr(sc,0, A_SPDIF_SAMPLERATE, A_SPDIF_48000); + } + - /* TOSLink detection */ sc->tos_link = 0; +#if 0 + /* + ALSA Driver stated that this code disbales LiveDrive !!! + */ + /* TOSLink detection */ + tmp = emu_rd(sc, HCFG, 4); if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) { emu_wr(sc, HCFG, tmp | 0x800, 4); @@ -1381,7 +1865,7 @@ emu_wr(sc, HCFG, tmp, 4); } } - +#endif return 0; } @@ -1439,11 +1923,9 @@ case EMU10K1_PCI_ID: s = "Creative EMU10K1"; break; -/* case EMU10K2_PCI_ID: s = "Creative EMU10K2"; break; -*/ default: return ENXIO; } @@ -1466,11 +1948,71 @@ return ENXIO; } + ctl_sc_info = sc; sc->lock = snd_mtxcreate(device_get_nameunit(dev), "sound softc"); sc->dev = dev; sc->type = pci_get_devid(dev); sc->rev = pci_get_revid(dev); + switch (sc->type) { + case EMU10K1_PCI_ID: + sc->is_audigy = 0; + sc->opcode_shift = 20; + sc->high_operand_shift = 10; + sc->code_base = MICROCODEBASE; + sc->code_size = 512; + sc->gpr_base = FXGPREGBASE; + sc->num_gprs = 0x100; + sc->input_base = 0x10; + sc->output_base = 0x20; + sc->dsp_zero=0x40; + sc->mchannel_fx = 0; + + /* mono voice */ + sc->waveio.send_dcba[SEND_MONO] = 0x0000ffff; + + /* stereo voice */ + /* left */ + sc->waveio.send_dcba[SEND_LEFT] = 0x000000ff; + /* right */ + sc->waveio.send_dcba[SEND_RIGHT] = 0x0000ff00; + + sc->waveio.send_routing[ROUTE_PCM0] = 0x00003210; /* Regular pcm*/ + + break; + case EMU10K2_PCI_ID: + sc->is_audigy = 1; + sc->opcode_shift = 24; + sc->high_operand_shift = 12; + sc->code_base = AUDIGY_CODEBASE; + sc->code_size = 1024; + sc->gpr_base = A_FXGPREGBASE; + sc->num_gprs = 0x200; + sc->input_base = 0x40; + sc->output_base = 0x60; + sc->dsp_zero=0xc0; + sc->mchannel_fx = 8; + /* mono voice */ + + sc->waveio.send_dcba[SEND_MONO] = 0xffffffff; + sc->waveio.send_hgfe[SEND_MONO] = 0x0000ffff; + + /* stereo voice */ + /* left */ + sc->waveio.send_dcba[SEND_LEFT] = 0x00ff00ff; + sc->waveio.send_hgfe[SEND_LEFT] = 0x00007f7f; + /* right */ + sc->waveio.send_dcba[SEND_RIGHT] = 0xff00ff00; + sc->waveio.send_hgfe[SEND_RIGHT] = 0x00007f7f; + + sc->waveio.send_routing[ROUTE_PCM0] = 0x03020100; /* Regular pcm*/ + sc->waveio.send_routing2[ROUTE_PCM0] = 0x07060504; + + break; + default: + return ENXIO; + } + data = pci_read_config(dev, PCIR_COMMAND, 2); data |= (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN); pci_write_config(dev, PCIR_COMMAND, data, 2); @@ -1497,6 +2039,16 @@ goto bad; } + i = 0; + sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &i, 0, ~0, 1, + RF_ACTIVE | RF_SHAREABLE); + if (!sc->irq || + snd_setup_intr(dev, sc->irq, INTR_MPSAFE, emu_intr, sc, &sc->ih)) { + device_printf(dev, "unable to map interrupt\n"); + goto bad; + } + + if (emu_init(sc) == -1) { device_printf(dev, "unable to initialize the card\n"); goto bad; @@ -1504,15 +2056,20 @@ codec = AC97_CREATE(dev, sc, emu_ac97); if (codec == NULL) goto bad; + sc->codec = codec; gotmic = (ac97_getcaps(codec) & AC97_CAP_MICCHANNEL) ? 1 : 0; if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad; +#if 0 + if (mixer_init(dev, &emu_mix_class, sc) == -1) goto bad; +#endif + + emu_wr(sc,AC97ADDRESS,0x18,1); + emu_wr(sc,AC97DATA,(sc->is_audigy) ? 0x8000 : 0x0000,2); + + emu_wr(sc,AC97ADDRESS,AC97_RECORD_GAIN,1); + emu_wr(sc,AC97DATA,0x0000,2); + - i = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &i, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, emu_intr, sc, &sc->ih)) { - device_printf(dev, "unable to map interrupt\n"); - goto bad; - } snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(sc->reg), rman_get_start(sc->irq)); @@ -1581,6 +2138,46 @@ MODULE_DEPEND(snd_emu10k1, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER); MODULE_VERSION(snd_emu10k1, 1); +/* sysctls to RO access to 8010 memory from userland */ +static int +sysctl_hw_snd_emu10k_dump(SYSCTL_HANDLER_ARGS) +{ + int error, i, j, v; + struct sbuf *sb; + + sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sbuf_clear(sb); + sbuf_printf(sb, "EMU8010 per-voice dump\n"); + for(v = 0; v < 64; v++) { + sbuf_printf(sb, "voice %04x\n", v); + for(i = 0; i < 0x20; i++) { + sbuf_printf(sb, "%04x", i * 0x4); + for(j = 0; j < 4; j++) + sbuf_printf(sb, " %08x", + emu_rdptr(ctl_sc_info, v, i * 0x4 + j)); + sbuf_printf(sb,"\n"); + }; + }; + sbuf_printf(sb, "EMU8010 memory dump\n"); + for(i = 0; i < 0x200; i++) { + sbuf_printf(sb, "%04x", i * 0x4); + for (j = 0; j < 0x4; j++) + sbuf_printf(sb, " %08x", emu_rdptr(ctl_sc_info, 0, + i * 0x4 + j)); + sbuf_printf(sb,"\n"); + }; + error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + sbuf_delete(sb); + return error; +} + +SYSCTL_NODE(_hw_snd, OID_AUTO, emu10k, CTLFLAG_RW, 0, "EMU10Kx management"); + +SYSCTL_PROC(_hw_snd_emu10k, OID_AUTO, dump, CTLTYPE_STRING|CTLFLAG_RD, + 0, 0, sysctl_hw_snd_emu10k_dump, "", + "Dump EMU10Kx memory in text"); + + /* dummy driver to silence the joystick device */ static int emujoy_pci_probe(device_t dev) Index: sys/gnu/dev/sound/pci/emu10k1.h =================================================================== RCS file: /home/ncvs/src/sys/gnu/dev/sound/pci/emu10k1.h,v retrieving revision 1.6 diff -u -r1.6 emu10k1.h --- sys/gnu/dev/sound/pci/emu10k1.h 18 Apr 2003 04:13:38 -0000 1.6 +++ sys/gnu/dev/sound/pci/emu10k1.h 20 Apr 2003 07:20:37 -0000 @@ -1,7 +1,7 @@ /* ********************************************************************** * emu10k1.h, derived from 8010.h - * Copyright 1999, 2000 Creative Labs, Inc. + * Copyright 1999-2001 Creative Labs, Inc. * ********************************************************************** * @@ -11,6 +11,8 @@ * November 2, 1999 Alan Cox Cleaned of 8bit chars, DOS * line endings * December 8, 1999 Jon Taylor Added lots of new register info + * May 16, 2001 Daniel Bertrand Added unofficial DBG register info + * Oct-Nov 2001 D.B. Added unofficial Audigy registers * ********************************************************************** * @@ -38,21 +40,14 @@ #ifndef EMU10K1_H #define EMU10K1_H -/* ------------------- DEFINES -------------------- */ +/* +// Driver version: +#define MAJOR_VER 0 +#define MINOR_VER 20 +#define DRIVER_VERSION "0.20a" +*/ -#define EMUPAGESIZE 4096 /* don't change */ -#define MAXREQVOICES 8 -#define MAXPAGES (32768 * 64 / EMUPAGESIZE) /* WAVEOUT_MAXBUFSIZE * NUM_G / EMUPAGESIZE */ -#define RESERVED 0 -#define NUM_MIDI 16 -#define NUM_G 64 /* use all channels */ -#define NUM_FXSENDS 4 - - -#define TMEMSIZE 256*1024 -#define TMEMSIZEREG 4 - -#define IP_TO_CP(ip) ((ip == 0) ? 0 : (((0x00001000uL | (ip & 0x00000FFFL)) << (((ip >> 12) & 0x000FL) + 4)) & 0xFFFF0000uL)) +/* Audigy specify registers are prefixed with 'A_' */ /************************************************************************************************/ /* PCI function 0 registers, address = + PCIBASE0 */ @@ -72,6 +67,11 @@ #define IPR 0x08 /* Global interrupt pending register */ /* Clear pending interrupts by writing a 1 to */ /* the relevant bits and zero to the other bits */ + +/* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */ +#define A_IPR_MIDITRANSBUFEMPTY2 0x10000000 /* MIDI UART transmit buffer empty */ +#define A_IPR_MIDIRECVBUFEMPTY2 0x08000000 /* MIDI UART receive buffer empty */ + #define IPR_SAMPLERATETRACKER 0x01000000 /* Sample rate tracker lock status change */ #define IPR_FXDSP 0x00800000 /* Enable FX DSP interrupts */ #define IPR_FORCEINT 0x00400000 /* Force Sound Blaster interrupt */ @@ -96,6 +96,10 @@ /* IP is written with CL set, the bit in CLIPL */ /* or CLIPH corresponding to the CIN value */ /* written will be cleared. */ +#define A_IPR_MIDITRANSBUFEMPTY1 IPR_MIDITRANSBUFEMPTY /* MIDI UART transmit buffer empty */ +#define A_IPR_MIDIRECVBUFEMPTY1 IPR_MIDIRECVBUFEMPTY /* MIDI UART receive buffer empty */ + + #define INTE 0x0c /* Interrupt enable register */ #define INTE_VIRTUALSB_MASK 0xc0000000 /* Virtual Soundblaster I/O port capture */ @@ -123,6 +127,11 @@ /* behavior and possibly random segfaults and */ /* lockups if enabled. */ +/* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */ +#define A_INTE_MIDITXENABLE2 0x00020000 /* Enable MIDI transmit-buffer-empty interrupts */ +#define A_INTE_MIDIRXENABLE2 0x00010000 /* Enable MIDI receive-buffer-empty interrupts */ + + #define INTE_SAMPLERATETRACKER 0x00002000 /* Enable sample rate tracker interrupts */ /* NOTE: This bit must always be enabled */ #define INTE_FXDSPENABLE 0x00001000 /* Enable FX DSP interrupts */ @@ -139,6 +148,10 @@ #define INTE_MIDITXENABLE 0x00000002 /* Enable MIDI transmit-buffer-empty interrupts */ #define INTE_MIDIRXENABLE 0x00000001 /* Enable MIDI receive-buffer-empty interrupts */ +/* The next two interrupts are for the midi port on the Audigy (A_MPU2) */ +#define A_INTE_MIDITXENABLE1 INTE_MIDITXENABLE +#define A_INTE_MIDIRXENABLE1 INTE_MIDIRXENABLE + #define WC 0x10 /* Wall Clock register */ #define WC_SAMPLECOUNTER_MASK 0x03FFFFC0 /* Sample periods elapsed since reset */ #define WC_SAMPLECOUNTER 0x14060010 @@ -170,7 +183,12 @@ #define HCFG_CODECFORMAT_I2S 0x00010000 /* I2S CODEC format -- Secondary (Rear) Output */ #define HCFG_GPINPUT0 0x00004000 /* External pin112 */ #define HCFG_GPINPUT1 0x00002000 /* External pin110 */ + #define HCFG_GPOUTPUT_MASK 0x00001c00 /* External pins which may be controlled */ +#define HCFG_GPOUT0 0x00001000 /* set to enable digital out on 5.1 cards */ +#define HCFG_GPOUT1 0x00000800 /* External pin? (IR) */ +#define HCFG_GPOUT2 0x00000400 /* External pin? (IR) */ + #define HCFG_JOYENABLE 0x00000200 /* Internal joystick enable */ #define HCFG_PHASETRACKENABLE 0x00000100 /* Phase tracking enable */ /* 1 = Force all 3 async digital inputs to use */ @@ -178,6 +196,7 @@ #define HCFG_AC3ENABLE_MASK 0x0x0000e0 /* AC3 async input control - Not implemented */ #define HCFG_AC3ENABLE_ZVIDEO 0x00000080 /* Channels 0 and 1 replace ZVIDEO */ #define HCFG_AC3ENABLE_CDSPDIF 0x00000040 /* Channels 0 and 1 replace CDSPDIF */ +#define HCFG_AC3ENABLE_GPSPDIF 0x00000020 /* Channels 0 and 1 replace GPSPDIF */ #define HCFG_AUTOMUTE 0x00000010 /* When set, the async sample rate convertors */ /* will automatically mute their output when */ /* they are not rate-locked to the external */ @@ -186,6 +205,7 @@ /* NOTE: This should generally never be used. */ #define HCFG_LOCKTANKCACHE_MASK 0x00000004 /* 1 = Cancel bustmaster accesses to tankcache */ /* NOTE: This should generally never be used. */ +#define HCFG_LOCKTANKCACHE 0x01020014 #define HCFG_MUTEBUTTONENABLE 0x00000002 /* 1 = Master mute button sets AUDIOENABLE = 0. */ /* NOTE: This is a 'cheap' way to implement a */ /* master mute function on the mute button, and */ @@ -196,6 +216,8 @@ /* Should be set to 1 when the EMU10K1 is */ /* completely initialized. */ +/*For Audigy, MPU port move to 0x70-0x74 ptr register */ + #define MUDATA 0x18 /* MPU401 data register (8 bits) */ #define MUCMD 0x19 /* MPU401 command register (8 bits) */ @@ -207,11 +229,16 @@ #define MUSTAT_IRDYN 0x80 /* 0 = MIDI data or command ACK */ #define MUSTAT_ORDYN 0x40 /* 0 = MUDATA can accept a command or data */ -#define TIMER 0x1a /* Timer terminal count register */ +#define A_IOCFG 0x18 /* GPIO on Audigy card (16bits) */ +#define A_GPINPUT_MASK 0xff00 +#define A_GPOUTPUT_MASK 0x00ff +#define A_IOCFG_GPOUT0 0x0044 /* ? */ + +#define TIMER 0x1a /* Timer terminal count register (16-bit) */ /* NOTE: After the rate is changed, a maximum */ /* of 1024 sample periods should be allowed */ /* before the new rate is guaranteed accurate. */ -#define TIMER_RATE_MASK 0x000003ff /* Timer interrupt rate in sample periods */ +#define TIMER_RATE_MASK 0x03ff /* Timer interrupt rate in sample periods */ /* 0 == 1024 periods, [1..4] are not useful */ #define TIMER_RATE 0x0a00001a @@ -221,54 +248,6 @@ #define AC97ADDRESS_READY 0x80 /* Read-only bit, reflects CODEC READY signal */ #define AC97ADDRESS_ADDRESS 0x7f /* Address of indexed AC97 register */ -/************************************************************************************************/ -/* PCI function 1 registers, address = + PCIBASE1 */ -/************************************************************************************************/ - -#define JOYSTICK1 0x00 /* Analog joystick port register */ -#define JOYSTICK2 0x01 /* Analog joystick port register */ -#define JOYSTICK3 0x02 /* Analog joystick port register */ -#define JOYSTICK4 0x03 /* Analog joystick port register */ -#define JOYSTICK5 0x04 /* Analog joystick port register */ -#define JOYSTICK6 0x05 /* Analog joystick port register */ -#define JOYSTICK7 0x06 /* Analog joystick port register */ -#define JOYSTICK8 0x07 /* Analog joystick port register */ - -/* When writing, any write causes JOYSTICK_COMPARATOR output enable to be pulsed on write. */ -/* When reading, use these bitfields: */ -#define JOYSTICK_BUTTONS 0x0f /* Joystick button data */ -#define JOYSTICK_COMPARATOR 0xf0 /* Joystick comparator data */ - - -/********************************************************************************************************/ -/* AC97 pointer-offset register set, accessed through the AC97ADDRESS and AC97DATA registers */ -/********************************************************************************************************/ - -#define AC97_RESET 0x00 -#define AC97_MASTERVOLUME 0x02 /* Master volume */ -#define AC97_HEADPHONEVOLUME 0x04 /* Headphone volume */ -#define AC97_MASTERVOLUMEMONO 0x06 /* Mast volume mono */ -#define AC97_MASTERTONE 0x08 -#define AC97_PCBEEPVOLUME 0x0a /* PC speaker system beep volume */ -#define AC97_PHONEVOLUME 0x0c -#define AC97_MICVOLUME 0x0e -#define AC97_LINEINVOLUME 0x10 -#define AC97_CDVOLUME 0x12 -#define AC97_VIDEOVOLUME 0x14 -#define AC97_AUXVOLUME 0x16 -#define AC97_PCMOUTVOLUME 0x18 -#define AC97_RECORDSELECT 0x1a -#define AC97_RECORDGAIN 0x1c -#define AC97_RECORDGAINMIC 0x1e -#define AC97_GENERALPURPOSE 0x20 -#define AC97_3DCONTROL 0x22 -#define AC97_MODEMRATE 0x24 -#define AC97_POWERDOWN 0x26 -#define AC97_VENDORID1 0x7c -#define AC97_VENDORID2 0x7e -#define AC97_ZVIDEOVOLUME 0xec -#define AC97_AC3VOLUME 0xed - /********************************************************************************************************/ /* Emu10k1 pointer-offset register set, accessed through the PTR and DATA registers */ /********************************************************************************************************/ @@ -444,6 +423,8 @@ #define TREMFRQ 0x1c /* Tremolo amount and modulation LFO frequency register */ #define TREMFRQ_DEPTH 0x0000ff00 /* Tremolo depth */ /* Signed 2's complement, with +/- 12dB extremes */ +#define TREMFRQ_FREQUENCY 0x000000ff /* Tremolo LFO frequency */ + /* ??Hz steps, maximum of ?? Hz. */ #define FM2FRQ2 0x1d /* Vibrato amount and vibrato LFO frequency register */ #define FM2FRQ2_DEPTH 0x0000ff00 /* Vibrato LFO vibrato depth */ @@ -484,7 +465,12 @@ #define ADCCR_LCHANENABLE 0x00000008 /* Enables left channel for writing to the host */ /* NOTE: To guarantee phase coherency, both channels */ /* must be disabled prior to enabling both channels. */ +#define A_ADCCR_RCHANENABLE 0x00000020 +#define A_ADCCR_LCHANENABLE 0x00000010 + +#define A_ADCCR_SAMPLERATE_MASK 0x0000000F /* Audigy sample rate convertor output rate */ #define ADCCR_SAMPLERATE_MASK 0x00000007 /* Sample rate convertor output rate */ + #define ADCCR_SAMPLERATE_48 0x00000000 /* 48kHz sample rate */ #define ADCCR_SAMPLERATE_44 0x00000001 /* 44.1kHz sample rate */ #define ADCCR_SAMPLERATE_32 0x00000002 /* 32kHz sample rate */ @@ -494,10 +480,16 @@ #define ADCCR_SAMPLERATE_11 0x00000006 /* 11.025kHz sample rate */ #define ADCCR_SAMPLERATE_8 0x00000007 /* 8kHz sample rate */ +#define A_ADCCR_SAMPLERATE_12 0x00000006 /* 12kHz sample rate */ +#define A_ADCCR_SAMPLERATE_11 0x00000007 /* 11.025kHz sample rate */ +#define A_ADCCR_SAMPLERATE_8 0x00000008 /* 8kHz sample rate */ + #define FXWC 0x43 /* FX output write channels register */ /* When set, each bit enables the writing of the */ - /* corresponding FX output channel into host memory */ - + /* corresponding FX output channel (internal registers */ + /* 0x20-0x3f) into host memory. This mode of recording */ + /* is 16bit, 48KHz only. All 32 channels can be enabled */ + /* simultaneously. */ #define TCBS 0x44 /* Tank cache buffer size register */ #define TCBS_MASK 0x00000007 /* Tank cache buffer size field */ #define TCBS_BUFFSIZE_16K 0x00000000 @@ -565,8 +557,25 @@ #define DBG 0x52 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ +/* definitions for debug register - taken from the alsa drivers */ +#define DBG_ZC 0x80000000 /* zero tram counter */ +#define DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ +#define DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */ +#define DBG_SINGLE_STEP 0x00008000 /* single step mode */ +#define DBG_STEP 0x00004000 /* start single step */ +#define DBG_CONDITION_CODE 0x00003e00 /* condition code */ +#define DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ + + #define REG53 0x53 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ +#define A_DBG 0x53 +#define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */ +#define A_DBG_ZC 0x40000000 /* zero tram counter */ +#define A_DBG_STEP_ADDR 0x000003ff +#define A_DBG_SATURATION_OCCURED 0x20000000 +#define A_DBG_SATURATION_ADDR 0x0ffc0000 + #define SPCS0 0x54 /* SPDIF output Channel Status 0 register */ #define SPCS1 0x55 /* SPDIF output Channel Status 1 register */ @@ -613,6 +622,10 @@ #define SPBYPASS 0x5e /* SPDIF BYPASS mode register */ #define SPBYPASS_ENABLE 0x00000001 /* Enable SPDIF bypass mode */ +#define AC97SLOT 0x5f /* additional AC97 slots enable bits */ +#define AC97SLOT_CNTR 0x10 /* Center enable */ +#define AC97SLOT_LFE 0x20 /* LFE enable */ + #define CDSRCS 0x60 /* CD-ROM Sample Rate Converter status register */ #define GPSRCS 0x61 /* General Purpose SPDIF sample rate cvt status */ @@ -626,10 +639,19 @@ #define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */ #define SRCS_ESTSAMPLERATE 0x0007ffff /* Do not modify this field. */ + +/* Note that these values can vary +/- by a small amount */ +#define SRCS_SPDIFRATE_44 0x0003acd9 +#define SRCS_SPDIFRATE_48 0x00040000 +#define SRCS_SPDIFRATE_96 0x00080000 + #define MICIDX 0x63 /* Microphone recording buffer index register */ #define MICIDX_MASK 0x0000ffff /* 16-bit value */ #define MICIDX_IDX 0x10000063 +#define A_ADCIDX 0x63 +#define A_ADCIDX_IDX 0x10000063 + #define ADCIDX 0x64 /* ADC recording buffer index register */ #define ADCIDX_MASK 0x0000ffff /* 16 bit index field */ #define ADCIDX_IDX 0x10000064 @@ -638,9 +660,50 @@ #define FXIDX_MASK 0x0000ffff /* 16-bit value */ #define FXIDX_IDX 0x10000065 +/* This is the MPU port on the card (via the game port) */ +#define A_MUDATA1 0x70 +#define A_MUCMD1 0x71 +#define A_MUSTAT1 A_MUCMD1 + +/* This is the MPU port on the Audigy Drive */ +#define A_MUDATA2 0x72 +#define A_MUCMD2 0x73 +#define A_MUSTAT2 A_MUCMD2 + +/* The next two are the Audigy equivalent of FXWC */ +/* the Audigy can record any output (16bit, 48kHz, up to 64 channel simultaneously) */ +/* Each bit selects a channel for recording */ +#define A_FXWC1 0x74 /* Selects 0x7f-0x60 for FX recording */ +#define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */ + +#define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ +#define A_SPDIF_48000 0x00000080 +#define A_SPDIF_44100 0x00000000 +#define A_SPDIF_96000 0x00000040 + +#define A_FXRT2 0x7c +#define A_FXRT_CHANNELE 0x0000003f /* Effects send bus number for channel's effects send E */ +#define A_FXRT_CHANNELF 0x00003f00 /* Effects send bus number for channel's effects send F */ +#define A_FXRT_CHANNELG 0x003f0000 /* Effects send bus number for channel's effects send G */ +#define A_FXRT_CHANNELH 0x3f000000 /* Effects send bus number for channel's effects send H */ + +#define A_SENDAMOUNTS 0x7d +#define A_FXSENDAMOUNT_E_MASK 0xff000000 +#define A_FXSENDAMOUNT_F_MASK 0x00ff0000 +#define A_FXSENDAMOUNT_G_MASK 0x0000ff00 +#define A_FXSENDAMOUNT_H_MASK 0x000000ff + +/* The send amounts for this one are the same as used with the emu10k1 */ +#define A_FXRT1 0x7e +#define A_FXRT_CHANNELA 0x0000003f +#define A_FXRT_CHANNELB 0x00003f00 +#define A_FXRT_CHANNELC 0x003f0000 +#define A_FXRT_CHANNELD 0x3f000000 + + /* Each FX general purpose register is 32 bits in length, all bits are used */ #define FXGPREGBASE 0x100 /* FX general purpose registers base */ - +#define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */ /* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */ /* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */ /* locations are for external TRAM. */ @@ -665,10 +728,13 @@ #define HIWORD_RESULT_MASK 0x000ffc00 /* Instruction result */ #define HIWORD_OPA_MASK 0x000003ff /* Instruction operand A */ -#define ENABLE 0xffffffff -#define DISABLE 0x00000000 -#define ENV_ON 0x80 -#define ENV_OFF 0x00 +/* Audigy Soundcard have a different instruction format */ +#define AUDIGY_CODEBASE 0x600 +#define A_LOWORD_OPY_MASK 0x000007ff +#define A_LOWORD_OPX_MASK 0x007ff000 +#define A_HIWORD_OPCODE_MASK 0x0f000000 +#define A_HIWORD_RESULT_MASK 0x007ff000 +#define A_HIWORD_OPA_MASK 0x000007ff #endif /* EMU10K1_H */ Index: sys/gnu/dev/sound/pci/emu10k1-ac97.h =================================================================== RCS file: sys/gnu/dev/sound/pci/emu10k1-ac97.h diff -N sys/gnu/dev/sound/pci/emu10k1-ac97.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/gnu/dev/sound/pci/emu10k1-ac97.h 18 Apr 2003 14:08:06 -0000 @@ -0,0 +1,191 @@ +#ifndef _EMU10K1_AC97_H_ +#define _EMU10K1_AC97_H_ + +/*********************************************/ +/* emu10k1-ac97.h, derived from ac97_codec.h */ +/*********************************************/ + +/********************************************************************************************************/ +/* AC97 pointer-offset register set, accessed through the AC97ADDRESS and AC97DATA registers */ +/********************************************************************************************************/ + + + +/* AC97 1.0 */ +#define AC97_RESET 0x0000 /* */ +#define AC97_MASTER_VOL_STEREO 0x0002 /* Line Out */ +#define AC97_HEADPHONE_VOL 0x0004 /* */ +#define AC97_MASTER_VOL_MONO 0x0006 /* TAD Output */ +#define AC97_MASTER_TONE 0x0008 /* */ +#define AC97_PCBEEP_VOL 0x000a /* none */ +#define AC97_PHONE_VOL 0x000c /* TAD Input (mono) */ +#define AC97_MIC_VOL 0x000e /* MIC Input (mono) */ +#define AC97_LINEIN_VOL 0x0010 /* Line Input (stereo) */ +#define AC97_CD_VOL 0x0012 /* CD Input (stereo) */ +#define AC97_VIDEO_VOL 0x0014 /* none */ +#define AC97_AUX_VOL 0x0016 /* Aux Input (stereo) */ +#define AC97_PCMOUT_VOL 0x0018 /* Wave Output (stereo) */ +#define AC97_RECORD_SELECT 0x001a /* */ +#define AC97_RECORD_GAIN 0x001c +#define AC97_RECORD_GAIN_MIC 0x001e +#define AC97_GENERAL_PURPOSE 0x0020 +#define AC97_3D_CONTROL 0x0022 +#define AC97_MODEM_RATE 0x0024 +#define AC97_POWER_CONTROL 0x0026 + +/* AC'97 2.0 */ +#define AC97_EXTENDED_ID 0x0028 /* Extended Audio ID */ +#define AC97_EXTENDED_STATUS 0x002A /* Extended Audio Status */ +#define AC97_PCM_FRONT_DAC_RATE 0x002C /* PCM Front DAC Rate */ +#define AC97_PCM_SURR_DAC_RATE 0x002E /* PCM Surround DAC Rate */ +#define AC97_PCM_LFE_DAC_RATE 0x0030 /* PCM LFE DAC Rate */ +#define AC97_PCM_LR_ADC_RATE 0x0032 /* PCM LR DAC Rate */ +#define AC97_PCM_MIC_ADC_RATE 0x0034 /* PCM MIC ADC Rate */ +#define AC97_CENTER_LFE_MASTER 0x0036 /* Center + LFE Master Volume */ +#define AC97_SURROUND_MASTER 0x0038 /* Surround (Rear) Master Volume */ +#define AC97_RESERVED_3A 0x003A /* Reserved in AC '97 < 2.2 */ + +/* AC'97 2.2 */ +#define AC97_SPDIF_CONTROL 0x003A /* S/PDIF Control */ + +/* range 0x3c-0x58 - MODEM */ +#define AC97_EXTENDED_MODEM_ID 0x003C +#define AC97_EXTEND_MODEM_STAT 0x003E +#define AC97_LINE1_RATE 0x0040 +#define AC97_LINE2_RATE 0x0042 +#define AC97_HANDSET_RATE 0x0044 +#define AC97_LINE1_LEVEL 0x0046 +#define AC97_LINE2_LEVEL 0x0048 +#define AC97_HANDSET_LEVEL 0x004A +#define AC97_GPIO_CONFIG 0x004C +#define AC97_GPIO_POLARITY 0x004E +#define AC97_GPIO_STICKY 0x0050 +#define AC97_GPIO_WAKE_UP 0x0052 +#define AC97_GPIO_STATUS 0x0054 +#define AC97_MISC_MODEM_STAT 0x0056 +#define AC97_RESERVED_58 0x0058 + +/* registers 0x005a - 0x007a are vendor reserved */ + +#define AC97_VENDOR_ID1 0x007c +#define AC97_VENDOR_ID2 0x007e + +/* volume control bit defines */ +#define AC97_MUTE 0x8000 +#define AC97_MICBOOST 0x0040 +#define AC97_LEFTVOL 0x3f00 +#define AC97_RIGHTVOL 0x003f + +/* record mux defines */ +#define AC97_RECMUX_MIC 0x0000 +#define AC97_RECMUX_CD 0x0101 +#define AC97_RECMUX_VIDEO 0x0202 +#define AC97_RECMUX_AUX 0x0303 +#define AC97_RECMUX_LINE 0x0404 +#define AC97_RECMUX_STEREO_MIX 0x0505 +#define AC97_RECMUX_MONO_MIX 0x0606 +#define AC97_RECMUX_PHONE 0x0707 + +/* general purpose register bit defines */ +#define AC97_GP_LPBK 0x0080 /* Loopback mode */ +#define AC97_GP_MS 0x0100 /* Mic Select 0=Mic1, 1=Mic2 */ +#define AC97_GP_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic */ +#define AC97_GP_RLBK 0x0400 /* Remote Loopback - Modem line codec */ +#define AC97_GP_LLBK 0x0800 /* Local Loopback - Modem Line codec */ +#define AC97_GP_LD 0x1000 /* Loudness 1=on */ +#define AC97_GP_3D 0x2000 /* 3D Enhancement 1=on */ +#define AC97_GP_ST 0x4000 /* Stereo Enhancement 1=on */ +#define AC97_GP_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */ + +/* extended audio status and control bit defines */ +#define AC97_EA_VRA 0x0001 /* Variable bit rate enable bit */ +#define AC97_EA_DRA 0x0002 /* Double-rate audio enable bit */ +#define AC97_EA_SPDIF 0x0004 /* S/PDIF Enable bit */ +#define AC97_EA_VRM 0x0008 /* Variable bit rate for MIC enable bit */ +#define AC97_EA_CDAC 0x0040 /* PCM Center DAC is ready (Read only) */ +#define AC97_EA_SDAC 0x0040 /* PCM Surround DACs are ready (Read only) */ +#define AC97_EA_LDAC 0x0080 /* PCM LFE DAC is ready (Read only) */ +#define AC97_EA_MDAC 0x0100 /* MIC ADC is ready (Read only) */ +#define AC97_EA_SPCV 0x0400 /* S/PDIF configuration valid (Read only) */ +#define AC97_EA_PRI 0x0800 /* Turns the PCM Center DAC off */ +#define AC97_EA_PRJ 0x1000 /* Turns the PCM Surround DACs off */ +#define AC97_EA_PRK 0x2000 /* Turns the PCM LFE DAC off */ +#define AC97_EA_PRL 0x4000 /* Turns the MIC ADC off */ +#define AC97_EA_SLOT_MASK 0xffcf /* Mask for slot assignment bits */ +#define AC97_EA_SPSA_3_4 0x0000 /* Slot assigned to 3 & 4 */ +#define AC97_EA_SPSA_7_8 0x0010 /* Slot assigned to 7 & 8 */ +#define AC97_EA_SPSA_6_9 0x0020 /* Slot assigned to 6 & 9 */ +#define AC97_EA_SPSA_10_11 0x0030 /* Slot assigned to 10 & 11 */ + +/* S/PDIF control bit defines */ +#define AC97_SC_PRO 0x0001 /* Professional status */ +#define AC97_SC_NAUDIO 0x0002 /* Non audio stream */ +#define AC97_SC_COPY 0x0004 /* Copyright status */ +#define AC97_SC_PRE 0x0008 /* Preemphasis status */ +#define AC97_SC_CC_MASK 0x07f0 /* Category Code mask */ +#define AC97_SC_L 0x0800 /* Generation Level status */ +#define AC97_SC_SPSR_MASK 0xcfff /* S/PDIF Sample Rate bits */ +#define AC97_SC_SPSR_44K 0x0000 /* Use 44.1kHz Sample rate */ +#define AC97_SC_SPSR_48K 0x2000 /* Use 48kHz Sample rate */ +#define AC97_SC_SPSR_32K 0x3000 /* Use 32kHz Sample rate */ +#define AC97_SC_DRS 0x4000 /* Double Rate S/PDIF */ +#define AC97_SC_V 0x8000 /* Validity status */ + +/* powerdown control and status bit defines */ + +/* status */ +#define AC97_PWR_MDM 0x0010 /* Modem section ready */ +#define AC97_PWR_REF 0x0008 /* Vref nominal */ +#define AC97_PWR_ANL 0x0004 /* Analog section ready */ +#define AC97_PWR_DAC 0x0002 /* DAC section ready */ +#define AC97_PWR_ADC 0x0001 /* ADC section ready */ + +/* control */ +#define AC97_PWR_PR0 0x0100 /* ADC and Mux powerdown */ +#define AC97_PWR_PR1 0x0200 /* DAC powerdown */ +#define AC97_PWR_PR2 0x0400 /* Output mixer powerdown (Vref on) */ +#define AC97_PWR_PR3 0x0800 /* Output mixer powerdown (Vref off) */ +#define AC97_PWR_PR4 0x1000 /* AC-link powerdown */ +#define AC97_PWR_PR5 0x2000 /* Internal Clk disable */ +#define AC97_PWR_PR6 0x4000 /* HP amp powerdown */ +#define AC97_PWR_PR7 0x8000 /* Modem off - if supported */ + +/* useful power states */ +#define AC97_PWR_D0 0x0000 /* everything on */ +#define AC97_PWR_D1 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR4 +#define AC97_PWR_D2 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4 +#define AC97_PWR_D3 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4 +#define AC97_PWR_ANLOFF AC97_PWR_PR2|AC97_PWR_PR3 /* analog section off */ + +/* Total number of defined registers. */ +#define AC97_REG_CNT 64 + + +/* OSS interface to the ac97s.. */ +#define AC97_STEREO_MASK (SOUND_MASK_VOLUME|SOUND_MASK_PCM|\ + SOUND_MASK_LINE|SOUND_MASK_CD|\ + SOUND_MASK_ALTPCM|SOUND_MASK_IGAIN|\ + SOUND_MASK_LINE1|SOUND_MASK_VIDEO|SOUND_MASK_IMIX) + +#define AC97_SUPPORTED_MASK (AC97_STEREO_MASK | \ + SOUND_MASK_BASS|SOUND_MASK_TREBLE|\ + SOUND_MASK_SPEAKER|SOUND_MASK_MIC|\ + SOUND_MASK_PHONEIN|SOUND_MASK_PHONEOUT) + +#define AC97_RECORD_MASK (SOUND_MASK_MIC|\ + SOUND_MASK_CD|SOUND_MASK_IGAIN|SOUND_MASK_VIDEO|\ + SOUND_MASK_LINE1| SOUND_MASK_LINE|\ + SOUND_MASK_PHONEIN) + +/* original check is not good enough in case FOO is greater than + * SOUND_MIXER_NRDEVICES because the supported_mixers has exactly + * SOUND_MIXER_NRDEVICES elements. + * before matching the given mixer against the bitmask in supported_mixers we + * check if mixer number exceeds maximum allowed size which is as mentioned + * above SOUND_MIXER_NRDEVICES */ +#define supported_mixer(CODEC,FOO) ((FOO >= 0) && \ + (FOO < SOUND_MIXER_NRDEVICES) && \ + (CODEC)->supported_mixers & (1< Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D53F37B401; Sun, 20 Apr 2003 18:35:02 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E95843FE1; Sun, 20 Apr 2003 18:32:17 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.9/8.12.9) with ESMTP id h3L1W4ZW068486; Sun, 20 Apr 2003 18:32:08 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.9/8.12.9/Submit) id h3L1VtDW068481; Sun, 20 Apr 2003 18:31:55 -0700 (PDT) Date: Sun, 20 Apr 2003 18:31:55 -0700 From: "David O'Brien" To: Orion Hodson Message-ID: <20030421013155.GA68442@dragon.nuxi.com> References: <20030420215557.GD55790@dragon.nuxi.com> <200304210017.h3L0HCnR040596@puma.icir.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline In-Reply-To: <200304210017.h3L0HCnR040596@puma.icir.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: sound@FreeBSD.org cc: multimedia@FreeBSD.org cc: Orlando Bassotto cc: Dag-Erling Smorgrav Subject: Re: Audigy [ was Re: ... Terratec EWS88MT ... ] X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 01:35:02 -0000 --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Apr 20, 2003 at 05:17:12PM -0700, Orion Hodson wrote: > /-- "David O'Brien" wrote: > | On Fri, Feb 21, 2003 at 02:21:42PM -0800, Orion Hodson wrote: > | > The project has had two drivers submitted for Audigy support in the > | > past couple of weeks. I've been holding off looking at them as cg's > | > really the man for the job. However, as I've found out today cg's > | > been ill of late and has plenty of things going on externally at > | > present. > | > | So how do we move forward? > > Orlando Bassotto, one of the Audigy code submitters, has taken on the task of Here is the previously posted Orlando diff, updated for today's 5-CURRENT. I am able to play mp3's with this patch. --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="audigy-orlando.diff" Index: sys/dev/sound/pci/emu10k1.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pci/emu10k1.c,v retrieving revision 1.37 diff -u -r1.37 emu10k1.c --- sys/dev/sound/pci/emu10k1.c 20 Apr 2003 09:07:14 -0000 1.37 +++ sys/dev/sound/pci/emu10k1.c 21 Apr 2003 01:23:22 -0000 @@ -1,4 +1,5 @@ /* + * Copyright (c) 2003 Orlando Bassotto * Copyright (c) 1999 Cameron Grant * All rights reserved. * @@ -27,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -39,9 +42,25 @@ #define EMU10K1_PCI_ID 0x00021102 #define EMU10K2_PCI_ID 0x00041102 #define EMU_DEFAULT_BUFSZ 4096 -#define EMU_CHANS 4 +#define EMU_MAX_CHANS 8 #undef EMUDEBUG +#define EMUPAGESIZE 4096 /* don't change */ +#define MAXREQVOICES 8 +#define MAXPAGES (32768 * 64 / EMUPAGESIZE) /* WAVEOUT_MAXBUFSIZE * NUM_G / EMUPAGESIZE */ +#define RESERVED 0 +#define NUM_MIDI 16 +#define NUM_G 64 /* use all channels */ +#define NUM_FXSENDS 4 + +#define TMEMSIZE 256*1024 +#define TMEMSIZEREG 4 + +#define ENABLE 0xffffffff +#define DISABLE 0x00000000 +#define ENV_ON 0x80 +#define ENV_OFF 0x00 + struct emu_memblk { SLIST_ENTRY(emu_memblk) link; void *buf; @@ -63,6 +82,8 @@ int b16:1, stereo:1, busy:1, running:1, ismaster:1; int speed; int start, end, vol; + int fxrt1; /* FX routing */ + int fxrt2; /* FX routing (only for audigy) */ u_int32_t buf; struct emu_voice *slave; struct pcm_channel *channel; @@ -91,7 +112,8 @@ struct sc_info { device_t dev; u_int32_t type, rev; - u_int32_t tos_link:1, APS:1; + u_int32_t tos_link:1, APS:1, audigy:1, audigy2:1; + u_int32_t addrmask; /* wider if audigy */ bus_space_tag_t st; bus_space_handle_t sh; @@ -104,9 +126,10 @@ unsigned int bufsz; int timer, timerinterval; int pnum, rnum; + int nchans; struct emu_mem mem; struct emu_voice voice[64]; - struct sc_pchinfo pch[EMU_CHANS]; + struct sc_pchinfo pch[EMU_MAX_CHANS]; struct sc_rchinfo rch[3]; }; @@ -166,6 +189,8 @@ static struct pcmchan_caps emu_playcaps = {4000, 48000, emu_pfmt, 0}; static int adcspeed[8] = {48000, 44100, 32000, 24000, 22050, 16000, 11025, 8000}; +/* audigy supports 12kHz. */ +static int audigy_adcspeed[9] = {48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000}; /* -------------------------------------------------------------------- */ /* Hardware */ @@ -205,7 +230,7 @@ { u_int32_t ptr, val, mask, size, offset; - ptr = ((reg << 16) & PTR_ADDRESS_MASK) | (chn & PTR_CHANNELNUM_MASK); + ptr = ((reg << 16) & sc->addrmask) | (chn & PTR_CHANNELNUM_MASK); emu_wr(sc, PTR, ptr, 4); val = emu_rd(sc, DATA, 4); if (reg & 0xff000000) { @@ -223,7 +248,7 @@ { u_int32_t ptr, mask, size, offset; - ptr = ((reg << 16) & PTR_ADDRESS_MASK) | (chn & PTR_CHANNELNUM_MASK); + ptr = ((reg << 16) & sc->addrmask) | (chn & PTR_CHANNELNUM_MASK); emu_wr(sc, PTR, ptr, 4); if (reg & 0xff000000) { size = (reg >> 24) & 0x3f; @@ -239,7 +264,8 @@ static void emu_wrefx(struct sc_info *sc, unsigned int pc, unsigned int data) { - emu_wrptr(sc, 0, MICROCODEBASE + pc, data); + pc += sc->audigy ? AUDIGY_CODEBASE : MICROCODEBASE; + emu_wrptr(sc, 0, pc, data); } /* -------------------------------------------------------------------- */ @@ -282,7 +308,7 @@ int i, tmp, rate; rate = 0; - for (i = 0; i < EMU_CHANS; i++) { + for (i = 0; i < sc->nchans; i++) { pch = &sc->pch[i]; if (pch->buffer) { tmp = (pch->spd * sndbuf_getbps(pch->buffer)) / pch->blksz; @@ -345,6 +371,16 @@ return val; } +static int +audigy_recval(int speed) { + int val; + + val = 0; + while (val < 8 && speed < audigy_adcspeed[val]) + val++; + return val; +} + static u_int32_t emu_rate_to_pitch(u_int32_t rate) { @@ -447,6 +483,20 @@ m->vol = 0xff; m->buf = tmp_addr; m->slave = s; + if (sc->audigy) { + m->fxrt1 = A_FXBUS_PCM_LEFT | A_FXBUS_PCM_RIGHT << 8 | + A_FXBUS_PCM_LEFT_REAR << 16 | + A_FXBUS_PCM_RIGHT_REAR << 24; + m->fxrt2 = A_FXBUS_PCM_CENTER | A_FXBUS_PCM_LFE << 8 | + A_FXBUS_MIDI_CHORUS << 16 | + A_FXBUS_MIDI_REVERB << 24; + } else { + m->fxrt1 = FXBUS_PCM_LEFT | FXBUS_PCM_RIGHT << 4 | + FXBUS_MIDI_CHORUS << 8 | + FXBUS_MIDI_REVERB << 12; + m->fxrt2 = 0; + } + if (s != NULL) { s->start = m->start; s->end = m->end; @@ -458,6 +508,8 @@ s->ismaster = 0; s->vol = m->vol; s->buf = m->buf; + s->fxrt1 = m->fxrt1; + s->fxrt2 = m->fxrt2; s->slave = NULL; } return 0; @@ -506,7 +558,13 @@ val *= v->b16 ? 1 : 2; start = sa + val; - emu_wrptr(sc, v->vnum, FXRT, 0xd01c0000); + if (sc->audigy) { + emu_wrptr(sc, v->vnum, A_FXRT1, v->fxrt1); + emu_wrptr(sc, v->vnum, A_FXRT2, v->fxrt2); + emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, 0); + } + else + emu_wrptr(sc, v->vnum, FXRT, v->fxrt1 << 16); emu_wrptr(sc, v->vnum, PTRX, (x << 8) | r); emu_wrptr(sc, v->vnum, DSL, ea | (y << 24)); @@ -607,6 +665,12 @@ "ip", "ifatn", "pefe", "fmmod", "tremfrq", "fmfrq2", "tempenv" }; + char *regname2[] = { + "mudata1", "mustat1", "mudata2", "mustat2", + "fxwc1", "fxwc2", "spdrate", NULL, NULL, + NULL, NULL, NULL, "fxrt2", "sndamnt", "fxrt1", + NULL, NULL + }; int i, x; printf("voice number %d\n", v->vnum); @@ -619,6 +683,19 @@ if (x > 2) x = 0; } + + /* Print out audigy extra registers */ + if (sc->audigy) { + for (i = 0; i <= 0xe; i++) { + if (regname2[i] == NULL) + continue; + printf("%s\t[%08x]", regname2[i], emu_rdptr(sc, v->vnum, i + 0x70)); + printf("%s", (x == 2)? "\n" : "\t"); + x++; + if (x > 2) + x = 0; + } + } printf("\n\n"); } #endif @@ -777,7 +854,7 @@ ch->num = sc->rnum; switch(sc->rnum) { case 0: - ch->idxreg = ADCIDX; + ch->idxreg = sc->audigy ? A_ADCIDX : ADCIDX; ch->basereg = ADCBA; ch->sizereg = ADCBS; ch->setupreg = ADCCR; @@ -826,8 +903,12 @@ { struct sc_rchinfo *ch = data; - if (ch->num == 0) - speed = adcspeed[emu_recval(speed)]; + if (ch->num == 0) { + if (ch->parent->audigy) + speed = audigy_adcspeed[audigy_recval(speed)]; + else + speed = adcspeed[emu_recval(speed)]; + } if (ch->num == 1) speed = 48000; if (ch->num == 2) @@ -891,10 +972,18 @@ ch->run = 1; emu_wrptr(sc, 0, ch->sizereg, sz); if (ch->num == 0) { - val = ADCCR_LCHANENABLE; - if (ch->fmt & AFMT_STEREO) - val |= ADCCR_RCHANENABLE; - val |= emu_recval(ch->spd); + if (sc->audigy) { + val = A_ADCCR_LCHANENABLE; + if (ch->fmt & AFMT_STEREO) + val |= A_ADCCR_RCHANENABLE; + val |= audigy_recval(ch->spd); + } else { + val = ADCCR_LCHANENABLE; + if (ch->fmt & AFMT_STEREO) + val |= ADCCR_RCHANENABLE; + val |= emu_recval(ch->spd); + } + emu_wrptr(sc, 0, ch->setupreg, 0); emu_wrptr(sc, 0, ch->setupreg, val); } @@ -976,7 +1065,7 @@ if (stat & IPR_INTERVALTIMER) { ack |= IPR_INTERVALTIMER; x = 0; - for (i = 0; i < EMU_CHANS; i++) { + for (i = 0; i < sc->nchans; i++) { if (sc->pch[i].run) { x = 1; chn_intr(sc->pch[i].channel); @@ -1155,11 +1244,174 @@ } static void +audigy_addefxop(struct sc_info *sc, int op, int z, int w, int x, int y, u_int32_t *pc) +{ + emu_wrefx(sc, (*pc) * 2, (x << 12) | y); + emu_wrefx(sc, (*pc) * 2 + 1, (op << 24) | (z << 12) | w); + (*pc)++; +} + +static void +audigy_initefx(struct sc_info *sc) +{ + int i; + u_int32_t pc = 0; + + /* skip 0, 0, -1, 0 - NOPs */ + for (i = 0; i < 512; i++) + audigy_addefxop(sc, 0x0f, 0x0c0, 0x0c0, 0x0cf, 0x0c0, &pc); + + for (i = 0; i < 512; i++) + emu_wrptr(sc, 0, A_FXGPREGBASE + i, 0x0); + + pc = 16; + + /* stop fx processor */ + emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + + /* Audigy 2 (EMU10K2) DSP Registers: + FX Bus + 0x000-0x00f : 16 registers (???) + Input + 0x040/0x041 : AC97 Codec (l/r) + 0x042/0x043 : ADC, S/PDIF (l/r) + 0x044/0x045 : Optical S/PDIF in (l/r) + 0x046/0x047 : ??? + 0x048/0x049 : Line/Mic 2 (l/r) + 0x04a/0x04b : RCA S/PDIF (l/r) + 0x04c/0x04d : Aux 2 (l/r) + Output + 0x060/0x061 : Digital Front (l/r) + 0x062/0x063 : Digital Center/LFE + 0x064/0x065 : AudigyDrive Heaphone (l/r) + 0x066/0x067 : Digital Rear (l/r) + 0x068/0x069 : Analog Front (l/r) + 0x06a/0x06b : Analog Center/LFE + 0x06c/0x06d : ??? + 0x06e/0x06f : Analog Rear (l/r) + 0x070/0x071 : AC97 Output (l/r) + 0x072/0x073 : ??? + 0x074/0x075 : ??? + 0x076/0x077 : ADC Recording Buffer (l/r) + Constants + 0x0c0 - 0x0c4 = 0 - 4 + 0x0c5 = 0x8, 0x0c6 = 0x10, 0x0c7 = 0x20 + 0x0c8 = 0x100, 0x0c9 = 0x10000, 0x0ca = 0x80000 + 0x0cb = 0x10000000, 0x0cc = 0x20000000, 0x0cd = 0x40000000 + 0x0ce = 0x80000000, 0x0cf = 0x7fffffff, 0x0d0 = 0xffffffff + 0x0d1 = 0xfffffffe, 0x0d2 = 0xc0000000, 0x0d3 = 0x41fbbcdc + 0x0d4 = 0x5a7ef9db, 0x0d5 = 0x00100000, 0x0dc = 0x00000001 (???) + Temporary Values + 0x0d6 : Accumulator (???) + 0x0d7 : Condition Register + 0x0d8 : Noise source + 0x0d9 : Noise source + Tank Memory Data Registers + 0x200 - 0x2ff + Tank Memory Address Registers + 0x300 - 0x3ff + General Purpose Registers + 0x400 - 0x5ff + */ + + /* AC97Output[l/r] = FXBus PCM[l/r] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_AC97_L), A_C_00000000, + A_C_00000000, A_FXBUS(A_FXBUS_PCM_LEFT), &pc); + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_AC97_R), A_C_00000000, + A_C_00000000, A_FXBUS(A_FXBUS_PCM_RIGHT), &pc); + + /* GPR[0/1] = RCA S/PDIF[l/r] -- Master volume */ + audigy_addefxop(sc, iACC3, A_GPR(0), A_C_00000000, + A_C_00000000, A_EXTIN(A_EXTIN_RCA_SPDIF_L), &pc); + audigy_addefxop(sc, iACC3, A_GPR(1), A_C_00000000, + A_C_00000000, A_EXTIN(A_EXTIN_RCA_SPDIF_R), &pc); + + /* GPR[2] = GPR[0] (Left) / 2 + GPR[1] (Right) / 2 -- Central volume */ + audigy_addefxop(sc, iINTERP, A_GPR(2), A_GPR(1), + A_C_40000000, A_GPR(0), &pc); + + /* Headphones[l/r] = GPR[0/1] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_HEADPHONE_L), + A_C_00000000, A_C_00000000, A_GPR(0), &pc); + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_HEADPHONE_R), + A_C_00000000, A_C_00000000, A_GPR(1), &pc); + + /* Analog Front[l/r] = GPR[0/1] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_AFRONT_L), A_C_00000000, + A_C_00000000, A_GPR(0), &pc); + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_AFRONT_R), A_C_00000000, + A_C_00000000, A_GPR(1), &pc); + + /* Digital Front[l/r] = GPR[0/1] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_FRONT_L), A_C_00000000, + A_C_00000000, A_GPR(0), &pc); + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_FRONT_R), A_C_00000000, + A_C_00000000, A_GPR(1), &pc); + + /* Center and Subwoofer configuration */ + /* Analog Center = GPR[0] + GPR[2] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_ACENTER), A_C_00000000, + A_GPR(0), A_GPR(2), &pc); + /* Analog Sub = GPR[1] + GPR[2] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_ALFE), A_C_00000000, + A_GPR(1), A_GPR(2), &pc); + + /* Digital Center = GPR[0] + GPR[2] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_CENTER), A_C_00000000, + A_GPR(0), A_GPR(2), &pc); + /* Digital Sub = GPR[1] + GPR[2] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_LFE), A_C_00000000, + A_GPR(1), A_GPR(2), &pc); + +#if 0 + /* Analog Rear[l/r] = (GPR[0/1] * RearVolume[l/r]) >> 31 */ + /* RearVolume = GPR[0x10/0x11] (Will this ever be implemented?) */ + audigy_addefxop(sc, iMAC0, A_EXTOUT(A_EXTOUT_AREAR_L), A_C_00000000, + A_GPR(16), A_GPR(0), &pc); + audigy_addefxop(sc, iMAC0, A_EXTOUT(A_EXTOUT_AREAR_R), A_C_00000000, + A_GPR(17), A_GPR(1), &pc); + + /* Digital Rear[l/r] = (GPR[0/1] * RearVolume[l/r]) >> 31 */ + /* RearVolume = GPR[0x10/0x11] (Will this ever be implemented?) */ + audigy_addefxop(sc, iMAC0, A_EXTOUT(A_EXTOUT_REAR_L), A_C_00000000, + A_GPR(16), A_GPR(0), &pc); + audigy_addefxop(sc, iMAC0, A_EXTOUT(A_EXTOUT_REAR_R), A_C_00000000, + A_GPR(17), A_GPR(1), &pc); +#else + /* XXX This is just a copy to the channel, since we do not have + * a patch manager, it is useful for have another output enabled. + */ + + /* Analog Rear[l/r] = GPR[0/1] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_AREAR_L), A_C_00000000, + A_C_00000000, A_GPR(0), &pc); + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_AREAR_R), A_C_00000000, + A_C_00000000, A_GPR(1), &pc); + + /* Digital Rear[l/r] = GPR[0/1] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_REAR_L), A_C_00000000, + A_C_00000000, A_GPR(0), &pc); + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_REAR_R), A_C_00000000, + A_C_00000000, A_GPR(1), &pc); +#endif + + /* ADC Recording buffer[l/r] = AC97Input[l/r] */ + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_ADC_CAP_L), A_C_00000000, + A_C_00000000, A_EXTIN(A_EXTIN_AC97_L), &pc); + audigy_addefxop(sc, iACC3, A_EXTOUT(A_EXTOUT_ADC_CAP_R), A_C_00000000, + A_C_00000000, A_EXTIN(A_EXTIN_AC97_R), &pc); + + /* resume normal operations */ + emu_wrptr(sc, 0, A_DBG, 0); +} + +static void emu_initefx(struct sc_info *sc) { int i; u_int32_t pc = 16; + /* acc3 0,0,0,0 - NOPs */ for (i = 0; i < 512; i++) { emu_wrefx(sc, i * 2, 0x10040); emu_wrefx(sc, i * 2 + 1, 0x610040); @@ -1175,24 +1427,34 @@ 0x010/0x011 : AC97 Codec (l/r) 0x012/0x013 : ADC, S/PDIF (l/r) 0x014/0x015 : Mic(left), Zoom (l/r) - 0x016/0x017 : APS S/PDIF?? (l/r) + 0x016/0x017 : TOS link in (l/r) + 0x018/0x019 : Line/Mic 1 (l/r) + 0x01a/0x01b : COAX S/PDIF (l/r) + 0x01c/0x01d : Line/Mic 2 (l/r) Output 0x020/0x021 : AC97 Output (l/r) 0x022/0x023 : TOS link out (l/r) - 0x024/0x025 : ??? (l/r) + 0x024/0x025 : Center/LFE 0x026/0x027 : LiveDrive Headphone (l/r) 0x028/0x029 : Rear Channel (l/r) 0x02a/0x02b : ADC Recording Buffer (l/r) + 0x02c : Mic Recording Buffer + 0x031/0x032 : Analog Center/LFE Constants 0x040 - 0x044 = 0 - 4 0x045 = 0x8, 0x046 = 0x10, 0x047 = 0x20 0x048 = 0x100, 0x049 = 0x10000, 0x04a = 0x80000 0x04b = 0x10000000, 0x04c = 0x20000000, 0x04d = 0x40000000 - 0x04e = 0x80000000, 0x04f = 0x7fffffff + 0x04e = 0x80000000, 0x04f = 0x7fffffff, 0x050 = 0xffffffff + 0x051 = 0xfffffffe, 0x052 = 0xc0000000, 0x053 = 0x41fbbcdc + 0x054 = 0x5a7ef9db, 0x055 = 0x00100000 Temporary Values 0x056 : Accumulator - 0x058 : Noise source? - 0x059 : Noise source? + 0x057 : Condition Register + 0x058 : Noise source + 0x059 : Noise source + 0x05a : IRQ Register + 0x05b : TRAM Delay Base Address Count General Purpose Registers 0x100 - 0x1ff Tank Memory Data Registers @@ -1201,40 +1463,81 @@ 0x300 - 0x3ff */ - /* Operators: - 0 : z := w + (x * y >> 31) - 4 : z := w + x * y - 6 : z := w + x + y - */ - /* Routing - this will be configurable in later version */ /* GPR[0/1] = FX * 4 + SPDIF-in */ - emu_addefxop(sc, 4, 0x100, 0x12, 0, 0x44, &pc); - emu_addefxop(sc, 4, 0x101, 0x13, 1, 0x44, &pc); + emu_addefxop(sc, iMACINT0, GPR(0), EXTIN(EXTIN_SPDIF_CD_L), + FXBUS(FXBUS_PCM_LEFT), C_00000004, &pc); + emu_addefxop(sc, iMACINT0, GPR(1), EXTIN(EXTIN_SPDIF_CD_R), + FXBUS(FXBUS_PCM_RIGHT), C_00000004, &pc); + /* GPR[0/1] += APS-input */ - emu_addefxop(sc, 6, 0x100, 0x100, 0x40, sc->APS ? 0x16 : 0x40, &pc); - emu_addefxop(sc, 6, 0x101, 0x101, 0x40, sc->APS ? 0x17 : 0x40, &pc); + emu_addefxop(sc, iACC3, GPR(0), GPR(0), C_00000000, + sc->APS ? EXTIN(EXTIN_TOSLINK_L) : C_00000000, &pc); + emu_addefxop(sc, iACC3, GPR(1), GPR(1), C_00000000, + sc->APS ? EXTIN(EXTIN_TOSLINK_R) : C_00000000, &pc); + /* FrontOut (AC97) = GPR[0/1] */ - emu_addefxop(sc, 6, 0x20, 0x40, 0x40, 0x100, &pc); - emu_addefxop(sc, 6, 0x21, 0x40, 0x41, 0x101, &pc); + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_AC97_L), C_00000000, + C_00000000, GPR(0), &pc); + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_AC97_R), C_00000000, + C_00000001, GPR(1), &pc); + + /* GPR[2] = GPR[0] (Left) / 2 + GPR[1] (Right) / 2 -- Central volume */ + emu_addefxop(sc, iINTERP, GPR(2), GPR(1), C_40000000, GPR(0), &pc); + +#if 0 /* RearOut = (GPR[0/1] * RearVolume) >> 31 */ - /* RearVolume = GRP[0x10/0x11] */ - emu_addefxop(sc, 0, 0x28, 0x40, 0x110, 0x100, &pc); - emu_addefxop(sc, 0, 0x29, 0x40, 0x111, 0x101, &pc); - /* TOS out = GPR[0/1] */ - emu_addefxop(sc, 6, 0x22, 0x40, 0x40, 0x100, &pc); - emu_addefxop(sc, 6, 0x23, 0x40, 0x40, 0x101, &pc); - /* Mute Out2 */ - emu_addefxop(sc, 6, 0x24, 0x40, 0x40, 0x40, &pc); - emu_addefxop(sc, 6, 0x25, 0x40, 0x40, 0x40, &pc); - /* Mute Out3 */ - emu_addefxop(sc, 6, 0x26, 0x40, 0x40, 0x40, &pc); - emu_addefxop(sc, 6, 0x27, 0x40, 0x40, 0x40, &pc); - /* Input0 (AC97) -> Record */ - emu_addefxop(sc, 6, 0x2a, 0x40, 0x40, 0x10, &pc); - emu_addefxop(sc, 6, 0x2b, 0x40, 0x40, 0x11, &pc); + /* RearVolume = GPR[0x10/0x11] */ + emu_addefxop(sc, iMAC0, EXTOUT(EXTOUT_REAR_L), C_00000000, + GPR(16), GPR(0), &pc); + emu_addefxop(sc, iMAC0, EXTOUT(EXTOUT_REAR_R), C_00000000, + GPR(17), GPR(1), &pc); +#else + /* XXX This is just a copy to the channel, since we do not have + * a patch manager, it is useful for have another output enabled. + */ + + /* Rear[l/r] = GPR[0/1] */ + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_REAR_L), C_00000000, + C_00000000, GPR(0), &pc); + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_REAR_R), C_00000000, + C_00000000, GPR(1), &pc); +#endif + /* TOS out[l/r] = GPR[0/1] */ + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_TOSLINK_L), C_00000000, + C_00000000, GPR(0), &pc); + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_TOSLINK_R), C_00000000, + C_00000000, GPR(1), &pc); + + /* Center and Subwoofer configuration */ + /* Analog Center = GPR[0] + GPR[2] */ + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_ACENTER), C_00000000, + GPR(0), GPR(2), &pc); + /* Analog Sub = GPR[1] + GPR[2] */ + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_ALFE), C_00000000, + GPR(1), GPR(2), &pc); + /* Digital Center = GPR[0] + GPR[2] */ + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_CENTER), C_00000000, + GPR(0), GPR(2), &pc); + /* Digital Sub = GPR[1] + GPR[2] */ + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_LFE), C_00000000, + GPR(1), GPR(2), &pc); + + /* Headphones[l/r] = GPR[0/1] */ + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_HEADPHONE_L), C_00000000, + C_00000000, GPR(0), &pc); + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_HEADPHONE_R), C_00000000, + C_00000000, GPR(1), &pc); + + /* ADC Recording buffer[l/r] = AC97Input[l/r] */ + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_ADC_CAP_L), C_00000000, + C_00000000, EXTIN(EXTIN_AC97_L), &pc); + emu_addefxop(sc, iACC3, EXTOUT(EXTOUT_ADC_CAP_R), C_00000000, + C_00000000, EXTIN(EXTIN_AC97_R), &pc); + + /* resume normal operations */ emu_wrptr(sc, 0, DBG, 0); } @@ -1244,6 +1547,9 @@ { u_int32_t spcs, ch, tmp, i; + /* enable additional AC97 slots */ + emu_wrptr(sc, 0, AC97SLOT, AC97SLOT_CNTR | AC97SLOT_LFE); + /* disable audio and lock cache */ emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, 4); @@ -1262,6 +1568,12 @@ emu_wrptr(sc, 0, SOLEL, 0); emu_wrptr(sc, 0, SOLEH, 0); + /* wonder what these do... */ + if (sc->audigy) { + emu_wrptr(sc, 0, SPBYPASS, 0xf00); + emu_wrptr(sc, 0, AC97SLOT, 0x3); + } + /* init envelope engine */ for (ch = 0; ch < NUM_G; ch++) { emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); @@ -1295,6 +1607,18 @@ emu_wrptr(sc, ch, ENVVOL, 0); emu_wrptr(sc, ch, ENVVAL, 0); + if (sc->audigy) { + /* audigy cards need this to initialize correctly */ + emu_wrptr(sc, ch, 0x4c, 0); + emu_wrptr(sc, ch, 0x4d, 0); + emu_wrptr(sc, ch, 0x4e, 0); + emu_wrptr(sc, ch, 0x4f, 0); + /* set default routing */ + emu_wrptr(sc, ch, A_FXRT1, 0x03020100); + emu_wrptr(sc, ch, A_FXRT2, 0x3f3f3f3f); + emu_wrptr(sc, ch, A_SENDAMOUNTS, 0); + } + sc->voice[ch].vnum = ch; sc->voice[ch].slave = NULL; sc->voice[ch].busy = 0; @@ -1331,7 +1655,26 @@ emu_wrptr(sc, 0, SPCS1, spcs); emu_wrptr(sc, 0, SPCS2, spcs); - emu_initefx(sc); + if (!sc->audigy) + emu_initefx(sc); + else if (sc->audigy2) { /* Audigy 2 */ + /* from ALSA initialization code: */ + + /* Hack for Alice3 to work independent of haP16V driver */ + u_int32_t tmp; + + /* Setup SRCMulti_I2S SamplingRate */ + tmp = emu_rdptr(sc, 0, A_SPDIF_SAMPLERATE) & 0xfffff1ff; + emu_wrptr(sc, 0, A_SPDIF_SAMPLERATE, tmp | 0x400); + + /* Setup SRCSel (Enable SPDIF, I2S SRCMulti) */ + emu_wr(sc, 0x20, 0x00600000, 4); + emu_wr(sc, 0x24, 0x00000014, 4); + + /* Setup SRCMulti Input Audio Enable */ + emu_wr(sc, 0x20, 0x006e0000, 4); + emu_wr(sc, 0x24, 0xff00ff00, 4); + } SLIST_INIT(&sc->mem.blocks); sc->mem.ptb_pages = emu_malloc(sc, MAXPAGES * sizeof(u_int32_t), &sc->mem.ptb_pages_addr); @@ -1361,26 +1704,69 @@ /* emu_memalloc(sc, EMUPAGESIZE); */ /* * Hokay, now enable the AUD bit + * + * Audigy + * Enable Audio = 0 (enabled after fx processor initialization) + * Mute Disable Audio = 0 + * Joystick = 1 + * + * Audigy 2 + * Enable Audio = 1 + * Mute Disable Audio = 0 + * Joystick = 1 + * GP S/PDIF AC3 Enable = 1 + * CD S/PDIF AC3 Enable = 1 + * + * EMU10K1 * Enable Audio = 1 * Mute Disable Audio = 0 * Lock Tank Memory = 1 * Lock Sound Memory = 0 * Auto Mute = 1 */ - tmp = HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE; - if (sc->rev >= 6) - tmp |= HCFG_JOYENABLE; - emu_wr(sc, HCFG, tmp, 4); - - /* TOSLink detection */ - sc->tos_link = 0; - tmp = emu_rd(sc, HCFG, 4); - if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) { - emu_wr(sc, HCFG, tmp | 0x800, 4); - DELAY(50); - if (tmp != (emu_rd(sc, HCFG, 4) & ~0x800)) { - sc->tos_link = 1; - emu_wr(sc, HCFG, tmp, 4); + + if (sc->audigy) { + tmp = HCFG_AUTOMUTE | HCFG_JOYENABLE; + if (sc->audigy2) /* Audigy 2 */ + tmp = HCFG_AUDIOENABLE | HCFG_AC3ENABLE_CDSPDIF | + HCFG_AC3ENABLE_GPSPDIF; + emu_wr(sc, HCFG, tmp, 4); + + audigy_initefx(sc); + + /* from ALSA initialization code: */ + + /* enable audio and disable both audio/digital outputs */ + emu_wr(sc, HCFG, emu_rd(sc, HCFG, 4) | HCFG_AUDIOENABLE, 4); + emu_wr(sc, A_IOCFG, emu_rd(sc, A_IOCFG, 4) & ~A_IOCFG_GPOUT_AD, + 4); + if (sc->audigy2) { /* Audigy 2 */ + /* Unmute Analog. + * Set GPO6 to 1 for Apollo. This has to be done after + * init Alice3 I2SOut beyond 48kHz. + * So, sequence is important. + */ + emu_wr(sc, A_IOCFG, + emu_rd(sc, A_IOCFG, 4) | A_IOCFG_GPOUT_A, 4); + } + } else { + /* EMU10K1 initialization code */ + tmp = HCFG_AUDIOENABLE | HCFG_AUTOMUTE | HCFG_LOCKTANKCACHE; + if (sc->rev >= 6) + tmp |= HCFG_JOYENABLE; + + emu_wr(sc, HCFG, tmp, 4); + + /* TOSLink detection */ + sc->tos_link = 0; + tmp = emu_rd(sc, HCFG, 4); + if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) { + emu_wr(sc, HCFG, tmp | HCFG_GPOUT1, 4); + DELAY(50); + if (tmp != (emu_rd(sc, HCFG, 4) & ~HCFG_GPOUT1)) { + sc->tos_link = 1; + emu_wr(sc, HCFG, tmp, 4); + } } } @@ -1402,6 +1788,10 @@ emu_wrptr(sc, ch, CPF, 0); } + if (sc->audigy) { /* stop fx processor */ + emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + } + /* disable audio and lock cache */ emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, 4); @@ -1441,11 +1831,14 @@ case EMU10K1_PCI_ID: s = "Creative EMU10K1"; break; -/* + case EMU10K2_PCI_ID: - s = "Creative EMU10K2"; + if (pci_get_revid(dev) == 0x04) + s = "Creative Audigy 2 (EMU10K2)"; + else + s = "Creative Audigy (EMU10K2)"; break; -*/ + default: return ENXIO; } @@ -1472,6 +1865,10 @@ sc->dev = dev; sc->type = pci_get_devid(dev); sc->rev = pci_get_revid(dev); + sc->audigy = (sc->type == EMU10K2_PCI_ID); + sc->audigy2 = (sc->audigy && sc->rev == 0x04); + sc->nchans = sc->audigy ? 8 : 4; + sc->addrmask = sc->audigy ? A_PTR_ADDRESS_MASK : PTR_ADDRESS_MASK; data = pci_read_config(dev, PCIR_COMMAND, 2); data |= (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN); @@ -1518,8 +1915,8 @@ snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(sc->reg), rman_get_start(sc->irq)); - if (pcm_register(dev, sc, EMU_CHANS, gotmic ? 3 : 2)) goto bad; - for (i = 0; i < EMU_CHANS; i++) + if (pcm_register(dev, sc, sc->nchans, gotmic ? 3 : 2)) goto bad; + for (i = 0; i < sc->nchans; i++) pcm_addchan(dev, PCMDIR_PLAY, &emupchan_class, sc); for (i = 0; i < (gotmic ? 3 : 2); i++) pcm_addchan(dev, PCMDIR_REC, &emurchan_class, sc); Index: sys/gnu/dev/sound/pci/emu10k1.h =================================================================== RCS file: /home/ncvs/src/sys/gnu/dev/sound/pci/emu10k1.h,v retrieving revision 1.6 diff -u -r1.6 emu10k1.h --- sys/gnu/dev/sound/pci/emu10k1.h 18 Apr 2003 04:13:38 -0000 1.6 +++ sys/gnu/dev/sound/pci/emu10k1.h 20 Apr 2003 07:20:37 -0000 @@ -1,7 +1,7 @@ /* ********************************************************************** * emu10k1.h, derived from 8010.h - * Copyright 1999, 2000 Creative Labs, Inc. + * Copyright 1999-2001 Creative Labs, Inc. * ********************************************************************** * @@ -11,6 +11,8 @@ * November 2, 1999 Alan Cox Cleaned of 8bit chars, DOS * line endings * December 8, 1999 Jon Taylor Added lots of new register info + * May 16, 2001 Daniel Bertrand Added unofficial DBG register info + * Oct-Nov 2001 D.B. Added unofficial Audigy registers * ********************************************************************** * @@ -38,21 +40,14 @@ #ifndef EMU10K1_H #define EMU10K1_H -/* ------------------- DEFINES -------------------- */ +/* +// Driver version: +#define MAJOR_VER 0 +#define MINOR_VER 20 +#define DRIVER_VERSION "0.20a" +*/ -#define EMUPAGESIZE 4096 /* don't change */ -#define MAXREQVOICES 8 -#define MAXPAGES (32768 * 64 / EMUPAGESIZE) /* WAVEOUT_MAXBUFSIZE * NUM_G / EMUPAGESIZE */ -#define RESERVED 0 -#define NUM_MIDI 16 -#define NUM_G 64 /* use all channels */ -#define NUM_FXSENDS 4 - - -#define TMEMSIZE 256*1024 -#define TMEMSIZEREG 4 - -#define IP_TO_CP(ip) ((ip == 0) ? 0 : (((0x00001000uL | (ip & 0x00000FFFL)) << (((ip >> 12) & 0x000FL) + 4)) & 0xFFFF0000uL)) +/* Audigy specify registers are prefixed with 'A_' */ /************************************************************************************************/ /* PCI function 0 registers, address = + PCIBASE0 */ @@ -72,6 +67,11 @@ #define IPR 0x08 /* Global interrupt pending register */ /* Clear pending interrupts by writing a 1 to */ /* the relevant bits and zero to the other bits */ + +/* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */ +#define A_IPR_MIDITRANSBUFEMPTY2 0x10000000 /* MIDI UART transmit buffer empty */ +#define A_IPR_MIDIRECVBUFEMPTY2 0x08000000 /* MIDI UART receive buffer empty */ + #define IPR_SAMPLERATETRACKER 0x01000000 /* Sample rate tracker lock status change */ #define IPR_FXDSP 0x00800000 /* Enable FX DSP interrupts */ #define IPR_FORCEINT 0x00400000 /* Force Sound Blaster interrupt */ @@ -96,6 +96,10 @@ /* IP is written with CL set, the bit in CLIPL */ /* or CLIPH corresponding to the CIN value */ /* written will be cleared. */ +#define A_IPR_MIDITRANSBUFEMPTY1 IPR_MIDITRANSBUFEMPTY /* MIDI UART transmit buffer empty */ +#define A_IPR_MIDIRECVBUFEMPTY1 IPR_MIDIRECVBUFEMPTY /* MIDI UART receive buffer empty */ + + #define INTE 0x0c /* Interrupt enable register */ #define INTE_VIRTUALSB_MASK 0xc0000000 /* Virtual Soundblaster I/O port capture */ @@ -123,6 +127,11 @@ /* behavior and possibly random segfaults and */ /* lockups if enabled. */ +/* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */ +#define A_INTE_MIDITXENABLE2 0x00020000 /* Enable MIDI transmit-buffer-empty interrupts */ +#define A_INTE_MIDIRXENABLE2 0x00010000 /* Enable MIDI receive-buffer-empty interrupts */ + + #define INTE_SAMPLERATETRACKER 0x00002000 /* Enable sample rate tracker interrupts */ /* NOTE: This bit must always be enabled */ #define INTE_FXDSPENABLE 0x00001000 /* Enable FX DSP interrupts */ @@ -139,6 +148,10 @@ #define INTE_MIDITXENABLE 0x00000002 /* Enable MIDI transmit-buffer-empty interrupts */ #define INTE_MIDIRXENABLE 0x00000001 /* Enable MIDI receive-buffer-empty interrupts */ +/* The next two interrupts are for the midi port on the Audigy (A_MPU2) */ +#define A_INTE_MIDITXENABLE1 INTE_MIDITXENABLE +#define A_INTE_MIDIRXENABLE1 INTE_MIDIRXENABLE + #define WC 0x10 /* Wall Clock register */ #define WC_SAMPLECOUNTER_MASK 0x03FFFFC0 /* Sample periods elapsed since reset */ #define WC_SAMPLECOUNTER 0x14060010 @@ -170,7 +183,12 @@ #define HCFG_CODECFORMAT_I2S 0x00010000 /* I2S CODEC format -- Secondary (Rear) Output */ #define HCFG_GPINPUT0 0x00004000 /* External pin112 */ #define HCFG_GPINPUT1 0x00002000 /* External pin110 */ + #define HCFG_GPOUTPUT_MASK 0x00001c00 /* External pins which may be controlled */ +#define HCFG_GPOUT0 0x00001000 /* set to enable digital out on 5.1 cards */ +#define HCFG_GPOUT1 0x00000800 /* External pin? (IR) */ +#define HCFG_GPOUT2 0x00000400 /* External pin? (IR) */ + #define HCFG_JOYENABLE 0x00000200 /* Internal joystick enable */ #define HCFG_PHASETRACKENABLE 0x00000100 /* Phase tracking enable */ /* 1 = Force all 3 async digital inputs to use */ @@ -178,6 +196,7 @@ #define HCFG_AC3ENABLE_MASK 0x0x0000e0 /* AC3 async input control - Not implemented */ #define HCFG_AC3ENABLE_ZVIDEO 0x00000080 /* Channels 0 and 1 replace ZVIDEO */ #define HCFG_AC3ENABLE_CDSPDIF 0x00000040 /* Channels 0 and 1 replace CDSPDIF */ +#define HCFG_AC3ENABLE_GPSPDIF 0x00000020 /* Channels 0 and 1 replace GPSPDIF */ #define HCFG_AUTOMUTE 0x00000010 /* When set, the async sample rate convertors */ /* will automatically mute their output when */ /* they are not rate-locked to the external */ @@ -186,6 +205,7 @@ /* NOTE: This should generally never be used. */ #define HCFG_LOCKTANKCACHE_MASK 0x00000004 /* 1 = Cancel bustmaster accesses to tankcache */ /* NOTE: This should generally never be used. */ +#define HCFG_LOCKTANKCACHE 0x01020014 #define HCFG_MUTEBUTTONENABLE 0x00000002 /* 1 = Master mute button sets AUDIOENABLE = 0. */ /* NOTE: This is a 'cheap' way to implement a */ /* master mute function on the mute button, and */ @@ -196,6 +216,8 @@ /* Should be set to 1 when the EMU10K1 is */ /* completely initialized. */ +/*For Audigy, MPU port move to 0x70-0x74 ptr register */ + #define MUDATA 0x18 /* MPU401 data register (8 bits) */ #define MUCMD 0x19 /* MPU401 command register (8 bits) */ @@ -207,11 +229,16 @@ #define MUSTAT_IRDYN 0x80 /* 0 = MIDI data or command ACK */ #define MUSTAT_ORDYN 0x40 /* 0 = MUDATA can accept a command or data */ -#define TIMER 0x1a /* Timer terminal count register */ +#define A_IOCFG 0x18 /* GPIO on Audigy card (16bits) */ +#define A_GPINPUT_MASK 0xff00 +#define A_GPOUTPUT_MASK 0x00ff +#define A_IOCFG_GPOUT0 0x0044 /* ? */ + +#define TIMER 0x1a /* Timer terminal count register (16-bit) */ /* NOTE: After the rate is changed, a maximum */ /* of 1024 sample periods should be allowed */ /* before the new rate is guaranteed accurate. */ -#define TIMER_RATE_MASK 0x000003ff /* Timer interrupt rate in sample periods */ +#define TIMER_RATE_MASK 0x03ff /* Timer interrupt rate in sample periods */ /* 0 == 1024 periods, [1..4] are not useful */ #define TIMER_RATE 0x0a00001a @@ -221,54 +248,6 @@ #define AC97ADDRESS_READY 0x80 /* Read-only bit, reflects CODEC READY signal */ #define AC97ADDRESS_ADDRESS 0x7f /* Address of indexed AC97 register */ -/************************************************************************************************/ -/* PCI function 1 registers, address = + PCIBASE1 */ -/************************************************************************************************/ - -#define JOYSTICK1 0x00 /* Analog joystick port register */ -#define JOYSTICK2 0x01 /* Analog joystick port register */ -#define JOYSTICK3 0x02 /* Analog joystick port register */ -#define JOYSTICK4 0x03 /* Analog joystick port register */ -#define JOYSTICK5 0x04 /* Analog joystick port register */ -#define JOYSTICK6 0x05 /* Analog joystick port register */ -#define JOYSTICK7 0x06 /* Analog joystick port register */ -#define JOYSTICK8 0x07 /* Analog joystick port register */ - -/* When writing, any write causes JOYSTICK_COMPARATOR output enable to be pulsed on write. */ -/* When reading, use these bitfields: */ -#define JOYSTICK_BUTTONS 0x0f /* Joystick button data */ -#define JOYSTICK_COMPARATOR 0xf0 /* Joystick comparator data */ - - -/********************************************************************************************************/ -/* AC97 pointer-offset register set, accessed through the AC97ADDRESS and AC97DATA registers */ -/********************************************************************************************************/ - -#define AC97_RESET 0x00 -#define AC97_MASTERVOLUME 0x02 /* Master volume */ -#define AC97_HEADPHONEVOLUME 0x04 /* Headphone volume */ -#define AC97_MASTERVOLUMEMONO 0x06 /* Mast volume mono */ -#define AC97_MASTERTONE 0x08 -#define AC97_PCBEEPVOLUME 0x0a /* PC speaker system beep volume */ -#define AC97_PHONEVOLUME 0x0c -#define AC97_MICVOLUME 0x0e -#define AC97_LINEINVOLUME 0x10 -#define AC97_CDVOLUME 0x12 -#define AC97_VIDEOVOLUME 0x14 -#define AC97_AUXVOLUME 0x16 -#define AC97_PCMOUTVOLUME 0x18 -#define AC97_RECORDSELECT 0x1a -#define AC97_RECORDGAIN 0x1c -#define AC97_RECORDGAINMIC 0x1e -#define AC97_GENERALPURPOSE 0x20 -#define AC97_3DCONTROL 0x22 -#define AC97_MODEMRATE 0x24 -#define AC97_POWERDOWN 0x26 -#define AC97_VENDORID1 0x7c -#define AC97_VENDORID2 0x7e -#define AC97_ZVIDEOVOLUME 0xec -#define AC97_AC3VOLUME 0xed - /********************************************************************************************************/ /* Emu10k1 pointer-offset register set, accessed through the PTR and DATA registers */ /********************************************************************************************************/ @@ -444,6 +423,8 @@ #define TREMFRQ 0x1c /* Tremolo amount and modulation LFO frequency register */ #define TREMFRQ_DEPTH 0x0000ff00 /* Tremolo depth */ /* Signed 2's complement, with +/- 12dB extremes */ +#define TREMFRQ_FREQUENCY 0x000000ff /* Tremolo LFO frequency */ + /* ??Hz steps, maximum of ?? Hz. */ #define FM2FRQ2 0x1d /* Vibrato amount and vibrato LFO frequency register */ #define FM2FRQ2_DEPTH 0x0000ff00 /* Vibrato LFO vibrato depth */ @@ -484,7 +465,12 @@ #define ADCCR_LCHANENABLE 0x00000008 /* Enables left channel for writing to the host */ /* NOTE: To guarantee phase coherency, both channels */ /* must be disabled prior to enabling both channels. */ +#define A_ADCCR_RCHANENABLE 0x00000020 +#define A_ADCCR_LCHANENABLE 0x00000010 + +#define A_ADCCR_SAMPLERATE_MASK 0x0000000F /* Audigy sample rate convertor output rate */ #define ADCCR_SAMPLERATE_MASK 0x00000007 /* Sample rate convertor output rate */ + #define ADCCR_SAMPLERATE_48 0x00000000 /* 48kHz sample rate */ #define ADCCR_SAMPLERATE_44 0x00000001 /* 44.1kHz sample rate */ #define ADCCR_SAMPLERATE_32 0x00000002 /* 32kHz sample rate */ @@ -494,10 +480,16 @@ #define ADCCR_SAMPLERATE_11 0x00000006 /* 11.025kHz sample rate */ #define ADCCR_SAMPLERATE_8 0x00000007 /* 8kHz sample rate */ +#define A_ADCCR_SAMPLERATE_12 0x00000006 /* 12kHz sample rate */ +#define A_ADCCR_SAMPLERATE_11 0x00000007 /* 11.025kHz sample rate */ +#define A_ADCCR_SAMPLERATE_8 0x00000008 /* 8kHz sample rate */ + #define FXWC 0x43 /* FX output write channels register */ /* When set, each bit enables the writing of the */ - /* corresponding FX output channel into host memory */ - + /* corresponding FX output channel (internal registers */ + /* 0x20-0x3f) into host memory. This mode of recording */ + /* is 16bit, 48KHz only. All 32 channels can be enabled */ + /* simultaneously. */ #define TCBS 0x44 /* Tank cache buffer size register */ #define TCBS_MASK 0x00000007 /* Tank cache buffer size field */ #define TCBS_BUFFSIZE_16K 0x00000000 @@ -565,8 +557,25 @@ #define DBG 0x52 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ +/* definitions for debug register - taken from the alsa drivers */ +#define DBG_ZC 0x80000000 /* zero tram counter */ +#define DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ +#define DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */ +#define DBG_SINGLE_STEP 0x00008000 /* single step mode */ +#define DBG_STEP 0x00004000 /* start single step */ +#define DBG_CONDITION_CODE 0x00003e00 /* condition code */ +#define DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ + + #define REG53 0x53 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ +#define A_DBG 0x53 +#define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */ +#define A_DBG_ZC 0x40000000 /* zero tram counter */ +#define A_DBG_STEP_ADDR 0x000003ff +#define A_DBG_SATURATION_OCCURED 0x20000000 +#define A_DBG_SATURATION_ADDR 0x0ffc0000 + #define SPCS0 0x54 /* SPDIF output Channel Status 0 register */ #define SPCS1 0x55 /* SPDIF output Channel Status 1 register */ @@ -613,6 +622,10 @@ #define SPBYPASS 0x5e /* SPDIF BYPASS mode register */ #define SPBYPASS_ENABLE 0x00000001 /* Enable SPDIF bypass mode */ +#define AC97SLOT 0x5f /* additional AC97 slots enable bits */ +#define AC97SLOT_CNTR 0x10 /* Center enable */ +#define AC97SLOT_LFE 0x20 /* LFE enable */ + #define CDSRCS 0x60 /* CD-ROM Sample Rate Converter status register */ #define GPSRCS 0x61 /* General Purpose SPDIF sample rate cvt status */ @@ -626,10 +639,19 @@ #define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */ #define SRCS_ESTSAMPLERATE 0x0007ffff /* Do not modify this field. */ + +/* Note that these values can vary +/- by a small amount */ +#define SRCS_SPDIFRATE_44 0x0003acd9 +#define SRCS_SPDIFRATE_48 0x00040000 +#define SRCS_SPDIFRATE_96 0x00080000 + #define MICIDX 0x63 /* Microphone recording buffer index register */ #define MICIDX_MASK 0x0000ffff /* 16-bit value */ #define MICIDX_IDX 0x10000063 +#define A_ADCIDX 0x63 +#define A_ADCIDX_IDX 0x10000063 + #define ADCIDX 0x64 /* ADC recording buffer index register */ #define ADCIDX_MASK 0x0000ffff /* 16 bit index field */ #define ADCIDX_IDX 0x10000064 @@ -638,9 +660,50 @@ #define FXIDX_MASK 0x0000ffff /* 16-bit value */ #define FXIDX_IDX 0x10000065 +/* This is the MPU port on the card (via the game port) */ +#define A_MUDATA1 0x70 +#define A_MUCMD1 0x71 +#define A_MUSTAT1 A_MUCMD1 + +/* This is the MPU port on the Audigy Drive */ +#define A_MUDATA2 0x72 +#define A_MUCMD2 0x73 +#define A_MUSTAT2 A_MUCMD2 + +/* The next two are the Audigy equivalent of FXWC */ +/* the Audigy can record any output (16bit, 48kHz, up to 64 channel simultaneously) */ +/* Each bit selects a channel for recording */ +#define A_FXWC1 0x74 /* Selects 0x7f-0x60 for FX recording */ +#define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */ + +#define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ +#define A_SPDIF_48000 0x00000080 +#define A_SPDIF_44100 0x00000000 +#define A_SPDIF_96000 0x00000040 + +#define A_FXRT2 0x7c +#define A_FXRT_CHANNELE 0x0000003f /* Effects send bus number for channel's effects send E */ +#define A_FXRT_CHANNELF 0x00003f00 /* Effects send bus number for channel's effects send F */ +#define A_FXRT_CHANNELG 0x003f0000 /* Effects send bus number for channel's effects send G */ +#define A_FXRT_CHANNELH 0x3f000000 /* Effects send bus number for channel's effects send H */ + +#define A_SENDAMOUNTS 0x7d +#define A_FXSENDAMOUNT_E_MASK 0xff000000 +#define A_FXSENDAMOUNT_F_MASK 0x00ff0000 +#define A_FXSENDAMOUNT_G_MASK 0x0000ff00 +#define A_FXSENDAMOUNT_H_MASK 0x000000ff + +/* The send amounts for this one are the same as used with the emu10k1 */ +#define A_FXRT1 0x7e +#define A_FXRT_CHANNELA 0x0000003f +#define A_FXRT_CHANNELB 0x00003f00 +#define A_FXRT_CHANNELC 0x003f0000 +#define A_FXRT_CHANNELD 0x3f000000 + + /* Each FX general purpose register is 32 bits in length, all bits are used */ #define FXGPREGBASE 0x100 /* FX general purpose registers base */ - +#define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */ /* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */ /* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */ /* locations are for external TRAM. */ @@ -665,10 +728,13 @@ #define HIWORD_RESULT_MASK 0x000ffc00 /* Instruction result */ #define HIWORD_OPA_MASK 0x000003ff /* Instruction operand A */ -#define ENABLE 0xffffffff -#define DISABLE 0x00000000 -#define ENV_ON 0x80 -#define ENV_OFF 0x00 +/* Audigy Soundcard have a different instruction format */ +#define AUDIGY_CODEBASE 0x600 +#define A_LOWORD_OPY_MASK 0x000007ff +#define A_LOWORD_OPX_MASK 0x007ff000 +#define A_HIWORD_OPCODE_MASK 0x0f000000 +#define A_HIWORD_RESULT_MASK 0x007ff000 +#define A_HIWORD_OPA_MASK 0x000007ff #endif /* EMU10K1_H */ Index: sys/gnu/dev/sound/pci/emu10k1-ac97.h =================================================================== RCS file: sys/gnu/dev/sound/pci/emu10k1-ac97.h diff -N sys/gnu/dev/sound/pci/emu10k1-ac97.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/gnu/dev/sound/pci/emu10k1-ac97.h 18 Apr 2003 14:08:06 -0000 @@ -0,0 +1,191 @@ +#ifndef _EMU10K1_AC97_H_ +#define _EMU10K1_AC97_H_ + +/*********************************************/ +/* emu10k1-ac97.h, derived from ac97_codec.h */ +/*********************************************/ + +/********************************************************************************************************/ +/* AC97 pointer-offset register set, accessed through the AC97ADDRESS and AC97DATA registers */ +/********************************************************************************************************/ + + + +/* AC97 1.0 */ +#define AC97_RESET 0x0000 /* */ +#define AC97_MASTER_VOL_STEREO 0x0002 /* Line Out */ +#define AC97_HEADPHONE_VOL 0x0004 /* */ +#define AC97_MASTER_VOL_MONO 0x0006 /* TAD Output */ +#define AC97_MASTER_TONE 0x0008 /* */ +#define AC97_PCBEEP_VOL 0x000a /* none */ +#define AC97_PHONE_VOL 0x000c /* TAD Input (mono) */ +#define AC97_MIC_VOL 0x000e /* MIC Input (mono) */ +#define AC97_LINEIN_VOL 0x0010 /* Line Input (stereo) */ +#define AC97_CD_VOL 0x0012 /* CD Input (stereo) */ +#define AC97_VIDEO_VOL 0x0014 /* none */ +#define AC97_AUX_VOL 0x0016 /* Aux Input (stereo) */ +#define AC97_PCMOUT_VOL 0x0018 /* Wave Output (stereo) */ +#define AC97_RECORD_SELECT 0x001a /* */ +#define AC97_RECORD_GAIN 0x001c +#define AC97_RECORD_GAIN_MIC 0x001e +#define AC97_GENERAL_PURPOSE 0x0020 +#define AC97_3D_CONTROL 0x0022 +#define AC97_MODEM_RATE 0x0024 +#define AC97_POWER_CONTROL 0x0026 + +/* AC'97 2.0 */ +#define AC97_EXTENDED_ID 0x0028 /* Extended Audio ID */ +#define AC97_EXTENDED_STATUS 0x002A /* Extended Audio Status */ +#define AC97_PCM_FRONT_DAC_RATE 0x002C /* PCM Front DAC Rate */ +#define AC97_PCM_SURR_DAC_RATE 0x002E /* PCM Surround DAC Rate */ +#define AC97_PCM_LFE_DAC_RATE 0x0030 /* PCM LFE DAC Rate */ +#define AC97_PCM_LR_ADC_RATE 0x0032 /* PCM LR DAC Rate */ +#define AC97_PCM_MIC_ADC_RATE 0x0034 /* PCM MIC ADC Rate */ +#define AC97_CENTER_LFE_MASTER 0x0036 /* Center + LFE Master Volume */ +#define AC97_SURROUND_MASTER 0x0038 /* Surround (Rear) Master Volume */ +#define AC97_RESERVED_3A 0x003A /* Reserved in AC '97 < 2.2 */ + +/* AC'97 2.2 */ +#define AC97_SPDIF_CONTROL 0x003A /* S/PDIF Control */ + +/* range 0x3c-0x58 - MODEM */ +#define AC97_EXTENDED_MODEM_ID 0x003C +#define AC97_EXTEND_MODEM_STAT 0x003E +#define AC97_LINE1_RATE 0x0040 +#define AC97_LINE2_RATE 0x0042 +#define AC97_HANDSET_RATE 0x0044 +#define AC97_LINE1_LEVEL 0x0046 +#define AC97_LINE2_LEVEL 0x0048 +#define AC97_HANDSET_LEVEL 0x004A +#define AC97_GPIO_CONFIG 0x004C +#define AC97_GPIO_POLARITY 0x004E +#define AC97_GPIO_STICKY 0x0050 +#define AC97_GPIO_WAKE_UP 0x0052 +#define AC97_GPIO_STATUS 0x0054 +#define AC97_MISC_MODEM_STAT 0x0056 +#define AC97_RESERVED_58 0x0058 + +/* registers 0x005a - 0x007a are vendor reserved */ + +#define AC97_VENDOR_ID1 0x007c +#define AC97_VENDOR_ID2 0x007e + +/* volume control bit defines */ +#define AC97_MUTE 0x8000 +#define AC97_MICBOOST 0x0040 +#define AC97_LEFTVOL 0x3f00 +#define AC97_RIGHTVOL 0x003f + +/* record mux defines */ +#define AC97_RECMUX_MIC 0x0000 +#define AC97_RECMUX_CD 0x0101 +#define AC97_RECMUX_VIDEO 0x0202 +#define AC97_RECMUX_AUX 0x0303 +#define AC97_RECMUX_LINE 0x0404 +#define AC97_RECMUX_STEREO_MIX 0x0505 +#define AC97_RECMUX_MONO_MIX 0x0606 +#define AC97_RECMUX_PHONE 0x0707 + +/* general purpose register bit defines */ +#define AC97_GP_LPBK 0x0080 /* Loopback mode */ +#define AC97_GP_MS 0x0100 /* Mic Select 0=Mic1, 1=Mic2 */ +#define AC97_GP_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic */ +#define AC97_GP_RLBK 0x0400 /* Remote Loopback - Modem line codec */ +#define AC97_GP_LLBK 0x0800 /* Local Loopback - Modem Line codec */ +#define AC97_GP_LD 0x1000 /* Loudness 1=on */ +#define AC97_GP_3D 0x2000 /* 3D Enhancement 1=on */ +#define AC97_GP_ST 0x4000 /* Stereo Enhancement 1=on */ +#define AC97_GP_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */ + +/* extended audio status and control bit defines */ +#define AC97_EA_VRA 0x0001 /* Variable bit rate enable bit */ +#define AC97_EA_DRA 0x0002 /* Double-rate audio enable bit */ +#define AC97_EA_SPDIF 0x0004 /* S/PDIF Enable bit */ +#define AC97_EA_VRM 0x0008 /* Variable bit rate for MIC enable bit */ +#define AC97_EA_CDAC 0x0040 /* PCM Center DAC is ready (Read only) */ +#define AC97_EA_SDAC 0x0040 /* PCM Surround DACs are ready (Read only) */ +#define AC97_EA_LDAC 0x0080 /* PCM LFE DAC is ready (Read only) */ +#define AC97_EA_MDAC 0x0100 /* MIC ADC is ready (Read only) */ +#define AC97_EA_SPCV 0x0400 /* S/PDIF configuration valid (Read only) */ +#define AC97_EA_PRI 0x0800 /* Turns the PCM Center DAC off */ +#define AC97_EA_PRJ 0x1000 /* Turns the PCM Surround DACs off */ +#define AC97_EA_PRK 0x2000 /* Turns the PCM LFE DAC off */ +#define AC97_EA_PRL 0x4000 /* Turns the MIC ADC off */ +#define AC97_EA_SLOT_MASK 0xffcf /* Mask for slot assignment bits */ +#define AC97_EA_SPSA_3_4 0x0000 /* Slot assigned to 3 & 4 */ +#define AC97_EA_SPSA_7_8 0x0010 /* Slot assigned to 7 & 8 */ +#define AC97_EA_SPSA_6_9 0x0020 /* Slot assigned to 6 & 9 */ +#define AC97_EA_SPSA_10_11 0x0030 /* Slot assigned to 10 & 11 */ + +/* S/PDIF control bit defines */ +#define AC97_SC_PRO 0x0001 /* Professional status */ +#define AC97_SC_NAUDIO 0x0002 /* Non audio stream */ +#define AC97_SC_COPY 0x0004 /* Copyright status */ +#define AC97_SC_PRE 0x0008 /* Preemphasis status */ +#define AC97_SC_CC_MASK 0x07f0 /* Category Code mask */ +#define AC97_SC_L 0x0800 /* Generation Level status */ +#define AC97_SC_SPSR_MASK 0xcfff /* S/PDIF Sample Rate bits */ +#define AC97_SC_SPSR_44K 0x0000 /* Use 44.1kHz Sample rate */ +#define AC97_SC_SPSR_48K 0x2000 /* Use 48kHz Sample rate */ +#define AC97_SC_SPSR_32K 0x3000 /* Use 32kHz Sample rate */ +#define AC97_SC_DRS 0x4000 /* Double Rate S/PDIF */ +#define AC97_SC_V 0x8000 /* Validity status */ + +/* powerdown control and status bit defines */ + +/* status */ +#define AC97_PWR_MDM 0x0010 /* Modem section ready */ +#define AC97_PWR_REF 0x0008 /* Vref nominal */ +#define AC97_PWR_ANL 0x0004 /* Analog section ready */ +#define AC97_PWR_DAC 0x0002 /* DAC section ready */ +#define AC97_PWR_ADC 0x0001 /* ADC section ready */ + +/* control */ +#define AC97_PWR_PR0 0x0100 /* ADC and Mux powerdown */ +#define AC97_PWR_PR1 0x0200 /* DAC powerdown */ +#define AC97_PWR_PR2 0x0400 /* Output mixer powerdown (Vref on) */ +#define AC97_PWR_PR3 0x0800 /* Output mixer powerdown (Vref off) */ +#define AC97_PWR_PR4 0x1000 /* AC-link powerdown */ +#define AC97_PWR_PR5 0x2000 /* Internal Clk disable */ +#define AC97_PWR_PR6 0x4000 /* HP amp powerdown */ +#define AC97_PWR_PR7 0x8000 /* Modem off - if supported */ + +/* useful power states */ +#define AC97_PWR_D0 0x0000 /* everything on */ +#define AC97_PWR_D1 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR4 +#define AC97_PWR_D2 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4 +#define AC97_PWR_D3 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4 +#define AC97_PWR_ANLOFF AC97_PWR_PR2|AC97_PWR_PR3 /* analog section off */ + +/* Total number of defined registers. */ +#define AC97_REG_CNT 64 + + +/* OSS interface to the ac97s.. */ +#define AC97_STEREO_MASK (SOUND_MASK_VOLUME|SOUND_MASK_PCM|\ + SOUND_MASK_LINE|SOUND_MASK_CD|\ + SOUND_MASK_ALTPCM|SOUND_MASK_IGAIN|\ + SOUND_MASK_LINE1|SOUND_MASK_VIDEO|SOUND_MASK_IMIX) + +#define AC97_SUPPORTED_MASK (AC97_STEREO_MASK | \ + SOUND_MASK_BASS|SOUND_MASK_TREBLE|\ + SOUND_MASK_SPEAKER|SOUND_MASK_MIC|\ + SOUND_MASK_PHONEIN|SOUND_MASK_PHONEOUT) + +#define AC97_RECORD_MASK (SOUND_MASK_MIC|\ + SOUND_MASK_CD|SOUND_MASK_IGAIN|SOUND_MASK_VIDEO|\ + SOUND_MASK_LINE1| SOUND_MASK_LINE|\ + SOUND_MASK_PHONEIN) + +/* original check is not good enough in case FOO is greater than + * SOUND_MIXER_NRDEVICES because the supported_mixers has exactly + * SOUND_MIXER_NRDEVICES elements. + * before matching the given mixer against the bitmask in supported_mixers we + * check if mixer number exceeds maximum allowed size which is as mentioned + * above SOUND_MIXER_NRDEVICES */ +#define supported_mixer(CODEC,FOO) ((FOO >= 0) && \ + (FOO < SOUND_MIXER_NRDEVICES) && \ + (CODEC)->supported_mixers & (1<> 31) ; saturation */ +#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */ +#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */ +#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */ +#define iMACINT0 0x04 /* R = A + X * Y ; saturation */ +#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */ +#define iACC3 0x06 /* R = A + X + Y ; saturation */ +#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */ +#define iANDXOR 0x08 /* R = (A & X) ^ Y */ +#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */ +#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */ +#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */ +#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */ +#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */ +#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */ +#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */ + +/* FX8010 opcode macros */ +#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */ +#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */ +#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f */ +#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ +#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ +#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ +#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ +#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ + +/* FX8010 Constants */ +#define C_00000000 0x40 +#define C_00000001 0x41 +#define C_00000002 0x42 +#define C_00000003 0x43 +#define C_00000004 0x44 +#define C_00000008 0x45 +#define C_00000010 0x46 +#define C_00000020 0x47 +#define C_00000100 0x48 +#define C_00010000 0x49 +#define C_00080000 0x4a +#define C_10000000 0x4b +#define C_20000000 0x4c +#define C_40000000 0x4d +#define C_80000000 0x4e +#define C_7fffffff 0x4f +#define C_ffffffff 0x50 +#define C_fffffffe 0x51 +#define C_c0000000 0x52 +#define C_4f1bbcdc 0x53 +#define C_5a7ef9db 0x54 +#define C_00100000 0x55 /* ?? */ + +/* FX8010 FX Send Bus Registers */ +#define FXBUS_PCM_LEFT 0x00 +#define FXBUS_PCM_RIGHT 0x01 +#define FXBUS_PCM_LEFT_REAR 0x02 +#define FXBUS_PCM_RIGHT_REAR 0x03 +#define FXBUS_MIDI_LEFT 0x04 +#define FXBUS_MIDI_RIGHT 0x05 +#define FXBUS_PCM_CENTER 0x06 +#define FXBUS_PCM_LFE 0x07 +#define FXBUS_MIDI_REVERB 0x0c +#define FXBUS_MIDI_CHORUS 0x0d + +/* FX8010 GPRs */ +#define GPR_ACCU 0x56 /* ACCUM, accumulator */ +#define GPR_COND 0x57 /* CCR, condition register */ +#define GPR_NOISE0 0x58 /* noise source */ +#define GPR_NOISE1 0x59 /* noise source */ +#define GPR_IRQ 0x5a /* IRQ register */ +#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */ + +/* FX8010 Inputs */ +#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ +#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ +#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */ +#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */ +#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */ +#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */ +#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */ +#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */ +#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */ +#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */ +#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */ +#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */ +#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */ +#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */ + +/* FX8010 Outputs */ +#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */ +#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */ +#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */ +#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */ +#define EXTOUT_CENTER 0x04 /* SB Live 5.1 - center */ +#define EXTOUT_LFE 0x05 /* SB Live 5.1 - LFE */ +#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */ +#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */ +#define EXTOUT_REAR_L 0x08 /* Rear channel - left */ +#define EXTOUT_REAR_R 0x09 /* Rear channel - right */ +#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */ +#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */ +#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */ +#define EXTOUT_ACENTER 0x11 /* Analog Center */ +#define EXTOUT_ALFE 0x12 /* Analog LFE */ + +/* Audigy opcode macros */ +#define A_FXBUS(x) ((x) + 0x00) +#define A_EXTIN(x) ((x) + 0x40) +#define A_EXTOUT(x) ((x) + 0x60) +#define A_GPR(x) ((x) + A_FXGPREGBASE) + +/* Audigy constants */ +#define A_C_00000000 0xc0 +#define A_C_00000001 0xc1 +#define A_C_00000002 0xc2 +#define A_C_00000003 0xc3 +#define A_C_00000004 0xc4 +#define A_C_00000008 0xc5 +#define A_C_00000010 0xc6 +#define A_C_00000020 0xc7 +#define A_C_00000100 0xc8 +#define A_C_00010000 0xc9 +#define A_C_00000800 0xca +#define A_C_10000000 0xcb +#define A_C_20000000 0xcc +#define A_C_40000000 0xcd +#define A_C_80000000 0xce +#define A_C_7fffffff 0xcf +#define A_C_ffffffff 0xd0 +#define A_C_fffffffe 0xd1 +#define A_C_c0000000 0xd2 +#define A_C_4f1bbcdc 0xd3 +#define A_C_5a7ef9db 0xd4 +#define A_C_00100000 0xd5 + +/* Audigy FX Send Bus Registers */ +#define A_FXBUS_PCM_LEFT FXBUS_PCM_LEFT +#define A_FXBUS_PCM_RIGHT FXBUS_PCM_RIGHT +#define A_FXBUS_PCM_LEFT_REAR FXBUS_PCM_LEFT_REAR +#define A_FXBUS_PCM_RIGHT_REAR FXBUS_PCM_RIGHT_REAR +#define A_FXBUS_MIDI_LEFT FXBUS_MIDI_LEFT +#define A_FXBUS_MIDI_RIGHT FXBUS_MIDI_RIGHT +#define A_FXBUS_PCM_CENTER FXBUS_PCM_CENTER +#define A_FXBUS_PCM_LFE FXBUS_PCM_LFE +#define A_FXBUS_MIDI_REVERB FXBUS_MIDI_REVERB +#define A_FXBUS_MIDI_CHORUS FXBUS_MIDI_CHORUS + +#define A_GPR_ACCU 0xd6 /* 0xd6 = 0x7fffffff (?) ACCUM? */ +#define A_GPR_COND 0xd7 /* 0xd7 = 0x0000000 CCR */ +#define A_GPR_NOISE0 0xd8 /* 0xd8 = noise1 */ +#define A_GPR_NOISE1 0xd9 /* 0xd9 = noise2 */ +#define A_GPR_IRQ 0xda /* IRQ register */ +#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter */ + +/* Audigy Inputs */ +#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ +#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ +#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */ +#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */ +#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */ +#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */ +#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */ +#define A_EXTIN_LINE2_R 0x09 /* right */ +#define A_EXTIN_RCA_SPDIF_L 0x0a /* audigy drive RCA SPDIF - left */ +#define A_EXTIN_RCA_SPDIF_R 0x0b /* right */ +#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */ +#define A_EXTIN_AUX2_R 0x0d /* - right */ + +/* Audigy Outputs */ +#define A_EXTOUT_FRONT_L 0x00 /* digital front left */ +#define A_EXTOUT_FRONT_R 0x01 /* right */ +#define A_EXTOUT_CENTER 0x02 /* digital front center */ +#define A_EXTOUT_LFE 0x03 /* digital front lfe */ +#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */ +#define A_EXTOUT_HEADPHONE_R 0x05 /* right */ +#define A_EXTOUT_REAR_L 0x06 /* digital rear left */ +#define A_EXTOUT_REAR_R 0x07 /* right */ +#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */ +#define A_EXTOUT_AFRONT_R 0x09 /* right */ +#define A_EXTOUT_ACENTER 0x0a /* analog center */ +#define A_EXTOUT_ALFE 0x0b /* analog LFE */ +/* 0x0c ?? */ +/* 0x0d ?? */ +#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */ +#define A_EXTOUT_AREAR_R 0x0f /* right */ +#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */ +#define A_EXTOUT_AC97_R 0x11 /* right */ +#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */ +#define A_EXTOUT_ADC_CAP_R 0x17 /* right */ --ReaqsoxgOBHFXBhH-- From owner-freebsd-multimedia@FreeBSD.ORG Sun Apr 20 18:56:46 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37BA937B401; Sun, 20 Apr 2003 18:56:46 -0700 (PDT) Received: from puma.icir.org (puma.icir.org [192.150.187.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2230943FE0; Sun, 20 Apr 2003 18:55:18 -0700 (PDT) (envelope-from hodson@puma.icir.org) Received: from puma.icir.org (localhost [127.0.0.1]) by puma.icir.org (8.12.8p1/8.12.3) with ESMTP id h3L1tInR041328; Sun, 20 Apr 2003 18:55:18 -0700 (PDT) (envelope-from hodson@puma.icir.org) Message-Id: <200304210155.h3L1tInR041328@puma.icir.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.3 To: obrien@FreeBSD.org In-Reply-To: Your message of "Sun, 20 Apr 2003 18:31:55 PDT." <20030421013155.GA68442@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 20 Apr 2003 18:55:18 -0700 From: Orion Hodson cc: multimedia@FreeBSD.org cc: Orlando Bassotto cc: sound@FreeBSD.org Subject: Re: Audigy [ was Re: ... Terratec EWS88MT ... ] X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 01:56:46 -0000 /-- "David O'Brien" wrote: | | --ReaqsoxgOBHFXBhH | Content-Type: text/plain; charset=us-ascii | Content-Disposition: inline | | On Sun, Apr 20, 2003 at 05:17:12PM -0700, Orion Hodson wrote: | > /-- "David O'Brien" wrote: | > | On Fri, Feb 21, 2003 at 02:21:42PM -0800, Orion Hodson wrote: | > | > The project has had two drivers submitted for Audigy support in the | > | > past couple of weeks. I've been holding off looking at them as cg's | > | > really the man for the job. However, as I've found out today cg's | > | > been ill of late and has plenty of things going on externally at | > | > present. | > | | > | So how do we move forward? | > | > Orlando Bassotto, one of the Audigy code submitters, has taken on the task | of | | Here is the previously posted Orlando diff, updated for today's | 5-CURRENT. I am able to play mp3's with this patch. | David The patch looks clean and given your assurance that it works, I have no problem with you committing this as-is so we can get something in the tree for the upcoming branching. Cameron may want to do a more formal review since he is more familiar with the Creative h/w in general. - Orion From owner-freebsd-multimedia@FreeBSD.ORG Sun Apr 20 19:06:54 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3334E37B432; Sun, 20 Apr 2003 19:06:54 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7492643F85; Sun, 20 Apr 2003 19:06:53 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.9/8.12.9) with ESMTP id h3L26bZW068926; Sun, 20 Apr 2003 19:06:37 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.9/8.12.9/Submit) id h3L26WsY068925; Sun, 20 Apr 2003 19:06:32 -0700 (PDT) Date: Sun, 20 Apr 2003 19:06:31 -0700 From: "David O'Brien" To: Orion Hodson Message-ID: <20030421020631.GA68901@dragon.nuxi.com> References: <20030421013155.GA68442@dragon.nuxi.com> <200304210155.h3L1tInR041328@puma.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200304210155.h3L1tInR041328@puma.icir.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: multimedia@FreeBSD.org cc: Orlando Bassotto cc: sound@FreeBSD.org Subject: Re: Audigy [ was Re: ... Terratec EWS88MT ... ] X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 02:06:54 -0000 On Sun, Apr 20, 2003 at 06:55:18PM -0700, Orion Hodson wrote: > /-- "David O'Brien" wrote: > | > | --ReaqsoxgOBHFXBhH > | Content-Type: text/plain; charset=us-ascii > | Content-Disposition: inline > | > | On Sun, Apr 20, 2003 at 05:17:12PM -0700, Orion Hodson wrote: > | > /-- "David O'Brien" wrote: > | > | On Fri, Feb 21, 2003 at 02:21:42PM -0800, Orion Hodson wrote: > | > | > The project has had two drivers submitted for Audigy support in the > | > | > past couple of weeks. I've been holding off looking at them as cg's > | > | > really the man for the job. However, as I've found out today cg's > | > | > been ill of late and has plenty of things going on externally at > | > | > present. > | > | > | > | So how do we move forward? > | > > | > Orlando Bassotto, one of the Audigy code submitters, has taken on the task > | of > | > | Here is the previously posted Orlando diff, updated for today's > | 5-CURRENT. I am able to play mp3's with this patch. > | > > David > > The patch looks clean and given your assurance that it works, I have > no problem with you committing this as-is so we can get something in > the tree for the upcoming branching. I've only tested it for Audigy[1]. Can you test it for Live!128? From owner-freebsd-multimedia@FreeBSD.ORG Sun Apr 20 19:08:00 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 955B237B40C; Sun, 20 Apr 2003 19:08:00 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74C9643FAF; Sun, 20 Apr 2003 19:07:59 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.9/8.12.9) with ESMTP id h3L27lZW068961; Sun, 20 Apr 2003 19:07:47 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.9/8.12.9/Submit) id h3L27ZtX068953; Sun, 20 Apr 2003 19:07:35 -0700 (PDT) Date: Sun, 20 Apr 2003 19:07:35 -0700 From: "David O'Brien" To: Orlando Bassotto Message-ID: <20030421020735.GB68901@dragon.nuxi.com> References: <20030421013155.GA68442@dragon.nuxi.com> <200304210155.h3L1tInR041328@puma.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200304210155.h3L1tInR041328@puma.icir.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: sound@FreeBSD.org cc: multimedia@FreeBSD.org Subject: Re: Audigy [ was Re: ... Terratec EWS88MT ... ] X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 02:08:00 -0000 On Sun, Apr 20, 2003 at 06:55:18PM -0700, Orion Hodson wrote: > The patch looks clean and given your assurance that it works, I have > no problem with you committing this as-is so we can get something in > the tree for the upcoming branching. Orlando, where did the ASLA header bits come from? I'd like to vendor import the file(s) they were pulled from for reference. From owner-freebsd-multimedia@FreeBSD.ORG Mon Apr 21 00:01:10 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E49E37B401; Mon, 21 Apr 2003 00:01:10 -0700 (PDT) Received: from ns.gfk.ru (ns.gfk.ru [62.205.179.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 727EB43F93; Mon, 21 Apr 2003 00:01:08 -0700 (PDT) (envelope-from Yuriy.Tsibizov@gfk.ru) Received: from mx.gfk.ru ([10.0.0.30]) by ns.gfk.ru ([62.205.179.194]) with SMTP (MDaemon.PRO.v6.5.2.R); Mon, 21 Apr 2003 11:00:54 +0400 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 Date: Mon, 21 Apr 2003 11:00:53 +0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Audigy [ was Re: ... Terratec EWS88MT ... ] Thread-Index: AcMHpnDFYAqVzPwSSSSwWXzvDoVL0QAK8Crg From: "Yuriy Tsibizov" To: , "Orion Hodson" X-MDRemoteIP: 10.0.0.30 X-Return-Path: Yuriy.Tsibizov@gfk.ru cc: multimedia@FreeBSD.org cc: Orlando Bassotto cc: sound@FreeBSD.org Subject: RE: Audigy X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 07:01:11 -0000 > > /-- "David O'Brien" wrote: > > | On Fri, Feb 21, 2003 at 02:21:42PM -0800, Orion Hodson wrote: > > | > The project has had two drivers submitted for Audigy support in = the > > | > past couple of weeks. I've been holding off looking at them as = cg's > > | > really the man for the job. However, as I've found out today = cg's > > | > been ill of late and has plenty of things going on externally at > > | > present. > > |=20 > > | So how do we move forward? > >=20 > > Orlando Bassotto, one of the Audigy code submitters, has=20 > taken on the task of=20 >=20 > Here is the previously posted Orlando diff, updated for today's > 5-CURRENT. I am able to play mp3's with this patch >=20 if you replace=20 @@ -1262,6 +1568,12 @@ emu_wrptr(sc, 0, SOLEL, 0); emu_wrptr(sc, 0, SOLEH, 0); =20 + /* wonder what these do... */ + if (sc->audigy) { + emu_wrptr(sc, 0, SPBYPASS, 0xf00); + emu_wrptr(sc, 0, AC97SLOT, 0x3); + } + /* init envelope engine */ for (ch =3D 0; ch < NUM_G; ch++) { emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); with @@ -1262,6 +1568,12 @@ emu_wrptr(sc, 0, SOLEL, 0); emu_wrptr(sc, 0, SOLEH, 0); =20 + /* wonder what these do... */ + if (sc->audigy) { + emu_wrptr(sc, 0, SPBYPASS, 0xf00); + emu_wrptr(sc, 0, AC97SLOT, 0x40 | AC97SLOT_CNTR | AC97SLOT_LFE | 0x02 = | 0x01); + } + /* init envelope engine */ for (ch =3D 0; ch < NUM_G; ch++) { emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); you will be able to listen to mp3s from AudigyDrive headphones (and = possible from S/PDIF connectors). I'm not shure about AC97SLOT_CNTR and = AC97SLOT_LFE, but 0x40 enables my AudigyDrive.=20 Yuriy Tsibizov, http://chibis.persons.gfk.ru/audigy From owner-freebsd-multimedia@FreeBSD.ORG Mon Apr 21 10:00:24 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2272B37B404 for ; Mon, 21 Apr 2003 10:00:24 -0700 (PDT) Received: from ip68-14-60-78.no.no.cox.net (ip68-14-60-78.no.no.cox.net [68.14.60.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DE2B43FCB for ; Mon, 21 Apr 2003 10:00:23 -0700 (PDT) (envelope-from conrads@ip68-14-60-78.no.no.cox.net) Received: from ip68-14-60-78.no.no.cox.net (conrads@localhost [127.0.0.1]) h3LH0MrC037600; Mon, 21 Apr 2003 12:00:22 -0500 (CDT) (envelope-from conrads@ip68-14-60-78.no.no.cox.net) Received: (from conrads@localhost)h3LH0LVr037599; Mon, 21 Apr 2003 12:00:21 -0500 (CDT) (envelope-from conrads) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20030411182758.E99993@carver.gumbysoft.com> Date: Mon, 21 Apr 2003 12:00:21 -0500 (CDT) Organization: A Rag-Tag Band of Drug-Crazed Hippies From: Conrad Sabatier To: Doug White cc: Mike Meyer cc: multimedia@freebsd.org Subject: Re: How to play new flavor of mp3 files X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 17:00:24 -0000 On 12-Apr-2003 Doug White wrote: > On Fri, 11 Apr 2003, Mike Meyer wrote: > >> I've recently started seeing mp3 files that neither mpg123 nor >> plaympeg can deal with. I find this rather annoying, and would like to >> know if there's something I can use to play them. All my examples are >> rather large, so I won't attach one here. But file identifies them as: >> "MP3, 32 kBits, 44.1 kHz, Stereo". Playing them with mpg123 results >> in errors about not being able to rewind the stream; playing them with >> plaympeg results in a random collection of clicks. > > Yeah, this is the hallmark of VBR coded MP3s. mpg123 won't play them but > xmms, and even the old xaudio tools, can play them. Jumping into this thread a bit late, but... mpg123 *can* play VBR MP3s; I do it all the time. -- Conrad Sabatier - "In Unix veritas" From owner-freebsd-multimedia@FreeBSD.ORG Tue Apr 22 09:04:57 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D084D37B401 for ; Tue, 22 Apr 2003 09:04:57 -0700 (PDT) Received: from adsl.hlfl.org (gobelins-1-81-57-24-20.fbx.proxad.net [81.57.24.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id E52E443F93 for ; Tue, 22 Apr 2003 09:04:54 -0700 (PDT) (envelope-from asl@launay.org) Received: from cassis.launay.org (cassis.launay.org [172.16.2.2]) by adsl.hlfl.org (Postfix) with ESMTP id 1F8091128A; Tue, 22 Apr 2003 18:04:53 +0200 (CEST) Received: by cassis.launay.org (Postfix, from userid 501) id 286A454004; Tue, 22 Apr 2003 18:05:09 +0200 (CEST) Date: Tue, 22 Apr 2003 18:05:09 +0200 From: Arnaud Launay To: gphoto-devel@gphoto.net Message-ID: <20030422160509.GA7603@launay.org> Mail-Followup-To: gphoto-devel@gphoto.net, "Louis A. Mamakos" , list-freebsd-multimedia References: <20030417172622.M63834@acatysmoof.com> <200304192149.h3JLnS1L000742@whizzo.transsys.com> <20030420143115.M90329@acatysmoof.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20030420143115.M90329@acatysmoof.com> User-Agent: Mutt/1.4.1i X-PGP-Key: http://launay.org/pgpkey.asc cc: list-freebsd-multimedia cc: "Louis A. Mamakos" Subject: Re: Compiliing gphoto2 cvs on FreeBSD. -- WAS: Re: gphoto2 with Canon Powershot S45? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2003 16:04:58 -0000 Le Sun, Apr 20, 2003 at 06:48:01AM -0800, Alex Teslik a écrit: > http://www.acatysmoof.com/posting/freebsd-stuff/gphoto2-cvs.html > Mabye the developers can look at the steps I had to take and > come up with fixes to help it compile "out of the box". Sure, but your thing is not very helpful. Let's study it... > Setup the environment: > setenv PKG_CONFIG_PATH /usr/local/libdata/pkgconfig PKG_CONFIG_PATH="/usr/local/libdata/pkgconfig:/usr/local/lib/pkgconfig"; export PKG_CONFIG_PATH permits to not use the mv trick below > Remove the Toshiba camera pdrm11 from the compile (I couldn't > get it to work - it breaks compile): > sed -i .bak s/'SUBDIRS = pdrm11'/'SUBDIRS = '/g libgphoto2/camlibs/toshiba/Makefile.am Not very useful. How does it break, what are the error messages ? > Build the confiure scripts for libgphoto2 (just press enter if it > prompts you - do not perform the steps listed): Complain to GNU gettext maintainers. We have no way to make it quiet. > You need to remove "--no-verify" from the configure scripts: > sed -i .bak s='--no-verify'==g libgphoto2/configure > sed -i .bak s='--no-verify'==g libgphoto2/libgphoto2_port/configure This is something I did when using an old autoconf, it isn't necessary from 2.54. Upgrading your autotools suite may help a lot. > Move the pkg-config file for libgphoto2 into the correct folder: Hmmm... pkgconfig directory is defined as ${libdir}/pkgconfig... This is something a port would do, no way to define this directly from the source without messing up with libraries place. > Force $ac_cv_lib_gphoto2_gp_library_version evaluation to true: > sed -i .bak s#'if test $ac_cv_lib_gphoto2_gp_library_version = yes; then'#'if /usr/bin/true; then'# gphoto2/configure Woah. Why do you need that ? Ah... Do you have /usr/local/lib in your lib search path ? ie, does /etc/rc.conf (or /etc/defaults/rc.conf) contains something like ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib" ? Did you rerun ldconfig after installing libgphoto2 ? Arnaud. -- Isn't it ironic that many men spend a great part of their lives avoiding marriage while single-mindedly pursuing those things that would make them better prospects? From owner-freebsd-multimedia@FreeBSD.ORG Tue Apr 22 13:39:26 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B42737B401 for ; Tue, 22 Apr 2003 13:39:26 -0700 (PDT) Received: from smtp020.tiscali.dk (smtp020.tiscali.dk [212.54.64.104]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39EF843FCB for ; Tue, 22 Apr 2003 13:39:25 -0700 (PDT) (envelope-from lp@lapont.dk) Received: from 192.168.1.96 (62.79.144.4.abk.nordit.dk [62.79.144.4] (may be forged)) by smtp020.tiscali.dk (8.12.5/8.12.5) with ESMTP id h3MKdM8W029959 for ; Tue, 22 Apr 2003 22:39:22 +0200 (MEST) From: Lars Pontoppidan Date: Tue, 22 Apr 2003 22:36:23 +0000 User-Agent: KMail/1.5.1 MIME-Version: 1.0 Content-Disposition: inline To: multimedia@freebsd.org Message-Id: <200304222222.55971.lp@lapont.dk> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Fxtv X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: lp@lapont.dk List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2003 20:39:26 -0000 I have made a fresh install of FreeBSD 4.8 and have installed fxtv fron the ports. But the program only flashes on the screen and dies immediately when I try to run it. Here is the result when fxtv is startet from a console: lars-> fxtv Whoah! Failed to load font '-adobe-utopia-regular-r-normal--20-0-75-75-p-0-iso8859-1' which X 'said' it knew about. This shouldn't happen (but does in XFree86 3.9.16). Basically, choose another font or take the default font. I have tried to 'uncomment' this line in the file /usr/X11R6/lib/X11/app-defaults/Fxtv: Fxtv*AnnotFont: -freefont-garamond-*-*-*-0-0-*-*-*-0-iso8859-1 Now the output from fxtv changes to: lars-> fxtv No matching font(s) registered with X Server: -freefont-garamond-*-*-*-0-0-*-*-*-0-iso8859-1 Falling back on '10x20' font. Whoah! Failed to load font '10x20' which X 'said' it knew about. This shouldn't happen (but does in XFree86 3.9.16). Basically, choose another font or take the default font. The freefonts port is installed!! How do I take the default font?? What can I do to make fxtv run???? Here is fhe output with the -debug option: lars-> fxtv -debug startup Fxtv v1.03 DETECTED CAPTURE CARD(S) [DRIVER PROBES]: bktr0: mem 0xec113000-0xec113fff irq 9 at device 8.0 on pci0 iicbb0: on bti2c0 bktr0: Hauppauge Model 56304 C bktr0: Hauppauge WinCast/TV, Temic PAL tuner. SYSCTL MIB VALUES: kern.version: FreeBSD 4.8-STABLE #15: Mon Apr 21 17:26:40 GMT 2003 root@FreeBSD01.askevej:/usr/obj/usr/src/sys/MULTIMEDIA hw.bt848.card: -1 hw.bt848.tuner: -1 hw.bt848.reverse_mute: -1 hw.bt848.format: -1 hw.bt848.slow_msp_audio: -1 TUNER SIGNATURE (0x01 - 0xff): 00 00 02 00 00 00 00 00 00 00 ff 00 02 00 00 00 TUNER I2C DEVICES FOUND AT: 0x22, 0xa0, 0xa2, 0xa4, 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xc2 CAPTURE CARD EEPROM CONTENTS: Read 256 EEPROM bytes (0x00 - 0xff) 84 11 00 00 04 48 09 02 04 0e 01 f0 db 00 00 8c 44 00 00 00 84 0a 00 01 01 20 77 00 40 61 c9 03 00 74 02 01 00 03 79 df ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 84 11 00 00 04 48 09 02 04 0e 01 f0 db 00 00 8c 44 00 00 00 84 0a 00 01 01 20 77 00 40 61 c9 03 00 74 02 01 00 03 79 df ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff SUPPORTED FREQUENCY SETS: 1 nabcst 2 cableirc 3 cablehrc 4 weurope 5 jpnbcst 6 jpncable 7 xussr 8 australia 9 france Supported RGB Capture Pixel Formats: bpp Bpp RGB Masks Swap --- --- ---------------------------- ---- 15 2 00007c00, 000003e0, 0000001f NB 16 2 0000f800, 000007e0, 0000001f NB 24 3 00ff0000, 0000ff00, 000000ff B 24 4 00ff0000, 0000ff00, 000000ff NBWb Supported YUV Capture Pixel Formats: YUVSize HSamp VSamp Pack CompOrder T->B L->R YTrans ------- ----- ----- ------ --------- ---- ---- ------ 8,8,8 1,2,2 1,1,1 PLANAR YUV Y Y N 8,8,8 1,2,2 1,1,1 PACKED YUYV Y Y N 8,8,8 1,2,2 1,2,2 PLANAR YUV Y Y N XSERVER: 'The XFree86 Project, Inc' v40300000, Protocol Verson 11.0 Screen Res = 1024x768, DefDepth = 24; NumScreens = 1 Bitmap Unit/BitOrder/Pad = 32/LSBFirst/32, Image ByteOrder = LSBFirst XF86DGAQueryVersion() succeeded - vers = 2.00 BaseAddr = 0xe0000000, Pitch = 1024, BankSize/RamSize = 32997376/32997376 Rating Available Visuals: Rating Class bpp Bpp R,G,B Masks Swap DirectVid ------ ----------- --- --- ---------------------------- ---- --------- 7 TrueColor 24 4,4 00ff0000, 0000ff00, 000000ff -- Yes 4 TrueColor 24 4,4 00ff0000, 0000ff00, 000000ff -- No 4 TrueColor 24 4,4 00ff0000, 0000ff00, 000000ff -- No 4 TrueColor 24 4,4 00ff0000, 0000ff00, 000000ff -- No Chosen Visual is 24-bpp TrueColor XF86VidModeQueryVersion() succeeded - version = 2.02 No matching font(s) registered with X Server: -freefont-garamond-*-*-*-0-0-*-*-*-0-iso8859-15 Falling back on '10x20' font. Whoah! Failed to load font '10x20' which X 'said' it knew about. This shouldn't happen (but does in XFree86 3.9.16). Basically, choose another font or take the default font. Regards Lars POntoppidan From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 10:08:05 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14A9D37B401 for ; Wed, 23 Apr 2003 10:08:05 -0700 (PDT) Received: from c0mailgw07.prontomail.com (c0mailgwalt.prontomail.com [207.183.238.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68E1843FB1 for ; Wed, 23 Apr 2003 10:08:04 -0700 (PDT) (envelope-from DerekYoung@easy.com) Received: from c0web104 (c0mailgwalt.prontomail.com [207.183.238.110]) by c0mailgw07.prontomail.com (8.11.6/8.11.6) with SMTP id h3NH4AX11438 for ; Wed, 23 Apr 2003 10:04:10 -0700 X-Version: easygroup 6.3.3.2329.0 X-SenderIP: 65.166.175.15 X-SenderID: 24844284 From: "Derek Young" Message-Id: <27091B526B7DD364E8EEE7E06CF7A9D9@DerekYoung.easy.com> Date: Wed, 23 Apr 2003 12:08:15 -0600 X-Priority: Normal Content-Type: text/plain; charset=iso-8859-1 To: freebsd-multimedia@freebsd.org X-Mailer: Web Based Pronto Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: creative extigy X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 17:08:05 -0000 Good news and bad news. The extigy does to some extint follow the USB Audio protocol. Bad news: when I got the existing uaudio module to recognize the extigy (only had to modify one line) it caused a kernel crash when I tried to play any music. I have another uaudio device called a eDio AS-100 that uaudio recognizes without modification that also causes the same crash.. supervisor read, page not present, blah blah blah. I am running STABLE, not CURRENT.. does anyone running STABLE have any usb audio devices working? Is something just straight up wrong with it? I just downloaded all the USB audio specs, and I will spend a lot of time on this.. grr, i NEED (not want) audio working on my laptop, grin. Derek easy.com This message was sent from the free private e-mail service by easy.com, the portal site owned by Stelios and the easyGroup. This email service is available to all members of the public to use for personal reasons only. Not all subscribers to this e-mail service are representatives of an easyGroup company. From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 10:49:10 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4479E37B401 for ; Wed, 23 Apr 2003 10:49:09 -0700 (PDT) Received: from heaven.gigo.com (heaven.gigo.com [64.57.102.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5742A43FA3 for ; Wed, 23 Apr 2003 10:49:09 -0700 (PDT) (envelope-from lioux@brturbo.com) Received: from 200-163-006-005.bsace7003.dsl.brasiltelecom.net.br (200-163-006-005.bsace7003.dsl.brasiltelecom.net.br [200.163.6.5]) by heaven.gigo.com (Postfix) with ESMTP id CF1D7B88E for ; Wed, 23 Apr 2003 10:49:08 -0700 (PDT) Received: (qmail 9388 invoked by uid 1001); 23 Apr 2003 17:25:38 -0000 Message-ID: <20030423172538.9387.qmail@exxodus.fedaykin.here> Date: Wed, 23 Apr 2003 14:25:16 -0300 From: Mario Sergio Fujikawa Ferreira To: Derek Young References: <27091B526B7DD364E8EEE7E06CF7A9D9@DerekYoung.easy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27091B526B7DD364E8EEE7E06CF7A9D9@DerekYoung.easy.com> X-Operating-System: FreeBSD 4.8-STABLE X-Disclaimer: I hope you find what you are looking for... in life :) User-Agent: Mutt/1.5.4i cc: freebsd-multimedia@freebsd.org Subject: Re: creative extigy X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 17:49:10 -0000 Hi, I do not have an USB audio device nor any experience with any of them. However, I understand that our USB audio implementation was borrowed from NetBSD. What about checking the latest version on NetBSD? - NetBSD uaudio.c CVS http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/usb/uaudio.c?cvsroot=netbsd We imported CVS revision 1.41. It is currently in 1.66. Something important might have changed. Regards, -- Mario S F Ferreira - DF - Brazil - "I guess this is a signature." FreeBSD Committer | CS Developer flames to beloved devnull@someotherworldbeloworabove.org feature, n: a documented bug | bug, n: an undocumented feature From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 10:50:50 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54D0037B401 for ; Wed, 23 Apr 2003 10:50:50 -0700 (PDT) Received: from puma.icir.org (puma.icir.org [192.150.187.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3DC743F93 for ; Wed, 23 Apr 2003 10:50:49 -0700 (PDT) (envelope-from hodson@puma.icir.org) Received: from puma.icir.org (localhost [127.0.0.1]) by puma.icir.org (8.12.8p1/8.12.3) with ESMTP id h3NHomnR085216; Wed, 23 Apr 2003 10:50:48 -0700 (PDT) (envelope-from hodson@puma.icir.org) Message-Id: <200304231750.h3NHomnR085216@puma.icir.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.3 To: "Derek Young" From: Orion Hodson In-Reply-To: Your message of "Wed, 23 Apr 2003 12:08:15 MDT." <27091B526B7DD364E8EEE7E06CF7A9D9@DerekYoung.easy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 23 Apr 2003 10:50:48 -0700 Sender: hodson@icir.org cc: freebsd-multimedia@freebsd.org Subject: Re: creative extigy X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 17:50:50 -0000 /-- "Derek Young" wrote: | Good news and bad news. The extigy does to some extint | follow the USB Audio protocol. | | Bad news: when I got the existing uaudio module to | recognize the extigy (only had to modify one line) it | caused a kernel crash when I tried to play any music. | | I have another uaudio device called a eDio AS-100 that | uaudio recognizes without modification that also causes | the same crash.. supervisor read, page not present, blah | blah blah. Okay, I'd suggest taking this up with Nick Sayer who is responsible for this code being in the tree. There is nobody on the sound team supporting USB audio AFAIK. I may buy some h/w shortly and look to change this. | I am running STABLE, not CURRENT.. does anyone | running STABLE have any usb audio devices working? | | Is something just straight up wrong with it? I just | downloaded all the USB audio specs, and I will spend a lot | of time on this.. grr, i NEED (not want) audio working on | my laptop, grin. Will you please provide details about the ich3 problem you mentioned in your previous email? - Orion From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 11:19:40 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19C5E37B40B; Wed, 23 Apr 2003 11:19:40 -0700 (PDT) Received: from c0mailgw02.prontomail.com (c0mailgwalt.prontomail.com [207.183.238.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B03843F93; Wed, 23 Apr 2003 11:19:39 -0700 (PDT) (envelope-from DerekYoung@easy.com) Received: from c0web104 (c0mailgwalt.prontomail.com [207.183.238.110]) h3NIFlu01412; Wed, 23 Apr 2003 11:15:47 -0700 X-Version: easygroup 6.3.3.2329.0 X-SenderIP: 65.166.175.15 X-SenderID: 24844284 From: "Derek Young" Message-Id: <9625508F3C497FC439BD584031315D34@DerekYoung.easy.com> Date: Wed, 23 Apr 2003 13:19:50 -0600 X-Priority: Normal Content-Type: text/plain; charset=iso-8859-1 To: orion@freebsd.org X-Mailer: Web Based Pronto Mime-Version: 1.0 Content-Transfer-Encoding: 7bit cc: freebsd-multimedia@freebsd.org Subject: Re: Re: creative extigy X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 18:19:40 -0000 |There is nobody on the sound |team supporting USB audio AFAIK. I may buy some h/w |shortly and look to |change this. You can if you want, however I have been using bsd since 96 or so and have been wanting to contribute to it before. Now that I am not married I have lots of free time/money now. :) |Will you please provide details about the ich3 problem you |mentioned in your |previous email? Well, umm... I feel stupid. It was the problem people were reporting that they had ACPI BIOS and with the ICH they would get choppy sound. And tons of error messages on dmesg when they tried to play sound. I have a sony vaio grx690. 17" screen, so I have no need for a normal computer anymore.... I never reported it myself because I did lots of searches on the mailing list and found complaints already. Same card/same laptop even. Apparently it has been fixed recently (like the last 1 or 2 months). Cause sound playback worked fine! There is one error message on loading the module that was not there before.. I will show it to you. pcm0: port 0x18c0-0x18ff,0x1c00-0x1cff irq 9 at device 31.5 on pci0 pcm0: (id=0x594d4803) The unknown codec message is new. It never showed before. Is this a bad thing? Derek easy.com This message was sent from the free private e-mail service by easy.com, the portal site owned by Stelios and the easyGroup. This email service is available to all members of the public to use for personal reasons only. Not all subscribers to this e-mail service are representatives of an easyGroup company. From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 11:37:39 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0EDB437B401 for ; Wed, 23 Apr 2003 11:37:39 -0700 (PDT) Received: from puma.icir.org (puma.icir.org [192.150.187.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 957BC43FA3 for ; Wed, 23 Apr 2003 11:37:38 -0700 (PDT) (envelope-from hodson@puma.icir.org) Received: from puma.icir.org (localhost [127.0.0.1]) by puma.icir.org (8.12.8p1/8.12.3) with ESMTP id h3NIbbnR086097; Wed, 23 Apr 2003 11:37:37 -0700 (PDT) (envelope-from hodson@puma.icir.org) Message-Id: <200304231837.h3NIbbnR086097@puma.icir.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.3 To: "Derek Young" From: Orion Hodson In-Reply-To: Your message of "Wed, 23 Apr 2003 13:19:50 MDT." <9625508F3C497FC439BD584031315D34@DerekYoung.easy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 23 Apr 2003 11:37:37 -0700 Sender: hodson@icir.org cc: freebsd-multimedia@freebsd.org Subject: Re: creative extigy X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 18:37:39 -0000 /-- "Derek Young" wrote: | |There is nobody on the sound | |team supporting USB audio AFAIK. I may buy some h/w | |shortly and look to | |change this. | | You can if you want, however I have been using bsd since | 96 or so and have been wanting to contribute to it before. | Now that I am not married I have lots of free time/money | now. :) Okay, sounds good. | There is one error message on loading the module that | was not there before.. I will show it to you. | | pcm0: port | 0x18c0-0x18ff,0x1c00-0x1cff irq 9 at device 31.5 on pci0 | | pcm0: (id=0x594d4803) | | The unknown codec message is new. It never showed | before. Is this a bad thing? No, it's fine. It just means there isn't a named entry in the table of AC97 codecs. It does exist on -CURRENT, but hasn't made it back into the -STABLE branch. We'll get that sorted out. Thanks - Orion From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 12:00:17 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9EFE37B401; Wed, 23 Apr 2003 12:00:17 -0700 (PDT) Received: from totem.fix.no (totem.fix.no [80.91.36.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3217643FA3; Wed, 23 Apr 2003 12:00:17 -0700 (PDT) (envelope-from anders@totem.fix.no) Received: by totem.fix.no (Postfix, from userid 1000) id 9A9BC20248; Wed, 23 Apr 2003 21:01:06 +0200 (CEST) Date: Wed, 23 Apr 2003 21:01:06 +0200 From: Anders Nordby To: Eric Anholt , stable@FreeBSD.org, multimedia@FreeBSD.org Message-ID: <20030423190106.GA85026@totem.fix.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-PGP-Key: http://anders.fix.no/pgp/ X-PGP-Key-FingerPrint: 1E0F C53C D8DF 6A8F EAAD 19C5 D12A BC9F 0083 5956 User-Agent: Mutt/1.5.1i Subject: Problems with dri/drm using Radeon 7000 VE in -stable X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 19:00:18 -0000 Hi, I tried applying http://people.freebsd.org/~anholt/dri/files/drm-stable-20030411.diff to stable from today (using device radeondrm and options DRM_LINUX). Kernel reports drm seems to be there: drm0: port 0x9000-0x90ff mem 0xed000000-0xed00ffff,0xe$ info: [drm] Initialized radeon 1.8.0 20020828 on minor 0 Now, when I try to start XFree86 everything looks fine at first: root@noname:~# startx Using authority file /root/.Xauthority Writing authority file /root/.Xauthority Using authority file /root/.Xauthority Writing authority file /root/.Xauthority XFree86 Version 4.3.0 Release Date: 27 February 2003 X Protocol Version 11, Revision 0, Release 6.6 Build Operating System: FreeBSD 4.8 i386 [ELF] Build Date: 23 April 2003 Before reporting problems, check http://www.XFree86.Org/ to make sure that you have the latest version. Module Loader present Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/XFree86.0.log", Time: Wed Apr 23 20:36:28 2003 (==) Using config file: "/etc/X11/XF86Config" But I get this in /var/log/messages: Apr 23 20:36:29 noname /kernel: error: [drm:radeon_unlock] *ERROR* Process 338 using kernel context 0 And glxinfo reports that I have no direct rendering (output: http://anders.fix.no/test/glxinfo.txt). :( My XF86Config: http://anders.fix.no/test/XF86Config. Excerpt from pciconf -l -v output: drm0@pci1:0:0: class=0x030000 card=0x7112174b chip=0x51591002 rev=0x00 hdr=0x00 vendor = 'ATI Technologies' device = 'Radeon VE QY Radeon 7000 / Radeon VE' class = display subclass = VGA scanpci reports this about the Radeon: pci bus 0x0001 cardnum 0x00 function 0x00: vendor 0x1002 device 0x5159 ATI Technologies Inc Radeon RV100 QY [Radeon 7000/VE] How do I get dri/drm to work? Has anyone got dri/drm in -stable with XFree86 4.3.0 running? Cheers, -- Anders. From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 12:13:56 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C34D37B401; Wed, 23 Apr 2003 12:13:56 -0700 (PDT) Received: from c0mailgw03.prontomail.com (c0mailgwalt.prontomail.com [207.183.238.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 924F143F93; Wed, 23 Apr 2003 12:13:53 -0700 (PDT) (envelope-from DerekYoung@easy.com) Received: from c0web104 (c0mailgwalt.prontomail.com [207.183.238.110]) h3NJ9pW25314; Wed, 23 Apr 2003 12:09:51 -0700 X-Version: easygroup 6.3.3.2329.0 X-SenderIP: 65.166.175.15 X-SenderID: 24844284 From: "Derek Young" Message-Id: Date: Wed, 23 Apr 2003 14:14:04 -0600 X-Priority: Normal Content-Type: text/plain; charset=iso-8859-1 To: Anders Nordby X-Mailer: Web Based Pronto Mime-Version: 1.0 Content-Transfer-Encoding: 7bit cc: multimedia@FreeBSD.org Subject: Problems with dri/drm using Radeon 7000 VE in -stable X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 19:13:56 -0000 According to http://people.freebsd.org/~anholt/dri/faq.html Q: With my ATI card and DRI enabled, I often get these errors in my system log: "error: [drm:radeon_cp_indirect] *ERROR* process 97092 using buffer owned by 0" A: This is a bug in the DRI where the X Server is using buffers the kernel thinks is unused. Luckily it doesn't cause any problems besides some log messages, and a little graphical mess for some people. Fixed in DRI CVS. So apparently that isn't your issue. I am using the ATI radeon mobility 7500 on STABLE and XF4.3 with the linux compat and I am having no issues. I am assuming you looked at http://people.freebsd.org/~anholt/dri/troubleshooting.html I had to follow that document to the letter to get my dri to work. All I wanted was my open gl screen savers to work, i don't even play games, rofl. Good luck. Derek easy.com This message was sent from the free private e-mail service by easy.com, the portal site owned by Stelios and the easyGroup. This email service is available to all members of the public to use for personal reasons only. Not all subscribers to this e-mail service are representatives of an easyGroup company. From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 12:30:15 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0816E37B401; Wed, 23 Apr 2003 12:30:15 -0700 (PDT) Received: from totem.fix.no (totem.fix.no [80.91.36.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4249343FA3; Wed, 23 Apr 2003 12:30:14 -0700 (PDT) (envelope-from anders@totem.fix.no) Received: by totem.fix.no (Postfix, from userid 1000) id AEFC92024B; Wed, 23 Apr 2003 21:31:03 +0200 (CEST) Date: Wed, 23 Apr 2003 21:31:03 +0200 From: Anders Nordby To: Derek Young Message-ID: <20030423193103.GA70531@totem.fix.no> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: http://anders.fix.no/pgp/ X-PGP-Key-FingerPrint: 1E0F C53C D8DF 6A8F EAAD 19C5 D12A BC9F 0083 5956 User-Agent: Mutt/1.5.1i cc: Eric Anholt cc: stable@FreeBSD.org cc: multimedia@FreeBSD.org Subject: Re: Problems with dri/drm using Radeon 7000 VE in -stable X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 19:30:15 -0000 Hi, Erm. Silly me. I wasn't getting the "[drm] AGP at .." message, because I had forgotten to remove agp_load="YES" from /boot/loader.conf. Now dri/drm works nicely. This increased glxgears FPS from 280 to 492! Wohoo! :-) Cheers, -- Anders. From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 12:35:53 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5546937B401; Wed, 23 Apr 2003 12:35:53 -0700 (PDT) Received: from sccrmhc03.attbi.com (sccrmhc03.attbi.com [204.127.202.63]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44D7543FB1; Wed, 23 Apr 2003 12:35:52 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc03.attbi.com (sccrmhc03) with ESMTP id <20030423193550003006bhple>; Wed, 23 Apr 2003 19:35:51 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA89202; Wed, 23 Apr 2003 12:35:50 -0700 (PDT) Date: Wed, 23 Apr 2003 12:35:48 -0700 (PDT) From: Julian Elischer To: Anders Nordby In-Reply-To: <20030423193103.GA70531@totem.fix.no> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Eric Anholt cc: stable@FreeBSD.org cc: Derek Young cc: multimedia@FreeBSD.org Subject: Re: Problems with dri/drm using Radeon 7000 VE in -stable X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 19:35:53 -0000 On Wed, 23 Apr 2003, Anders Nordby wrote: > Hi, > > Erm. Silly me. I wasn't getting the "[drm] AGP at .." message, because I > had forgotten to remove agp_load="YES" from /boot/loader.conf. Is there a "for dummies" outline on howe all the terms go together in the graphics world? e.g. what is : dri, and how does it connect to agp. for that matter what is agp, and how does it connect to PCI? etc.etc. ? some of these thigns are libraries, modules, hardware interfaces, etc.etc. is there a glossary? > > Now dri/drm works nicely. This increased glxgears FPS from 280 to 492! > Wohoo! :-) > > Cheers, > > -- > Anders. > _______________________________________________ > freebsd-multimedia@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-multimedia > To unsubscribe, send any mail to "freebsd-multimedia-unsubscribe@freebsd.org" > From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 12:39:53 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5553C37B401; Wed, 23 Apr 2003 12:39:53 -0700 (PDT) Received: from theinternet.com.au (c17609.carlnfd1.nsw.optusnet.com.au [210.49.139.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 450B843FAF; Wed, 23 Apr 2003 12:39:45 -0700 (PDT) (envelope-from akm@theinternet.com.au) Received: from theinternet.com.au (akm@localhost [127.0.0.1]) by theinternet.com.au (8.12.9/8.12.9) with ESMTP id h3NJd08g047931; Thu, 24 Apr 2003 05:39:00 +1000 (EST) (envelope-from akm@theinternet.com.au) Received: (from akm@localhost) by theinternet.com.au (8.12.9/8.12.9/Submit) id h3NJcxRP047930; Thu, 24 Apr 2003 05:38:59 +1000 (EST) Date: Thu, 24 Apr 2003 05:38:59 +1000 From: Andrew Kenneth Milton To: Julian Elischer Message-ID: <20030423193859.GG508@zeus.theinternet.com.au> References: <20030423193103.GA70531@totem.fix.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: Eric Anholt cc: Anders Nordby cc: stable@freebsd.org cc: multimedia@freebsd.org cc: Derek Young Subject: Re: Problems with dri/drm using Radeon 7000 VE in -stable X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 19:39:53 -0000 +-------[ Julian Elischer ]---------------------- | | | On Wed, 23 Apr 2003, Anders Nordby wrote: | | > Hi, | > | > Erm. Silly me. I wasn't getting the "[drm] AGP at .." message, because I | > had forgotten to remove agp_load="YES" from /boot/loader.conf. | | Is there a "for dummies" outline on howe all the terms go together | in the graphics world? | | e.g. what is : | dri, and how does it connect to agp. | for that matter what is agp, and how does it connect to PCI? | etc.etc. | | ? | some of these thigns are libraries, modules, hardware interfaces, | etc.etc. | | is there a glossary? http://dri.sourceforge.net/doc/howto/other-formats/html-single/DRI-Driver-HOWTO.htm Has a glossary of terms in it... -- Totally Holistic Enterprises Internet| | Andrew Milton The Internet (Aust) Pty Ltd | M:+61 416 022 411 | ACN: 082 081 472 ABN: 83 082 081 472 |akm@theinternet.com.au| Carpe Daemon From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 13:59:04 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 075AB37B411 for ; Wed, 23 Apr 2003 13:59:04 -0700 (PDT) Received: from pit.databus.com (p70-227.acedsl.com [66.114.70.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id B71E343FBD for ; Wed, 23 Apr 2003 13:59:02 -0700 (PDT) (envelope-from barney@pit.databus.com) Received: from pit.databus.com (localhost [127.0.0.1]) by pit.databus.com (8.12.9/8.12.9) with ESMTP id h3NKwsGW011104; Wed, 23 Apr 2003 16:58:54 -0400 (EDT) (envelope-from barney@pit.databus.com) Received: (from barney@localhost) by pit.databus.com (8.12.9/8.12.9/Submit) id h3NKwroq011103; Wed, 23 Apr 2003 16:58:53 -0400 (EDT) Date: Wed, 23 Apr 2003 16:58:53 -0400 From: Barney Wolff To: Andrew Kenneth Milton Message-ID: <20030423205853.GA11044@pit.databus.com> References: <20030423193103.GA70531@totem.fix.no> <20030423193859.GG508@zeus.theinternet.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030423193859.GG508@zeus.theinternet.com.au> User-Agent: Mutt/1.4.1i X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) cc: Anders Nordby cc: Julian Elischer cc: multimedia@freebsd.org cc: Eric Anholt cc: stable@freebsd.org cc: Derek Young Subject: Re: Problems with dri/drm using Radeon 7000 VE in -stable X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 20:59:04 -0000 I had DRM working perfectly on a 7500 with X4.3.0 and -stable, until it stopped. After wracking my brain for quite a while, and comparing things to -current, I discovered that something (undiscovered) had created /dev/dri/card0 with major/minor as 0/0. Deleting that caused DRM to again work perfectly. Major/minor should be 145/0, but you don't have to set that up yourself - it seems to be created automatically if card0 is not there. The symptom with the bogus card0 was that drmOpenDevice did not recognize the successful open (return code 6) of card0 and kept trying card1..14. Also, exiting X and startx'ing again resulted in a message in XFree86.0.log that it could not load radeon.ko - it apparently did not recognize that it was already loaded. Both of these problems went away after I deleted the bogus card0. -- Barney Wolff http://www.databus.com/bwresume.pdf I'm available by contract or FT, in the NYC metro area or via the 'Net. From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 23 17:04:24 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5013337B404; Wed, 23 Apr 2003 17:04:24 -0700 (PDT) Received: from pisces.web-ster.com (ns2.web-ster.com [12.111.170.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2AD5543FAF; Wed, 23 Apr 2003 17:04:23 -0700 (PDT) (envelope-from randy@rcreighton.org) Received: from mail.web-ster.com (mail.web-ster.com [12.111.170.10]) by pisces.web-ster.com (Postfix) with ESMTP id EB130F3AE2; Wed, 23 Apr 2003 17:04:22 -0700 (PDT) Received: from comp1.rcreighton.org [12.154.198.69] by mail.web-ster.com with ESMTP (SMTPD32-7.14) id AA065FC9012E; Wed, 23 Apr 2003 17:04:22 -0700 Received: from rcreighton.org (localhost.rcreighton.org [127.0.0.1]) by comp1.rcreighton.org (8.12.9/8.12.8) with ESMTP id h3O05bjM049375; Wed, 23 Apr 2003 17:05:37 -0700 (PDT) (envelope-from randy@rcreighton.org) Message-ID: <3EA72A51.3020900@rcreighton.org> Date: Wed, 23 Apr 2003 17:05:37 -0700 From: Randall Creighton User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Anders Nordby References: <20030423190106.GA85026@totem.fix.no> In-Reply-To: <20030423190106.GA85026@totem.fix.no> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: multimedia@freebsd.org Subject: Re: Problems with dri/drm using Radeon 7000 VE in -stable X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2003 00:04:24 -0000 Wow, thats weird, I just bought the same card this weekend, I tried to install the kernel mods vi the port /usr/ports/graphics/drm-kmod I didn't have any probs until I tried glxgears, glxinfo reports no direct rendering. I ran out of weekend before I got any further, now I will just do what you did. Thanks for breaking trail! Randy Anders Nordby wrote: >Hi, > >I tried applying >http://people.freebsd.org/~anholt/dri/files/drm-stable-20030411.diff to >stable from today (using device radeondrm and options DRM_LINUX). >Kernel reports drm seems to be there: > >drm0: port 0x9000-0x90ff mem >0xed000000-0xed00ffff,0xe$ >info: [drm] Initialized radeon 1.8.0 20020828 on minor 0 > >Now, when I try to start XFree86 everything looks fine at first: > >root@noname:~# startx >Using authority file /root/.Xauthority >Writing authority file /root/.Xauthority >Using authority file /root/.Xauthority >Writing authority file /root/.Xauthority > > >XFree86 Version 4.3.0 >Release Date: 27 February 2003 >X Protocol Version 11, Revision 0, Release 6.6 >Build Operating System: FreeBSD 4.8 i386 [ELF] >Build Date: 23 April 2003 > Before reporting problems, check http://www.XFree86.Org/ > to make sure that you have the latest version. >Module Loader present >Markers: (--) probed, (**) from config file, (==) default setting, > (++) from command line, (!!) notice, (II) informational, > (WW) warning, (EE) error, (NI) not implemented, (??) unknown. >(==) Log file: "/var/log/XFree86.0.log", Time: Wed Apr 23 20:36:28 2003 >(==) Using config file: "/etc/X11/XF86Config" > >But I get this in /var/log/messages: > >Apr 23 20:36:29 noname /kernel: error: [drm:radeon_unlock] *ERROR* >Process 338 using kernel context 0 > >And glxinfo reports that I have no direct rendering (output: >http://anders.fix.no/test/glxinfo.txt). :( > >My XF86Config: http://anders.fix.no/test/XF86Config. > >Excerpt from pciconf -l -v output: > >drm0@pci1:0:0: class=0x030000 card=0x7112174b chip=0x51591002 rev=0x00 >hdr=0x00 > vendor = 'ATI Technologies' > device = 'Radeon VE QY Radeon 7000 / Radeon VE' > class = display > subclass = VGA > >scanpci reports this about the Radeon: > >pci bus 0x0001 cardnum 0x00 function 0x00: vendor 0x1002 device 0x5159 > ATI Technologies Inc Radeon RV100 QY [Radeon 7000/VE] > >How do I get dri/drm to work? Has anyone got dri/drm in -stable with >XFree86 4.3.0 running? > >Cheers, > > > From owner-freebsd-multimedia@FreeBSD.ORG Thu Apr 24 13:00:22 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1D8837B401; Thu, 24 Apr 2003 13:00:22 -0700 (PDT) Received: from c0mailgw08.prontomail.com (c0mailgwalt.prontomail.com [207.183.238.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8203143FD7; Thu, 24 Apr 2003 13:00:19 -0700 (PDT) (envelope-from DerekYoung@easy.com) Received: from c0web105 (c0mailgwalt.prontomail.com [207.183.238.110]) h3OJuYF03507; Thu, 24 Apr 2003 12:56:36 -0700 X-Version: easygroup 6.3.3.2329.0 X-SenderIP: 63.156.48.218 X-SenderID: 24844284 From: "Derek Young" Message-Id: Date: Thu, 24 Apr 2003 15:00:07 -0500 X-Priority: Normal Content-Type: text/plain; charset=iso-8859-1 To: orion@freebsd.org X-Mailer: Web Based Pronto Mime-Version: 1.0 Content-Transfer-Encoding: 7bit cc: freebsd-multimedia@freebsd.org Subject: Intel ICH3/Yamaha X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2003 20:00:23 -0000 Remember that Intel ICH3 card with the ACPI BIOS problem? Rofl, it isn't really fixed.. See, yesterday when it was working.. I was amazed. When I got home from work it wasn't working.. so I retraced my steps. See, I work at an ISP. I was downloading some of the FreeBSD ISOs to setup a remote kgdb machine on a box I wasn't using at home. Apparently the 300KB/sec traffic or so was generating a lot of pci interrupts which made the card go fine. When I'm downloading a huge file really quickly sound works good. When I move my mouse around a lot sort sort of works. When I don't do anything not hooked up to the net, sound barely works. I get those PCM interrupt timeout messages on dmesg and choppy sound. Just as before. Sorry about the false positive report. But maybe this will help. I think i'll set up some ddos tools and dos my box during the day so I can listen to music, rofl. Now, the laptop that has this card does not have a serial port.. so as far as the ICH3/Yamaha goes I can't remote kgdb it.. but is there anything from ddb that I can do to help you? I have that setup and working. Derek easy.com This message was sent from the free private e-mail service by easy.com, the portal site owned by Stelios and the easyGroup. This email service is available to all members of the public to use for personal reasons only. Not all subscribers to this e-mail service are representatives of an easyGroup company. From owner-freebsd-multimedia@FreeBSD.ORG Thu Apr 24 14:01:49 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D68737B401 for ; Thu, 24 Apr 2003 14:01:49 -0700 (PDT) Received: from puma.icir.org (puma.icir.org [192.150.187.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id C551843F93 for ; Thu, 24 Apr 2003 14:01:48 -0700 (PDT) (envelope-from hodson@puma.icir.org) Received: from puma.icir.org (localhost [127.0.0.1]) by puma.icir.org (8.12.8p1/8.12.3) with ESMTP id h3OL1lnR024648; Thu, 24 Apr 2003 14:01:47 -0700 (PDT) (envelope-from hodson@puma.icir.org) Message-Id: <200304242101.h3OL1lnR024648@puma.icir.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.3 To: "Derek Young" From: Orion Hodson In-Reply-To: Your message of "Thu, 24 Apr 2003 15:00:07 CDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 24 Apr 2003 14:01:47 -0700 Sender: hodson@icir.org cc: freebsd-multimedia@freebsd.org Subject: Re: Intel ICH3/Yamaha X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2003 21:01:49 -0000 /-- "Derek Young" wrote: | Remember that Intel ICH3 card with the ACPI BIOS | problem? Rofl, it isn't really fixed.. Derek What you describe sounds like an interrupt routing problem and it just happens to be sound where the problem manifests itself. This is very common on laptops. If in the BIOS of the machine in question there is a PnP OS setting, try setting it to No. If it's not there or it doesn't work, then try adding: options PCI_ENABLE_IO_MODES to your kernel configuration (and then rebuild and reinstall the kernel). If that doesn't work, then probably the only FreeBSD paths available to you are the 5.0 or -CURRENT branches where ACPI support is implemented. - Orion From owner-freebsd-multimedia@FreeBSD.ORG Fri Apr 25 06:28:22 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BFF837B401 for ; Fri, 25 Apr 2003 06:28:22 -0700 (PDT) Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A08443FAF for ; Fri, 25 Apr 2003 06:28:20 -0700 (PDT) (envelope-from schweikh@schweikhardt.net) Received: from bremen.shuttle.de (localhost [127.0.0.1]) by bremen.shuttle.de (Postfix) with ESMTP id 9F7D917D85 for ; Fri, 25 Apr 2003 15:28:18 +0200 (CEST) Received: (from uucp@localhost)h3PDSIEc027406 for multimedia@freebsd.org; Fri, 25 Apr 2003 15:28:18 +0200 Received: from hal9000.schweikhardt.net (localhost [127.0.0.1]) h3PDRo0I018119 for ; Fri, 25 Apr 2003 15:27:50 +0200 (CEST) (envelope-from schweikh@hal9000.schweikhardt.net) Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.12.9/8.12.6/Submit) id h3PDRohi018118 for multimedia@freebsd.org; Fri, 25 Apr 2003 15:27:50 +0200 (CEST) Date: Fri, 25 Apr 2003 15:27:50 +0200 From: Jens Schweikhardt To: multimedia@freebsd.org Message-ID: <20030425132750.GA4975@schweikhardt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: Abysmal frame rate during disk IO X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2003 13:28:22 -0000 hello, world\n I wonder if there is anything I can tune to get a decent frame rate from my tv card identifying as bktr0: mem 0xc2000000-0xc2000fff irq 5 at device 10.0 on pci1 bktr0: Hauppauge Model 38104 B208 bktr0: Hauppauge WinCast/TV, Philips PAL I tuner. The frame rate is okay if the system is idle (ASUS A7N8X, AMD Athlon 2500+, FSB 333, 1GB RAM, 4-STABLE) but as soon as there is a lot of disk IO, say find / or cvsup, the picture often halts for fractions of a second. Audio continues without interruption. Is there anything in the BIOS, X11 config or kernel I can tune to make the frames display smoothly even when disk IO is significant? Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped) From owner-freebsd-multimedia@FreeBSD.ORG Fri Apr 25 08:47:36 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D787737B401 for ; Fri, 25 Apr 2003 08:47:36 -0700 (PDT) Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id B576743FCB for ; Fri, 25 Apr 2003 08:47:35 -0700 (PDT) (envelope-from schweikh@schweikhardt.net) Received: from bremen.shuttle.de (localhost [127.0.0.1]) by bremen.shuttle.de (Postfix) with ESMTP id 7F57017DE2; Fri, 25 Apr 2003 17:47:34 +0200 (CEST) Received: (from uucp@localhost)h3PFlYmH010464; Fri, 25 Apr 2003 17:47:34 +0200 Received: from hal9000.schweikhardt.net (localhost [127.0.0.1]) h3PFk90I021153; Fri, 25 Apr 2003 17:46:09 +0200 (CEST) (envelope-from schweikh@hal9000.schweikhardt.net) Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.12.9/8.12.6/Submit) id h3PFk951021152; Fri, 25 Apr 2003 17:46:09 +0200 (CEST) Date: Fri, 25 Apr 2003 17:46:09 +0200 From: Jens Schweikhardt To: Steven Campbell , multimedia@freebsd.org Message-ID: <20030425154609.GA20883@schweikhardt.net> References: <20030425132750.GA4975@schweikhardt.net> <3EA95476.9040801@Ncrypted.ORG> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EA95476.9040801@Ncrypted.ORG> User-Agent: Mutt/1.4.1i Subject: Re: Abysmal frame rate during disk IO X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2003 15:47:37 -0000 Steven at al, # Greetings, Jens. You don't get into the specifics of your machine's # hardware. I'm guessing that it has IDE disks. ... # Please share more details of your system and the folks on # freebsd-multimedia may be able to help further... Sorry, I should have thought of that. No, it's a SCSI-only system, with four disks on an U160 cable and one disk+cdr+dvd on a 50pin cable. The complete dmesg follows, allong with the non-comment lines of my kernel config. Copyright (c) 1992-2003 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 4.8-STABLE #0: Tue Apr 8 23:04:44 CEST 2003 toor@hal9000.schweikhardt.net:/usr/obj/src/stable/sys/HAL9000 Timecounter "i8254" frequency 1193182 Hz CPU: AMD Athlon(tm) XP 2500+ (1830.01-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0x6a0 Stepping = 0 Features=0x383fbff AMD Features=0xc0400000 real memory = 1073676288 (1048512K bytes) config> q avail memory = 1041145856 (1016744K bytes) Preloaded elf kernel "kernel" at 0xc03db000. Preloaded userconfig_script "/boot/kernel.conf" at 0xc03db09c. Preloaded elf module "splash_bmp.ko" at 0xc03db0ec. Preloaded elf module "vesa.ko" at 0xc03db190. Preloaded splash_image_data "/boot/splash.bmp" at 0xc03db22c. Preloaded elf module "fdesc.ko" at 0xc03db27c. Preloaded elf module "linux.ko" at 0xc03db31c. Preloaded elf module "ipfw.ko" at 0xc03db3bc. Preloaded elf module "miibus.ko" at 0xc03db458. Preloaded elf module "ng_ether.ko" at 0xc03db4f8. Preloaded elf module "netgraph.ko" at 0xc03db598. Preloaded elf module "ng_pppoe.ko" at 0xc03db638. Preloaded elf module "ng_socket.ko" at 0xc03db6d8. Preloaded elf module "snd_ich.ko" at 0xc03db77c. Preloaded elf module "snd_pcm.ko" at 0xc03db81c. Preloaded elf module "ums.ko" at 0xc03db8bc. Preloaded elf module "bktr_mem.ko" at 0xc03db958. Preloaded elf module "bktr.ko" at 0xc03db9f8. Preloaded elf module "logo_saver.ko" at 0xc03dba94. Preloaded elf module "kernfs.ko" at 0xc03dbb38. Preloaded elf module "md.ko" at 0xc03dbbd8. can't re-use a leaf (mddebug)! bktr_mem: memory holder loaded VESA: v3.0, 32768k memory, flags:0x1, mode table:0xc00c52cd (c00052cd) VESA: Matrox Graphics Inc. Pentium Pro MTRR support enabled md0: Malloc disk md0: Malloc disk Using $PIR table, 11 entries at 0xc00fdeb0 npx0: on motherboard npx0: INT 16 interface pcib0: on motherboard pci0: on pcib0 pci0: (vendor=0x10de, dev=0x01eb) at 0.1 pci0: (vendor=0x10de, dev=0x01ee) at 0.2 pci0: (vendor=0x10de, dev=0x01ed) at 0.3 pci0: (vendor=0x10de, dev=0x01ec) at 0.4 pci0: (vendor=0x10de, dev=0x01ef) at 0.5 isab0: at device 1.0 on pci0 isa0: on isab0 pci0: (vendor=0x10de, dev=0x0064) at 1.1 irq 12 ohci0: mem 0xc8002000-0xc8002fff irq 11 at device 2.0 on pci0 usb0: OHCI version 1.0, legacy support usb0: on ohci0 usb0: USB revision 1.0 uhub0: (0x10de) OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 3 ports with 3 removable, self powered ohci1: mem 0xc8003000-0xc8003fff irq 5 at device 2.1 on pci0 usb1: OHCI version 1.0, legacy support usb1: on ohci1 usb1: USB revision 1.0 uhub1: (0x10de) OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 3 ports with 3 removable, self powered ums0: Logitech USB Mouse, rev 1.10/4.00, addr 2, iclass 3/1 ums0: 3 buttons and Z dir. pci0: at 2.2 irq 12 pci0: (vendor=0x10de, dev=0x0066) at 4.0 irq 12 pcm0: port 0xd800-0xd87f,0xd400-0xd4ff mem 0xc8000000-0xc8000fff irq 11 at device 6.0 on pci0 pcm0: pcib1: at device 8.0 on pci0 pci1: on pcib1 pci1: (vendor=0x10b7, dev=0x9001) at 6.0 irq 5 ahc0: port 0xc400-0xc4ff mem 0xc7000000-0xc7000fff irq 11 at device 7.0 on pci1 aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs bktr0: mem 0xc2000000-0xc2000fff irq 5 at device 10.0 on pci1 bktr0: Hauppauge Model 38104 B208 bktr0: Hauppauge WinCast/TV, Philips PAL I tuner. pci1: (vendor=0x109e, dev=0x0878) at 10.1 irq 5 pci0: at 9.0 pcib2: at device 30.0 on pci0 pci2: on pcib2 pci2: at 0.0 irq 11 orm0: