Added patch to Ravenna driver to solve a possible corruption issue at the beginning of a playback or recording caused by not initialized buffers.

This commit is contained in:
Andrea Bondavalli 2021-01-31 18:19:33 +01:00
parent 143d98dee5
commit bf847edd73
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,22 @@
diff --git a/driver/audio_driver.c b/driver/audio_driver.c
index 3d9debd..339327b 100644
--- a/driver/audio_driver.c
+++ b/driver/audio_driver.c
@@ -2441,7 +2142,7 @@ static int mr_alsa_audio_preallocate_memory(struct mr_alsa_audio_chip *chip)
printk(KERN_ERR "mr_alsa_audio_preallocate_memory: could not allocate playback buffer (%zd bytes vmalloc requested...\n", wanted);
goto _failed;
}
-
+ memset(chip->playback_buffer, 0, wanted);
wanted = mr_alsa_audio_pcm_hardware_capture.buffer_bytes_max; // MR_ALSA_RINGBUFFER_NB_FRAMES * MR_ALSA_NB_CHANNELS_MAX * 4;
@@ -2452,6 +2153,7 @@ static int mr_alsa_audio_preallocate_memory(struct mr_alsa_audio_chip *chip)
printk(KERN_ERR "mr_alsa_audio_preallocate_memory: could not allocate capture buffer (%zd bytes vmalloc requested...\n", wanted);
goto _failed;
}
+ memset(chip->capture_buffer, 0, wanted);
for (i = 0; i < MR_ALSA_NB_CHANNELS_MAX; i++)
{
chip->capture_buffer_channels_map[i] = (void*)chip->capture_buffer + MR_ALSA_RINGBUFFER_NB_FRAMES * i * 4;

View File

@ -24,12 +24,15 @@ if [ ! -d ravenna-alsa-lkm.git ]; then
git apply ../patches/ravenna-alsa-lkm-independent-playback-capture.patch git apply ../patches/ravenna-alsa-lkm-independent-playback-capture.patch
git apply ../patches/ravenna-alsa-lkm-direct-pcm-transfer.patch git apply ../patches/ravenna-alsa-lkm-direct-pcm-transfer.patch
git apply ../patches/ravenna-alsa-lkm-enable-mono-channels.patch git apply ../patches/ravenna-alsa-lkm-enable-mono-channels.patch
git apply ../patches/ravenna-alsa-lkm-init-play-capture-buffers.patch
echo "Building ravenna-alsa-lkm kernel module ..." echo "Building ravenna-alsa-lkm kernel module ..."
cd driver cd driver
make make
cd ../.. cd ../..
fi fi
exit 1
if [ ! -d cpp-httplib.git ]; then if [ ! -d cpp-httplib.git ]; then
git clone https://github.com/yhirose/cpp-httplib.git git clone https://github.com/yhirose/cpp-httplib.git
cd cpp-httplib cd cpp-httplib