From: Takashi Iwai <tiwai@suse.de>
To: Hui Wang <hui.wang@canonical.com>
Cc: alsa-devel@alsa-project.org, stable@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH] ALSA: hda/hdmi - add a parameter to let users decide if checking the eld_valid
Date: Mon, 18 Nov 2019 08:12:37 +0100 [thread overview]
Message-ID: <s5himnh3bfe.wl-tiwai@suse.de> (raw)
In-Reply-To: <5af71ae2-2a1e-cb75-cfce-7228c433a957@canonical.com>
On Mon, 18 Nov 2019 05:40:52 +0100,
Hui Wang wrote:
>
>
> On 2019/11/12 下午8:21, Hui Wang wrote:
> >
> > On 2019/11/12 上午12:04, Takashi Iwai wrote:
> >> On Mon, 11 Nov 2019 16:33:45 +0100,
> >> Takashi Iwai wrote:
> >>> On Mon, 11 Nov 2019 15:45:02 +0100,
> >>> Hui Wang wrote:
> >
> [snip]
> >> On the second thought, I wonder whether eld_valid would be corrected
> >> later by the graphics side at all. If yes, it's a timing issue, and
> >> it can be corrected with the repolling.
> >>
> >> A totally untested patch is below.
> >
> > I will build a testing kernel with this patch and let the bug
> > reporter test it.
> >
> > Thanks,
> >
> > Hui.
>
> Hello Takashi,
>
> Tested the patch, it didn't work. The driver always failed to read
> the speaker allocation from snd_hdmi_get_eld_ati().
>
> This is the dmesg after adding the patch:
>
> https://launchpadlibrarian.net/451420819/dmesg (both presence and
> eld_valid bits are set, but can't get the speaker_alloc)
So it's likely a bug in the graphics driver :)
In anyway, it indicates that it's not about eld_valid check itself.
The eld_valid was returned correctly together with the monitor_present
flag.
I guess the system worked casually with your patch to ignore eld_valid
because we don't care much about the channel mapping if channels <= 2.
IOW, another workaround would be to ignore the error if channels <=
2.
But I wonder whether this state persists after this resume moment.
Could you check what happens if you unload / reload the HD-audio
driver? Does the read of spk_alloc still fail?
thanks,
Takashi
>
> Regards,
>
> Hui.
>
>
> >
> >
> >>
> >> thanks,
> >>
> >> Takashi
> >>
> >> --- a/sound/pci/hda/patch_hdmi.c
> >> +++ b/sound/pci/hda/patch_hdmi.c
> >> @@ -1549,19 +1549,25 @@ static bool
> >> hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
> >> do_repoll = true;
> >> }
> >> - if (do_repoll)
> >> + do_repoll |= repoll && eld->eld_valid != eld->monitor_present;
> >> + if (do_repoll) {
> >> schedule_delayed_work(&per_pin->work, msecs_to_jiffies(300));
> >> - else
> >> + ret = false;
> >> + } else {
> >> update_eld(codec, per_pin, eld);
> >> -
> >> - ret = !repoll || !eld->monitor_present || eld->eld_valid;
> >> + per_pin->repoll_count = 0;
> >> + ret = true;
> >> + }
> >> jack = snd_hda_jack_tbl_get(codec, pin_nid);
> >> if (jack) {
> >> jack->block_report = !ret;
> >> - jack->pin_sense = (eld->monitor_present && eld->eld_valid) ?
> >> - AC_PINSENSE_PRESENCE : 0;
> >> + if (ret) {
> >> + jack->pin_sense = (eld->monitor_present &&
> >> eld->eld_valid) ?
> >> + AC_PINSENSE_PRESENCE : 0;
> >> + }
> >> }
> >> +
> >> mutex_unlock(&per_pin->lock);
> >> return ret;
> >> }
> >>
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2019-11-18 7:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 14:45 [alsa-devel] [PATCH] ALSA: hda/hdmi - add a parameter to let users decide if checking the eld_valid Hui Wang
2019-11-11 15:33 ` Takashi Iwai
2019-11-11 16:04 ` Takashi Iwai
2019-11-12 12:21 ` Hui Wang
2019-11-18 4:40 ` Hui Wang
2019-11-18 7:12 ` Takashi Iwai [this message]
2019-11-18 7:52 ` Hui Wang
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=s5himnh3bfe.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=hui.wang@canonical.com \
--cc=stable@vger.kernel.org \
/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).