]> git.alsa-project.org Git - alsa-utils.git/commitdiff
amixer: Print TLV of channel map controls
authorDavid Henningsson <david.henningsson@canonical.com>
Fri, 14 Jun 2013 09:41:01 +0000 (11:41 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 14 Jun 2013 11:38:23 +0000 (13:38 +0200)
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>
amixer/amixer.c

index fe83b497e83c13c45de60cf2a1064afdc438012f..7727943c8d5c49830e3562f076d32a2c611cde49 100644 (file)
@@ -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");
@@ -540,6 +541,27 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
                        print_dB((int)tlv[3]);
                }
                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);