diff mbox series

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

Message ID 20210709023345.6359-1-hui.wang@canonical.com
State New
Headers show
Series ALSA: hda/proc - dump the coeff with the capital letters | expand

Commit Message

Hui Wang July 9, 2021, 2:33 a.m. UTC
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.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/pci/hda/hda_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hui Wang July 9, 2021, 7:54 a.m. UTC | #1
On 7/9/21 3:52 PM, Takashi Iwai wrote:
> On Fri, 09 Jul 2021 04:33:45 +0200,
> Hui Wang wrote:
>> 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.
> 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.

>
> thanks,
>
> Takashi
>
>> Signed-off-by: Hui Wang <hui.wang@canonical.com>
>> ---
>>   sound/pci/hda/hda_proc.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
>> index 00c2eeb2c472..9037c87665b6 100644
>> --- a/sound/pci/hda/hda_proc.c
>> +++ b/sound/pci/hda/hda_proc.c
>> @@ -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);
>>   }
>> -- 
>> 2.25.1
>>
diff mbox series

Patch

diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 00c2eeb2c472..9037c87665b6 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -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);
 }