aes67-daemon/3rdparty/patches/ravenna-alsa-lkm-fixes.patch
Andrea Bondavalli 3d3209bfc9 Set of chnages to ALSA Ravenna driver to fix the playback with memory mapped access mode on ARM platform.
Issue is in the mr_alsa_audio_pcm_playback_copy_internal() function of audio_driver.c that transfers the PCM samples from the ALSA buffer to the Ravenna buffer using the get_user() function.
In case of memory access mode the ALSA buffer can be directly accessed by the kernel and the samples must be copied.
mr_alsa_audio_pcm_playback_copy_internal() has been modified  to handle the transfer of the ALSA buffer from user space (used with read/write access mode) and from kernel space (used by memory access mode).
The issue is common to all the platform but impacting ARM only.
Additional changes:
- changed type for dma_playback_offset and dma_capture_offset variables to uint32_t instead of atomic_t since the pointer callback mr_alsa_audio_pcm_pointer() is now atomic
- added variables to the mr_alsa_audio_chip scructure to decrease the number of calls to snd_pcm_lib_xxx() functions. These get assigned in the prepare callback mr_alsa_audio_pcm_prepare()
- changed mr_alsa_audio_get_playback_buffer_size_in_frames() to return configured size of Ravenna playback buffer (same as mr_alsa_audio_get_capture_buffer_size_in_frames())
- some rework of the existing patches
This fixes issue #20
2020-08-27 21:20:19 +02:00

83 lines
2.8 KiB
Diff

diff --git a/common/MergingRAVENNACommon.h b/common/MergingRAVENNACommon.h
index f26368d..a21f4a7 100644
--- a/common/MergingRAVENNACommon.h
+++ b/common/MergingRAVENNACommon.h
@@ -78,8 +78,8 @@
#define DEFAULT_AUDIOMODE MergingRAVENNACommon::AM_PCM
#define DEFAULT_AUDIODATAFORMAT MergingRAVENNACommon::ADF_PCM
#define DEFAULT_ZONE MergingRAVENNACommon::Z_8_HP
-#define DEFAULT_NUMBEROFINPUTS 8
-#define DEFAULT_NUMBEROFOUTPUTS 8
+#define DEFAULT_NUMBEROFINPUTS 64
+#define DEFAULT_NUMBEROFOUTPUTS 64
#define DEFAULT_FOLLOWDOPDETECTION true
#ifdef DSD256_at_705k6
diff --git a/driver/PTP.c b/driver/PTP.c
index 4b2242a..1bf593a 100644
--- a/driver/PTP.c
+++ b/driver/PTP.c
@@ -90,7 +90,7 @@ uint32_t get_FS(uint32_t ui32SamplingRate)
return 2;
default:
// TODO: should assert
- MTAL_DP("Caudio_streamer_clock::get_FS error: unknown SamplingRate = %u\n", ui32SamplingRate);
+ //MTAL_DP("Caudio_streamer_clock::get_FS error: unknown SamplingRate = %u\n", ui32SamplingRate);
case 48000:
case 44100:
return 1;
@@ -110,7 +110,7 @@ uint32_t get_samplerate_base(uint32_t ui32SamplingRate)
default:
// TODO: should assert
- MTAL_DP("Caudio_streamer_clock::get_samplerate_base error: unknown SamplingRate = %u\n", ui32SamplingRate);
+ //MTAL_DP("Caudio_streamer_clock::get_samplerate_base error: unknown SamplingRate = %u\n", ui32SamplingRate);
case 352800:
case 176400:
case 88200:
diff --git a/driver/module_netlink.c b/driver/module_netlink.c
index 48de263..dcdcce0 100644
--- a/driver/module_netlink.c
+++ b/driver/module_netlink.c
@@ -158,7 +158,7 @@ void recv_reply_from_user_land(struct sk_buff *skb)
// check if the given size if sufficient to copy the answered data
if (response_from_user_land->dataSize >= msg->dataSize)
{
- if (response_from_user_land->data == NULL)
+ if (response_from_user_land->data != NULL)
{
memcpy(response_from_user_land->data, msg->data, msg->dataSize);
}
diff --git a/driver/MTAL_stdint.h b/driver/MTAL_stdint.h
index 3ccc109..2f11a58 100644
--- a/driver/MTAL_stdint.h
+++ b/driver/MTAL_stdint.h
@@ -64,9 +64,9 @@
}
#endif // __cplusplus
#include <linux/types.h>
- #define new NEW
+ //#define new NEW
#include <linux/string.h>
- #undef new
+ //#undef new
#else
#include <stdint.h>
#endif
diff --git a/driver/RTP_stream_info.c b/driver/RTP_stream_info.c
index ac65bbb..a65994f 100644
--- a/driver/RTP_stream_info.c
+++ b/driver/RTP_stream_info.c
@@ -32,9 +32,9 @@
#include "MTAL_TargetPlatform.h"
#if (defined(MTAL_LINUX) && defined(MTAL_KERNEL))
- #define new NEW
+ //#define new NEW
#include <linux/string.h>
- #undef new
+ //#undef new
#else
#include <string.h>
#endif