Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716252 - media-sound/pulseaudio CONFIG_SND_HDA_PREALLOC_SIZE not changeable
Summary: media-sound/pulseaudio CONFIG_SND_HDA_PREALLOC_SIZE not changeable
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 3 votes (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://git.kernel.org/pub/scm/linux/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-05 08:32 UTC by jospezial
Modified: 2021-11-06 19:35 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jospezial 2020-04-05 08:32:29 UTC
media-sound/pulseaudio ebuild warns about CONFIG_SND_HDA_PREALLOC_SIZE if it is not set to "2048".

In a modern 64bit kernel the symbol defaults to "0" and is not visible and not changeable.

Editing that symbol in .config does not survive a "make oldconfig".

The same for UML and SND_DMA_SGBUF.

Symbol: SND_HDA_PREALLOC_SIZE [=0]                                                                                                                                                                                                                                                                                                                 │  
  │ Type  : integer                                                                                                                                                                                                                                                                                                                                    │  
  │ Range : [0 32768]                                                                                                                                                                                                                                                                                                                                  │  
  │ Defined at sound/hda/Kconfig:23                                                                                                                                                                                                                                                                                                                    │  
  │   Prompt: Pre-allocated buffer size for HD-audio driver                                                                                                                                                                                                                                                                                            │  
  │   Depends on: SOUND [=y] && !UML && SND [=y]                                                                                                                                                                                                                                                                                                       │  
  │   Visible if: SOUND [=y] && !UML && SND [=y] && !SND_DMA_SGBUF [=y]                                                                                                                                                                                                                                                                                │  
  │   Location:                                                                                                                                                                                                                                                                                                                                        │  
  │     -> Device Drivers                                                                                                                                                                                                                                                                                                                              │  
  │       -> Sound card support (SOUND [=y])                                                                                                                                                                                                                                                                                                           │  
  │ (1)     -> Advanced Linux Sound Architecture (SND [=y])                                                                                                                                                                                                                                                                                            │
Comment 1 Lars Wendler (Polynomial-C) gentoo-dev 2020-04-05 10:43:44 UTC
What is a "modern" kernel for you?

  # zgrep -F SND_HDA_PREALLOC_SIZE /proc/config.gz 
  CONFIG_SND_HDA_PREALLOC_SIZE=2048
  # uname -r
  5.4.30
  #
Comment 2 jospezial 2020-04-05 12:19:51 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #1)
> What is a "modern" kernel for you?
> 
>   # zgrep -F SND_HDA_PREALLOC_SIZE /proc/config.gz 
>   CONFIG_SND_HDA_PREALLOC_SIZE=2048
>   # uname -r
>   5.4.30
>   #

I'm on 5.6.0

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/sound/hda/Kconfig?id=c31427d0d21e198c74d5d92082c4b8194b257f82

"ALSA: hda: No preallocation on x86 platforms
Like many other drivers, HD-audio drivers also do PCM buffer
preallocation to assure the buffer pages allocated at the early boot
stage.  This step is useful for platforms that may fail to allocate
the PCM hardware buffers -- which is mostly for either large
continuous pages or with the specific DMA mask (like emu10k1).

OTOH, when a buffer is allocated as SG-buffer and the DMA mask is
either 32 or 64 bits, the allocation almost never fails unless it hits
the real OOM situation.  In such a case, we don't need the
preallocation inevitably unlike the cases above.

That said, we may drop the preallocation for HD-audio that does
allocate via SG-buffers, and the patch achieves it.

However, there is one caveat: the buffer allocation behavior depends
on CONFIG_SND_DMA_SGBUF, and it falls back to the continuous pages
when it's not set.  And, currently this SG buffer allocation is
enabled only on x86 platforms.  So, covering those fall-outs, the
patch adjusts CONFIG_SND_HDA_PREALLOC_SIZE depending on the condition,
and keeps the old behavior as-is for non-x86 platforms.

On x86, the kconfig item is no longer adjustable but always set to
zero for disabling the preallocation.  You can still enable the
preallocation via procfs interface at any time later, too."
Comment 3 inactive 2020-04-20 00:16:32 UTC
 * A preallocated buffer-size of 2048 (kB) or higher is recommended for the HD-audio driver!
 * CONFIG_SND_HDA_PREALLOC_SIZE=0

^ that is not visible due to SND_DMA_SGBUF=y and this is Y because
Depends on: SOUND [=m] && !UML && SND [=m] && X86 [=y]  

Maybe this message should only show if SND_DMA_SGBUF isn't y ? even though the prev. comment says:
> You can still enable the preallocation via procfs interface at any time later

I remember seeing that message at least once before and went through the steps to try to enable it, yet found out (again) why I cannot :)
Comment 4 A Schenck 2021-07-01 17:36:47 UTC
Just got this today with dist-kernel since I got lazy about going through kernel config every time.  Would be nice to silence the warning since it's not needed in this case.
Comment 5 Paul Gover 2021-10-07 08:28:44 UTC
I too have just hit this situation on
  kernel 5.14.9-gentoo,
as a result of the
  emerge -e @world
suggested to sort out the /var/db/pkg debacle.

IIUC the message in the ebuild is misleading on x86, as there's no need or mechanism to set SND_HDA_PREALLOC_SIZE.

If you try to set it using make nconfig, you go down a rabbit hole trying to work out how to change UML, which I guess you shouldn't...