Fix SND_HDA_PREALLOC issue
Status from this message: Applied all three patches now. Thanks.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 1 replyApplied
- v13 patches 4 repliesSuperseded
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | ALSA: pcm: Add debug print on memory allocation failuresound/ | +8 | 0 replies | |
| 2/3 | ALSA: hda: Change AZX_MAX_BUF_SIZE from 1GB to 4MBinclude/ | +6 | 0 replies | |
| 3/3 | ALSA: hda: Revert "ALSA: hda: Allow setting preallocation again for x86"sound/ | +3 | 0 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Cezary Rojewski |
|---|---|
| 1/3 | R-b |
| 2/3 | R-b |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/3] Fix SND_HDA_PREALLOC issue
For context it started with user reporting failures when running arecord without any error or warning in dmesg (after fixing some configuration problems thet they had).
https://bugzilla.kernel.org/show_bug.cgi?id=201251#c279
After spending time investigating the issue it was narrowed to quite big setting of CONFIG_SND_HDA_PREALLOC_SIZE (4096).
When looking at code
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/core/pcm_memory.c?id=6417f03132a6952cd17ddd8eaddbac92b61b17e0#n30
there is a limit of memory per card:max_alloc_per_card = 32UL * 1024UL * 1024UL
When SND_HDA_PREALLOC_SIZE is set to 4096 it only has memory to alloc for 8 frontends, while Skylake HDA card has 10 of them (6 playback and 4 capture), so preallocated memory is exhausted while probing. In consequence 2 of FEs end without allocated memory.
It can be workarounded on user side with setting SND_HDA_PREALLOC_SIZE to lower value, other is changing memory limit per card.
However in order to not waste user memory, change maximum allocation size on HDA controller to 4MB and force automatical memory allocation insted of preallocated one.
First patch adds prints, so similar issues can be easily identified in the future.
Second changes maximum size of hda buffer to reasonable value of 4MB. And last one reverts patch which allowed setting prealloc size on X86 platforms.
Amadeusz Sławiński (3):
ALSA: pcm: Add debug print on memory allocation failure
ALSA: hda: Change AZX_MAX_BUF_SIZE from 1GB to 4MB
ALSA: hda: Revert "ALSA: hda: Allow setting preallocation again for
x86"
include/sound/hda_register.h | 8 ++++++-- sound/core/pcm_memory.c | 8 ++++++++ sound/hda/Kconfig | 7 +++---- 3 files changed, 17 insertions(+), 6 deletions(-)
Signature · 1 line
2.25.1