mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: tiwai@suse.com, Bard Liao <yung-chuan.liao@linux.intel.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: hda: Skip creating captures in SOF context
Date: Thu, 5 Jan 2023 13:43:15 +0100	[thread overview]
Message-ID: <144a8a27-ac7a-6d3b-1744-26fe0806deee@perex.cz> (raw)
In-Reply-To: <CAAd53p4Jcfo1_jsCd98_HxzkfqhUxS_7h7vM5a2dcK4fRYS1RA@mail.gmail.com>

On 05. 01. 23 13:36, Kai-Heng Feng wrote:
> On Mon, Aug 15, 2022 at 3:55 PM Kai-Heng Feng
> <kai.heng.feng@canonical.com> wrote:
>>
>> On Wed, Jul 20, 2022 at 9:31 PM Pierre-Louis Bossart
>> <pierre-louis.bossart@linux.intel.com> wrote:
>>>
>>>
>>>
>>> On 7/20/22 02:52, Jaroslav Kysela wrote:
>>>> Dne 20. 07. 22 v 3:45 Kai-Heng Feng napsal(a):
>>>>> On Tue, Jul 19, 2022 at 11:41 PM Jaroslav Kysela <perex@perex.cz> wrote:
>>>>>>
>>>>>> Dne 19. 07. 22 v 16:47 Kai-Heng Feng napsal(a):
>>>>>>> On HP laptops that use SOF driver for DMIC, the micmute LED doesn't
>>>>>>> light up when mic is muted after commit 9b014266ef8a ("ASoC: SOF:
>>>>>>> topology: use new sound control LED layer").
>>>>>>>
>>>>>>> The micmute LED itself is still working via sysfs, but it doesn't follow
>>>>>>> mute anymore. That's because unlike vendors like Dell and Lenovo, HP
>>>>>>> laptops use HDA codec to control mute LEDs instead of ACPI. So on HP
>>>>>>> laptops, both SOF and HDA create captures with
>>>>>>> SNDRV_CTL_ELEM_ACCESS_MIC_LED access, snd_ctl_led_set_state() considers
>>>>>>> there are two different kcontrols and one of them is not muted.
>>>>>>
>>>>>> It does not mean that it's a wrong behavior. When both controls are muted, the
>>>>>> LED should be turned on. It just requires that all inputs are off (and it may
>>>>>> be the default - probably we can set in UCM or so). If you turn the "Capture
>>>>>> Switch" off in amixer / alsamixer, do things work as expected ?
>>>>>
>>>>> Yes. When all captures are muted the micmute LED is on.
>>>>>
>>>>>>
>>>>>>> So skip creating captures for HDA when it's called from SOF, the
>>>>>>> captures are already handled by SOF.
>>>>>>
>>>>>> The capture controls are for other inputs like external analog microphone. If
>>>>>> it is required to suppress the MIC LED for some hardware, just skip the
>>>>>> "spec->mic_mute_led = 1" assignment in hda_generic.c . Also, the check
>>>>>> "codec->core.type != HDA_DEV_ASOC" is not sufficient, because you don't know,
>>>>>> if the topology really sets the MIC LED flag.
>>>>>
>>>>> AFAIK the external analog microphone on DMIC laptop is driven by SOF driver too.
>>>>> If those capture controls are indeed needed for external analog mics,
>>>>> use UCM to mute them by default won't work either.
>>>>
>>>> Could you describe this ? I though that only DMIC is handled by SOF when HDA
>>>> codec is in the system. There is a separate analog codec for external analog
>>>> microphone or the HDA codec is somehow connected to SOF/DSP ? If so, how ?
>>>
>>> The HDA codec is connected in the same way in all cases, there's no
>>> hardware/electrical/routing difference.
>>>
>>> When used, the SOF driver will handle ALL links, be they DMIC or
>>> HDAudio. The difference for HDaudio is that instead of a single DMA
>>> transfer (DDR->FIFO), we have a first 'Host' DMA into the DSP SRAM, some
>>> processing and a second 'Link' DMA from DSP SRAM to the HDaudio FIFO
>>> (reversed flow for capture).
>>
>> So is this approach sufficient for this issue? Or should I explore
>> other possibilities?
> 
> A gentle ping...

This Mic LED problem was resolved through UCM for the moment:

https://github.com/alsa-project/alsa-ucm-conf/commit/79a8ec44d3dcf097f4a4492c506cbcf338324175

More discussion:

https://bugzilla.redhat.com/show_bug.cgi?id=2134824

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

  reply	other threads:[~2023-01-05 12:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 14:47 Kai-Heng Feng
2022-07-19 15:41 ` Jaroslav Kysela
2022-07-20  1:45   ` Kai-Heng Feng
2022-07-20  6:29     ` Takashi Iwai
2022-07-20  7:52     ` Jaroslav Kysela
2022-07-20 13:31       ` Pierre-Louis Bossart
2022-08-15  7:55         ` Kai-Heng Feng
2023-01-05 12:36           ` Kai-Heng Feng
2023-01-05 12:43             ` Jaroslav Kysela [this message]
2023-01-06  5:00               ` Kai-Heng Feng

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=144a8a27-ac7a-6d3b-1744-26fe0806deee@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /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

all inboxes | Powered by JetHome®