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 e1e2d8bf0e577fbecb22cc63413d58b68d28b1af..bdc57650fa3a69bb6dc839ad30ace4246418eba4 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 dde2ec0c29ef82377ffcda56045dee51bf42e4e9..9b03df79ca1547e171c6c46bee72808b86270eeb 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 6613a25ce2d813ee4a84da52af5a070fe385211d..e6122f85e8aed2b7b271909e005c4815b427ad85 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) {