All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell@joe-job.com>
To: alsa-devel@lists.sourceforge.net
Cc: pzad@pobox.sk, joachim.falk@gmx.de
Subject: [PATCH] fix for ac97->front speaker routing (was Re: Some Patches for emu10k1)
Date: Sat, 26 Jun 2004 18:00:34 -0400	[thread overview]
Message-ID: <1088287234.24275.113.camel@mindpipe> (raw)
In-Reply-To: <40CF759E.7050102@jfalk.easynet.de>

[-- Attachment #1: Type: text/plain, Size: 3117 bytes --]

On Tue, 2004-06-15 at 18:18, Joachim Falk wrote:
> |>But some FX buses seam to be connected to outputs even if there is no
> |>code in the dsp. Is that hardcoded in hardware or configurable and if
> |>yes where ?
> |
> |
> | This is maybe hardware feature or ld10k1 bug. If you connect FX bus
> | 0,1 to AC97 PCM output I think it will stop to do this.
> This seams to be a hardware feature of the EMU10K1 I think because if
> you clear the dsp code than FX bus channels 0,1 and 8,9 will be
> forwarded to Output channels 0,1 and 8,9. This I can say for sure.
> The others (2-7 and 10-15) I can not be sure because I have no speakers
> on these channels or they are not connected to output on my card. But I
> assume that to be the case too. As soon as you start driving an output
> within your DSP code the forwarding seams to vanish. I think this can
> not be a alsa driver feature because you can verify that the DSP really
> is empty by catting /proc/asound/Live/fx8010_acode. So the alsa driver
> has no possibility to magically insert some of its one forwardings if
> none are programmed by the user.

I believe I have figured this out.  The following lines are taken from
8010.h in the kX Project SDK.  This file is basically the same as
emu10k1.h in the ALSA driver, with some interesting additions.  The
following lines are *not* present in the ALSA driver:

    // HCFG2 for 10k2: 0x18:
    #define HCFG_K2                 0x18
    // -- unknown; experiments only FIXME
    #define HCFG_K2_GPINPUT_MASK    0x0000ff00
    #define HCFG_K2_GPOUTPUT_MASK   0x000000ff
    #define HCFG_K2_DISABLE_ANALOG  0x40                    // = 'enable' for Audigy2 (chiprev=4)
    #define HCFG_K2_ENABLE_DIGITAL  0x04
    #define HCFG_K2_BYPASS          0x02                    // drive's internal bypass (?)
    #define HCFG_K2_UNKNOWN_20      0x20
    #define HCFG_K2_UNKNOWN_80      0x80                    // turn off ac97 front -> front (10k2.1)
    #define HCFG_K2_MULTIPURPOSE_JACK       0x2000          // center+swf+rear_center (a2/a2ex)
                                                            // + digital for generic 10k2
    #define HCFG_K2_DIGITAL_JACK    0x1000                  // digital for a2 platinum
    #define HCFG_K2_FRONT_JACK      0x4000
    #define HCFG_K2_REAR_JACK       0x8000
    #define HCFG_K2_PHONES_JACK     0x0100          // LiveDrive

    // outputs:
    //   for audigy2 platinum: 0xa00
    //   for a2 platinum ex: 0x1c00
    //   for a1 platinum: 0x0

It appears that HCFG_K2_UNKNOWN_80 is used to disable the ac97 front -> front 
output routing.

If you compare 8010.h to emu10k1.h, there are several ofthese places where gaps 
appear in the sequence of register values, and they have filled many of them in,
by reverse engineering.

I have attached a patch to add these defines to emu10k1.h, renaming the variables 
in keeping with the ALSA convention.  Please retain the lines that attribute this code 
to the kX project; I added this because there is a part of 8010.h which they copied 
from emu10k1.h (the DBG_ stuff), and they give credit to ALSA in the comments.

Lee




[-- Attachment #2: Type: text/x-patch, Size: 1669 bytes --]

Index: alsa-kernel/include/emu10k1.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/emu10k1.h,v
retrieving revision 1.41
diff -u -r1.41 emu10k1.h
--- alsa-kernel/include/emu10k1.h	23 Jun 2004 11:49:07 -0000	1.41
+++ alsa-kernel/include/emu10k1.h	26 Jun 2004 04:56:40 -0000
@@ -218,6 +218,32 @@
 						/* Should be set to 1 when the EMU10K1 is	*/
 						/* completely initialized.			*/
 
+/* the following A_HCFG_* lines (including comments) are taken from 8010.h in the kX driver SDK.*/
+
+// HCFG2 for 10k2: 0x18:
+#define A_HCFG                 0x18
+// -- unknown; experiments only FIXME
+#define A_HCFG_GPINPUT_MASK    0x0000ff00
+#define A_HCFG_GPOUTPUT_MASK   0x000000ff
+#define A_HCFG_DISABLE_ANALOG  0x40		/* 'enable' for Audigy2 (chiprev=4)		*/
+#define A_HCFG_ENABLE_DIGITAL  0x04
+#define A_HCFG_BYPASS          0x02		/* drive's internal bypass (?)			*/
+#define A_HCFG_UNKNOWN_20      0x20
+#define A_HCFG_UNKNOWN_80      0x80		/* turn off ac97 front -> front (10k2.1)	*/
+#define A_HCFG_MULTIPURPOSE_JACK       0x2000	/* center+swf+rear_center (a2/a2ex)		*/
+						/* + digital for generic 10k2			*/
+#define A_HCFG_DIGITAL_JACK    0x1000		/* digital for a2 platinum			*/
+#define A_HCFG_FRONT_JACK      0x4000
+#define A_HCFG_REAR_JACK       0x8000
+#define A_HCFG_PHONES_JACK     0x0100		/* LiveDrive					*/
+
+// outputs:
+//   for audigy2 platinum: 0xa00
+//   for a2 platinum ex: 0x1c00
+//   for a1 platinum: 0x0
+
+/* end section from kX driver									*/
+
 //For Audigy, MPU port move to 0x70-0x74 ptr register
 
 #define MUDATA			0x18		/* MPU401 data register (8 bits)       		*/

  reply	other threads:[~2004-06-26 22:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-08  8:07 Some Patches for emu10k1 Peter Zubaj
2004-06-15 22:18 ` Joachim Falk
2004-06-26 22:00   ` Lee Revell [this message]
2004-06-26 23:57     ` [PATCH] fix for ac97->front speaker routing (was Re: Some Patches for emu10k1) James Courtier-Dutton
  -- strict thread matches above, loose matches on Subject: below --
2004-06-28  6:55 Peter Zubaj
2004-06-28 19:50 ` Lee Revell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1088287234.24275.113.camel@mindpipe \
    --to=rlrevell@joe-job.com \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=joachim.falk@gmx.de \
    --cc=pzad@pobox.sk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.