All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda - Turn on PIN_OUT from hdmi playback prepare.
@ 2012-07-19  9:19 Dylan Reid
  2012-07-19  9:26 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Dylan Reid @ 2012-07-19  9:19 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, Dylan Reid, swarren

Turn on the pin widget's PIN_OUT bit from playback prepare. The pin is
enabled in open, but is disabled in hdmi_init_pin which is called during
system resume. This causes a system suspend/resume during playback to
mute HDMI/DP. Enabling the pin in prepare allows calling snd_pcm_prepare
after a system resume to restore audio.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
---
 sound/pci/hda/patch_hdmi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 0b4a1ea..c53f99c 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1153,11 +1153,17 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
 	struct hdmi_spec *spec = codec->spec;
 	int pin_idx = hinfo_to_pin_index(spec, hinfo);
 	hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid;
+	int pinctl;
 
 	hdmi_set_channel_count(codec, cvt_nid, substream->runtime->channels);
 
 	hdmi_setup_audio_infoframe(codec, pin_idx, substream);
 
+	pinctl = snd_hda_codec_read(codec, pin_nid, 0,
+				    AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
+	snd_hda_codec_write(codec, pin_nid, 0,
+			    AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl | PIN_OUT);
+
 	return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
 }
 
-- 
1.7.11.2.138.g2b53359

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

* Re: [PATCH] ALSA: hda - Turn on PIN_OUT from hdmi playback prepare.
  2012-07-19  9:19 [PATCH] ALSA: hda - Turn on PIN_OUT from hdmi playback prepare Dylan Reid
@ 2012-07-19  9:26 ` Takashi Iwai
  2012-07-19  9:34   ` Dylan Reid
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2012-07-19  9:26 UTC (permalink / raw)
  To: Dylan Reid; +Cc: alsa-devel, swarren

At Thu, 19 Jul 2012 02:19:11 -0700,
Dylan Reid wrote:
> 
> Turn on the pin widget's PIN_OUT bit from playback prepare. The pin is
> enabled in open, but is disabled in hdmi_init_pin which is called during
> system resume. This causes a system suspend/resume during playback to
> mute HDMI/DP. Enabling the pin in prepare allows calling snd_pcm_prepare
> after a system resume to restore audio.

Then we can remove the corresponding code in
generic_hdmi_playback_pcm_open()?


Takashi

> 
> Signed-off-by: Dylan Reid <dgreid@chromium.org>
> ---
>  sound/pci/hda/patch_hdmi.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index 0b4a1ea..c53f99c 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -1153,11 +1153,17 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
>  	struct hdmi_spec *spec = codec->spec;
>  	int pin_idx = hinfo_to_pin_index(spec, hinfo);
>  	hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid;
> +	int pinctl;
>  
>  	hdmi_set_channel_count(codec, cvt_nid, substream->runtime->channels);
>  
>  	hdmi_setup_audio_infoframe(codec, pin_idx, substream);
>  
> +	pinctl = snd_hda_codec_read(codec, pin_nid, 0,
> +				    AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
> +	snd_hda_codec_write(codec, pin_nid, 0,
> +			    AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl | PIN_OUT);
> +
>  	return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
>  }
>  
> -- 
> 1.7.11.2.138.g2b53359
> 

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

