mirror of
https://github.com/alsa-project/alsa-utils
synced 2025-01-03 05:19:46 +01:00
amixer: Print TLV of channel map controls
Previously these were written as "unk-25..." which wasn't very user friendly. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
c80a38dbf5
commit
9fe90a020c
1 changed files with 22 additions and 0 deletions
|
@ -443,6 +443,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
|
||||||
unsigned int type = tlv[0];
|
unsigned int type = tlv[0];
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
unsigned int idx = 0;
|
unsigned int idx = 0;
|
||||||
|
const char *chmap_type = NULL;
|
||||||
|
|
||||||
if (tlv_size < 2 * sizeof(unsigned int)) {
|
if (tlv_size < 2 * sizeof(unsigned int)) {
|
||||||
printf("TLV size error!\n");
|
printf("TLV size error!\n");
|
||||||
|
@ -540,6 +541,27 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
|
||||||
print_dB((int)tlv[3]);
|
print_dB((int)tlv[3]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#ifdef SND_CTL_TLVT_CHMAP_FIXED
|
||||||
|
case SND_CTL_TLVT_CHMAP_FIXED:
|
||||||
|
chmap_type = "fixed";
|
||||||
|
/* Fall through */
|
||||||
|
case SND_CTL_TLVT_CHMAP_VAR:
|
||||||
|
if (!chmap_type)
|
||||||
|
chmap_type = "variable";
|
||||||
|
/* Fall through */
|
||||||
|
case SND_CTL_TLVT_CHMAP_PAIRED:
|
||||||
|
if (!chmap_type)
|
||||||
|
chmap_type = "paired";
|
||||||
|
printf("chmap-%s=", chmap_type);
|
||||||
|
|
||||||
|
while (size > 0) {
|
||||||
|
printf("%s", snd_pcm_chmap_name(tlv[idx++]));
|
||||||
|
size -= sizeof(unsigned int);
|
||||||
|
if (size > 0)
|
||||||
|
printf(",");
|
||||||
|
}
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
printf("unk-%i-", type);
|
printf("unk-%i-", type);
|
||||||
|
|
Loading…
Reference in a new issue