[alsa-devel] auto_mute for early patch issue

Kailang kailang at realtek.com
Thu Jan 31 09:33:51 CET 2019


OK!
I go to generate patch now.

Thanks.

-----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.


More information about the Alsa-devel mailing list