<br><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 9, 2012 at 9:26 AM, Josu Lazkano <span dir="ltr">&lt;<a href="mailto:josu.lazkano@gmail.com" target="_blank">josu.lazkano@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2012/11/8 Jean-Yves Avenard &lt;<a href="mailto:jyavenard@gmail.com">jyavenard@gmail.com</a>&gt;:<br>

<div><div class="h5">&gt; On 9 November 2012 07:24, Andrey Zhunev &lt;<a href="mailto:a-j@a-j.ru">a-j@a-j.ru</a>&gt; wrote:<br>
&gt;&gt; Hello All,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I just noticed that mythfrontend is asking to allocate a larger buffer for alsa:<br>
&gt;&gt; So I increased the value of /proc/asound/card0/pcm0p/sub0/prealloc to<br>
&gt;&gt; &#39;1024&#39; - even more than requested. Strangely, mythfrontend asked for more:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2012-11-09 00:10:18.681551 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:139 (TryOpenDevice) - ALSA: OpenDevice default<br>
&gt;&gt; 2012-11-09 00:10:18.683052 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:678 (SetParameters) - ALSA: SetParameters(format=10, channels=2, rate=48000, buffer_time=500000, period_time=4)<br>
&gt;&gt; 2012-11-09 00:10:18.683407 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:736 (SetParameters) - ALSA: Buffer size range from 2048 to 16384<br>
&gt;&gt; 2012-11-09 00:10:18.683421 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:739 (SetParameters) - ALSA: Period size range from 1024 to 1024<br>
&gt;&gt; 2012-11-09 00:10:18.683483 E [3892/3892] CoreContext audio/audiooutputalsa.cpp:783 (SetParameters) - ALSA: Requested 500000us got 341333 buffer time<br>
&gt;&gt; 2012-11-09 00:10:18.683615 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:224 (IncPreallocBufferSize) - ALSA: Hardware audio buffer cur: 1024 need: 1536 max allowed: 32768<br>
&gt;&gt; 2012-11-09 00:10:18.683648 E [3892/3892] CoreContext audio/audiooutputalsa.cpp:242 (IncPreallocBufferSize) - ALSA: Try to manually increase audio buffer with: echo 1536 | sudo tee /proc/asound/card0/pcm0p/sub0/prealloc<br>

&gt;&gt; 2012-11-09 00:10:18.683666 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:791 (SetParameters) - ALSA: Buffer time = 341333 us<br>
&gt;&gt; 2012-11-09 00:10:18.683677 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:797 (SetParameters) - ALSA: Period time = 16 periods<br>
&gt;&gt; 2012-11-09 00:10:18.683823 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:806 (SetParameters) - ALSA: Buffer size = 16384 | Period size = 1024<br>
&gt;<br>
&gt; The way it works is this:<br>
&gt;<br>
&gt; We ask ALSA to allocate an audio buffer of a certain length. It<br>
&gt; allocates some, and return how much it allocated.<br>
&gt; If there&#39;s more than 10% difference between what was asked and what we<br>
&gt; got, we display a message.<br>
&gt; The hardware buffer sized suggested is calculated according to how<br>
&gt; much the hardware buffer size currently is, and how much we got.<br>
&gt;<br>
&gt; So, say the HW buffer size is 128kB. We asked for 500ms buffer, and we<br>
&gt; got 341ms instead. So myth assumes that we only got 341ms because the<br>
&gt; HW buffer size was set to 128kB and that should it be higher, we would<br>
&gt; have gotten more.<br>
&gt; so we need: 500 * 128 / 341 = 187kB, we round it to the next 64kB<br>
&gt; block, it will display that you need to increase the HW buffer to<br>
&gt; 192kB...<br>
&gt;<br>
&gt; This works and is accurate for 99.9% of the ALSA setup in my experience.<br>
&gt;<br>
&gt; Now you&#39;re the 2nd person to report the problem above. No matter what<br>
&gt; you ask ALSA, regardless of the HW memory buffer size, you always get<br>
&gt; the same maximum value, is 341333us.<br>
&gt; That throws off myth and the message displayed is incorrect.<br>
&gt;<br>
&gt; I would just ignore that message, it is not displayed unless you<br>
&gt; increase the verbosity (it used to be displayed all the time)<br>
&gt;<br>
&gt; JY<br>
&gt; _______________________________________________<br>
&gt; mythtv-users mailing list<br>
&gt; <a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>
&gt; <a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>
<br>
</div></div>Hello, I have same problem. I add this on the sudoer configuration file:<br>
<br>
myuser ALL=(ALL) NOPASSWD:/usr/bin/tee /proc/asound/card0/pcm3p/sub0/prealloc<br>
<br>
Now I can allocate the buffer size as mythfrontend user.<br>
<br>
But it doesnt change nothing:<br>
<br>
1. I check the initial buffer size:<br>
<br>
$ cat /proc/asound/card0/pcm3p/sub0/prealloc<br>
64<br>
<br>
2. Change the buffer size:<br>
<br>
$ echo 192 | sudo tee /proc/asound/card0/pcm3p/sub0/prealloc<br>
192<br>
<br>
3. Check the buffer size:<br>
<br>
$ cat /proc/asound/card0/pcm3p/sub0/prealloc<br>
64<br>
<br>
As you can see, it does not change the buffer size. I am doing something wrong?<br>
<br>
Thanks and best regards.<br>
<br>
--<br>
Josu Lazkano<br>
<div class=""><div class="h5">_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>
<a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>
</div></div></blockquote></div><br>I use to put &quot;buffer_size 4096&quot; in my .asoundrc file for the digital device I want to set specific buffer size.<br></div>