All of lore.kernel.org
 help / color / mirror / Atom feed
* prealloc/buffer time limit?
@ 2006-02-10 21:11 Ron Cococcia
  2006-02-13  8:06 ` Clemens Ladisch
  2006-02-13 18:16 ` James Courtier-Dutton
  0 siblings, 2 replies; 7+ messages in thread
From: Ron Cococcia @ 2006-02-10 21:11 UTC (permalink / raw)
  To: alsa-devel

Hello,

Recently I've been playing around with buffering in ALSA to reduce the 
number of underruns I observe when playing audio under heavy system 
load.  The playback device has 64k allocated by default, and I upped it 
to 128k (echo 128 > /proc/asound/card0/pcm0p/sub0/prealloc).  I observed 
a significant reduction in underruns with this change.  The buffer time 
went from 371519 to 743038 (using snd_pcm_hw_params_set_buffer_time_near 
to 5000000 (not .5 sec, but 5 sec)).  I am assuming that the value is 
updated to give the actual available buffer time after snd_pcm_hw_params 
has complete (please inform me if I am wrong!!).

I then tried to up it to 256, and it didn't work (prealloc remained at 
128).  I went into the driver for the sound device (intel8x0), and 
noticed the buffer_max being set to 128.  I modified the max values to 
512k (overkill, but I want to experiment a little), recompiled, 
installed, etc.

When I tried to increase it to 256, prealloc reports 256 successfully 
(same for 512).  The buffer time did not increase, however.  I am 
looking to be able to increase the buffer time a little further.  I have 
been poking through code (at a snail's pace unfortunately) to see if I 
can find some other place where this value is limited (driver, lib, 
etc).  Either prealloc reports the value and doesn't actually have a 
larger buffer, or some other buffer time limit is in place that I 
haven't been able to find yet.

Is there some other place I can check to increase the buffer time (in 
particular, if I increase the prealloc size).

TIA,
Ron


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prealloc/buffer time limit?
  2006-02-10 21:11 prealloc/buffer time limit? Ron Cococcia
@ 2006-02-13  8:06 ` Clemens Ladisch
  2006-02-13 15:07   ` Ron Cococcia
  2006-02-13 18:16 ` James Courtier-Dutton
  1 sibling, 1 reply; 7+ messages in thread
From: Clemens Ladisch @ 2006-02-13  8:06 UTC (permalink / raw)
  To: Ron Cococcia; +Cc: alsa-devel

Ron Cococcia wrote:
> I went into the driver for the sound device (intel8x0), and noticed
> the buffer_max being set to 128.  I modified the max values to 512k

There is no buffer_max symbol.  What exactly did you change?


Regards,
Clemens


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prealloc/buffer time limit?
  2006-02-13  8:06 ` Clemens Ladisch
@ 2006-02-13 15:07   ` Ron Cococcia
  2006-02-13 15:52     ` Clemens Ladisch
  0 siblings, 1 reply; 7+ messages in thread
From: Ron Cococcia @ 2006-02-13 15:07 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

My apologies :)  I've been flipping between 2 different tasks, and 
flipped the symbol name.  I am referring to "prealloc_max_size", part of 
the ich_pcm_table struct for intel8x0.

Thanks and best regards,
Ron


Clemens Ladisch wrote:
> Ron Cococcia wrote:
> 
>>I went into the driver for the sound device (intel8x0), and noticed
>>the buffer_max being set to 128.  I modified the max values to 512k
> 
> 
> There is no buffer_max symbol.  What exactly did you change?
> 
> 
> Regards,
> Clemens



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prealloc/buffer time limit?
  2006-02-13 15:07   ` Ron Cococcia
@ 2006-02-13 15:52     ` Clemens Ladisch
  2006-02-13 19:08       ` Ron Cococcia
  0 siblings, 1 reply; 7+ messages in thread
From: Clemens Ladisch @ 2006-02-13 15:52 UTC (permalink / raw)
  To: Ron Cococcia; +Cc: alsa-devel

A. Because it's contrary to the direction we normally read in.
Q. Why is top-posting so bad, then?
A. Top-posting.
Q. What's the biggest problem with readability on the Net?

Ron Cococcia wrote:
> I am referring to "prealloc_max_size", part of the ich_pcm_table
> struct for intel8x0.

Change appropriate fields in snd_intel8x0_stream, too.


HTH
Clemens


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prealloc/buffer time limit?
  2006-02-10 21:11 prealloc/buffer time limit? Ron Cococcia
  2006-02-13  8:06 ` Clemens Ladisch
