Skip to content

Commit f8e4ae1

Browse files
committed
ALSA: hda: Allow setting preallocation again for x86
The commit c31427d ("ALSA: hda: No preallocation on x86 platforms") changed CONFIG_SND_HDA_PREALLOC_SIZE setup and its default to zero for x86, as the preallocation should work almost all cases. However, this expectation was too naive; some applications try to allocate as the max buffer size as possible, and it leads to the memory exhaustion. More badly, the commit changed the kconfig no longer adjustable for x86, so you can't fix it statically (although it can be still adjusted via procfs). So, practically seen, it's more recommended to set a reasonable limit for x86, too. This patch follows to that experience, and changes the default to 2048 and allow the kconfig adjustable again. Fixes: c31427d ("ALSA: hda: No preallocation on x86 platforms") Cc: <[email protected]> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207223 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 3ba2111 commit f8e4ae1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sound/hda/Kconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ config SND_HDA_EXT_CORE
2121
select SND_HDA_CORE
2222

2323
config SND_HDA_PREALLOC_SIZE
24-
int "Pre-allocated buffer size for HD-audio driver" if !SND_DMA_SGBUF
24+
int "Pre-allocated buffer size for HD-audio driver"
2525
range 0 32768
26-
default 0 if SND_DMA_SGBUF
26+
default 2048 if SND_DMA_SGBUF
2727
default 64 if !SND_DMA_SGBUF
2828
help
2929
Specifies the default pre-allocated buffer-size in kB for the
3030
HD-audio driver. A larger buffer (e.g. 2048) is preferred
3131
for systems using PulseAudio. The default 64 is chosen just
3232
for compatibility reasons.
33-
On x86 systems, the default is zero as we need no preallocation.
33+
On x86 systems, the default is 2048 as a reasonable value for
34+
most of modern systems.
3435

3536
Note that the pre-allocation size can be changed dynamically
3637
via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too.

0 commit comments

Comments
 (0)