* Re: [PATCH] ALSA: hda - Turn on PIN_OUT from hdmi playback prepare.
  2012-07-19  9:26 ` Takashi Iwai
@ 2012-07-19  9:34   ` Dylan Reid
  2012-07-19  9:50     ` Rajeev kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Dylan Reid @ 2012-07-19  9:34 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, swarren

On Thu, Jul 19, 2012 at 2:26 AM, Takashi Iwai <tiwai@suse.de> wrote:
> At Thu, 19 Jul 2012 02:19:11 -0700,
> Dylan Reid wrote:
>>
>> Turn on the pin widget's PIN_OUT bit from playback prepare. The pin is
>> enabled in open, but is disabled in hdmi_init_pin which is called during
>> system resume. This causes a system suspend/resume during playback to
>> mute HDMI/DP. Enabling the pin in prepare allows calling snd_pcm_prepare
>> after a system resume to restore audio.
>
> Then we can remove the corresponding code in
> generic_hdmi_playback_pcm_open()?
good point, I'll run a quick test and send a new patch.
>
>
> Takashi
>
>>
>> Signed-off-by: Dylan Reid <dgreid@chromium.org>
>> ---
>>  sound/pci/hda/patch_hdmi.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
>> index 0b4a1ea..c53f99c 100644
>> --- a/sound/pci/hda/patch_hdmi.c
>> +++ b/sound/pci/hda/patch_hdmi.c
>> @@ -1153,11 +1153,17 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
>>       struct hdmi_spec *spec = codec->spec;
>>       int pin_idx = hinfo_to_pin_index(spec, hinfo);
>>       hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid;
>> +     int pinctl;
>>
>>       hdmi_set_channel_count(codec, cvt_nid, substream->runtime->channels);
>>
>>       hdmi_setup_audio_infoframe(codec, pin_idx, substream);
>>
>> +     pinctl = snd_hda_codec_read(codec, pin_nid, 0,
>> +                                 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
>> +     snd_hda_codec_write(codec, pin_nid, 0,
>> +                         AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl | PIN_OUT);
>> +
>>       return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
>>  }
>>
>> --
>> 1.7.11.2.138.g2b53359
>>

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

* Re: [PATCH] ALSA: hda - Turn on PIN_OUT from hdmi playback prepare.
  2012-07-19  9:34   ` Dylan Reid
@ 2012-07-19  9:50     ` Rajeev kumar
  0 siblings, 0 replies; 4+ messages in thread
From: Rajeev kumar @ 2012-07-19  9:50 UTC (permalink / raw)
  To: Dylan Reid; +Cc: Takashi Iwai, alsa-devel, swarren

On 7/19/2012 3:04 PM, Dylan Reid wrote:
> On Thu, Jul 19, 2012 at 2:26 AM, Takashi Iwai<tiwai@suse.de>  wrote:
>> At Thu, 19 Jul 2012 02:19:11 -0700,
>> Dylan Reid wrote:
>>>
>>> Turn on the pin widget's PIN_OUT bit from playback prepare. The pin is
>>> enabled in open, but is disabled in hdmi_init_pin which is called during
>>> system resume. This causes a system suspend/resume during playback to
>>> mute HDMI/DP. Enabling the pin in prepare allows calling snd_pcm_prepare
>>> after a system resume to restore audio.
>>
>> Then we can remove the corresponding code in
>> generic_hdmi_playback_pcm_open()?
> good point, I'll run a quick test and send a new patch.

Leave a blank line before and after your comment, so that it easy to locate.

~Rajeev

>>
>>
>> Takashi
>>
>>>
>>> Signed-off-by: Dylan Reid<dgreid@chromium.org>
>>> ---
>>>   sound/pci/hda/patch_hdmi.c | 6 ++++++
>>>   1 file changed, 6 insertions(+)
>>>
>>> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
>>> index 0b4a1ea..c53f99c 100644
>>> --- a/sound/pci/hda/patch_hdmi.c
>>> +++ b/sound/pci/hda/patch_hdmi.c
>>> @@ -1153,11 +1153,17 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
>>>        struct hdmi_spec *spec = codec->spec;
>>>        int pin_idx = hinfo_to_pin_index(spec, hinfo);
>>>        hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid;
>>> +     int pinctl;
>>>
>>>        hdmi_set_channel_count(codec, cvt_nid, substream->runtime->channels);
>>>
>>>        hdmi_setup_audio_infoframe(codec, pin_idx, substream);
>>>
>>> +     pinctl = snd_hda_codec_read(codec, pin_nid, 0,
>>> +                                 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
>>> +     snd_hda_codec_write(codec, pin_nid, 0,
>>> +                         AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl | PIN_OUT);
>>> +
>>>        return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
>>>   }
>>>
>>> --
>>> 1.7.11.2.138.g2b53359
>>>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> .
>

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

end of thread, other threads:[~2012-07-19  9:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19  9:19 [PATCH] ALSA: hda - Turn on PIN_OUT from hdmi playback prepare Dylan Reid
2012-07-19  9:26 ` Takashi Iwai
2012-07-19  9:34   ` Dylan Reid
2012-07-19  9:50     ` Rajeev kumar

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.