Skip to contentSkip to conversation

ALSA: hda/proc - dump the coeff with the capital letters

PATCH In review Hui Wang 2 participants 3 messages Jul 9, 2021 Sound

lore
Share & tools
lore

Hui Wang

author
#0 lore raw

PATCH 1/1 ALSA: hda/proc - dump the coeff with the capital letters

Sometimes we need to dump the coeff to debug the audio issues, and need to compare it with the log of RTHDDump.exe under Windows, this is the coeff under Windows and Linux:
Vendor widget coefficient value under Windows

Index 0x00  0x0002
Index 0x01  0xAAAA
Index 0x02  0x8AAA

Processing caps: benign=0, ncoeff=91 under Linux
Coeff 0x00: 0x0002
Coeff 0x01: 0xaaaa
Coeff 0x02: 0x8aaa

Windows prints the hex number with capital letter while Linux prints the hex number with lower case letter, it adds the trouble when comparing them. Let us change it to use capital letter.

---
 sound/pci/hda/hda_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_proc.c +1 -1
index 00c2eeb2c472..9037c87665b6 100644
@@ -590,7 +590,7 @@ static void print_proc_caps(struct snd_info_buffer *buffer,
 		snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, i);
 		val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF,
 					 0);
-		snd_iprintf(buffer, "    Coeff 0x%02x: 0x%04x\n", i, val);
+		snd_iprintf(buffer, "    Coeff 0x%02X: 0x%04X\n", i, val);
 	}
 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, oldindex);
 }
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · Hui Wang

Sometimes we need to dump the coeff to debug the audio issues, and need to compare it with the log of RTHDDump.exe under Windows, this is the coeff under Windows and Linux:
Vendor widget coefficient value under Windows

Index 0x00  0x0002
Index 0x01  0xAAAA
Index 0x02  0x8AAA
Quoted 8 lines

Processing caps: benign=0, ncoeff=91 under Linux
Coeff 0x00: 0x0002
Coeff 0x01: 0xaaaa
Coeff 0x02: 0x8aaa

Windows prints the hex number with capital letter while Linux prints the hex number with lower case letter, it adds the trouble when comparing them. Let us change it to use capital letter.

I'm not convinced by that argument, sorry. You have to convert the strings in anyway (e.g. "Index" vs "Coeff" and strip colon). If we were to provide a compatible string intentionally, we'd have to fix it, but that's not the case.

Also, there can be already some tools to use the proc file and parse the values as of now, and such a change would break them.

thanks,

Takashi

Quoted 22 lines
---
 sound/pci/hda/hda_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_proc.c +1 -1
index 00c2eeb2c472..9037c87665b6 100644
@@ -590,7 +590,7 @@ static void print_proc_caps(struct snd_info_buffer *buffer,
 		snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, i);
 		val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF,
 					 0);
-		snd_iprintf(buffer, "    Coeff 0x%02x: 0x%04x\n", i, val);
+		snd_iprintf(buffer, "    Coeff 0x%02X: 0x%04X\n", i, val);
 	}
 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, oldindex);
 }
Signature · 1 line
2.25.1
author
#2 lore raw
Quoted 18 lines · Takashi Iwai
Quoted 8 lines · Hui Wang

Sometimes we need to dump the coeff to debug the audio issues, and need to compare it with the log of RTHDDump.exe under Windows, this is the coeff under Windows and Linux:
Vendor widget coefficient value under Windows

Index 0x00  0x0002
Index 0x01  0xAAAA
Index 0x02  0x8AAA
Quoted 8 lines

Processing caps: benign=0, ncoeff=91 under Linux
Coeff 0x00: 0x0002
Coeff 0x01: 0xaaaa
Coeff 0x02: 0x8aaa

Windows prints the hex number with capital letter while Linux prints the hex number with lower case letter, it adds the trouble when comparing them. Let us change it to use capital letter.

Quoted 7 lines

I'm not convinced by that argument, sorry. You have to convert the strings in anyway (e.g. "Index" vs "Coeff" and strip colon). If we were to provide a compatible string intentionally, we'd have to fix it, but that's not the case.

Also, there can be already some tools to use the proc file and parse the values as of now, and such a change would break them.

OK, got it.

Thanks.

Quoted 26 lines

thanks,

Takashi

Quoted 21 lines
---
  sound/pci/hda/hda_proc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_proc.c +1 -1
index 00c2eeb2c472..9037c87665b6 100644
@@ -590,7 +590,7 @@ static void print_proc_caps(struct snd_info_buffer *buffer,
  		snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, i);
  		val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF,
  					 0);
-		snd_iprintf(buffer, "    Coeff 0x%02x: 0x%04x\n", i, val);
+		snd_iprintf(buffer, "    Coeff 0x%02X: 0x%04X\n", i, val);
  	}
  	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, oldindex);
  }
Signature · 1 line
2.25.1