[alsa-devel] auto_mute for early patch issue
Kailang
kailang at realtek.com
Fri Feb 1 10:18:45 CET 2019
Hi Takashi,
I forgot it solved this issue for ALC283 before. It was also chrome OS case.
I cooked attach patch. It will not need to move spec->suppress_auto_mute check line.
Many thanks.
BR,
Kailang
-----Original Message-----
From: Takashi Iwai <tiwai at suse.de>
Sent: Thursday, January 31, 2019 7:02 PM
To: Kailang <kailang at realtek.com>
Cc: (alsa-devel at alsa-project.org) <alsa-devel at alsa-project.org>
Subject: Re: auto_mute for early patch issue
On Thu, 31 Jan 2019 11:50:26 +0100,
Kailang wrote:
>
> Hi Takashi,
>
> spec->suppress_auto_mute = 1;
> This will cause spec->gen.autocfg.hp_pins [0] = 0.
> This will cause alc2??_init() and alc2??_shutup() and dell headset mode not run errors.
That's the result with your suggested change (moving
spec->supress_auto_mute_mode in check_auto_mute_availability()) ??
Takashi
>
> Does it has other place to store pin NID?
> Or just only this place hp_pin = spec->gen.autocfg.hp_pins[0]; to get headphone NID.
>
> BR,
> Kailang
>
> -----Original Message-----
> From: Takashi Iwai <tiwai at suse.de>
> Sent: Thursday, January 31, 2019 4:23 PM
> To: Kailang <kailang at realtek.com>
> Cc: (alsa-devel at alsa-project.org) <alsa-devel at alsa-project.org>
> Subject: Re: auto_mute for early patch issue
>
> On Thu, 31 Jan 2019 09:00:36 +0100,
> Kailang wrote:
> >
> > Hi Takashi,
> >
> > I move check line to below. It will show value for hp_pins[0].
> > As I know, search from verb table in function snd_hda_parse_pin_defcfg().
> > It will fill pins at auto_pin_cfg.
> > Why it need to run below function to get cfg->hp_pins?
>
> It's just because hp_pins[] and speaker_pins[] are used for the case with the auto-mute, so far, not for other evaluations :)
>
> The change below looks safe, so if this works for you, feel fee to apply like that.
>
>
> thanks,
>
> Takashi
>
>
> > static int check_auto_mute_availability(struct hda_codec *codec) {
> > struct hda_gen_spec *spec = codec->spec;
> > struct auto_pin_cfg *cfg = &spec->autocfg;
> > int present = 0;
> > int i, err;
> >
> > - if (spec->suppress_auto_mute)
> > - return 0;
> >
> > if (cfg->hp_pins[0])
> > present++;
> > if (cfg->line_out_pins[0])
> > present++;
> > if (cfg->speaker_pins[0])
> > present++;
> > if (present < 2) /* need two different output types */
> > return 0;
> >
> > if (!cfg->speaker_pins[0] &&
> > cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) {
> > memcpy(cfg->speaker_pins, cfg->line_out_pins,
> > sizeof(cfg->speaker_pins));
> > cfg->speaker_outs = cfg->line_outs;
> > }
> >
> > if (!cfg->hp_pins[0] &&
> > cfg->line_out_type == AUTO_PIN_HP_OUT) {
> > memcpy(cfg->hp_pins, cfg->line_out_pins,
> > sizeof(cfg->hp_pins));
> > cfg->hp_outs = cfg->line_outs;
> > }
> >
> > + if (spec->suppress_auto_mute)
> > + return 0;
> >
> > ......
> > .....
> > ......
> > }
> >
> > BR,
> > Kailang
> >
> > -----Original Message-----
> > From: Kailang
> > Sent: Thursday, January 31, 2019 12:08 PM
> > To: Takashi Iwai (tiwai at suse.de) <tiwai at suse.de>
> > Cc: (alsa-devel at alsa-project.org) <alsa-devel at alsa-project.org>
> > Subject: auto_mute for early patch issue
> >
> > Hi Takashi,
> >
> > Chrome OS use early patch firmware file to load model and use auto_mute =no hint options.
> > I find an issue for early patch issue about hint option auto_mute = no.
> >
> > This will cause all spec->init_hook can't get hp_pin values.
> >
> > For example: alc225_init() alc225_shutup() alc256_init() alc256_shutup() Early patch file hint auto_mute = no equal spec->suppress_auto_mute = 1 It will return function check_auto_mute_availability() in had_generic.c.
> >
> > hp_pin = spec->gen.autocfg.hp_pins[0]; ==> It will get value 0.
> >
> > I think this issue was for a long time.
> > Please see the attach dmesg. One is kill hint auto_mute option.
> >
> > BR,
> > Kailang
> >
>
> ------Please consider the environment before printing this e-mail.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0000-fix-lose-hp-pins.patch
Type: application/octet-stream
Size: 3960 bytes
Desc: 0000-fix-lose-hp-pins.patch
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20190201/b876c18e/attachment.obj>
More information about the Alsa-devel
mailing list