2 This file is part of PulseAudio.
4 Copyright 2004-2006 Lennart Poettering
6 PulseAudio is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 2.1 of the License,
9 or (at your option) any later version.
11 PulseAudio is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with PulseAudio; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
28 #include <pulse/volume.h>
29 #include <pulse/xmalloc.h>
30 #include <pulse/timeval.h>
32 #include <pulsecore/module.h>
33 #include <pulsecore/client.h>
34 #include <pulsecore/sink.h>
35 #include <pulsecore/source.h>
36 #include <pulsecore/sink-input.h>
37 #include <pulsecore/source-output.h>
38 #include <pulsecore/strbuf.h>
39 #include <pulsecore/sample-util.h>
40 #include <pulsecore/core-scache.h>
41 #include <pulsecore/macro.h>
42 #include <pulsecore/core-util.h>
46 char *pa_module_list_to_string(pa_core
*c
) {
49 uint32_t idx
= PA_IDXSET_INVALID
;
54 pa_strbuf_printf(s
, "%u module(s) loaded.\n", pa_idxset_size(c
->modules
));
56 for (m
= pa_idxset_first(c
->modules
, &idx
); m
; m
= pa_idxset_next(c
->modules
, &idx
)) {
59 pa_strbuf_printf(s
, " index: %u\n"
66 pa_strempty(m
->argument
),
67 pa_module_get_n_used(m
),
68 pa_yes_no(m
->load_once
));
70 t
= pa_proplist_to_string_sep(m
->proplist
, "\n\t\t");
71 pa_strbuf_printf(s
, "\tproperties:\n\t\t%s\n", t
);
75 return pa_strbuf_tostring_free(s
);
78 char *pa_client_list_to_string(pa_core
*c
) {
81 uint32_t idx
= PA_IDXSET_INVALID
;
86 pa_strbuf_printf(s
, "%u client(s) logged in.\n", pa_idxset_size(c
->clients
));
88 for (client
= pa_idxset_first(c
->clients
, &idx
); client
; client
= pa_idxset_next(c
->clients
, &idx
)) {
98 pa_strbuf_printf(s
, "\towner module: %u\n", client
->module
->index
);
100 t
= pa_proplist_to_string_sep(client
->proplist
, "\n\t\t");
101 pa_strbuf_printf(s
, "\tproperties:\n\t\t%s\n", t
);
105 return pa_strbuf_tostring_free(s
);
108 char *pa_card_list_to_string(pa_core
*c
) {
111 uint32_t idx
= PA_IDXSET_INVALID
;
116 pa_strbuf_printf(s
, "%u card(s) available.\n", pa_idxset_size(c
->cards
));
118 for (card
= pa_idxset_first(c
->cards
, &idx
); card
; card
= pa_idxset_next(c
->cards
, &idx
)) {
134 pa_strbuf_printf(s
, "\towner module: %u\n", card
->module
->index
);
136 t
= pa_proplist_to_string_sep(card
->proplist
, "\n\t\t");
137 pa_strbuf_printf(s
, "\tproperties:\n\t\t%s\n", t
);
140 if (card
->profiles
) {
144 pa_strbuf_puts(s
, "\tprofiles:\n");
146 while ((p
= pa_hashmap_iterate(card
->profiles
, &state
, NULL
)))
147 pa_strbuf_printf(s
, "\t\t%s: %s (priority %u)\n", p
->name
, p
->description
, p
->priority
);
150 if (card
->active_profile
)
153 "\tactive profile: <%s>\n",
154 card
->active_profile
->name
);
156 if (!pa_idxset_isempty(card
->sinks
)) {
157 pa_strbuf_puts(s
, "\tsinks:\n");
158 for (sink
= pa_idxset_first(card
->sinks
, &sidx
); sink
; sink
= pa_idxset_next(card
->sinks
, &sidx
))
159 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
)));
162 if (!pa_idxset_isempty(card
->sources
)) {
163 pa_strbuf_puts(s
, "\tsources:\n");
164 for (source
= pa_idxset_first(card
->sources
, &sidx
); source
; source
= pa_idxset_next(card
->sources
, &sidx
))
165 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
)));
169 return pa_strbuf_tostring_free(s
);
172 static const char *sink_state_to_string(pa_sink_state_t state
) {
176 case PA_SINK_RUNNING
:
178 case PA_SINK_SUSPENDED
:
182 case PA_SINK_UNLINKED
:
189 static const char *source_state_to_string(pa_source_state_t state
) {
193 case PA_SOURCE_RUNNING
:
195 case PA_SOURCE_SUSPENDED
:
199 case PA_SOURCE_UNLINKED
:
206 char *pa_sink_list_to_string(pa_core
*c
) {
209 uint32_t idx
= PA_IDXSET_INVALID
;
214 pa_strbuf_printf(s
, "%u sink(s) available.\n", pa_idxset_size(c
->sinks
));
216 for (sink
= pa_idxset_first(c
->sinks
, &idx
); sink
; sink
= pa_idxset_next(c
->sinks
, &idx
)) {
217 char ss
[PA_SAMPLE_SPEC_SNPRINT_MAX
],
218 cv
[PA_CVOLUME_SNPRINT_MAX
],
219 cvdb
[PA_SW_CVOLUME_SNPRINT_DB_MAX
],
220 v
[PA_VOLUME_SNPRINT_MAX
],
221 vdb
[PA_SW_VOLUME_SNPRINT_DB_MAX
],
222 cm
[PA_CHANNEL_MAP_SNPRINT_MAX
], *t
;
225 cmn
= pa_channel_map_to_pretty_name(&sink
->channel_map
);
233 "\tflags: %s%s%s%s%s%s%s%s\n"
237 "\tbase volume: %s%s%s\n"
238 "\tvolume steps: %u\n"
240 "\tcurrent latency: %0.2f ms\n"
241 "\tmax request: %lu KiB\n"
242 "\tmax rewind: %lu KiB\n"
243 "\tmonitor source: %u\n"
244 "\tsample spec: %s\n"
245 "\tchannel map: %s%s%s\n"
248 sink
== c
->default_sink
? '*' : ' ',
252 sink
->flags
& PA_SINK_HARDWARE
? "HARDWARE " : "",
253 sink
->flags
& PA_SINK_NETWORK
? "NETWORK " : "",
254 sink
->flags
& PA_SINK_HW_MUTE_CTRL
? "HW_MUTE_CTRL " : "",
255 sink
->flags
& PA_SINK_HW_VOLUME_CTRL
? "HW_VOLUME_CTRL " : "",
256 sink
->flags
& PA_SINK_DECIBEL_VOLUME
? "DECIBEL_VOLUME " : "",
257 sink
->flags
& PA_SINK_LATENCY
? "LATENCY " : "",
258 sink
->flags
& PA_SINK_FLAT_VOLUME
? "FLAT_VOLUME " : "",
259 sink
->flags
& PA_SINK_DYNAMIC_LATENCY
? "DYNAMIC_LATENCY" : "",
260 sink_state_to_string(pa_sink_get_state(sink
)),
261 pa_cvolume_snprint(cv
, sizeof(cv
), pa_sink_get_volume(sink
, FALSE
)),
262 sink
->flags
& PA_SINK_DECIBEL_VOLUME
? "\n\t " : "",
263 sink
->flags
& PA_SINK_DECIBEL_VOLUME
? pa_sw_cvolume_snprint_dB(cvdb
, sizeof(cvdb
), pa_sink_get_volume(sink
, FALSE
)) : "",
264 pa_cvolume_get_balance(pa_sink_get_volume(sink
, FALSE
), &sink
->channel_map
),
265 pa_volume_snprint(v
, sizeof(v
), sink
->base_volume
),
266 sink
->flags
& PA_SINK_DECIBEL_VOLUME
? "\n\t " : "",
267 sink
->flags
& PA_SINK_DECIBEL_VOLUME
? pa_sw_volume_snprint_dB(vdb
, sizeof(vdb
), sink
->base_volume
) : "",
268 sink
->n_volume_steps
,
269 pa_yes_no(pa_sink_get_mute(sink
, FALSE
)),
270 (double) pa_sink_get_latency(sink
) / (double) PA_USEC_PER_MSEC
,
271 (unsigned long) pa_sink_get_max_request(sink
) / 1024,
272 (unsigned long) pa_sink_get_max_rewind(sink
) / 1024,
273 sink
->monitor_source
? sink
->monitor_source
->index
: PA_INVALID_INDEX
,
274 pa_sample_spec_snprint(ss
, sizeof(ss
), &sink
->sample_spec
),
275 pa_channel_map_snprint(cm
, sizeof(cm
), &sink
->channel_map
),
278 pa_sink_used_by(sink
),
279 pa_sink_linked_by(sink
));
281 if (sink
->flags
& PA_SINK_DYNAMIC_LATENCY
) {
282 pa_usec_t min_latency
, max_latency
;
283 pa_sink_get_latency_range(sink
, &min_latency
, &max_latency
);
287 "\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n",
288 (double) pa_sink_get_requested_latency(sink
) / (double) PA_USEC_PER_MSEC
,
289 (double) min_latency
/ PA_USEC_PER_MSEC
,
290 (double) max_latency
/ PA_USEC_PER_MSEC
);
294 pa_strbuf_printf(s
, "\tcard: %u <%s>\n", sink
->card
->index
, sink
->card
->name
);
296 pa_strbuf_printf(s
, "\tmodule: %u\n", sink
->module
->index
);
298 t
= pa_proplist_to_string_sep(sink
->proplist
, "\n\t\t");
299 pa_strbuf_printf(s
, "\tproperties:\n\t\t%s\n", t
);
303 return pa_strbuf_tostring_free(s
);
306 char *pa_source_list_to_string(pa_core
*c
) {
309 uint32_t idx
= PA_IDXSET_INVALID
;
314 pa_strbuf_printf(s
, "%u source(s) available.\n", pa_idxset_size(c
->sources
));
316 for (source
= pa_idxset_first(c
->sources
, &idx
); source
; source
= pa_idxset_next(c
->sources
, &idx
)) {
317 char ss
[PA_SAMPLE_SPEC_SNPRINT_MAX
],
318 cv
[PA_CVOLUME_SNPRINT_MAX
],
319 cvdb
[PA_SW_CVOLUME_SNPRINT_DB_MAX
],
320 v
[PA_VOLUME_SNPRINT_MAX
],
321 vdb
[PA_SW_VOLUME_SNPRINT_DB_MAX
],
322 cm
[PA_CHANNEL_MAP_SNPRINT_MAX
], *t
;
325 cmn
= pa_channel_map_to_pretty_name(&source
->channel_map
);
332 "\tflags: %s%s%s%s%s%s%s\n"
336 "\tbase volume: %s%s%s\n"
337 "\tvolume steps: %u\n"
339 "\tcurrent latency: %0.2f ms\n"
340 "\tmax rewind: %lu KiB\n"
341 "\tsample spec: %s\n"
342 "\tchannel map: %s%s%s\n"
345 c
->default_source
== source
? '*' : ' ',
349 source
->flags
& PA_SOURCE_HARDWARE
? "HARDWARE " : "",
350 source
->flags
& PA_SOURCE_NETWORK
? "NETWORK " : "",
351 source
->flags
& PA_SOURCE_HW_MUTE_CTRL
? "HW_MUTE_CTRL " : "",
352 source
->flags
& PA_SOURCE_HW_VOLUME_CTRL
? "HW_VOLUME_CTRL " : "",
353 source
->flags
& PA_SOURCE_DECIBEL_VOLUME
? "DECIBEL_VOLUME " : "",
354 source
->flags
& PA_SOURCE_LATENCY
? "LATENCY " : "",
355 source
->flags
& PA_SOURCE_DYNAMIC_LATENCY
? "DYNAMIC_LATENCY" : "",
356 source_state_to_string(pa_source_get_state(source
)),
357 pa_cvolume_snprint(cv
, sizeof(cv
), pa_source_get_volume(source
, FALSE
)),
358 source
->flags
& PA_SOURCE_DECIBEL_VOLUME
? "\n\t " : "",
359 source
->flags
& PA_SOURCE_DECIBEL_VOLUME
? pa_sw_cvolume_snprint_dB(cvdb
, sizeof(cvdb
), pa_source_get_volume(source
, FALSE
)) : "",
360 pa_cvolume_get_balance(pa_source_get_volume(source
, FALSE
), &source
->channel_map
),
361 pa_volume_snprint(v
, sizeof(v
), source
->base_volume
),
362 source
->flags
& PA_SOURCE_DECIBEL_VOLUME
? "\n\t " : "",
363 source
->flags
& PA_SOURCE_DECIBEL_VOLUME
? pa_sw_volume_snprint_dB(vdb
, sizeof(vdb
), source
->base_volume
) : "",
364 source
->n_volume_steps
,
365 pa_yes_no(pa_source_get_mute(source
, FALSE
)),
366 (double) pa_source_get_latency(source
) / PA_USEC_PER_MSEC
,
367 (unsigned long) pa_source_get_max_rewind(source
) / 1024,
368 pa_sample_spec_snprint(ss
, sizeof(ss
), &source
->sample_spec
),
369 pa_channel_map_snprint(cm
, sizeof(cm
), &source
->channel_map
),
372 pa_source_used_by(source
),
373 pa_source_linked_by(source
));
375 if (source
->flags
& PA_SOURCE_DYNAMIC_LATENCY
) {
376 pa_usec_t min_latency
, max_latency
;
377 pa_source_get_latency_range(source
, &min_latency
, &max_latency
);
381 "\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n",
382 (double) pa_source_get_requested_latency(source
) / PA_USEC_PER_MSEC
,
383 (double) min_latency
/ PA_USEC_PER_MSEC
,
384 (double) max_latency
/ PA_USEC_PER_MSEC
);
387 if (source
->monitor_of
)
388 pa_strbuf_printf(s
, "\tmonitor_of: %u\n", source
->monitor_of
->index
);
390 pa_strbuf_printf(s
, "\tcard: %u <%s>\n", source
->card
->index
, source
->card
->name
);
392 pa_strbuf_printf(s
, "\tmodule: %u\n", source
->module
->index
);
394 t
= pa_proplist_to_string_sep(source
->proplist
, "\n\t\t");
395 pa_strbuf_printf(s
, "\tproperties:\n\t\t%s\n", t
);
399 return pa_strbuf_tostring_free(s
);
403 char *pa_source_output_list_to_string(pa_core
*c
) {
406 uint32_t idx
= PA_IDXSET_INVALID
;
407 static const char* const state_table
[] = {
408 [PA_SOURCE_OUTPUT_INIT
] = "INIT",
409 [PA_SOURCE_OUTPUT_RUNNING
] = "RUNNING",
410 [PA_SOURCE_OUTPUT_CORKED
] = "CORKED",
411 [PA_SOURCE_OUTPUT_UNLINKED
] = "UNLINKED"
417 pa_strbuf_printf(s
, "%u source outputs(s) available.\n", pa_idxset_size(c
->source_outputs
));
419 for (o
= pa_idxset_first(c
->source_outputs
, &idx
); o
; o
= pa_idxset_next(c
->source_outputs
, &idx
)) {
420 char ss
[PA_SAMPLE_SPEC_SNPRINT_MAX
], cm
[PA_CHANNEL_MAP_SNPRINT_MAX
], *t
, clt
[28];
424 cmn
= pa_channel_map_to_pretty_name(&o
->channel_map
);
426 if ((cl
= pa_source_output_get_requested_latency(o
)) == (pa_usec_t
) -1)
427 pa_snprintf(clt
, sizeof(clt
), "n/a");
429 pa_snprintf(clt
, sizeof(clt
), "%0.2f ms", (double) cl
/ PA_USEC_PER_MSEC
);
431 pa_assert(o
->source
);
437 "\tflags: %s%s%s%s%s%s%s%s%s%s\n"
439 "\tsource: %u <%s>\n"
440 "\tcurrent latency: %0.2f ms\n"
441 "\trequested latency: %s\n"
442 "\tsample spec: %s\n"
443 "\tchannel map: %s%s%s\n"
444 "\tresample method: %s\n",
447 o
->flags
& PA_SOURCE_OUTPUT_VARIABLE_RATE
? "VARIABLE_RATE " : "",
448 o
->flags
& PA_SOURCE_OUTPUT_DONT_MOVE
? "DONT_MOVE " : "",
449 o
->flags
& PA_SOURCE_OUTPUT_START_CORKED
? "START_CORKED " : "",
450 o
->flags
& PA_SOURCE_OUTPUT_NO_REMAP
? "NO_REMAP " : "",
451 o
->flags
& PA_SOURCE_OUTPUT_NO_REMIX
? "NO_REMIX " : "",
452 o
->flags
& PA_SOURCE_OUTPUT_FIX_FORMAT
? "FIX_FORMAT " : "",
453 o
->flags
& PA_SOURCE_OUTPUT_FIX_RATE
? "FIX_RATE " : "",
454 o
->flags
& PA_SOURCE_OUTPUT_FIX_CHANNELS
? "FIX_CHANNELS " : "",
455 o
->flags
& PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND
? "DONT_INHIBIT_AUTO_SUSPEND " : "",
456 o
->flags
& PA_SOURCE_OUTPUT_FAIL_ON_SUSPEND
? "FAIL_ON_SUSPEND " : "",
457 state_table
[pa_source_output_get_state(o
)],
458 o
->source
->index
, o
->source
->name
,
459 (double) pa_source_output_get_latency(o
, NULL
) / PA_USEC_PER_MSEC
,
461 pa_sample_spec_snprint(ss
, sizeof(ss
), &o
->sample_spec
),
462 pa_channel_map_snprint(cm
, sizeof(cm
), &o
->channel_map
),
465 pa_resample_method_to_string(pa_source_output_get_resample_method(o
)));
467 pa_strbuf_printf(s
, "\towner module: %u\n", o
->module
->index
);
469 pa_strbuf_printf(s
, "\tclient: %u <%s>\n", o
->client
->index
, pa_strnull(pa_proplist_gets(o
->client
->proplist
, PA_PROP_APPLICATION_NAME
)));
470 if (o
->direct_on_input
)
471 pa_strbuf_printf(s
, "\tdirect on input: %u\n", o
->direct_on_input
->index
);
473 t
= pa_proplist_to_string_sep(o
->proplist
, "\n\t\t");
474 pa_strbuf_printf(s
, "\tproperties:\n\t\t%s\n", t
);
478 return pa_strbuf_tostring_free(s
);
481 char *pa_sink_input_list_to_string(pa_core
*c
) {
484 uint32_t idx
= PA_IDXSET_INVALID
;
485 static const char* const state_table
[] = {
486 [PA_SINK_INPUT_INIT
] = "INIT",
487 [PA_SINK_INPUT_RUNNING
] = "RUNNING",
488 [PA_SINK_INPUT_DRAINED
] = "DRAINED",
489 [PA_SINK_INPUT_CORKED
] = "CORKED",
490 [PA_SINK_INPUT_UNLINKED
] = "UNLINKED"
496 pa_strbuf_printf(s
, "%u sink input(s) available.\n", pa_idxset_size(c
->sink_inputs
));
498 for (i
= pa_idxset_first(c
->sink_inputs
, &idx
); i
; i
= pa_idxset_next(c
->sink_inputs
, &idx
)) {
499 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];
503 cmn
= pa_channel_map_to_pretty_name(&i
->channel_map
);
505 if ((cl
= pa_sink_input_get_requested_latency(i
)) == (pa_usec_t
) -1)
506 pa_snprintf(clt
, sizeof(clt
), "n/a");
508 pa_snprintf(clt
, sizeof(clt
), "%0.2f ms", (double) cl
/ PA_USEC_PER_MSEC
);
516 "\tflags: %s%s%s%s%s%s%s%s%s%s\n"
523 "\tcurrent latency: %0.2f ms\n"
524 "\trequested latency: %s\n"
525 "\tsample spec: %s\n"
526 "\tchannel map: %s%s%s\n"
527 "\tresample method: %s\n",
530 i
->flags
& PA_SINK_INPUT_VARIABLE_RATE
? "VARIABLE_RATE " : "",
531 i
->flags
& PA_SINK_INPUT_DONT_MOVE
? "DONT_MOVE " : "",
532 i
->flags
& PA_SINK_INPUT_START_CORKED
? "START_CORKED " : "",
533 i
->flags
& PA_SINK_INPUT_NO_REMAP
? "NO_REMAP " : "",
534 i
->flags
& PA_SINK_INPUT_NO_REMIX
? "NO_REMIX " : "",
535 i
->flags
& PA_SINK_INPUT_FIX_FORMAT
? "FIX_FORMAT " : "",
536 i
->flags
& PA_SINK_INPUT_FIX_RATE
? "FIX_RATE " : "",
537 i
->flags
& PA_SINK_INPUT_FIX_CHANNELS
? "FIX_CHANNELS " : "",
538 i
->flags
& PA_SINK_INPUT_DONT_INHIBIT_AUTO_SUSPEND
? "DONT_INHIBIT_AUTO_SUSPEND " : "",
539 i
->flags
& PA_SINK_INPUT_FAIL_ON_SUSPEND
? "FAIL_ON_SUSPEND " : "",
540 state_table
[pa_sink_input_get_state(i
)],
541 i
->sink
->index
, i
->sink
->name
,
542 pa_cvolume_snprint(cv
, sizeof(cv
), pa_sink_input_get_volume(i
)),
543 pa_sw_cvolume_snprint_dB(cvdb
, sizeof(cvdb
), pa_sink_input_get_volume(i
)),
544 pa_cvolume_get_balance(pa_sink_input_get_volume(i
), &i
->channel_map
),
545 pa_yes_no(pa_sink_input_get_mute(i
)),
546 (double) pa_sink_input_get_latency(i
, NULL
) / PA_USEC_PER_MSEC
,
548 pa_sample_spec_snprint(ss
, sizeof(ss
), &i
->sample_spec
),
549 pa_channel_map_snprint(cm
, sizeof(cm
), &i
->channel_map
),
552 pa_resample_method_to_string(pa_sink_input_get_resample_method(i
)));
555 pa_strbuf_printf(s
, "\tmodule: %u\n", i
->module
->index
);
557 pa_strbuf_printf(s
, "\tclient: %u <%s>\n", i
->client
->index
, pa_strnull(pa_proplist_gets(i
->client
->proplist
, PA_PROP_APPLICATION_NAME
)));
559 t
= pa_proplist_to_string_sep(i
->proplist
, "\n\t\t");
560 pa_strbuf_printf(s
, "\tproperties:\n\t\t%s\n", t
);
564 return pa_strbuf_tostring_free(s
);
567 char *pa_scache_list_to_string(pa_core
*c
) {
573 pa_strbuf_printf(s
, "%u cache entrie(s) available.\n", c
->scache
? pa_idxset_size(c
->scache
) : 0);
577 uint32_t idx
= PA_IDXSET_INVALID
;
579 for (e
= pa_idxset_first(c
->scache
, &idx
); e
; e
= pa_idxset_next(c
->scache
, &idx
)) {
581 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
;
584 cmn
= pa_channel_map_to_pretty_name(&e
->channel_map
);
586 if (e
->memchunk
.memblock
) {
587 pa_sample_spec_snprint(ss
, sizeof(ss
), &e
->sample_spec
);
588 pa_channel_map_snprint(cm
, sizeof(cm
), &e
->channel_map
);
589 l
= (double) e
->memchunk
.length
/ (double) pa_bytes_per_second(&e
->sample_spec
);
596 "\tsample spec: %s\n"
597 "\tchannel map: %s%s%s\n"
599 "\tduration: %0.1f s\n"
604 "\tfilename: <%s>\n",
611 (long unsigned)(e
->memchunk
.memblock
? e
->memchunk
.length
: 0),
613 e
->volume_is_set
? pa_cvolume_snprint(cv
, sizeof(cv
), &e
->volume
) : "n/a",
614 e
->volume_is_set
? pa_sw_cvolume_snprint_dB(cvdb
, sizeof(cvdb
), &e
->volume
) : "n/a",
615 (e
->memchunk
.memblock
&& e
->volume_is_set
) ? pa_cvolume_get_balance(&e
->volume
, &e
->channel_map
) : 0.0f
,
617 e
->filename
? e
->filename
: "n/a");
619 t
= pa_proplist_to_string_sep(e
->proplist
, "\n\t\t");
620 pa_strbuf_printf(s
, "\tproperties:\n\t\t%s\n", t
);
625 return pa_strbuf_tostring_free(s
);
628 char *pa_full_status_string(pa_core
*c
) {
634 for (i
= 0; i
< 8; i
++) {
639 t
= pa_sink_list_to_string(c
);
642 t
= pa_source_list_to_string(c
);
645 t
= pa_sink_input_list_to_string(c
);
648 t
= pa_source_output_list_to_string(c
);
651 t
= pa_client_list_to_string(c
);
654 t
= pa_card_list_to_string(c
);
657 t
= pa_module_list_to_string(c
);
660 t
= pa_scache_list_to_string(c
);
664 pa_strbuf_puts(s
, t
);
668 return pa_strbuf_tostring_free(s
);