stream-manager: Revise logs regarding ducking 39/210839/1
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Jul 2019 07:20:12 +0000 (16:20 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Jul 2019 07:21:18 +0000 (16:21 +0900)
[Version] 11.1.65
[Issue type] Log

Change-Id: Ic568205d567e6a3d65629e4aefecc7a526c186d8
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/stream-manager-dbus.c
src/stream-manager.c

index 936c3ae..4eb7764 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          11.1.64
+Version:          11.1.65
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 0ffdd72..1a7155c 100644 (file)
@@ -1830,15 +1830,16 @@ static void handle_activate_ducking(DBusConnection *conn, DBusMessage *msg, void
 
             pa_idxset_put(sd->idx_ducking_streams, (void *)stream, NULL);
 
-            pa_log_info("ducking: [%p] set vol [%u], key [%s], role [%s]",
-                stream, sd->set_vol, sd->vol_key, sd->target_role);
+            pa_log_info("ducking: add volume_ramp factor, key[%s], set_vol[%u] to stream[idx:%u]",
+                sd->vol_key, sd->set_vol, stream->index);
 
             pa_cvolume_ramp_set(&vol_ramp, stream->volume.channels,
                 PA_VOLUME_RAMP_TYPE_LINEAR, (long)duration, sd->set_vol);
 
             pa_sink_input_add_volume_ramp_factor(stream, sd->vol_key, &vol_ramp, true);
         } else {
-            pa_log_info("unducking : remove volume(ramp) factor [key:%s]", sd->vol_key);
+            pa_log_info("unducking: remove volume(ramp) factor, key[%s] from stream[idx:%u]",
+                sd->vol_key, stream->index);
 
             pa_sink_input_remove_volume_factor(stream, sd->vol_key);
             pa_sink_input_remove_volume_ramp_factor(stream, sd->vol_key, true);
@@ -1852,7 +1853,7 @@ static void handle_activate_ducking(DBusConnection *conn, DBusMessage *msg, void
         sd->set_vol = PA_VOLUME_NORM;
     }
 
-    pa_log_info("ducking stream count %d", sd->ducking_stream_count);
+    pa_log_info("ducking stream count(%d)", sd->ducking_stream_count);
 
     pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_OK], DBUS_TYPE_INVALID));
 
@@ -1864,7 +1865,7 @@ static void handle_activate_ducking(DBusConnection *conn, DBusMessage *msg, void
            because ramp_finish_cb could not be called in this case */
         sd->is_ducked = enable;
 
-        pa_log_info("send signal for ramp finished(but, no stream matched) - is_ducked %d", sd->is_ducked);
+        pa_log_info("send signal for ramp finished(but, no stream matched) - is_ducked(%d)", sd->is_ducked);
 
         send_ducking_state_changed_signal(pa_dbus_connection_get(m->dbus_conn), sd->trigger_index, sd->is_ducked);
     }
@@ -1978,7 +1979,7 @@ void send_ducking_state_changed_signal(DBusConnection *conn, const int index, co
 
     pa_assert(conn);
 
-    pa_log_debug("trigger index %d : is_ducked[%d]", index, is_ducked);
+    pa_log_debug("trigger_index(%d) : is_ducked(%d)", index, is_ducked);
 
     pa_assert_se((signal_msg = dbus_message_new_signal(STREAM_MANAGER_OBJECT_PATH, STREAM_MANAGER_INTERFACE, STREAM_MANAGER_SIGNAL_NAME_DUCKING_STATE_CHANGED)));
     dbus_message_iter_init_append(signal_msg, &msg_iter);
index d8fbbb9..667fd50 100644 (file)
@@ -2251,7 +2251,8 @@ static void remove_sink_input_from_ducking_streams(pa_stream_manager *m, pa_sink
     PA_HASHMAP_FOREACH(sd, m->stream_duckings, state) {
         PA_IDXSET_FOREACH(stream, sd->idx_ducking_streams, idx) {
             if (stream == i) {
-                pa_log_info("remove ducking stream[i:%u,%p] from idx_ducking_streams", i->index, i);
+                pa_log_info("remove stream(idx:%u,%p) from idx_ducking_streams, trigger_index(%u)",
+                    i->index, i, sd->trigger_index);
                 pa_idxset_remove_by_data(sd->idx_ducking_streams, stream, NULL);
                 return;
             }
@@ -2273,8 +2274,8 @@ static void add_sink_input_to_ducking_streams(pa_stream_manager *m, pa_sink_inpu
         if (!pa_safe_streq(sd->target_role, pa_proplist_gets(i->proplist, PA_PROP_MEDIA_ROLE)))
             continue;
 
-        pa_log_info("add ducking stream[i:%u,%p] to idx_ducking_streams, volume %u",
-            i->index, i, sd->set_vol);
+        pa_log_info("add stream(idx:%u,%p) to idx_ducking_streams, trigger_index(%u), volume(%u)",
+            i->index, i, sd->trigger_index, sd->set_vol);
 
         pa_idxset_put(sd->idx_ducking_streams, (void *)i, NULL);
 
@@ -2442,7 +2443,7 @@ static pa_hook_result_t sink_input_ramp_finish_cb(pa_core *core, pa_sink_input *
 
     /* send signal when all streams are ducked */
     if (--sd->ducking_stream_count == 0) {
-        pa_log_info("send signal for ramp finished - is_ducked %d", is_ducked);
+        pa_log_info("send signal for ramp finished - is_ducked(%d)", is_ducked);
         sd->is_ducked = is_ducked;
         send_ducking_state_changed_signal(pa_dbus_connection_get(m->dbus_conn), sd->trigger_index, sd->is_ducked);
     }
@@ -3313,7 +3314,7 @@ static void subscribe_cb(pa_core *core, pa_subscription_event_type_t t, uint32_t
             sd->idx_ducking_streams = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
             sd->trigger_index = idx;
             pa_hashmap_put(m->stream_duckings, (void *)idx, sd);
-            pa_log_debug(" - add sd(%p), idx(%u)", sd, idx);
+            pa_log_debug(" - add sd(%p), trigger_index(%u)", sd, idx);
             return;
         }
     } else if (t == (PA_SUBSCRIPTION_EVENT_CLIENT|PA_SUBSCRIPTION_EVENT_REMOVE)) {
@@ -3338,10 +3339,10 @@ static void subscribe_cb(pa_core *core, pa_subscription_event_type_t t, uint32_t
             uint32_t ducking_idx = 0;
             pa_sink_input *stream = NULL;
 
-            pa_log_info(" - remove sd(%p), idx(%u)", sd, idx);
+            pa_log_info(" - remove sd(%p), trigger_index(%u)", sd, idx);
 
             PA_IDXSET_FOREACH(stream, sd->idx_ducking_streams, ducking_idx) {
-                pa_log_info("remove volume ramp for remained stream %p, key %s", stream, sd->vol_key);
+                pa_log_info(" -- remove volume ramp, key(%s) from remained stream(idx:%u)", sd->vol_key, stream->index);
                 pa_sink_input_remove_volume_factor(stream, sd->vol_key);
                 pa_sink_input_remove_volume_ramp_factor(stream, sd->vol_key, true);
             }
@@ -3349,8 +3350,6 @@ static void subscribe_cb(pa_core *core, pa_subscription_event_type_t t, uint32_t
             pa_idxset_free(sd->idx_ducking_streams, NULL);
             pa_hashmap_remove(m->stream_duckings, (const void*)idx);
             pa_xfree(sd);
-
-            pa_log_info("done");
             return;
         }
     }