FS#25501 - [linux] set SND_HDA_PREALLOC_SIZE=2048 in linux-3.1

Attached to Project: Arch Linux
Opened by Tom Gundersen (tomegun) - Wednesday, 10 August 2011, 22:25 GMT
Last edited by Tobias Powalowski (tpowa) - Saturday, 29 October 2011, 06:39 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Jan Alexander Steffens (heftig)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

As of 3.1 there will be a new config option in the alsa HD-audio module: SND_HDA_PREALLOC_SIZE.

For people using alsa directly, the value of this option makes no difference (as far as I know). However, with PulseAudio increasing this value will make it possible to only wake up once every two seconds when playing audio.

I suggest setting the value to 2048, as mentioned in the help text (below). As far as I know, there is no downside to this, the only reason not to increase it further is that PulseAudio does not take advantage of a value above 2048, so there would be no point.

For easy reference:

+config SND_HDA_PREALLOC_SIZE
+ int "Pre-allocated buffer size for HD-audio driver"
+ range 0 32768
+ default 64
+ help
+ Speficies the default pre-allocated buffer-size in kB for
+ HD-audio driver. A larger buffer (e.g. 2048) is preferred
+ for systems with PulseAudio. The default 64 is chosen just
+ from the compatibility reason.
+
+ Note that the pre-allocation size can be changed dynamically
+ via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too.
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Saturday, 29 October 2011, 06:39 GMT
Reason for closing:  Fixed
Comment by Jan Alexander Steffens (heftig) - Thursday, 11 August 2011, 00:18 GMT
This may result in increased delays with classical audio scheduling (i.e. no PA). Needs research.
Comment by Tom Gundersen (tomegun) - Thursday, 11 August 2011, 00:51 GMT
@heftig: I'll make sure to test out the no-PA case. Do you have a reference/link to any known problems? I was under the impression that this would not be a problem, but I might have gotten it wrong, I'll re-read the docs.
Comment by Jan Alexander Steffens (heftig) - Thursday, 11 August 2011, 00:57 GMT
Ah, I might have misunderstood this. Could be the only bad effect is some wasted memory.
Comment by Tom Gundersen (tomegun) - Saturday, 20 August 2011, 14:32 GMT
I tried disabling PA and using vlc with ALSA directly. I was not able to notice any difference in behavior. If anyone else who does not use PA would like to try this out (with a standard kernel), they can see if

for dev in /proc/asound/card*/pcm*/sub*/prealloc; do
echo 2048 > $dev
done

causes any problems with their audio.
Comment by Tobias Powalowski (tpowa) - Wednesday, 24 August 2011, 06:25 GMT
any objections if adding 4096?
Fedora defaults to this value on 3.1 series.
Comment by Tom Gundersen (tomegun) - Wednesday, 24 August 2011, 09:48 GMT
@tpowa: If Fedora uses 4096, then it probably means I got my numbers wrong and that PA can take advantage of that much buffer (not only 2048), so no objections from me. I just suggested the number based on what the kernel help said.
Comment by Tobias Powalowski (tpowa) - Tuesday, 25 October 2011, 06:56 GMT
Added to 3.1 config 4096

Loading...