From: Wu Fengguang <fengguang.wu@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
"Wu Fengguang" <fengguang.wu@intel.com>,
"Shane W" <shane-alsa@csy.ca>,
"David Härdeman" <david@hardeman.nu>
Subject: [PATCH 08/10] intelhdmi - sticky stream id and format
Date: Wed, 18 Nov 2009 12:38:06 +0800 [thread overview]
Message-ID: <20091118043935.715143761@intel.com> (raw)
In-Reply-To: 20091118043758.141785140@intel.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: hdmi-setup-stream.patch --]
[-- Type: text/plain, Size: 2111 bytes --]
We tracked down the first-0.5s-hdmi-audio-samples-lost problem to the
AC_VERB_SET_CHANNEL_STREAMID command. It is suspected that many HDMI
sinks need some time to adapt to the new state.
The workaround is to avoid changing stream id/format whenever possible.
Proposed by David.
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
sound/pci/hda/patch_intelhdmi.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
--- sound-2.6.orig/sound/pci/hda/patch_intelhdmi.c 2009-11-05 13:56:58.000000000 +0800
+++ sound-2.6/sound/pci/hda/patch_intelhdmi.c 2009-11-05 13:58:05.000000000 +0800
@@ -772,6 +772,31 @@ static void intel_hdmi_unsol_event(struc
* Callbacks
*/
+static void hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
+ u32 stream_tag, int format)
+{
+ int tag;
+ int fmt;
+
+ tag = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0) >> 4;
+ fmt = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_STREAM_FORMAT, 0);
+
+ snd_printdd("hdmi_setup_stream: "
+ "NID=0x%x, %sstream=0x%x, %sformat=0x%x\n",
+ nid,
+ tag == stream_tag ? "" : "new-",
+ stream_tag,
+ fmt == format ? "" : "new-",
+ format);
+
+ if (tag != stream_tag)
+ snd_hda_codec_write(codec, nid, 0,
+ AC_VERB_SET_CHANNEL_STREAMID, stream_tag << 4);
+ if (fmt != format)
+ snd_hda_codec_write(codec, nid, 0,
+ AC_VERB_SET_STREAM_FORMAT, format);
+}
+
static int intel_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag,
@@ -783,7 +808,7 @@ static int intel_hdmi_playback_pcm_prepa
hdmi_setup_audio_infoframe(codec, hinfo->nid, substream);
- snd_hda_codec_setup_stream(codec, hinfo->nid, stream_tag, 0, format);
+ hdmi_setup_stream(codec, hinfo->nid, stream_tag, format);
return 0;
}
@@ -791,7 +816,6 @@ static int intel_hdmi_playback_pcm_clean
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
- snd_hda_codec_cleanup_stream(codec, hinfo->nid);
return 0;
}
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2009-11-18 4:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-18 4:37 [PATCH 00/10] Intel HDMI fixes v2 Wu Fengguang
2009-11-18 4:37 ` [PATCH 01/10] intelhdmi - fix audio infoframe fill size Wu Fengguang
2009-11-18 4:38 ` [PATCH 02/10] intelhdmi - fix channel mapping slot mask Wu Fengguang
2009-11-18 4:38 ` [PATCH 03/10] intelhdmi - export monitor-presence and ELD-valid status Wu Fengguang
2009-11-18 4:38 ` [PATCH 04/10] hda - introduce snd_hda_jack_detect() and snd_hda_pin_sense() Wu Fengguang
2009-11-18 4:38 ` [PATCH 05/10] intelhdmi - probe for monitor/eld presence at module init time Wu Fengguang
2009-11-18 9:04 ` Takashi Iwai
2009-11-18 9:16 ` Wu Fengguang
2009-11-18 4:38 ` [PATCH 06/10] intelhdmi - separate out infoframe checksum routine Wu Fengguang
2009-11-18 4:38 ` [PATCH 07/10] intelhdmi - sticky infoframe Wu Fengguang
2009-11-18 4:38 ` Wu Fengguang [this message]
2009-11-18 4:38 ` [PATCH 09/10] intelhdmi - sticky channel count Wu Fengguang
2009-11-18 4:38 ` [PATCH 10/10] hda - show EPSS capability in proc Wu Fengguang
2009-11-18 4:58 ` [PATCH 00/10] Intel HDMI fixes v2 Wu Fengguang
2009-11-18 7:04 ` Takashi Iwai
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=20091118043935.715143761@intel.com \
--to=fengguang.wu@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=david@hardeman.nu \
--cc=shane-alsa@csy.ca \
--cc=tiwai@suse.de \
/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