All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: tomasz motylewski <T.Motylewski@bfad.de>
Cc: twoller@crystal.cirrus.com, pcaudio@crystal.cirrus.com,
	alsa-devel@lists.sourceforge.net, peter wachtendorf <pew@bfad.de>,
	arip@bfad.de
Subject: Re: Linux driver for cs4281 with TWO cs4299 codecs?
Date: Thu, 23 May 2002 10:40:21 +0200	[thread overview]
Message-ID: <s5hbsb7fea2.wl@alsa2.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.21.0205222228000.12692-100000@mailserver.intern.bfad.de>

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

At Wed, 22 May 2002 23:15:36 +0200 (CEST),
tomasz motylewski wrote:
> 
> Another test with Takashi patch:
> 
> single codec installed, snd_dual_codec=1
> ALSA ../../alsa-kernel/pci/ac97/ac97_codec.c:1458: AC'97 1:0 does not respond -
> RESET [REC_GAIN = 0xffff]
> CS4281 soundcard not found or device busy
> 
> - this suggests autodetection should be possible.

yes.  but i think we can keep it as a module option, because, as
Thomas mentioned, there is almost no cards with dual codecs.


> 
> I have looked more on the hardware and found out that the clock signal on
> XTL_IN was too weak when the plate with additional codec was added. This signal
> is not connected to the secondary codec, but the length of the wire was enough
> to make it too weak.
> 
> After I fixed the problem the driver patched by Takashi actually loaded with
> snd_dual_codec=1 !

good to hear that :)

> I have seen:
> cat /proc/asound/card0/ac97#0
> 0-1/0: Cirrus Logic CS4299 rev 4
> 
> Capabilities     : -headphone out-
> DAC resolution   : 20-bit
> ADC resolution   : 18-bit
> 3D enhancement   : Crystal Semi 3D Stereo Enhancement
> 
> Current setup
> Mic gain         : +0dB [+0dB]
> POP path         : pre 3D
> Sim. stereo      : off
> 3D enhancement   : off
> Loudness         : off
> Mono output      : MIX
> Mic select       : Mic1
> ADC/DAC loopback : off
> Extended ID      : codec=3 rev=0 AMAP DSA=0 VRA
> Extended status  : VRA
> PCM front DAC    : 48000Hz
> PCM ADC          : 48000Hz
> 
> When I loaded the same driver with snd_dual_codec=0 I have got:
> 
> cat /proc/asound/card0/ac97#0
> 0-0/0: Cirrus Logic CS4299 rev 4
> 
> Capabilities     : -headphone out-
> DAC resolution   : 20-bit
> ADC resolution   : 18-bit
> 3D enhancement   : Crystal Semi 3D Stereo Enhancement
> 
> Current setup
> Mic gain         : +0dB [+0dB]
> POP path         : pre 3D
> Sim. stereo      : off
> 3D enhancement   : off
> Loudness         : off
> Mono output      : MIX
> Mic select       : Mic1
> ADC/DAC loopback : off
> Extended ID      : codec=0 rev=0 AMAP DSA=0 VRA
> Extended status  : VRA
> PCM front DAC    : 48000Hz
> PCM ADC          : 48000Hz
> 
> But why there was always only a single codec listed in /proc/asound/card0/ ?

oh, you hit a bug.
the second codec is not shown, because the primary and secondary codec
try to create the same file.
the attached patch will fix this problem.
the second codec will be shown in the file
/proc/asound/card0/ac97#0-1.

does alsamixer show entries for the second codec?
they must be there even without the patch below.


Takashi

[-- Attachment #2: ac97-fix.dif --]
[-- Type: application/octet-stream, Size: 1229 bytes --]

Index: alsa-kernel/pci/ac97/ac97_codec.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/ac97/ac97_codec.c,v
retrieving revision 1.17
diff -u -r1.17 ac97_codec.c
--- alsa-kernel/pci/ac97/ac97_codec.c	22 May 2002 09:55:01 -0000	1.17
+++ alsa-kernel/pci/ac97/ac97_codec.c	23 May 2002 08:23:30 -0000
@@ -1775,9 +1775,12 @@
 static void snd_ac97_proc_init(snd_card_t * card, ac97_t * ac97)
 {
 	snd_info_entry_t *entry;
-	char name[12];
+	char name[32];
 
-	sprintf(name, "ac97#%d", ac97->addr);
+	if (ac97->num)
+		sprintf(name, "ac97#%d-%d", ac97->addr, ac97->num);
+	else
+		sprintf(name, "ac97#%d", ac97->addr);
 	if ((entry = snd_info_create_card_entry(card, name, card->proc_root)) != NULL) {
 		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->private_data = ac97;
@@ -1790,7 +1793,10 @@
 		}
 	}
 	ac97->proc_entry = entry;
-	sprintf(name, "ac97#%dregs", ac97->addr);
+	if (ac97->num)
+		sprintf(name, "ac97#%d-%dregs", ac97->addr, ac97->num);
+	else
+		sprintf(name, "ac97#%dregs", ac97->addr);
 	if ((entry = snd_info_create_card_entry(card, name, card->proc_root)) != NULL) {
 		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->private_data = ac97;

  reply	other threads:[~2002-05-23  8:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-22 15:59 Linux driver for cs4281 with TWO cs4299 codecs? tomasz motylewski
2002-05-22 18:11 ` Takashi Iwai
2002-05-22 18:33   ` tomasz motylewski
2002-05-22 21:15   ` tomasz motylewski
2002-05-23  8:40     ` Takashi Iwai [this message]
2002-05-23 10:27       ` tomasz motylewski
2002-05-27 16:37         ` tomasz motylewski
2002-05-27 16:49           ` Takashi Iwai
2002-05-28 20:10           ` does CS4281 have enough SRC for 4 input + 4 output channels? tomasz motylewski
2002-05-29 16:53           ` cs4281 with TWO cs4299 codecs - something works tomasz motylewski
2002-06-08 16:46             ` cs4281 - only 2 periods supported? tomasz motylewski
2002-06-10 13:54               ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2002-05-22 18:27 Linux driver for cs4281 with TWO cs4299 codecs? Woller, Thomas

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=s5hbsb7fea2.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=T.Motylewski@bfad.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=arip@bfad.de \
    --cc=pcaudio@crystal.cirrus.com \
    --cc=pew@bfad.de \
    --cc=twoller@crystal.cirrus.com \
    /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.