]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/cli-text.c
sink-input, source-output: Remove redundant get_mute() functions
[pulseaudio] / src / pulsecore / cli-text.c
index 5498744cd842002de4352a26f87727f7823e8260..2992ae834f57e0b73222b7aecf00938dc5f8a3af 100644 (file)
@@ -37,6 +37,7 @@
 #include <pulsecore/core-scache.h>
 #include <pulsecore/macro.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/namereg.h>
 
 #include "cli-text.h"
 
@@ -50,7 +51,7 @@ char *pa_module_list_to_string(pa_core *c) {
 
     pa_strbuf_printf(s, "%u module(s) loaded.\n", pa_idxset_size(c->modules));
 
-    for (m = pa_idxset_first(c->modules, &idx); m; m = pa_idxset_next(c->modules, &idx)) {
+    PA_IDXSET_FOREACH(m, c->modules, idx) {
         char *t;
 
         pa_strbuf_printf(s, "    index: %u\n"
@@ -82,7 +83,7 @@ char *pa_client_list_to_string(pa_core *c) {
 
     pa_strbuf_printf(s, "%u client(s) logged in.\n", pa_idxset_size(c->clients));
 
-    for (client = pa_idxset_first(c->clients, &idx); client; client = pa_idxset_next(c->clients, &idx)) {
+    PA_IDXSET_FOREACH(client, c->clients, idx) {
         char *t;
         pa_strbuf_printf(
                 s,
@@ -102,6 +103,39 @@ char *pa_client_list_to_string(pa_core *c) {
     return pa_strbuf_tostring_free(s);
 }
 
+static const char *available_to_string(pa_available_t a) {
+    switch (a) {
+        case PA_AVAILABLE_UNKNOWN:
+            return "unknown";
+        case PA_AVAILABLE_NO:
+            return "no";
+        case PA_AVAILABLE_YES:
+            return "yes";
+        default:
+            return "invalid"; /* Should never happen! */
+    }
+}
+
+static void append_port_list(pa_strbuf *s, pa_hashmap *ports) {
+    pa_device_port *p;
+    void *state;
+
+    pa_assert(ports);
+
+    if (pa_hashmap_isempty(ports))
+        return;
+
+    pa_strbuf_puts(s, "\tports:\n");
+    PA_HASHMAP_FOREACH(p, ports, state) {
+        char *t = pa_proplist_to_string_sep(p->proplist, "\n\t\t\t\t");
+        pa_strbuf_printf(s, "\t\t%s: %s (priority %u, latency offset %" PRId64 " usec, available: %s)\n",
+            p->name, p->description, p->priority, p->latency_offset,
+            available_to_string(p->available));
+        pa_strbuf_printf(s, "\t\t\tproperties:\n\t\t\t\t%s\n", t);
+        pa_xfree(t);
+    }
+}
+
 char *pa_card_list_to_string(pa_core *c) {
     pa_strbuf *s;
     pa_card *card;
@@ -112,11 +146,13 @@ char *pa_card_list_to_string(pa_core *c) {
 
     pa_strbuf_printf(s, "%u card(s) available.\n", pa_idxset_size(c->cards));
 
-    for (card = pa_idxset_first(c->cards, &idx); card; card = pa_idxset_next(c->cards, &idx)) {
+    PA_IDXSET_FOREACH(card, c->cards, idx) {
         char *t;
         pa_sink *sink;
         pa_source *source;
         uint32_t sidx;
+        pa_card_profile *profile;
+        void *state;
 
         pa_strbuf_printf(
                 s,
@@ -134,32 +170,29 @@ char *pa_card_list_to_string(pa_core *c) {
         pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
         pa_xfree(t);
 
-        if (card->profiles) {
-            pa_card_profile *p;
-            void *state;
-
-            pa_strbuf_puts(s, "\tprofiles:\n");
-            PA_HASHMAP_FOREACH(p, card->profiles, state)
-                pa_strbuf_printf(s, "\t\t%s: %s (priority %u)\n", p->name, p->description, p->priority);
-        }
+        pa_strbuf_puts(s, "\tprofiles:\n");
+        PA_HASHMAP_FOREACH(profile, card->profiles, state)
+            pa_strbuf_printf(s, "\t\t%s: %s (priority %u, available: %s)\n", profile->name, profile->description,
+                             profile->priority, available_to_string(profile->available));
 
-        if (card->active_profile)
-            pa_strbuf_printf(
-                    s,
-                    "\tactive profile: <%s>\n",
-                    card->active_profile->name);
+        pa_strbuf_printf(
+                s,
+                "\tactive profile: <%s>\n",
+                card->active_profile->name);
 
         if (!pa_idxset_isempty(card->sinks)) {
             pa_strbuf_puts(s, "\tsinks:\n");
-            for (sink = pa_idxset_first(card->sinks, &sidx); sink; sink = pa_idxset_next(card->sinks, &sidx))
+            PA_IDXSET_FOREACH(sink, card->sinks, sidx)
                 pa_strbuf_printf(s, "\t\t%s/#%u: %s\n", sink->name, sink->index, pa_strna(pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_DESCRIPTION)));
         }
 
         if (!pa_idxset_isempty(card->sources)) {
             pa_strbuf_puts(s, "\tsources:\n");
-            for (source = pa_idxset_first(card->sources, &sidx); source; source = pa_idxset_next(card->sources, &sidx))
+            PA_IDXSET_FOREACH(source, card->sources, sidx)
                 pa_strbuf_printf(s, "\t\t%s/#%u: %s\n", source->name, source->index, pa_strna(pa_proplist_gets(source->proplist, PA_PROP_DEVICE_DESCRIPTION)));
         }
+
+        append_port_list(s, card->ports);
     }
 
     return pa_strbuf_tostring_free(s);
@@ -201,7 +234,7 @@ static const char *source_state_to_string(pa_source_state_t state) {
 
 char *pa_sink_list_to_string(pa_core *c) {
     pa_strbuf *s;
-    pa_sink *sink;
+    pa_sink *sink, *default_sink;
     uint32_t idx = PA_IDXSET_INVALID;
     pa_assert(c);
 
@@ -209,18 +242,17 @@ char *pa_sink_list_to_string(pa_core *c) {
 
     pa_strbuf_printf(s, "%u sink(s) available.\n", pa_idxset_size(c->sinks));
 
-    for (sink = pa_idxset_first(c->sinks, &idx); sink; sink = pa_idxset_next(c->sinks, &idx)) {
+    default_sink = pa_namereg_get_default_sink(c);
+
+    PA_IDXSET_FOREACH(sink, c->sinks, idx) {
         char ss[PA_SAMPLE_SPEC_SNPRINT_MAX],
-            cv[PA_CVOLUME_SNPRINT_MAX],
-            cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX],
-            v[PA_VOLUME_SNPRINT_MAX],
-            vdb[PA_SW_VOLUME_SNPRINT_DB_MAX],
+            cv[PA_CVOLUME_SNPRINT_VERBOSE_MAX],
+            v[PA_VOLUME_SNPRINT_VERBOSE_MAX],
             cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t;
         const char *cmn;
 
         cmn = pa_channel_map_to_pretty_name(&sink->channel_map);
 
-
         pa_strbuf_printf(
             s,
             "  %c index: %u\n"
@@ -230,9 +262,9 @@ char *pa_sink_list_to_string(pa_core *c) {
             "\tstate: %s\n"
             "\tsuspend cause: %s%s%s%s\n"
             "\tpriority: %u\n"
-            "\tvolume: %s%s%s\n"
+            "\tvolume: %s\n"
             "\t        balance %0.2f\n"
-            "\tbase volume: %s%s%s\n"
+            "\tbase volume: %s\n"
             "\tvolume steps: %u\n"
             "\tmuted: %s\n"
             "\tcurrent latency: %0.2f ms\n"
@@ -243,7 +275,7 @@ char *pa_sink_list_to_string(pa_core *c) {
             "\tchannel map: %s%s%s\n"
             "\tused by: %u\n"
             "\tlinked by: %u\n",
-            sink == c->default_sink ? '*' : ' ',
+            sink == default_sink ? '*' : ' ',
             sink->index,
             sink->name,
             sink->driver,
@@ -261,15 +293,15 @@ char *pa_sink_list_to_string(pa_core *c) {
             sink->suspend_cause & PA_SUSPEND_IDLE ? "IDLE " : "",
             sink->suspend_cause & PA_SUSPEND_SESSION ? "SESSION" : "",
             sink->priority,
-            pa_cvolume_snprint(cv, sizeof(cv), pa_sink_get_volume(sink, FALSE)),
-            sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t        " : "",
-            sink->flags & PA_SINK_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_sink_get_volume(sink, FALSE)) : "",
-            pa_cvolume_get_balance(pa_sink_get_volume(sink, FALSE), &sink->channel_map),
-            pa_volume_snprint(v, sizeof(v), sink->base_volume),
-            sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t             " : "",
-            sink->flags & PA_SINK_DECIBEL_VOLUME ? pa_sw_volume_snprint_dB(vdb, sizeof(vdb), sink->base_volume) : "",
+            pa_cvolume_snprint_verbose(cv,
+                                       sizeof(cv),
+                                       pa_sink_get_volume(sink, false),
+                                       &sink->channel_map,
+                                       sink->flags & PA_SINK_DECIBEL_VOLUME),
+            pa_cvolume_get_balance(pa_sink_get_volume(sink, false), &sink->channel_map),
+            pa_volume_snprint_verbose(v, sizeof(v), sink->base_volume, sink->flags & PA_SINK_DECIBEL_VOLUME),
             sink->n_volume_steps,
-            pa_yes_no(pa_sink_get_mute(sink, FALSE)),
+            pa_yes_no(pa_sink_get_mute(sink, false)),
             (double) pa_sink_get_latency(sink) / (double) PA_USEC_PER_MSEC,
             (unsigned long) pa_sink_get_max_request(sink) / 1024,
             (unsigned long) pa_sink_get_max_rewind(sink) / 1024,
@@ -306,15 +338,7 @@ char *pa_sink_list_to_string(pa_core *c) {
         pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
         pa_xfree(t);
 
-        if (sink->ports) {
-            pa_device_port *p;
-            void *state;
-
-            pa_strbuf_puts(s, "\tports:\n");
-            PA_HASHMAP_FOREACH(p, sink->ports, state)
-                pa_strbuf_printf(s, "\t\t%s: %s (priority %u)\n", p->name, p->description, p->priority);
-        }
-
+        append_port_list(s, sink->ports);
 
         if (sink->active_port)
             pa_strbuf_printf(
@@ -328,7 +352,7 @@ char *pa_sink_list_to_string(pa_core *c) {
 
 char *pa_source_list_to_string(pa_core *c) {
     pa_strbuf *s;
-    pa_source *source;
+    pa_source *source, *default_source;
     uint32_t idx = PA_IDXSET_INVALID;
     pa_assert(c);
 
@@ -336,12 +360,12 @@ char *pa_source_list_to_string(pa_core *c) {
 
     pa_strbuf_printf(s, "%u source(s) available.\n", pa_idxset_size(c->sources));
 
-    for (source = pa_idxset_first(c->sources, &idx); source; source = pa_idxset_next(c->sources, &idx)) {
+    default_source = pa_namereg_get_default_source(c);
+
+    PA_IDXSET_FOREACH(source, c->sources, idx) {
         char ss[PA_SAMPLE_SPEC_SNPRINT_MAX],
-            cv[PA_CVOLUME_SNPRINT_MAX],
-            cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX],
-            v[PA_VOLUME_SNPRINT_MAX],
-            vdb[PA_SW_VOLUME_SNPRINT_DB_MAX],
+            cv[PA_CVOLUME_SNPRINT_VERBOSE_MAX],
+            v[PA_VOLUME_SNPRINT_VERBOSE_MAX],
             cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t;
         const char *cmn;
 
@@ -356,9 +380,9 @@ char *pa_source_list_to_string(pa_core *c) {
             "\tstate: %s\n"
             "\tsuspend cause: %s%s%s%s\n"
             "\tpriority: %u\n"
-            "\tvolume: %s%s%s\n"
+            "\tvolume: %s\n"
             "\t        balance %0.2f\n"
-            "\tbase volume: %s%s%s\n"
+            "\tbase volume: %s\n"
             "\tvolume steps: %u\n"
             "\tmuted: %s\n"
             "\tcurrent latency: %0.2f ms\n"
@@ -367,7 +391,7 @@ char *pa_source_list_to_string(pa_core *c) {
             "\tchannel map: %s%s%s\n"
             "\tused by: %u\n"
             "\tlinked by: %u\n",
-            c->default_source == source ? '*' : ' ',
+            source == default_source ? '*' : ' ',
             source->index,
             source->name,
             source->driver,
@@ -384,15 +408,15 @@ char *pa_source_list_to_string(pa_core *c) {
             source->suspend_cause & PA_SUSPEND_IDLE ? "IDLE " : "",
             source->suspend_cause & PA_SUSPEND_SESSION ? "SESSION" : "",
             source->priority,
-            pa_cvolume_snprint(cv, sizeof(cv), pa_source_get_volume(source, FALSE)),
-            source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t        " : "",
-            source->flags & PA_SOURCE_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_source_get_volume(source, FALSE)) : "",
-            pa_cvolume_get_balance(pa_source_get_volume(source, FALSE), &source->channel_map),
-            pa_volume_snprint(v, sizeof(v), source->base_volume),
-            source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t             " : "",
-            source->flags & PA_SOURCE_DECIBEL_VOLUME ? pa_sw_volume_snprint_dB(vdb, sizeof(vdb), source->base_volume) : "",
+            pa_cvolume_snprint_verbose(cv,
+                                       sizeof(cv),
+                                       pa_source_get_volume(source, false),
+                                       &source->channel_map,
+                                       source->flags & PA_SOURCE_DECIBEL_VOLUME),
+            pa_cvolume_get_balance(pa_source_get_volume(source, false), &source->channel_map),
+            pa_volume_snprint_verbose(v, sizeof(v), source->base_volume, source->flags & PA_SOURCE_DECIBEL_VOLUME),
             source->n_volume_steps,
-            pa_yes_no(pa_source_get_mute(source, FALSE)),
+            pa_yes_no(pa_source_get_mute(source, false)),
             (double) pa_source_get_latency(source) / PA_USEC_PER_MSEC,
             (unsigned long) pa_source_get_max_rewind(source) / 1024,
             pa_sample_spec_snprint(ss, sizeof(ss), &source->sample_spec),
@@ -429,14 +453,7 @@ char *pa_source_list_to_string(pa_core *c) {
         pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
         pa_xfree(t);
 
-        if (source->ports) {
-            pa_device_port *p;
-            void *state;
-
-            pa_strbuf_puts(s, "\tports:\n");
-            PA_HASHMAP_FOREACH(p, source->ports, state)
-                pa_strbuf_printf(s, "\t\t%s: %s (priority %u)\n", p->name, p->description, p->priority);
-        }
+        append_port_list(s, source->ports);
 
         if (source->active_port)
             pa_strbuf_printf(
@@ -448,7 +465,6 @@ char *pa_source_list_to_string(pa_core *c) {
     return pa_strbuf_tostring_free(s);
 }
 
-
 char *pa_source_output_list_to_string(pa_core *c) {
     pa_strbuf *s;
     pa_source_output *o;
@@ -463,12 +479,14 @@ char *pa_source_output_list_to_string(pa_core *c) {
 
     s = pa_strbuf_new();
 
-    pa_strbuf_printf(s, "%u source outputs(s) available.\n", pa_idxset_size(c->source_outputs));
+    pa_strbuf_printf(s, "%u source output(s) available.\n", pa_idxset_size(c->source_outputs));
 
-    for (o = pa_idxset_first(c->source_outputs, &idx); o; o = pa_idxset_next(c->source_outputs, &idx)) {
-        char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t, clt[28];
+    PA_IDXSET_FOREACH(o, c->source_outputs, idx) {
+        char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cv[PA_CVOLUME_SNPRINT_VERBOSE_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t, clt[28];
         pa_usec_t cl;
         const char *cmn;
+        pa_cvolume v;
+        char *volume_str = NULL;
 
         cmn = pa_channel_map_to_pretty_name(&o->channel_map);
 
@@ -479,13 +497,23 @@ char *pa_source_output_list_to_string(pa_core *c) {
 
         pa_assert(o->source);
 
+        if (pa_source_output_is_volume_readable(o)) {
+            pa_source_output_get_volume(o, &v, true);
+            volume_str = pa_sprintf_malloc("%s\n\t        balance %0.2f",
+                                           pa_cvolume_snprint_verbose(cv, sizeof(cv), &v, &o->channel_map, true),
+                                           pa_cvolume_get_balance(&v, &o->channel_map));
+        } else
+            volume_str = pa_xstrdup("n/a");
+
         pa_strbuf_printf(
             s,
             "    index: %u\n"
             "\tdriver: <%s>\n"
-            "\tflags: %s%s%s%s%s%s%s%s%s%s%s\n"
+            "\tflags: %s%s%s%s%s%s%s%s%s%s%s%s\n"
             "\tstate: %s\n"
             "\tsource: %u <%s>\n"
+            "\tvolume: %s\n"
+            "\tmuted: %s\n"
             "\tcurrent latency: %0.2f ms\n"
             "\trequested latency: %s\n"
             "\tsample spec: %s\n"
@@ -504,8 +532,11 @@ char *pa_source_output_list_to_string(pa_core *c) {
             o->flags & PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND ? "DONT_INHIBIT_AUTO_SUSPEND " : "",
             o->flags & PA_SOURCE_OUTPUT_NO_CREATE_ON_SUSPEND ? "NO_CREATE_ON_SUSPEND " : "",
             o->flags & PA_SOURCE_OUTPUT_KILL_ON_SUSPEND ? "KILL_ON_SUSPEND " : "",
+            o->flags & PA_SOURCE_OUTPUT_PASSTHROUGH ? "PASSTHROUGH " : "",
             state_table[pa_source_output_get_state(o)],
             o->source->index, o->source->name,
+            volume_str,
+            pa_yes_no(o->muted),
             (double) pa_source_output_get_latency(o, NULL) / PA_USEC_PER_MSEC,
             clt,
             pa_sample_spec_snprint(ss, sizeof(ss), &o->sample_spec),
@@ -513,6 +544,9 @@ char *pa_source_output_list_to_string(pa_core *c) {
             cmn ? "\n\t             " : "",
             cmn ? cmn : "",
             pa_resample_method_to_string(pa_source_output_get_resample_method(o)));
+
+        pa_xfree(volume_str);
+
         if (o->module)
             pa_strbuf_printf(s, "\towner module: %u\n", o->module->index);
         if (o->client)
@@ -545,8 +579,8 @@ char *pa_sink_input_list_to_string(pa_core *c) {
 
     pa_strbuf_printf(s, "%u sink input(s) available.\n", pa_idxset_size(c->sink_inputs));
 
-    for (i = pa_idxset_first(c->sink_inputs, &idx); i; i = pa_idxset_next(c->sink_inputs, &idx)) {
-        char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX], cv[PA_CVOLUME_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t, clt[28];
+    PA_IDXSET_FOREACH(i, c->sink_inputs, idx) {
+        char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cv[PA_CVOLUME_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t, clt[28];
         pa_usec_t cl;
         const char *cmn;
         pa_cvolume v;
@@ -562,10 +596,9 @@ char *pa_sink_input_list_to_string(pa_core *c) {
         pa_assert(i->sink);
 
         if (pa_sink_input_is_volume_readable(i)) {
-            pa_sink_input_get_volume(i, &v, TRUE);
-            volume_str = pa_sprintf_malloc("%s\n\t        %s\n\t        balance %0.2f",
-                                           pa_cvolume_snprint(cv, sizeof(cv), &v),
-                                           pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), &v),
+            pa_sink_input_get_volume(i, &v, true);
+            volume_str = pa_sprintf_malloc("%s\n\t        balance %0.2f",
+                                           pa_cvolume_snprint_verbose(cv, sizeof(cv), &v, &i->channel_map, true),
                                            pa_cvolume_get_balance(&v, &i->channel_map));
         } else
             volume_str = pa_xstrdup("n/a");
@@ -574,7 +607,7 @@ char *pa_sink_input_list_to_string(pa_core *c) {
             s,
             "    index: %u\n"
             "\tdriver: <%s>\n"
-            "\tflags: %s%s%s%s%s%s%s%s%s%s%s\n"
+            "\tflags: %s%s%s%s%s%s%s%s%s%s%s%s\n"
             "\tstate: %s\n"
             "\tsink: %u <%s>\n"
             "\tvolume: %s\n"
@@ -597,10 +630,11 @@ char *pa_sink_input_list_to_string(pa_core *c) {
             i->flags & PA_SINK_INPUT_DONT_INHIBIT_AUTO_SUSPEND ? "DONT_INHIBIT_AUTO_SUSPEND " : "",
             i->flags & PA_SINK_INPUT_NO_CREATE_ON_SUSPEND ? "NO_CREATE_SUSPEND " : "",
             i->flags & PA_SINK_INPUT_KILL_ON_SUSPEND ? "KILL_ON_SUSPEND " : "",
+            i->flags & PA_SINK_INPUT_PASSTHROUGH ? "PASSTHROUGH " : "",
             state_table[pa_sink_input_get_state(i)],
             i->sink->index, i->sink->name,
             volume_str,
-            pa_yes_no(pa_sink_input_get_mute(i)),
+            pa_yes_no(i->muted),
             (double) pa_sink_input_get_latency(i, NULL) / PA_USEC_PER_MSEC,
             clt,
             pa_sample_spec_snprint(ss, sizeof(ss), &i->sample_spec),
@@ -636,9 +670,9 @@ char *pa_scache_list_to_string(pa_core *c) {
         pa_scache_entry *e;
         uint32_t idx = PA_IDXSET_INVALID;
 
-        for (e = pa_idxset_first(c->scache, &idx); e; e = pa_idxset_next(c->scache, &idx)) {
+        PA_IDXSET_FOREACH(e, c->scache, idx) {
             double l = 0;
-            char ss[PA_SAMPLE_SPEC_SNPRINT_MAX] = "n/a", cv[PA_CVOLUME_SNPRINT_MAX], cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX] = "n/a", *t;
+            char ss[PA_SAMPLE_SPEC_SNPRINT_MAX] = "n/a", cv[PA_CVOLUME_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX] = "n/a", *t;
             const char *cmn;
 
             cmn = pa_channel_map_to_pretty_name(&e->channel_map);
@@ -658,7 +692,6 @@ char *pa_scache_list_to_string(pa_core *c) {
                 "\tlength: %lu\n"
                 "\tduration: %0.1f s\n"
                 "\tvolume: %s\n"
-                "\t        %s\n"
                 "\t        balance %0.2f\n"
                 "\tlazy: %s\n"
                 "\tfilename: <%s>\n",
@@ -670,8 +703,7 @@ char *pa_scache_list_to_string(pa_core *c) {
                 cmn ? cmn : "",
                 (long unsigned)(e->memchunk.memblock ? e->memchunk.length : 0),
                 l,
-                e->volume_is_set ? pa_cvolume_snprint(cv, sizeof(cv), &e->volume) : "n/a",
-                e->volume_is_set ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), &e->volume) : "n/a",
+                e->volume_is_set ? pa_cvolume_snprint_verbose(cv, sizeof(cv), &e->volume, &e->channel_map, true) : "n/a",
                 (e->memchunk.memblock && e->volume_is_set) ? pa_cvolume_get_balance(&e->volume, &e->channel_map) : 0.0f,
                 pa_yes_no(e->lazy),
                 e->filename ? e->filename : "n/a");