summaryrefslogtreecommitdiff
path: root/amixer
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2013-06-14 11:41:01 +0200
committerJaroslav Kysela <perex@perex.cz>2013-06-14 13:38:23 +0200
commit9fe90a020ccd2662120b498e9a5cdd4ea1b959ba (patch)
tree55b5813a2041b0c5a00f0e6a0c90dd8ae8b2aa86 /amixer
parentc80a38dbf53531d57c9bd4ccdc05553bd7fb79a1 (diff)
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>
Diffstat (limited to 'amixer')
-rw-r--r--amixer/amixer.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/amixer/amixer.c b/amixer/amixer.c
index fe83b49..7727943 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -443,6 +443,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
unsigned int type = tlv[0];
unsigned int size;
unsigned int idx = 0;
+ const char *chmap_type = NULL;
if (tlv_size < 2 * sizeof(unsigned int)) {
printf("TLV size error!\n");
@@ -541,6 +542,27 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
}
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
default:
printf("unk-%i-", type);
while (size > 0) {