diff mbox

[17/53] ALSA: x86: Drop unused hw_silence field

Message ID 20170202170307.24484-19-tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai Feb. 2, 2017, 5:02 p.m. UTC
It's nowhere used.  Let's drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/x86/intel_hdmi_audio.c | 1 -
 sound/x86/intel_hdmi_audio.h | 2 --
 2 files changed, 3 deletions(-)

Comments

Pierre-Louis Bossart Feb. 2, 2017, 7:11 p.m. UTC | #1
On 2/2/17 11:02 AM, Takashi Iwai wrote:
> It's nowhere used.  Let's drop it.

That's one of the things I wanted to add. When you start playback there 
is a 1-2s period where the receiver is still looking at the data to 
figure out if it's PCM or compressed, and you lose those 1-2s of audio. 
The hw silence mode is a way to keep the link active.
But I guess we can remove first and re-add later so no objections.

>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  sound/x86/intel_hdmi_audio.c | 1 -
>  sound/x86/intel_hdmi_audio.h | 2 --
>  2 files changed, 3 deletions(-)
>
> diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
> index e08691110a48..efc56544af17 100644
> --- a/sound/x86/intel_hdmi_audio.c
> +++ b/sound/x86/intel_hdmi_audio.c
> @@ -1696,7 +1696,6 @@ int hdmi_audio_probe(struct platform_device *devptr,
>  	pm_runtime_set_active(intelhaddata->dev);
>  	pm_runtime_enable(intelhaddata->dev);
>
> -	intelhaddata->hw_silence = 1;
>  	*had_ret = intelhaddata;
>
>  	return 0;
> diff --git a/sound/x86/intel_hdmi_audio.h b/sound/x86/intel_hdmi_audio.h
> index da0a927d37fe..32a2fb766e47 100644
> --- a/sound/x86/intel_hdmi_audio.h
> +++ b/sound/x86/intel_hdmi_audio.h
> @@ -118,7 +118,6 @@ struct had_pvt_data {
>   * @kctl: holds kctl ptrs used for channel map
>   * @chmap: holds channel map info
>   * @audio_reg_base: hdmi audio register base offset
> - * @hw_silence: flag indicates SoC support for HW silence/Keep alive
>   * @underrun_count: PCM stream underrun counter
>   */
>  struct snd_intelhad {
> @@ -142,7 +141,6 @@ struct snd_intelhad {
>  	struct snd_pcm_chmap *chmap;
>  	unsigned int	*audio_reg_base;
>  	unsigned int	audio_cfg_offset;
> -	bool		hw_silence;
>  	int underrun_count;
>  };
>
>
Takashi Iwai Feb. 2, 2017, 8:04 p.m. UTC | #2
On Thu, 02 Feb 2017 20:11:10 +0100,
Pierre-Louis Bossart wrote:
> 
> On 2/2/17 11:02 AM, Takashi Iwai wrote:
> > It's nowhere used.  Let's drop it.
> 
> That's one of the things I wanted to add. When you start playback
> there is a 1-2s period where the receiver is still looking at the data
> to figure out if it's PCM or compressed, and you lose those 1-2s of
> audio. The hw silence mode is a way to keep the link active.

I see.  Yes, the feature would be useful.

> But I guess we can remove first and re-add later so no objections.

Agreed.

How would it be actually implemented?  Just avoid to turn off the
audio config bits at trigger callback, etc?

Since the runtime PM will be in the same game, we'll have to cope with
it, too.


thanks,

Takashi
Pierre-Louis Bossart Feb. 2, 2017, 8:26 p.m. UTC | #3
On 02/02/2017 02:04 PM, Takashi Iwai wrote:
> On Thu, 02 Feb 2017 20:11:10 +0100,
> Pierre-Louis Bossart wrote:
>> On 2/2/17 11:02 AM, Takashi Iwai wrote:
>>> It's nowhere used.  Let's drop it.
>> That's one of the things I wanted to add. When you start playback
>> there is a 1-2s period where the receiver is still looking at the data
>> to figure out if it's PCM or compressed, and you lose those 1-2s of
>> audio. The hw silence mode is a way to keep the link active.
> I see.  Yes, the feature would be useful.
>
>> But I guess we can remove first and re-add later so no objections.
> Agreed.
>
> How would it be actually implemented?  Just avoid to turn off the
> audio config bits at trigger callback, etc?
>
> Since the runtime PM will be in the same game, we'll have to cope with
> it, too.
I must admit I don't remember the details, just that's it's the same 
behavior as the HDAudio KAE (Keep Alive Enable) functionality.

>
>
> thanks,
>
> Takashi
Ughreja, Rakesh A Feb. 3, 2017, 4:25 a.m. UTC | #4
>-----Original Message-----
>From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-bounces@alsa-
>project.org] On Behalf Of Pierre-Louis Bossart
>Sent: Friday, February 3, 2017 1:57 AM
>To: Takashi Iwai <tiwai@suse.de>
>Cc: alsa-devel@alsa-project.org; Anand, Jerome <jerome.anand@intel.com>
>Subject: Re: [alsa-devel] [PATCH 17/53] ALSA: x86: Drop unused hw_silence
>field
>
>
>
>On 02/02/2017 02:04 PM, Takashi Iwai wrote:
>> On Thu, 02 Feb 2017 20:11:10 +0100,
>> Pierre-Louis Bossart wrote:
>>> On 2/2/17 11:02 AM, Takashi Iwai wrote:
>>>> It's nowhere used.  Let's drop it.
>>> That's one of the things I wanted to add. When you start playback
>>> there is a 1-2s period where the receiver is still looking at the data
>>> to figure out if it's PCM or compressed, and you lose those 1-2s of
>>> audio. The hw silence mode is a way to keep the link active.
>> I see.  Yes, the feature would be useful.
>>
>>> But I guess we can remove first and re-add later so no objections.
>> Agreed.
>>
>> How would it be actually implemented?  Just avoid to turn off the
>> audio config bits at trigger callback, etc?
>>
>> Since the runtime PM will be in the same game, we'll have to cope with
>> it, too.
>I must admit I don't remember the details, just that's it's the same
>behavior as the HDAudio KAE (Keep Alive Enable) functionality.
>

I have this patch from the past. It won't apply with the recent changes
in the code. But the silence filling code can be used from there.

The idea was to use hardware functionality to generate silence
when the hotplug event is detected.


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

Patch

diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index e08691110a48..efc56544af17 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1696,7 +1696,6 @@  int hdmi_audio_probe(struct platform_device *devptr,
 	pm_runtime_set_active(intelhaddata->dev);
 	pm_runtime_enable(intelhaddata->dev);
 
-	intelhaddata->hw_silence = 1;
 	*had_ret = intelhaddata;
 
 	return 0;
diff --git a/sound/x86/intel_hdmi_audio.h b/sound/x86/intel_hdmi_audio.h
index da0a927d37fe..32a2fb766e47 100644
--- a/sound/x86/intel_hdmi_audio.h
+++ b/sound/x86/intel_hdmi_audio.h
@@ -118,7 +118,6 @@  struct had_pvt_data {
  * @kctl: holds kctl ptrs used for channel map
  * @chmap: holds channel map info
  * @audio_reg_base: hdmi audio register base offset
- * @hw_silence: flag indicates SoC support for HW silence/Keep alive
  * @underrun_count: PCM stream underrun counter
  */
 struct snd_intelhad {
@@ -142,7 +141,6 @@  struct snd_intelhad {
 	struct snd_pcm_chmap *chmap;
 	unsigned int	*audio_reg_base;
 	unsigned int	audio_cfg_offset;
-	bool		hw_silence;
 	int underrun_count;
 };