alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: "Ivan N. Zlatev" <contact@i-nz.net>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>
Subject: Re: SigmaTel STAC9221 - Mux Amp-Out > 0x02 == microphone not working
Date: Tue, 29 May 2007 17:49:54 +0100	[thread overview]
Message-ID: <3db1ec7f0705290949r6d1b3068l47fa147429a5d8ad@mail.gmail.com> (raw)
In-Reply-To: <s5hwsyrzjr3.wl%tiwai@suse.de>

On 5/29/07, Takashi Iwai <tiwai@suse.de> wrote:
> At Tue, 29 May 2007 17:29:10 +0200,
> I wrote:
> >
> > At Tue, 29 May 2007 16:20:33 +0100,
> > Ivan N. Zlatev wrote:
> > >
> > > On 5/29/07, Takashi Iwai <tiwai@suse.de> wrote:
> > > >
> > > > And, does this volume have any influence on the quality of recorded
> > > > sound at all?  If not, we should remove this control rather than
> > > > keeping a dangerous thing...
> > > >
> > >
> > > Yes. This controls the microphone boost level (without boost the sound
> > > recorded has *very* low volume). Also Windows shows  up a +20db
> > > microphone boost slider on this machine.
> >
> > Ah, OK.  Then the control seems indicates the wrong max level indeed.
> > So, we need two fixes:
> >
> > - rename "Mux Capture Volume" to more intuitive one, such as "Capture
> >   Boost" or something like that.
> >
> > - limit the max level of this volume to 2.
> >
> > The latter is a bit hard to fix.  Let's see whether I can do some
> > hack...
>
> Could you check the patch below?
> (This doesn't rename but just fix the latter item.)
>
>
> Takashi
>
> diff -r 200fc3a7ef62 pci/hda/hda_codec.c
> --- a/pci/hda/hda_codec.c       Tue May 29 18:01:06 2007 +0200
> +++ b/pci/hda/hda_codec.c       Tue May 29 18:17:15 2007 +0200
> @@ -711,6 +711,19 @@ static u32 query_amp_caps(struct hda_cod
>                         info->status |= INFO_AMP_CAPS;
>         }
>         return info->amp_caps;
> +}
> +
> +int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
> +                             unsigned int caps)
> +{
> +       struct hda_amp_info *info;
> +
> +       info = get_alloc_amp_hash(codec, HDA_HASH_KEY(nid, dir, 0));
> +       if (!info)
> +               return -EINVAL;
> +       info->amp_caps = caps;
> +       info->status |= INFO_AMP_CAPS;
> +       return 0;
>  }
>
>  /*
> diff -r 200fc3a7ef62 pci/hda/hda_local.h
> --- a/pci/hda/hda_local.h       Tue May 29 18:01:06 2007 +0200
> +++ b/pci/hda/hda_local.h       Tue May 29 18:17:02 2007 +0200
> @@ -277,5 +277,7 @@ static inline u32 get_wcaps(struct hda_c
>         return codec->wcaps[nid - codec->start_nid];
>  }
>
> +int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
> +                             unsigned int caps);
>
>  #endif /* __SOUND_HDA_LOCAL_H */
> diff -r 200fc3a7ef62 pci/hda/patch_sigmatel.c
> --- a/pci/hda/patch_sigmatel.c  Tue May 29 18:01:06 2007 +0200
> +++ b/pci/hda/patch_sigmatel.c  Tue May 29 18:12:30 2007 +0200
> @@ -2033,6 +2033,12 @@ static int patch_stac925x(struct hda_cod
>
>         codec->patch_ops = stac92xx_patch_ops;
>
> +       /* Fix Mux capture level; max to 2 */
> +       snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT,
> +                                 (0 << AC_AMPCAP_OFFSET_SHIFT) |
> +                                 (2 << AC_AMPCAP_NUM_STEPS_SHIFT) |
> +                                 (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) |
> +                                 (0 << AC_AMPCAP_MUTE_SHIFT));
>         return 0;
>  }
>
>

Works, BUT the last hunk is at the wrong place. The
snd_hda_override_amp_caps call should be in patch_stac922x (...) and
not in patch_stac925x (...)

Cheers!
-- 
Ivan N. Zlatev

Web: http://www.i-nZ.net
"It's all some kind of whacked out conspiracy."

  reply	other threads:[~2007-05-29 16:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-27 22:50 SigmaTel STAC9221 - Mux Amp-Out > 0x02 == microphone not working Ivan N. Zlatev
2007-05-29 15:08 ` Takashi Iwai
2007-05-29 15:20   ` Ivan N. Zlatev
2007-05-29 15:29     ` Takashi Iwai
2007-05-29 16:18       ` Takashi Iwai
2007-05-29 16:49         ` Ivan N. Zlatev [this message]
2007-05-29 17:03           ` Takashi Iwai

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=3db1ec7f0705290949r6d1b3068l47fa147429a5d8ad@mail.gmail.com \
    --to=contact@i-nz.net \
    --cc=alsa-devel@alsa-project.org \
    --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;
as well as URLs for NNTP newsgroup(s).