@ 2006-02-13 18:16 ` James Courtier-Dutton
  1 sibling, 0 replies; 7+ messages in thread
From: James Courtier-Dutton @ 2006-02-13 18:16 UTC (permalink / raw)
  To: Ron Cococcia; +Cc: alsa-devel

On 10/02/06, Ron Cococcia <ron.cococcia@request.com> wrote:
> Hello,
>
> Recently I've been playing around with buffering in ALSA to reduce the
> number of underruns I observe when playing audio under heavy system
> load.  The playback device has 64k allocated by default, and I upped it
> to 128k (echo 128 > /proc/asound/card0/pcm0p/sub0/prealloc).  I observed
> a significant reduction in underruns with this change.  The buffer time
> went from 371519 to 743038 (using snd_pcm_hw_params_set_buffer_time_near
> to 5000000 (not .5 sec, but 5 sec)).  I am assuming that the value is
> updated to give the actual available buffer time after snd_pcm_hw_params
> has complete (please inform me if I am wrong!!).
>
> I then tried to up it to 256, and it didn't work (prealloc remained at
> 128).  I went into the driver for the sound device (intel8x0), and
> noticed the buffer_max being set to 128.  I modified the max values to
> 512k (overkill, but I want to experiment a little), recompiled,
> installed, etc.
>
> When I tried to increase it to 256, prealloc reports 256 successfully
> (same for 512).  The buffer time did not increase, however.  I am
> looking to be able to increase the buffer time a little further.  I have
> been poking through code (at a snail's pace unfortunately) to see if I
> can find some other place where this value is limited (driver, lib,
> etc).  Either prealloc reports the value and doesn't actually have a
> larger buffer, or some other buffer time limit is in place that I
> haven't been able to find yet.
>
> Is there some other place I can check to increase the buffer time (in
> particular, if I increase the prealloc size).
>
> TIA,
> Ron
>

You are most likely running up against the hardware limitations of the
sound card.
If the hardware DMA pointer is only X bits long, it won't matter how
big you make the buffer, the sound card will not be able to use it.

James


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prealloc/buffer time limit?
  2006-02-13 15:52     ` Clemens Ladisch
@ 2006-02-13 19:08       ` Ron Cococcia
  2006-02-14  8:13         ` Clemens Ladisch
  0 siblings, 1 reply; 7+ messages in thread
From: Ron Cococcia @ 2006-02-13 19:08 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

Clemens Ladisch wrote:
> 
> Change appropriate fields in snd_intel8x0_stream, too.

That's exactly what I was looking for :)  As James mentioned, it might 
not work correctly, but I'm experimenting to see what I can make it do.

Thanks again!

-Ron


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prealloc/buffer time limit?
  2006-02-13 19:08       ` Ron Cococcia
@ 2006-02-14  8:13         ` Clemens Ladisch
  0 siblings, 0 replies; 7+ messages in thread
From: Clemens Ladisch @ 2006-02-14  8:13 UTC (permalink / raw)
  To: Ron Cococcia; +Cc: alsa-devel

Ron Cococcia wrote:
> Clemens Ladisch wrote:
> >Change appropriate fields in snd_intel8x0_stream, too.
> 
> That's exactly what I was looking for :)  As James mentioned, it might 
> not work correctly, but I'm experimenting to see what I can make it do.

This hardware has not size limit for its DMA buffer.


Clemens


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-02-14  8:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-10 21:11 prealloc/buffer time limit? Ron Cococcia
2006-02-13  8:06 ` Clemens Ladisch
2006-02-13 15:07   ` Ron Cococcia
2006-02-13 15:52     ` Clemens Ladisch
2006-02-13 19:08       ` Ron Cococcia
2006-02-14  8:13         ` Clemens Ladisch
2006-02-13 18:16 ` James Courtier-Dutton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.