Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.co.uk>
To: Takashi Iwai <tiwai@suse.de>
Cc: Peter Zubaj <pzad@pobox.sk>, Dave Jones <davej@redhat.com>,
	alsa-devel@alsa-project.org, perex@suse.cz
Subject: Re: Re: [ALSA] snd-emu10k1: ALSA bug#1297: Fix a error recognising the SB Live Platinum.
Date: Tue, 04 Oct 2005 12:08:53 +0100	[thread overview]
Message-ID: <434262C5.80608@superbug.co.uk> (raw)
In-Reply-To: <s5h4q7xeesw.wl%tiwai@suse.de>

Takashi Iwai wrote:

>At Tue, 04 Oct 2005 08:39:36 +0200,
>Peter Zubaj wrote:
>  
>
>>If ac97_chip=1 and ac97 doesn't exists - driver will refuse to load.
>>If ac97_chip=2 and ac97 doesn't exists - driver should ignore ac97
>>
>>But I don't know if this is correct (I am not author of patch and I not tested it).
>>if message is printed then there is
>>goto no_ac97; /* FIXME: get rid of ugly gotos.. */
>>this will skip ac97 mixer creation (if ac97 is not there this will fail and driver refuses to load)
>>But I don't know if snd_ac97_bus will fail if there is no ac97 codec (I think - not, and this is not correct), then test should be done on snd_ac97_mixer and not on snd_ac97_bus creation.
>>    
>>
>
>You're right.  The additional patch below fixes it.
>
>
>Takashi
>
>
>--- linux/sound/pci/emu10k1/emumixer.c	29 Sep 2005 17:59:43 -0000	1.38
>+++ linux/sound/pci/emu10k1/emumixer.c	4 Oct 2005 10:48:42 -0000
>@@ -802,21 +802,21 @@
> 			.read = snd_emu10k1_ac97_read,
> 		};
> 
>-		if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0) {
>-			if (emu->card_capabilities->ac97_chip == 1)
>-				return err;
>-			snd_printd(KERN_INFO "emu10k1: AC97 is optional on this board\n");
>-			snd_printd(KERN_INFO"          Proceeding without ac97 mixers...\n");
>-			goto no_ac97; /* FIXME: get rid of ugly gotos.. */
>-		}
>+		if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0)
>+			return err;
> 		pbus->no_vra = 1; /* we don't need VRA */
> 		
> 		memset(&ac97, 0, sizeof(ac97));
> 		ac97.private_data = emu;
> 		ac97.private_free = snd_emu10k1_mixer_free_ac97;
> 		ac97.scaps = AC97_SCAP_NO_SPDIF;
>-		if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0)
>-			return err;
>+		if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) {
>+			if (emu->card_capabilities->ac97_chip == 1)
>+				return err;
>+			snd_printd(KERN_INFO "emu10k1: AC97 is optional on this board\n");
>+			snd_printd(KERN_INFO"          Proceeding without ac97 mixers...\n");
>+			goto no_ac97; /* FIXME: get rid of ugly gotos.. */
>+		}
> 		if (emu->audigy) {
> 			/* set master volume to 0 dB */
> 			snd_ac97_write(emu->ac97, AC97_MASTER, 0x0000);
>
>
>  
>
Surely is the snd_ac97_bus() always passes, and then the 
snd_ac97_mixer()  fails, it would be cleaner to undo the snd_ac97_bus() 
as well.




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl

  reply	other threads:[~2005-10-04 11:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <dc7e3d7c111741a991e11a1a39ca9262@pobox.sk>
2005-10-04 10:50 ` Re: [ALSA] snd-emu10k1: ALSA bug#1297: Fix a error recognising the SB Live Platinum Takashi Iwai
2005-10-04 11:08   ` James Courtier-Dutton [this message]
2005-10-04 11:14     ` Takashi Iwai
2005-10-04 11:05 ` James Courtier-Dutton
2005-10-04 20:40   ` Dave Jones
2005-10-05 11:58     ` Takashi Iwai
     [not found] <7a5967f2d895440aa1ca2fa1d201c380@pobox.sk>
2005-10-04  0:54 ` Dave Jones
2005-10-03  6:23 Peter Zubaj

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=434262C5.80608@superbug.co.uk \
    --to=james@superbug.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=davej@redhat.com \
    --cc=perex@suse.cz \
    --cc=pzad@pobox.sk \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox