tizenaudio-sink2/source2: Add fixed_latency_msec parameter 22/301022/3 accepted/tizen/unified/20231115.024823
authorJaechul Lee <jcsing.lee@samsung.com>
Tue, 7 Nov 2023 06:53:29 +0000 (15:53 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Fri, 10 Nov 2023 02:08:04 +0000 (11:08 +0900)
[Version] 15.0.66
[Issue Type] Update

Change-Id: I6c1dd0fc703996f4db77d4be9e9a4c671e2aaad1
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/tizenaudio-sink2.c
src/tizenaudio-source2.c

index e1e2d8b..bdc5765 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          15.0.65
+Version:          15.0.66
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index dde2ec0..9b03df7 100644 (file)
 
 #define DEFAULT_SINK_NAME "tizenaudio-sink2"
 
-#ifdef TIZEN_TV
 #define DEFAULT_FRAGMENT_MSEC                50
-#else
-#define DEFAULT_FRAGMENT_MSEC                10
-#endif
 #define DEFAULT_FRAGMENTS                     4
 
 struct userdata {
@@ -481,6 +477,8 @@ pa_sink *pa_tizenaudio_sink2_new(pa_module *m,
     uint32_t period_size;
     uint32_t periods;
 
+    uint32_t fixed_latency_msec;
+
     pa_assert(m);
     pa_assert(ma);
 
@@ -520,7 +518,10 @@ pa_sink *pa_tizenaudio_sink2_new(pa_module *m,
         goto fail;
     }
 
-    u->frag_size = (uint32_t) pa_usec_to_bytes(DEFAULT_FRAGMENT_MSEC * PA_USEC_PER_MSEC, &ss);
+    fixed_latency_msec = DEFAULT_FRAGMENT_MSEC;
+    pa_modargs_get_value_u32(ma, "fixed_latency_msec", &fixed_latency_msec);
+
+    u->frag_size = (uint32_t) pa_usec_to_bytes(fixed_latency_msec * PA_USEC_PER_MSEC, &ss);
     u->nfrags = DEFAULT_FRAGMENTS;
     if (pa_modargs_get_value_u32(ma, "fragment_size", &u->frag_size) < 0 ||
         pa_modargs_get_value_u32(ma, "fragments", &u->nfrags) < 0) {
index 6613a25..e6122f8 100644 (file)
 
 #define DEFAULT_SOURCE_NAME "tizenaudio-source2"
 
-#ifdef TIZEN_TV
 #define DEFAULT_FRAGMENT_MSEC                50
-#else
-#define DEFAULT_FRAGMENT_MSEC                10
-#endif
 #define DEFAULT_FRAGMENTS                     4
 #define DEFAULT_HAL_READ_TIMEOUT            150
 
@@ -473,6 +469,8 @@ pa_source *pa_tizenaudio_source2_new(pa_module *m,
     uint32_t period_size;
     uint32_t periods;
 
+    uint32_t fixed_latency_msec;
+
     pa_assert(m);
     pa_assert(ma);
 
@@ -511,7 +509,10 @@ pa_source *pa_tizenaudio_source2_new(pa_module *m,
         goto fail;
     }
 
-    u->frag_size = (uint32_t) pa_usec_to_bytes(DEFAULT_FRAGMENT_MSEC * PA_USEC_PER_MSEC, &ss);
+    fixed_latency_msec = DEFAULT_FRAGMENT_MSEC;
+    pa_modargs_get_value_u32(ma, "fixed_latency_msec", &fixed_latency_msec);
+
+    u->frag_size = (uint32_t) pa_usec_to_bytes(fixed_latency_msec * PA_USEC_PER_MSEC, &ss);
     u->nfrags = DEFAULT_FRAGMENTS;
     if (pa_modargs_get_value_u32(ma, "fragment_size", &u->frag_size) < 0 ||
         pa_modargs_get_value_u32(ma, "fragments", &u->nfrags) < 0) {