Merge branch 'master' into test_issue_17

This commit is contained in:
Andrea Bondavalli 2021-01-31 18:22:40 +01:00
commit b34efd2a45
3 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,23 @@
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
@@ -1106,7 +1130,7 @@ static struct snd_pcm_hardware mr_alsa_audio_pcm_hardware_playback =
.rates = (SNDRV_PCM_RATE_KNOT|SNDRV_PCM_RATE_44100|SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_176400|SNDRV_PCM_RATE_192000),
.rate_min = 44100,
.rate_max = 384000,
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = MR_ALSA_NB_CHANNELS_MAX,
.buffer_bytes_max = MR_ALSA_RINGBUFFER_NB_FRAMES * MR_ALSA_NB_CHANNELS_MAX * 4, // 4 bytes per sample, 128 ch
.period_bytes_min = MR_ALSA_NB_FRAMES_PER_PERIOD_AT_1FS * 2 * 3, // amount of data in bytes for 8 channels, 24bit samples, at 1Fs
@@ -1135,7 +1159,7 @@ static struct snd_pcm_hardware mr_alsa_audio_pcm_hardware_capture =
.rates = (SNDRV_PCM_RATE_KNOT|SNDRV_PCM_RATE_44100|SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_176400|SNDRV_PCM_RATE_192000),
.rate_min = 44100,
.rate_max = 384000,
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = MR_ALSA_NB_CHANNELS_MAX,
.buffer_bytes_max = MR_ALSA_RINGBUFFER_NB_FRAMES * MR_ALSA_NB_CHANNELS_MAX * 4, // 4 bytes per sample, 128 ch
.period_bytes_min = MR_ALSA_NB_FRAMES_PER_PERIOD_AT_1FS * 2 * 4, // amount of data in bytes for 8 channels, 24bit samples, at 1Fs

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

@ -23,12 +23,16 @@ if [ ! -d ravenna-alsa-lkm.git ]; then
git apply ../patches/ravenna-alsa-lkm-disable-ptp-checksum.patch git apply ../patches/ravenna-alsa-lkm-disable-ptp-checksum.patch
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-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