[MPlayer-dev-eng] Increase alsa buffer size request

Vladimir Voroshilov voroshil at univer.omsk.su
Sun Jul 2 19:45:02 CEST 2006


Hi, All

I'm working on MPlayer radio support (threadless version).
I am using rawaudio demuxer and staff from tv's audio_in.c.
demuxer makes packets with AvgBytesPerSecond length.
In ai_alsa.c and ai_alsa1x.c ALSA's buffer_time is initialized
as 1000000 microseconds.
Thus, when my module is working i get a lot of xrun events.
Is it possible to increase buffer size to 2 seconds or this exact value
is mandatory for tv?

-- 
Vladimir Voroshilov mailto:voroshli at univer.omsk.su
Omsk State University
JID: voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
Index: ai_alsa.c
===================================================================
--- ai_alsa.c	(revision 18884)
+++ ai_alsa.c	(working copy)
@@ -52,7 +52,7 @@
     rate = err;
     ai->samplerate = rate;
 
-    ai->alsa.buffer_time = 1000000;
+    ai->alsa.buffer_time = 2000000;
     ai->alsa.buffer_time = snd_pcm_hw_params_set_buffer_time_near(ai->alsa.handle, params,
 							       ai->alsa.buffer_time, 0);
     assert(ai->alsa.buffer_time >= 0);
Index: ai_alsa1x.c
===================================================================
--- ai_alsa1x.c	(revision 18884)
+++ ai_alsa1x.c	(working copy)
@@ -60,7 +60,7 @@
     ai->samplerate = rate;
 
     dir = 0;
-    ai->alsa.buffer_time = 1000000;
+    ai->alsa.buffer_time = 2000000;
     err = snd_pcm_hw_params_set_buffer_time_near(ai->alsa.handle, params,
 						 &ai->alsa.buffer_time, &dir);
     if (err < 0) {


More information about the MPlayer-dev-eng mailing list