All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: codec: hdac_hdmi: no checking monitor in hw_params
@ 2019-05-07  6:33 libin.yang
  2019-05-07  8:42 ` Takashi Iwai
  2019-05-08  9:01 ` Applied "ASoC: codec: hdac_hdmi: no checking monitor in hw_params" to the asoc tree Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: libin.yang @ 2019-05-07  6:33 UTC (permalink / raw)
  To: alsa-devel; +Cc: Libin Yang, tiwai, pierre-louis.bossart, hui.wang, broonie

From: Libin Yang <libin.yang@intel.com>

Some userspace apps, like pulseaudio, may call open, hw_params,
prepare to judge whether the pcm is ready or not. Current hdac_hdmi
will return -ENODEV if monitor is not connected, which will cause
the apps believe the pcm is not ready. Actually PCM for hdmi is ready,
even the monitor is not connected.

This patch removes the check of monitor presence in hw_params, just like
what the legacy HD-Audio driver does.

Signed-off-by: Libin Yang <libin.yang@intel.com>
---
 sound/soc/codecs/hdac_hdmi.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 4de1fbf..660e058 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -455,24 +455,11 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream,
 	struct snd_pcm_hw_params *hparams, struct snd_soc_dai *dai)
 {
 	struct hdac_hdmi_priv *hdmi = snd_soc_dai_get_drvdata(dai);
-	struct hdac_device *hdev = hdmi->hdev;
 	struct hdac_hdmi_dai_port_map *dai_map;
-	struct hdac_hdmi_port *port;
 	struct hdac_hdmi_pcm *pcm;
 	int format;
 
 	dai_map = &hdmi->dai_map[dai->id];
-	port = dai_map->port;
-
-	if (!port)
-		return -ENODEV;
-
-	if ((!port->eld.monitor_present) || (!port->eld.eld_valid)) {
-		dev_err(&hdev->dev,
-			"device is not configured for this pin:port%d:%d\n",
-					port->pin->nid, port->id);
-		return -ENODEV;
-	}
 
 	format = snd_hdac_calc_stream_format(params_rate(hparams),
 			params_channels(hparams), params_format(hparams),
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: codec: hdac_hdmi: no checking monitor in hw_params
  2019-05-07  6:33 [PATCH] ASoC: codec: hdac_hdmi: no checking monitor in hw_params libin.yang
@ 2019-05-07  8:42 ` Takashi Iwai
  2019-05-07 13:39   ` Pierre-Louis Bossart
  2019-05-08  9:01 ` Applied "ASoC: codec: hdac_hdmi: no checking monitor in hw_params" to the asoc tree Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2019-05-07  8:42 UTC (permalink / raw)
  To: libin.yang; +Cc: hui.wang, alsa-devel, broonie, pierre-louis.bossart

On Tue, 07 May 2019 08:33:11 +0200,
libin.yang@intel.com wrote:
> 
> From: Libin Yang <libin.yang@intel.com>
> 
> Some userspace apps, like pulseaudio, may call open, hw_params,
> prepare to judge whether the pcm is ready or not. Current hdac_hdmi
> will return -ENODEV if monitor is not connected, which will cause
> the apps believe the pcm is not ready. Actually PCM for hdmi is ready,
> even the monitor is not connected.
> 
> This patch removes the check of monitor presence in hw_params, just like
> what the legacy HD-Audio driver does.
> 
> Signed-off-by: Libin Yang <libin.yang@intel.com>

LTGM,
  Reviewed-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: codec: hdac_hdmi: no checking monitor in hw_params
  2019-05-07  8:42 ` Takashi Iwai
@ 2019-05-07 13:39   ` Pierre-Louis Bossart
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre-Louis Bossart @ 2019-05-07 13:39 UTC (permalink / raw)
  To: Takashi Iwai, libin.yang; +Cc: hui.wang, alsa-devel, broonie



On 5/7/19 3:42 AM, Takashi Iwai wrote:
> On Tue, 07 May 2019 08:33:11 +0200,
> libin.yang@intel.com wrote:
>>
>> From: Libin Yang <libin.yang@intel.com>
>>
>> Some userspace apps, like pulseaudio, may call open, hw_params,
>> prepare to judge whether the pcm is ready or not. Current hdac_hdmi
>> will return -ENODEV if monitor is not connected, which will cause
>> the apps believe the pcm is not ready. Actually PCM for hdmi is ready,
>> even the monitor is not connected.
>>
>> This patch removes the check of monitor presence in hw_params, just like
>> what the legacy HD-Audio driver does.
>>
>> Signed-off-by: Libin Yang <libin.yang@intel.com>
> 
> LTGM,
>    Reviewed-by: Takashi Iwai <tiwai@suse.de>

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> 
> 
> thanks,
> 
> Takashi
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Applied "ASoC: codec: hdac_hdmi: no checking monitor in hw_params" to the asoc tree
  2019-05-07  6:33 [PATCH] ASoC: codec: hdac_hdmi: no checking monitor in hw_params libin.yang
  2019-05-07  8:42 ` Takashi Iwai
@ 2019-05-08  9:01 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2019-05-08  9:01 UTC (permalink / raw)
  To: Libin Yang; +Cc: alsa-devel, tiwai, Pierre-Louis Bossart, hui.wang, Mark Brown

The patch

   ASoC: codec: hdac_hdmi: no checking monitor in hw_params

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 939507f2779836919271ba0311723d1001d3993b Mon Sep 17 00:00:00 2001
From: Libin Yang <libin.yang@intel.com>
Date: Tue, 7 May 2019 14:33:11 +0800
Subject: [PATCH] ASoC: codec: hdac_hdmi: no checking monitor in hw_params

Some userspace apps, like pulseaudio, may call open, hw_params,
prepare to judge whether the pcm is ready or not. Current hdac_hdmi
will return -ENODEV if monitor is not connected, which will cause
the apps believe the pcm is not ready. Actually PCM for hdmi is ready,
even the monitor is not connected.

This patch removes the check of monitor presence in hw_params, just like
what the legacy HD-Audio driver does.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/hdac_hdmi.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 4de1fbfa8827..660e0587f399 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -455,24 +455,11 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream,
 	struct snd_pcm_hw_params *hparams, struct snd_soc_dai *dai)
 {
 	struct hdac_hdmi_priv *hdmi = snd_soc_dai_get_drvdata(dai);
-	struct hdac_device *hdev = hdmi->hdev;
 	struct hdac_hdmi_dai_port_map *dai_map;
-	struct hdac_hdmi_port *port;
 	struct hdac_hdmi_pcm *pcm;
 	int format;
 
 	dai_map = &hdmi->dai_map[dai->id];
-	port = dai_map->port;
-
-	if (!port)
-		return -ENODEV;
-
-	if ((!port->eld.monitor_present) || (!port->eld.eld_valid)) {
-		dev_err(&hdev->dev,
-			"device is not configured for this pin:port%d:%d\n",
-					port->pin->nid, port->id);
-		return -ENODEV;
-	}
 
 	format = snd_hdac_calc_stream_format(params_rate(hparams),
 			params_channels(hparams), params_format(hparams),
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-08  9:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07  6:33 [PATCH] ASoC: codec: hdac_hdmi: no checking monitor in hw_params libin.yang
2019-05-07  8:42 ` Takashi Iwai
2019-05-07 13:39   ` Pierre-Louis Bossart
2019-05-08  9:01 ` Applied "ASoC: codec: hdac_hdmi: no checking monitor in hw_params" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.