[alsa-devel] [PATCH] ALSA: hda/hdmi - Don't report Jack event if no need to do that

Hui Wang hui.wang at canonical.com
Sat May 4 11:25:49 CEST 2019


On 2019/5/4 下午3:18, Takashi Iwai wrote:
> On Sat, 04 May 2019 04:45:36 +0200,
> Hui Wang wrote:
>>
>> On 2019/5/3 下午11:57, Takashi Iwai wrote:
>>> On Fri, 03 May 2019 06:05:09 +0200,
>>> Hui Wang wrote:
>>
> Right...
>
>> And inspired by your change, maybe we just make this change, then it
>> is enough to fix the falsely report issue here.
>>
>> @@ -1551,8 +1551,11 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
>>   	ret = !repoll || !eld->monitor_present || eld->eld_valid;
>>   	jack = snd_hda_jack_tbl_get(codec, pin_nid);
>> -	if (jack)
>> +	if (jack) {
>>   		jack->block_report = !ret;
>> +		jack->pin_sense = (eld->monitor_present && eld->eld_valid) ?
>> +			AC_PINSENSE_PRESENCE : 0;
>> +	}
>>
>> because in the snd_hda_pin_sense(), the jack_dirty is set to 0, then
>> we change the jack->pin_sense,  and in the report_sync() it will
>> decide the jack state according to the jack->pin_sense we changed.
> OK, that should work, just overriding and correcting the pin_sense.
>
> I guess the only missing code path is the case where jack->dirty is
> set manually without the callback call via
> snd_hda_jack_set_dirty_all().  Through a quick glance, it's called
> from the common resume code, hda_call_codec_resume().  But, again,
> HDMI codec has its own resume to refresh pin detection
> (generic_hdmi_resume()), and the changed code-path should be
> involved.
>
> The rest callers of snd_hda_jack_set_dirty_all() are the polling mode
> and the unsol event handler for the old HDMI codecs, both of which we
> don't care much.
>
> That said, your minimal change looks good to me, and I'll happily
> apply as long as it's tested.  Of course, it needs some more careful
> comments about the behavior.

OK,  after testing it, I will send the patch to review.

Thanks.


>
>
> Thanks!
>
> Takashi
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel


More information about the Alsa-devel mailing list