* Re: [PATCH 2/2 V2] ALSA: hda - Add cache connection info
2013-06-24 13:10 ` [PATCH 2/2 V2] ALSA: hda - Add cache connection info Wang Xingchao
@ 2013-06-24 12:07 ` Takashi Iwai
2013-06-24 12:10 ` Wang, Xingchao
2013-06-25 2:29 ` Wang, Xingchao
0 siblings, 2 replies; 6+ messages in thread
From: Takashi Iwai @ 2013-06-24 12:07 UTC (permalink / raw)
To: Wang Xingchao; +Cc: alsa-devel, xingchao.wang
At Mon, 24 Jun 2013 09:10:19 -0400,
Wang Xingchao wrote:
>
> Pin's connection list may change dynamically with hot-plug event
> on Intel Haswell chip. Users would see connections be "0" in codec#.
> when play audio on this pin, software choose connections from cache.
> So add Cache connection info to avoid confuse.
>
> Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
> ---
> sound/pci/hda/hda_proc.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
> index 0fee8fa..403589c 100644
> --- a/sound/pci/hda/hda_proc.c
> +++ b/sound/pci/hda/hda_proc.c
> @@ -504,6 +504,8 @@ static void print_conn_list(struct snd_info_buffer *buffer,
> int conn_len)
> {
> int c, curr = -1;
> + const hda_nid_t *list;
> + int cache_len;
>
> if (conn_len > 1 &&
> wid_type != AC_WID_AUD_MIX &&
> @@ -511,7 +513,7 @@ static void print_conn_list(struct snd_info_buffer *buffer,
> wid_type != AC_WID_POWER)
> curr = snd_hda_codec_read(codec, nid, 0,
> AC_VERB_GET_CONNECT_SEL, 0);
> - snd_iprintf(buffer, " Connection: %d\n", conn_len);
> + snd_iprintf(buffer, " Raw Connection: %d\n", conn_len);
Don't change the existing entry. It'll break the user-space tools
that read the proc contents.
> if (conn_len > 0) {
> snd_iprintf(buffer, " ");
> for (c = 0; c < conn_len; c++) {
> @@ -521,6 +523,19 @@ static void print_conn_list(struct snd_info_buffer *buffer,
> }
> snd_iprintf(buffer, "\n");
> }
> +
> + /* Get Cache connections info */
> + cache_len = snd_hda_get_conn_list(codec, nid, &list);
> + if (cache_len != conn_len
> + || memcmp(list, conn, conn_len)) {
> + snd_iprintf(buffer, " Cache Connection: %d\n", conn_len);
Must be cache_len.
Also "Cache connection" might be a bit misleading. In this case, it's
not cached but used as alternative in driver. "In-driver connection"
or such? English-native people can give better advice...
> + if (cache_len > 0) {
> + snd_iprintf(buffer, " ");
> + for (c = 0; c < conn_len; c++)
Must be cache_len, too.
thanks,
Takashi
> + snd_iprintf(buffer, " 0x%02x", list[c]);
> + snd_iprintf(buffer, "\n");
> + }
> + }
> }
>
> static void print_gpio(struct snd_info_buffer *buffer,
> --
> 1.8.1.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2 V2] ALSA: hda - Add cache connection info
2013-06-24 12:07 ` Takashi Iwai
@ 2013-06-24 12:10 ` Wang, Xingchao
2013-06-25 2:29 ` Wang, Xingchao
1 sibling, 0 replies; 6+ messages in thread
From: Wang, Xingchao @ 2013-06-24 12:10 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Wang Xingchao
> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai@suse.de]
> Sent: Monday, June 24, 2013 8:07 PM
> To: Wang Xingchao
> Cc: alsa-devel@alsa-project.org; Wang, Xingchao
> Subject: Re: [PATCH 2/2 V2] ALSA: hda - Add cache connection info
>
> At Mon, 24 Jun 2013 09:10:19 -0400,
> Wang Xingchao wrote:
> >
> > Pin's connection list may change dynamically with hot-plug event on
> > Intel Haswell chip. Users would see connections be "0" in codec#.
> > when play audio on this pin, software choose connections from cache.
> > So add Cache connection info to avoid confuse.
> >
> > Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
> > ---
> > sound/pci/hda/hda_proc.c | 17 ++++++++++++++++-
> > 1 file changed, 16 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index
> > 0fee8fa..403589c 100644
> > --- a/sound/pci/hda/hda_proc.c
> > +++ b/sound/pci/hda/hda_proc.c
> > @@ -504,6 +504,8 @@ static void print_conn_list(struct snd_info_buffer
> *buffer,
> > int conn_len)
> > {
> > int c, curr = -1;
> > + const hda_nid_t *list;
> > + int cache_len;
> >
> > if (conn_len > 1 &&
> > wid_type != AC_WID_AUD_MIX &&
> > @@ -511,7 +513,7 @@ static void print_conn_list(struct snd_info_buffer
> *buffer,
> > wid_type != AC_WID_POWER)
> > curr = snd_hda_codec_read(codec, nid, 0,
> > AC_VERB_GET_CONNECT_SEL, 0);
> > - snd_iprintf(buffer, " Connection: %d\n", conn_len);
> > + snd_iprintf(buffer, " Raw Connection: %d\n", conn_len);
>
> Don't change the existing entry. It'll break the user-space tools that read the
> proc contents.
>
> > if (conn_len > 0) {
> > snd_iprintf(buffer, " ");
> > for (c = 0; c < conn_len; c++) {
> > @@ -521,6 +523,19 @@ static void print_conn_list(struct snd_info_buffer
> *buffer,
> > }
> > snd_iprintf(buffer, "\n");
> > }
> > +
> > + /* Get Cache connections info */
> > + cache_len = snd_hda_get_conn_list(codec, nid, &list);
> > + if (cache_len != conn_len
> > + || memcmp(list, conn, conn_len)) {
> > + snd_iprintf(buffer, " Cache Connection: %d\n", conn_len);
>
> Must be cache_len.
>
> Also "Cache connection" might be a bit misleading. In this case, it's not
> cached but used as alternative in driver. "In-driver connection"
> or such? English-native people can give better advice...
Yes, waiting for a better name :)
>
> > + if (cache_len > 0) {
> > + snd_iprintf(buffer, " ");
> > + for (c = 0; c < conn_len; c++)
>
> Must be cache_len, too.
Oh , sorry, a mistake, will fix it.
>
>
> thanks,
>
> Takashi
>
>
> > + snd_iprintf(buffer, " 0x%02x", list[c]);
> > + snd_iprintf(buffer, "\n");
> > + }
> > + }
> > }
> >
> > static void print_gpio(struct snd_info_buffer *buffer,
> > --
> > 1.8.1.2
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ALSA: hda - Remove unused variable
2013-06-24 13:10 [PATCH 1/2] ALSA: hda - Remove unused variable Wang Xingchao
@ 2013-06-24 12:16 ` Takashi Iwai
2013-06-24 13:10 ` [PATCH 2/2 V2] ALSA: hda - Add cache connection info Wang Xingchao
1 sibling, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2013-06-24 12:16 UTC (permalink / raw)
To: Wang Xingchao; +Cc: alsa-devel, xingchao.wang
At Mon, 24 Jun 2013 09:10:18 -0400,
Wang Xingchao wrote:
>
> Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
Thanks, applied this one.
Takashi
> ---
> sound/pci/hda/patch_hdmi.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index 7803ddd..0f7a380 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -1891,7 +1891,6 @@ static void intel_haswell_fixup_connect_list(struct hda_codec *codec,
>
> /* override pins connection list */
> snd_printdd("hdmi: haswell: override pin connection 0x%x\n", nid);
> - nconns = max(spec->num_cvts, 4);
> snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids);
> }
>
> --
> 1.8.1.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ALSA: hda - Remove unused variable
@ 2013-06-24 13:10 Wang Xingchao
2013-06-24 12:16 ` Takashi Iwai
2013-06-24 13:10 ` [PATCH 2/2 V2] ALSA: hda - Add cache connection info Wang Xingchao
0 siblings, 2 replies; 6+ messages in thread
From: Wang Xingchao @ 2013-06-24 13:10 UTC (permalink / raw)
To: tiwai; +Cc: alsa-devel, Wang Xingchao, xingchao.wang
Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
---
sound/pci/hda/patch_hdmi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 7803ddd..0f7a380 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1891,7 +1891,6 @@ static void intel_haswell_fixup_connect_list(struct hda_codec *codec,
/* override pins connection list */
snd_printdd("hdmi: haswell: override pin connection 0x%x\n", nid);
- nconns = max(spec->num_cvts, 4);
snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids);
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2 V2] ALSA: hda - Add cache connection info
2013-06-24 13:10 [PATCH 1/2] ALSA: hda - Remove unused variable Wang Xingchao
2013-06-24 12:16 ` Takashi Iwai
@ 2013-06-24 13:10 ` Wang Xingchao
2013-06-24 12:07 ` Takashi Iwai
1 sibling, 1 reply; 6+ messages in thread
From: Wang Xingchao @ 2013-06-24 13:10 UTC (permalink / raw)
To: tiwai; +Cc: alsa-devel, Wang Xingchao, xingchao.wang
Pin's connection list may change dynamically with hot-plug event
on Intel Haswell chip. Users would see connections be "0" in codec#.
when play audio on this pin, software choose connections from cache.
So add Cache connection info to avoid confuse.
Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
---
sound/pci/hda/hda_proc.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 0fee8fa..403589c 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -504,6 +504,8 @@ static void print_conn_list(struct snd_info_buffer *buffer,
int conn_len)
{
int c, curr = -1;
+ const hda_nid_t *list;
+ int cache_len;
if (conn_len > 1 &&
wid_type != AC_WID_AUD_MIX &&
@@ -511,7 +513,7 @@ static void print_conn_list(struct snd_info_buffer *buffer,
wid_type != AC_WID_POWER)
curr = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CONNECT_SEL, 0);
- snd_iprintf(buffer, " Connection: %d\n", conn_len);
+ snd_iprintf(buffer, " Raw Connection: %d\n", conn_len);
if (conn_len > 0) {
snd_iprintf(buffer, " ");
for (c = 0; c < conn_len; c++) {
@@ -521,6 +523,19 @@ static void print_conn_list(struct snd_info_buffer *buffer,
}
snd_iprintf(buffer, "\n");
}
+
+ /* Get Cache connections info */
+ cache_len = snd_hda_get_conn_list(codec, nid, &list);
+ if (cache_len != conn_len
+ || memcmp(list, conn, conn_len)) {
+ snd_iprintf(buffer, " Cache Connection: %d\n", conn_len);
+ if (cache_len > 0) {
+ snd_iprintf(buffer, " ");
+ for (c = 0; c < conn_len; c++)
+ snd_iprintf(buffer, " 0x%02x", list[c]);
+ snd_iprintf(buffer, "\n");
+ }
+ }
}
static void print_gpio(struct snd_info_buffer *buffer,
--
1.8.1.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2 V2] ALSA: hda - Add cache connection info
2013-06-24 12:07 ` Takashi Iwai
2013-06-24 12:10 ` Wang, Xingchao
@ 2013-06-25 2:29 ` Wang, Xingchao
1 sibling, 0 replies; 6+ messages in thread
From: Wang, Xingchao @ 2013-06-25 2:29 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Wang Xingchao
Hi Takashi,
I revised the patch and will send you now. The "Cache connection" name was replaced with "In-driver connection".
In my test with only one HDMI monitor connected at second pin, it looks like:
Node 5/7:
Connection: 0
In-driver Connection: 3
0x02 0x03 0x04
Node 6:
Connection: 3
0x02* 0x03 0x04
Thanks
--xingchao
> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai@suse.de]
> Sent: Monday, June 24, 2013 8:07 PM
> To: Wang Xingchao
> Cc: alsa-devel@alsa-project.org; Wang, Xingchao
> Subject: Re: [PATCH 2/2 V2] ALSA: hda - Add cache connection info
>
> At Mon, 24 Jun 2013 09:10:19 -0400,
> Wang Xingchao wrote:
> >
> > Pin's connection list may change dynamically with hot-plug event on
> > Intel Haswell chip. Users would see connections be "0" in codec#.
> > when play audio on this pin, software choose connections from cache.
> > So add Cache connection info to avoid confuse.
> >
> > Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
> > ---
> > sound/pci/hda/hda_proc.c | 17 ++++++++++++++++-
> > 1 file changed, 16 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index
> > 0fee8fa..403589c 100644
> > --- a/sound/pci/hda/hda_proc.c
> > +++ b/sound/pci/hda/hda_proc.c
> > @@ -504,6 +504,8 @@ static void print_conn_list(struct snd_info_buffer
> *buffer,
> > int conn_len)
> > {
> > int c, curr = -1;
> > + const hda_nid_t *list;
> > + int cache_len;
> >
> > if (conn_len > 1 &&
> > wid_type != AC_WID_AUD_MIX &&
> > @@ -511,7 +513,7 @@ static void print_conn_list(struct snd_info_buffer
> *buffer,
> > wid_type != AC_WID_POWER)
> > curr = snd_hda_codec_read(codec, nid, 0,
> > AC_VERB_GET_CONNECT_SEL, 0);
> > - snd_iprintf(buffer, " Connection: %d\n", conn_len);
> > + snd_iprintf(buffer, " Raw Connection: %d\n", conn_len);
>
> Don't change the existing entry. It'll break the user-space tools that read the
> proc contents.
>
> > if (conn_len > 0) {
> > snd_iprintf(buffer, " ");
> > for (c = 0; c < conn_len; c++) {
> > @@ -521,6 +523,19 @@ static void print_conn_list(struct snd_info_buffer
> *buffer,
> > }
> > snd_iprintf(buffer, "\n");
> > }
> > +
> > + /* Get Cache connections info */
> > + cache_len = snd_hda_get_conn_list(codec, nid, &list);
> > + if (cache_len != conn_len
> > + || memcmp(list, conn, conn_len)) {
> > + snd_iprintf(buffer, " Cache Connection: %d\n", conn_len);
>
> Must be cache_len.
>
> Also "Cache connection" might be a bit misleading. In this case, it's not
> cached but used as alternative in driver. "In-driver connection"
> or such? English-native people can give better advice...
>
> > + if (cache_len > 0) {
> > + snd_iprintf(buffer, " ");
> > + for (c = 0; c < conn_len; c++)
>
> Must be cache_len, too.
>
>
> thanks,
>
> Takashi
>
>
> > + snd_iprintf(buffer, " 0x%02x", list[c]);
> > + snd_iprintf(buffer, "\n");
> > + }
> > + }
> > }
> >
> > static void print_gpio(struct snd_info_buffer *buffer,
> > --
> > 1.8.1.2
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-06-25 2:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-24 13:10 [PATCH 1/2] ALSA: hda - Remove unused variable Wang Xingchao
2013-06-24 12:16 ` Takashi Iwai
2013-06-24 13:10 ` [PATCH 2/2 V2] ALSA: hda - Add cache connection info Wang Xingchao
2013-06-24 12:07 ` Takashi Iwai
2013-06-24 12:10 ` Wang, Xingchao
2013-06-25 2:29 ` Wang, Xingchao
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.