From 4a301de44c24f431aef869bb81b48ec32ce369a1 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Fri, 26 Feb 2021 00:10:37 +0100 Subject: [PATCH] RPi: add udev rule to increase alsa buffer size to 1.2MB The default of 512k is too small at 192kHz/8ch, kodi can only get a 86ms buffer instead of the 200ms buffer it usually wants. That results in occasional buffer underruns when playing media from local storage which is uncached in kodi's default settings. Increase the alsa buffer size to 1.2MB so kodi can get the audio buffer size it likes to have. Signed-off-by: Matthias Reichl --- .../filesystem/usr/lib/udev/rules.d/80-alsa-preallocsize.rules | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 projects/RPi/filesystem/usr/lib/udev/rules.d/80-alsa-preallocsize.rules diff --git a/projects/RPi/filesystem/usr/lib/udev/rules.d/80-alsa-preallocsize.rules b/projects/RPi/filesystem/usr/lib/udev/rules.d/80-alsa-preallocsize.rules new file mode 100644 index 0000000000..364294325c --- /dev/null +++ b/projects/RPi/filesystem/usr/lib/udev/rules.d/80-alsa-preallocsize.rules @@ -0,0 +1,3 @@ +ACTION=="add", SUBSYSTEM=="sound", KERNEL=="pcmC*", ATTRS{id}=="vc4hdmi*", \ + ENV{.snd_card}="$id", \ + RUN+="/bin/sh -c 'echo 1280 > /proc/asound/$env{.snd_card}/pcm0p/sub0/prealloc'"