Added patch to Ravenna driver to fix a problem that leads to an initial playback buffer corruption in case the read/write interleaved mode is used.
The problem arises from pre-buffering performed after ALSA prepare and before ALSA start trigger- The patch enables the early startup of the audio playback interrupt and disables the cleanup (mute) of the playback buffer. This issue can be reproduced using the test suite developed to investigate #17 and by removing the (-M) option from aplay in run_test.sh script.
This commit is contained in:
parent
bde3de9472
commit
77cf7bdb28
26
3rdparty/patches/ravenna-alsa-fix-playback-rw-mode.patch
vendored
Normal file
26
3rdparty/patches/ravenna-alsa-fix-playback-rw-mode.patch
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
diff --git a/driver/audio_driver.c b/driver/audio_driver.c
|
||||
index 3d9debd..cc6240e 100644
|
||||
--- a/driver/audio_driver.c
|
||||
+++ b/driver/audio_driver.c
|
||||
@@ -936,6 +936,8 @@
|
||||
chip->dma_playback_offset = 0;
|
||||
chip->dma_playback_buffer = runtime->dma_area;
|
||||
chip->pcm_playback_buffer_size = snd_pcm_lib_buffer_bytes(chip->playback_substream);
|
||||
+ // early startup to fix problem with read-write interleaved mode pre-buffering
|
||||
+ chip->mr_alsa_audio_ops->start_interrupts(chip->ravenna_peer, 1);
|
||||
}
|
||||
else if(substream->stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||
{
|
||||
index 5a90eca..8023708 100644
|
||||
--- a/driver/manager.c
|
||||
+++ b/driver/manager.c
|
||||
@@ -279,7 +279,7 @@
|
||||
}
|
||||
else {
|
||||
printk(KERN_DEBUG "starting playback I/O\n");
|
||||
- MuteOutputBuffer(self);
|
||||
+ //MuteOutputBuffer(self);
|
||||
self->m_bIsPlaybackIO = true;
|
||||
}
|
||||
|
||||
|
1
build.sh
1
build.sh
@ -25,6 +25,7 @@ if [ ! -d ravenna-alsa-lkm.git ]; then
|
||||
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-init-play-capture-buffers.patch
|
||||
git apply ../patches/ravenna-alsa-fix-playback-rw-mode.patch
|
||||
echo "Building ravenna-alsa-lkm kernel module ..."
|
||||
cd driver
|
||||
make
|
||||
|
Loading…
x
Reference in New Issue
Block a user