core, sink-input: dump sink-input info when it exceeds the maximum connection 77/264877/6
authorSeungbae Shin <seungbae.shin@samsung.com>
Fri, 1 Oct 2021 12:09:58 +0000 (21:09 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 7 Oct 2021 12:59:01 +0000 (12:59 +0000)
+ fix minor warning

[Version] 13.0-36
[Issue Type] Debugging

Change-Id: Ia33d4fc0507630576b1305acff64633853a99de3

packaging/pulseaudio.spec
src/pulsecore/core-util.h
src/pulsecore/core.c
src/pulsecore/core.h
src/pulsecore/sink-input.c
src/pulsecore/sink-input.h

index fc319a7..9f97e11 100644 (file)
@@ -3,7 +3,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          13.0
-Release:          35
+Release:          36
 Group:            Multimedia/Audio
 License:          LGPL-2.1
 URL:              http://pulseaudio.org
index cfb9eb2..498a1ce 100644 (file)
@@ -200,6 +200,9 @@ static inline unsigned pa_make_power_of_two(unsigned n) {
     return 1U << (pa_ulog2(n) + 1);
 }
 
+#ifdef __TIZEN_
+int pa_safe_close_pipe(int fd);
+#endif
 void pa_close_pipe(int fds[2]);
 
 char *pa_readlink(const char *p);
index eca2dde..c263c69 100644 (file)
@@ -565,3 +565,15 @@ const char *pa_suspend_cause_to_string(pa_suspend_cause_t cause_bitfield, char b
 
     return buf;
 }
+
+#ifdef __TIZEN__
+void pa_core_dump_sink_inputs(pa_core *core) {
+    pa_sink_input *si = NULL;
+    uint32_t idx = 0;
+
+    pa_log_warn(">> Start dumping (%u) sink-inputs", pa_idxset_size(core->sink_inputs));
+    PA_IDXSET_FOREACH(si, core->sink_inputs, idx)
+        pa_sink_input_dump_info(si);
+    pa_log_warn("<< Dump finished!");
+}
+#endif
\ No newline at end of file
index 2d9c27d..7e367fc 100644 (file)
@@ -298,4 +298,8 @@ static const size_t PA_SUSPEND_CAUSE_TO_STRING_BUF_SIZE =
  * provided buffer. The same buffer is the return value of this function. */
 const char *pa_suspend_cause_to_string(pa_suspend_cause_t cause, char buf[PA_SUSPEND_CAUSE_TO_STRING_BUF_SIZE]);
 
+#ifdef __TIZEN__
+void pa_core_dump_sink_inputs(pa_core *core);
+#endif
+
 #endif
index 6edf57f..7d41377 100644 (file)
@@ -572,6 +572,9 @@ int pa_sink_input_new(
 
     if (pa_idxset_size(data->sink->inputs) >= PA_MAX_INPUTS_PER_SINK) {
         pa_log_warn("Failed to create sink input: too many inputs per sink.");
+#ifdef __TIZEN__
+        pa_core_dump_sink_inputs(core);
+#endif
         return -PA_ERR_TOOLARGE;
     }
 
@@ -2858,3 +2861,19 @@ void pa_sink_input_set_reference_ratio(pa_sink_input *i, const pa_cvolume *ratio
                  pa_cvolume_snprint_verbose(old_ratio_str, sizeof(old_ratio_str), &old_ratio, &i->channel_map, true),
                  pa_cvolume_snprint_verbose(new_ratio_str, sizeof(new_ratio_str), ratio, &i->channel_map, true));
 }
+
+#ifdef __TIZEN__
+void pa_sink_input_dump_info(pa_sink_input *i) {
+    pa_assert(i);
+
+    pa_log_warn("#%4u: client(%5d), sink(%2u), state(%d), muted(%d), app(pid:%s, org:%s, binary:%s), media(name:%s, role:%s)",
+                i->index,
+                i->client ? (int)i->client->index : -1,
+                i->sink->index, i->state, i->muted,
+                pa_proplist_gets(i->proplist, PA_PROP_APPLICATION_PROCESS_ID),
+                pa_proplist_gets(i->proplist, PA_PROP_APPLICATION_PROCESS_ID_ORIGIN),
+                pa_proplist_gets(i->proplist, PA_PROP_APPLICATION_PROCESS_BINARY),
+                pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME),
+                pa_proplist_gets(i->proplist, PA_PROP_MEDIA_ROLE));
+}
+#endif
\ No newline at end of file
index f6aad84..f12e09f 100644 (file)
@@ -501,6 +501,7 @@ void pa_sink_input_set_reference_ratio(pa_sink_input *i, const pa_cvolume *ratio
 
 #ifdef __TIZEN__
 void pa_sink_input_update_empty_pop(pa_sink_input *i, size_t length, bool *is_timeout);
+void pa_sink_input_dump_info(pa_sink_input *i);
 #endif
 
 #define pa_sink_input_assert_io_context(s) \