adjust buffer size
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 2 Jun 2022 16:31:23 +0000 (18:31 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 2 Jun 2022 16:31:23 +0000 (18:31 +0200)
music_assistant/helpers/process.py

index d0900e8d01acf2a3e214b65b56f8fe87be741445..c790b4ca2896d1f4bb8f3005c846f0c540281a9e 100644 (file)
@@ -14,7 +14,7 @@ from async_timeout import timeout as _timeout
 
 LOGGER = logging.getLogger("AsyncProcess")
 
-DEFAULT_CHUNKSIZE = 64000
+DEFAULT_CHUNKSIZE = 176400  # 1 second of pcm 44100/16
 DEFAULT_TIMEOUT = 120
 
 
@@ -41,7 +41,7 @@ class AsyncProcess:
                 args,
                 stdin=asyncio.subprocess.PIPE if self._enable_write else None,
                 stdout=asyncio.subprocess.PIPE,
-                limit=DEFAULT_CHUNKSIZE,
+                limit=DEFAULT_CHUNKSIZE * 10,
                 close_fds=True,
             )
         else:
@@ -49,7 +49,7 @@ class AsyncProcess:
                 *args,
                 stdin=asyncio.subprocess.PIPE if self._enable_write else None,
                 stdout=asyncio.subprocess.PIPE,
-                limit=DEFAULT_CHUNKSIZE,
+                limit=DEFAULT_CHUNKSIZE * 10,
                 close_fds=True,
             )
         return self