diff --git a/3rdparty/patches/ravenna-alsa-lkm-arm-32bit.patch b/3rdparty/patches/ravenna-alsa-lkm-arm-32bit.patch new file mode 100644 index 0000000..b112c99 --- /dev/null +++ b/3rdparty/patches/ravenna-alsa-lkm-arm-32bit.patch @@ -0,0 +1,321 @@ +diff --git a/driver/RTP_audio_stream.c b/driver/RTP_audio_stream.c +index 5a160e4..a5c84e4 100644 +--- a/driver/RTP_audio_stream.c ++++ b/driver/RTP_audio_stream.c +@@ -40,6 +40,7 @@ + + #include "RTP_audio_stream.h" + #include "MTAL_DP.h" ++#include "c_wrapper_lib.h" + + #define DEBUG_TRACE(x) MTAL_DP("[RTP Stream] "); MTAL_DP x + #define ASSERT(x) {if(!(x)) { MTAL_DP("Assert in %s line %i\n", __FILE__, __LINE__); }} +@@ -377,7 +378,7 @@ int Create(TRTP_audio_stream* self, TRTP_stream_info* pRTP_stream_info, rtp_audi + // if audio data format was changed we have to mute channels with the proper mute pattern; for now, we always mute + for(us = 0; us < pRTP_stream_info->m_byNbOfChannels; us++) + { +- //MTAL_DP("[%u] m_pvLivesInCircularBuffer[us] = 0x%x buffer length = %u wordlength = %u\n", us, m_pvLivesInCircularBuffer[us], pManager->get_live_in_jitter_buffer_length(pManager->user), m_usAudioEngineSampleWordLength); ++ //MTAL_DP("[%u] m_pvLivesInCircularBuffer[us] = 0x%x buffer length = %u wordlength = %u\n", us, self->m_pvLivesInCircularBuffer[us], pManager->get_live_in_jitter_buffer_length(pManager->user), self->m_usAudioEngineSampleWordLength); + + if(self->m_pvLivesInCircularBuffer[us]) + { // mute +@@ -413,7 +414,7 @@ int Destroy(TRTP_audio_stream* self) + unsigned short us; + for(us = 0; us < pRTP_stream_info->m_byNbOfChannels; us++) + { +- //MTAL_DP("[%u] m_pvLivesInCircularBuffer[us] = 0x%x buffer length = %u wordlength = %u\n", us, m_pvLivesInCircularBuffer[us], pManager->get_live_in_jitter_buffer_length(pManager->user), m_usAudioEngineSampleWordLength); ++ //MTAL_DP("[%u] m_pvLivesInCircularBuffer[us] = 0x%x buffer length = %u wordlength = %u\n", us, self->m_pvLivesInCircularBuffer[us], self->m_pManager->get_live_in_jitter_buffer_length(self->m_pManager->user), self->m_usAudioEngineSampleWordLength); + + if(self->m_pvLivesInCircularBuffer[us]) + { // mute +@@ -782,7 +783,7 @@ int ProcessRTPAudioPacket(TRTP_audio_stream* self, TRTPPacketBase* pRTPPacketBas + + //MTAL_DP("ui32RTPSAC %u perfcounter %I64u\n", ui32RTPSAC, MTAL_LK_GetCounterTime()); + // ui32UsedSAC is the first frame SAC when this packet will be used +- ui64UsedSAC = (ui64RTPSAC - (ui64RTPSAC % pManager->get_frame_size(pManager->user))); ++ ui64UsedSAC = (ui64RTPSAC - (CW_ll_modulo(ui64RTPSAC, pManager->get_frame_size(pManager->user)))); + + i64DeltaSAC = ui64UsedSAC - ui64GlobalSAC; + //MTAL_DP("i64DeltaSAC %I64u playout delay %u, frame size: %u\n", i64DeltaSAC, pRTP_stream_info->m_ui32PlayOutDelay, pManager->get_frame_size(pManager->user)); +diff --git a/driver/audio_driver.c b/driver/audio_driver.c +index a04ec21..4569f20 100644 +--- a/driver/audio_driver.c ++++ b/driver/audio_driver.c +@@ -1205,7 +1205,7 @@ static int mr_alsa_audio_pcm_capture_copy_internal( struct snd_pcm_substream *s + { + int ret_pu; + char val = 0xf1; +- __put_user_x(1, val, (unsigned long __user *)src, ret_pu); ++ //__put_user_x(1, val, (unsigned long __user *)src, ret_pu); + ret_pu = put_user(val, (unsigned long __user *)src); + //put_user(val, (unsigned long __user *)src); + switch(nb_logical_bits) +@@ -2758,4 +2758,4 @@ void mr_alsa_audio_card_exit(void) + g_ravenna_peer = NULL; + g_mr_alsa_audio_ops = NULL; + printk(KERN_INFO "leaving mr_alsa_audio_card_exit..\n"); +-} +\ No newline at end of file ++} +diff --git a/driver/manager.c b/driver/manager.c +index 5a90eca..8023708 100644 +--- a/driver/manager.c ++++ b/driver/manager.c +@@ -1272,10 +1272,10 @@ uint32_t get_live_in_jitter_buffer_offset(void* user, const uint64_t ui64Current + struct TManager* self = (struct TManager*)user; + + #if defined(MT_TONE_TEST) || defined (MT_RAMP_TEST) || defined (MTLOOPBACK) || defined (MTTRANSPARENCY_CHECK) +- return (uint32_t)(ui64CurrentSAC % get_live_in_jitter_buffer_length(self)); ++ return (uint32_t)CW_ll_modulo(ui64CurrentSAC, get_live_in_jitter_buffer_length(self)); + #else + uint32_t live_in_jitter_buffer_length = self->m_alsa_driver_frontend->get_capture_buffer_size_in_frames(self->m_pALSAChip); +- return (uint32_t)(ui64CurrentSAC % live_in_jitter_buffer_length); ++ return (uint32_t)CW_ll_modulo(ui64CurrentSAC, live_in_jitter_buffer_length); + #endif + } + +@@ -1298,7 +1298,7 @@ uint32_t get_live_out_jitter_buffer_offset(void* user, const uint64_t ui64Curren + struct TManager* self = (struct TManager*)user; + + #if defined(MT_TONE_TEST) || defined (MT_RAMP_TEST) || defined (MTLOOPBACK) || defined (MTTRANSPARENCY_CHECK) +- return (uint32_t)(ui64CurrentSAC % get_live_out_jitter_buffer_length(self)); ++ return (uint32_t)CW_ll_modulo(ui64CurrentSAC, get_live_out_jitter_buffer_length(self)); + #else + uint32_t offset = self->m_alsa_driver_frontend->get_playback_buffer_offset(self->m_pALSAChip); + const uint32_t sacOffset = (uint32_t)(get_global_SAC(self) - get_frame_size(self) - ui64CurrentSAC); +@@ -1432,9 +1432,9 @@ void AudioFrameTIC(void* user) + { + #if defined(MT_TONE_TEST) + unsigned long p = (self->m_tone_test_phase * self->m_SampleRate) / LUTSampleRate; +- int16_t val16 = LUT[(p + 4 * chIdx) % LUTnbPoints]/* >> 1*/; ++ int16_t val16 = LUT[CW_ll_modulo((p + 4 * chIdx), LUTnbPoints)]/* >> 1*/; + int32_t val24 = val16 << 8; +- self->m_tone_test_phase = (self->m_tone_test_phase + 1) % (LUTnbPoints * 100); ++ self->m_tone_test_phase = CW_ll_modulo((self->m_tone_test_phase + 1), (LUTnbPoints * 100)); + #elif defined(MT_RAMP_TEST) + int32_t val24 = self->m_ramp_test_phase; + if(val24 >= 8388608) // 2^23 +diff --git a/driver/MTAL_DP.h b/driver/MTAL_DP.h +index 1f0fb89..8aeaba2 100644 +--- a/driver/MTAL_DP.h ++++ b/driver/MTAL_DP.h +@@ -129,26 +129,34 @@ + #include + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) + #include +- #define MTAL_DP(...) MTAL_LK_print(KERN_INFO __VA_ARGS__) ++ #define MTAL_DP(...) ++ //#define MTAL_DP(...) MTAL_LK_print(KERN_INFO __VA_ARGS__) + #define MTAL_DP_EMRG(...) MTAL_LK_print(KERN_EMERG __VA_ARGS__) + #define MTAL_DP_ALERT(...) MTAL_LK_print(KERN_ALERT __VA_ARGS__) + #define MTAL_DP_CRIT(...) MTAL_LK_print(KERN_CRIT __VA_ARGS__) + #define MTAL_DP_ERR(...) MTAL_LK_print(KERN_ERR __VA_ARGS__) + #define MTAL_DP_WARN(...) MTAL_LK_print(KERN_WARNING __VA_ARGS__) +- #define MTAL_DP_NOTICE(...) MTAL_LK_print(KERN_NOTICE __VA_ARGS__) +- #define MTAL_DP_INFO(...) MTAL_LK_print(KERN_INFO __VA_ARGS__) +- #define MTAL_DP_DEBUG(...) MTAL_LK_print(KERN_DEBUG __VA_ARGS__) ++ #define MTAL_DP_NOTICE(...) ++ //#define MTAL_DP_NOTICE(...) MTAL_LK_print(KERN_NOTICE __VA_ARGS__) ++ #define MTAL_DP_INFO(...) ++ //#define MTAL_DP_INFO(...) MTAL_LK_print(KERN_INFO __VA_ARGS__) ++ #define MTAL_DP_DEBUG(...) ++ //#define MTAL_DP_DEBUG(...) MTAL_LK_print(KERN_DEBUG __VA_ARGS__) + #else + //#include +- #define MTAL_DP(...) MTAL_LK_print(""__VA_ARGS__) ++ #define MTAL_DP(...) ++ //#define MTAL_DP(...) MTAL_LK_print(""__VA_ARGS__) + #define MTAL_DP_EMRG(...) MTAL_LK_print("<>"__VA_ARGS__) + #define MTAL_DP_ALERT(...) MTAL_LK_print("<1>"__VA_ARGS__) + #define MTAL_DP_CRIT(...) MTAL_LK_print("<2>"__VA_ARGS__) + #define MTAL_DP_ERR(...) MTAL_LK_print("<3>"__VA_ARGS__) + #define MTAL_DP_WARN(...) MTAL_LK_print("<4>"__VA_ARGS__) +- #define MTAL_DP_NOTICE(...) MTAL_LK_print("<5>"__VA_ARGS__) +- #define MTAL_DP_INFO(...) MTAL_LK_print("<6>"__VA_ARGS__) +- #define MTAL_DP_DEBUG(...) MTAL_LK_print("<7>"__VA_ARGS__) ++ #define MTAL_DP_NOTICE(...) ++ //#define MTAL_DP_NOTICE(...) MTAL_LK_print("<5>"__VA_ARGS__) ++ #define MTAL_DP_INFO(...) ++ //#define MTAL_DP_INFO(...) MTAL_LK_print("<6>"__VA_ARGS__) ++ #define MTAL_DP_DEBUG(...) ++ //#define MTAL_DP_DEBUG(...) MTAL_LK_print("<7>"__VA_ARGS__) + #endif + + +diff --git a/driver/MTConvert.c b/driver/MTConvert.c +index c94bc03..c9fdffe 100644 +--- a/driver/MTConvert.c ++++ b/driver/MTConvert.c +@@ -1318,10 +1318,10 @@ int MTConvertMappedInt32ToInt16LEInterleave(void** input_buffer, const uint32_t + { + const uint8_t* in = (uint8_t*)input_buffer[ch] + in_pos; + #if defined(MTAL_LINUX) && defined(MTAL_KERNEL) +- __put_user_x(1, in[1], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[1], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[0], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[0], (unsigned char __user *)out); + ret |= ret_pu; + out++; + #else +@@ -1358,10 +1358,10 @@ int MTConvertMappedInt32ToInt16LEInterleave(void** input_buffer, const uint32_t + { + const uint8_t* in = (uint8_t*)input_buffer[ch] + in_pos; + #if defined(MTAL_LINUX) && defined(MTAL_KERNEL) +- __put_user_x(1, in[2], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[2], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[3], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[3], (unsigned char __user *)out); + ret |= ret_pu; + out++; + #else +@@ -1411,13 +1411,13 @@ int MTConvertMappedInt32ToInt24LEInterleave(void** input_buffer, const uint32_t + { + const uint8_t* in = (uint8_t*)input_buffer[ch] + in_pos; + #if defined(MTAL_LINUX) && defined(MTAL_KERNEL) +- __put_user_x(1, in[2], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[2], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[1], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[1], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[0], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[0], (unsigned char __user *)out); + ret |= ret_pu; + out++; + #else +@@ -1457,13 +1457,13 @@ int MTConvertMappedInt32ToInt24LEInterleave(void** input_buffer, const uint32_t + { + const uint8_t* in = (uint8_t*)input_buffer[ch] + in_pos; + #if defined(MTAL_LINUX) && defined(MTAL_KERNEL) +- __put_user_x(1, in[1], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[1], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[2], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[2], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[3], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[3], (unsigned char __user *)out); + ret |= ret_pu; + out++; + #else +@@ -1516,16 +1516,16 @@ int MTConvertMappedInt32ToInt24LE4ByteInterleave(void** input_buffer, const uint + const uint8_t* in = (uint8_t*)input_buffer[ch] + in_pos; + #if defined(MTAL_LINUX) && defined(MTAL_KERNEL) + char zero = 0x00; +- __put_user_x(1, in[2], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[2], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[1], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[1], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[0], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[0], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, zero, (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(zero, (unsigned char __user *)out); + ret |= ret_pu; + out++; + #else +@@ -1568,16 +1568,16 @@ int MTConvertMappedInt32ToInt24LE4ByteInterleave(void** input_buffer, const uint + const uint8_t* in = (uint8_t*)input_buffer[ch] + in_pos; + #if defined(MTAL_LINUX) && defined(MTAL_KERNEL) + char zero = 0x00; +- __put_user_x(1, in[1], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[1], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[2], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[2], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[3], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[3], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, zero, (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(zero, (unsigned char __user *)out); + ret |= ret_pu; + out++; + #else +@@ -1600,16 +1600,16 @@ int MTConvertMappedInt32ToInt24LE4ByteInterleave(void** input_buffer, const uint + const uint8_t* in = (uint8_t*)input_buffer[ch] + in_pos; + #if defined(MTAL_LINUX) && defined(MTAL_KERNEL) + char zero = 0x00; +- __put_user_x(1, in[1], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[1], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[2], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[2], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[3], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[3], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, zero, (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(zero, (unsigned char __user *)out); + ret |= ret_pu; + out++; + #else +@@ -1648,16 +1648,16 @@ int MTConvertMappedInt32ToInt32LEInterleave(void** input_buffer, const uint32_t + { + const uint8_t* in = (uint8_t*)input_buffer[ch] + in_pos; + #if defined(MTAL_LINUX) && defined(MTAL_KERNEL) +- __put_user_x(1, in[3], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[3], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[2], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[2], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[1], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[1], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[0], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[0], (unsigned char __user *)out); + ret |= ret_pu; + out++; + #else +@@ -1699,16 +1699,16 @@ int MTConvertMappedInt32ToInt32LEInterleave(void** input_buffer, const uint32_t + { + const uint8_t* in = (uint8_t*)input_buffer[ch] + in_pos; + #if defined(MTAL_LINUX) && defined(MTAL_KERNEL) +- __put_user_x(1, in[0], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[0], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[1], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[1], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[2], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[2], (unsigned char __user *)out); + ret |= ret_pu; + out++; +- __put_user_x(1, in[3], (unsigned long __user *)out, ret_pu); ++ ret_pu = put_user(in[3], (unsigned char __user *)out); + ret |= ret_pu; + out++; + #else +@@ -1867,6 +1867,7 @@ void MTConvertBigEndianInt16ToMappedInt32DeInterleave( void* input_buffer, + uint32_t i, ch; + const unsigned int stride_in = 2 * nb_channels, stride_out = 4; + const unsigned int out_pos = offset_output_buf * stride_out; ++ + for(ch = 0; ch < nb_channels; ++ch) + { + uint8_t* in = (uint8_t*)input_buffer + 2 * ch; diff --git a/3rdparty/patches/ravenna-alsa-lkm-kernel-v5.patch b/3rdparty/patches/ravenna-alsa-lkm-kernel-v5.patch index c81fdcf..bb77ef3 100644 --- a/3rdparty/patches/ravenna-alsa-lkm-kernel-v5.patch +++ b/3rdparty/patches/ravenna-alsa-lkm-kernel-v5.patch @@ -24,13 +24,13 @@ index 164f315..a993b41 100644 getnstimeofday64(&ts64); #else diff --git a/driver/module_timer.c b/driver/module_timer.c -index 5f64a8e..372afa3 100644 +index 5f64a8e..0ba770f 100644 --- a/driver/module_timer.c +++ b/driver/module_timer.c @@ -35,7 +35,11 @@ #include "module_main.h" #include "module_timer.h" - + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) +static struct hrtimer my_hrtimer_; +#else @@ -39,6 +39,25 @@ index 5f64a8e..372afa3 100644 static uint64_t base_period_; static uint64_t max_period_allowed; static uint64_t min_period_allowed; +@@ -57,15 +61,15 @@ enum hrtimer_restart timer_callback(struct hrtimer *timer) + + if (now > next_wakeup) + { +- printk(KERN_INFO "Timer won't sleep, clock_timer is recall instantly\n"); ++ //printk(KERN_INFO "Timer won't sleep, clock_timer is recall instantly\n"); + period = ktime_set(0, 0); + } + else if (ktime_to_ns(period) > max_period_allowed || ktime_to_ns(period) < min_period_allowed) + { +- printk(KERN_INFO "Timer period out of range: %lld [ms]. Target period = %lld\n", ktime_to_ns(period) / 1000000, base_period_ / 1000000); ++ //printk(KERN_INFO "Timer period out of range: %lld [ms]. Target period = %lld\n", ktime_to_ns(period) / 1000000, base_period_ / 1000000); + if (ktime_to_ns(period) > (unsigned long)5E9L) + { +- printk(KERN_ERR "Timer period greater than 5s, set it to 1s!\n"); ++ //printk(KERN_ERR "Timer period greater than 5s, set it to 1s!\n"); + period = ktime_set(0,((unsigned long)1E9L)); //1s + } + } @@ -80,8 +84,8 @@ enum hrtimer_restart timer_callback(struct hrtimer *timer) ///ret_overrun = hrtimer_forward(timer, kt_now, period); ret_overrun = hrtimer_forward_now(timer, period); @@ -48,7 +67,7 @@ index 5f64a8e..372afa3 100644 + /*if(ret_overrun > 1) + printk(KERN_INFO "Timer overrun ! (%d times)\n", ret_overrun);*/ return HRTIMER_RESTART; - + } @@ -89,9 +93,12 @@ enum hrtimer_restart timer_callback(struct hrtimer *timer) int init_clock_timer(void) @@ -62,11 +81,11 @@ index 5f64a8e..372afa3 100644 tasklet_hrtimer_init(&my_hrtimer_, timer_callback, CLOCK_MONOTONIC/*_RAW*/, HRTIMER_MODE_PINNED/*HRTIMER_MODE_ABS*/); - ///my_hrtimer_.function = &timer_callback; +#endif - + //base_period_ = 100 * ((unsigned long)1E6L); // 100 ms base_period_ = 1333333; // 1.3 ms @@ -108,8 +115,12 @@ void kill_clock_timer(void) - + int start_clock_timer(void) { - ktime_t period = ktime_set(0, base_period_); //100 ms @@ -76,13 +95,13 @@ index 5f64a8e..372afa3 100644 +#else tasklet_hrtimer_start(&my_hrtimer_, period, HRTIMER_MODE_ABS); +#endif - + return 0; } @@ -117,7 +128,11 @@ int start_clock_timer(void) void stop_clock_timer(void) { - + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) + hrtimer_cancel(&my_hrtimer_); +#else @@ -98,3 +117,5 @@ index 5f64a8e..372afa3 100644 -} \ No newline at end of file +} + + diff --git a/README.md b/README.md index 53c009b..c884d5b 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ With the WebUI a user can do the following operations: ### [3rdparty](3rdparty) directory ### This directory used to download the 3rdparty open source used by the daemon. -The **patches** subdirectory contains patches applied to the ALSA RAVENNA/AES67 module to compile with the Linux Kernel 5.x and to enable operations on the network loopback device (for testing purposes). +The **patches** subdirectory contains patches applied to the ALSA RAVENNA/AES67 module to compile with the Linux Kernel 5.x and on ARMv7 32bit platform and to enable operations on the network loopback device (for testing purposes). The ALSA RAVENNA/AES67 kernel module is responsible for: @@ -55,15 +55,18 @@ See [ALSA RAVENNA/AES67 Driver README](https://bitbucket.org/MergingTechnologies This directory contains a the daemon configuration and status files used to run a short demo on the network loopback device. The [demo](#demo) is described below. ## Prerequisite ## -The daemon has been tested on **Ubuntu 18.04** and **19.10** using: +The daemon and the demo have been tested on **Ubuntu 18.04** distro on **x86/ARMv7** plattforms and on **19.10** distro on **x86** using: -* Linux kernel version >= 5.0.0 -* GCC version >= 7.4 / clang >= 6.0.0 (C++17 support required) +* Linux kernel version >= 4.14.x +* GCC version >= 7.4 / clang >= 6.0.0 (C++17 support required, clang is required to compile on ARMv7) * cmake version >= 3.10.2 * node version >= 8.10.0 * mpm version >= 3.5.2 * boost libraries version >= 1.65.1 +The BeagleBone® Black board with ARM Cortex-A8 32-Bit processor was used for testing ARMv7. +See [Ubuntu 18.04 on BeagleBone® Black](https://elinux.org/BeagleBoardUbuntu) for additional information about how to setup Ubuntu on this board. + The [ubuntu-packages.sh](ubuntu-packages.sh) script can be used to install all the packages required to compile and run the AES67 daemon, the daemon tests and the [demo](#demo). See [PulseAudio and scripts notes](#notes). ## How to build ## diff --git a/build.sh b/build.sh index 710dc03..01b95af 100755 --- a/build.sh +++ b/build.sh @@ -3,8 +3,9 @@ # Tested on Ubuntu 18.04 # -#export CC=/usr/bin/clang -#export CXX=/usr/bin/clang++ +#we need clang when compiling on ARMv7 +export CC=/usr/bin/clang +export CXX=/usr/bin/clang++ cd 3rdparty if [ ! -d ravenna-alsa-lkm.git ]; then @@ -16,7 +17,7 @@ if [ ! -d ravenna-alsa-lkm.git ]; then git apply ../../patches/ravenna-alsa-lkm-kernel-v5.patch git apply ../../patches/ravenna-alsa-lkm-enable-loopback.patch git apply ../../patches/ravenna-alsa-lkm-fixes.patch - #git apply ../../patches/ravenna-alsa-lkm-arm.patch + git apply ../../patches/ravenna-alsa-lkm-arm-32bit.patch echo "Building ravenna-alsa-lkm kernel module ..." make cd ../.. diff --git a/daemon/tests/daemon_test.cpp b/daemon/tests/daemon_test.cpp index c064086..3ec9060 100644 --- a/daemon/tests/daemon_test.cpp +++ b/daemon/tests/daemon_test.cpp @@ -31,7 +31,9 @@ #define BOOST_TEST_MODULE DaemonTest #include +#if ! (defined (__arm__) || defined (__arm64__)) #define _MEMORY_CHECK_ +#endif constexpr static const char g_daemon_address[] = "127.0.0.1"; constexpr static uint16_t g_daemon_port = 9999; diff --git a/run_demo.sh b/run_demo.sh index b90e350..71ef30c 100755 --- a/run_demo.sh +++ b/run_demo.sh @@ -42,13 +42,15 @@ trap cleanup EXIT #configure system parms sudo sysctl -w net/ipv4/igmp_max_memberships=64 -#stop pulseaudio, this seems to open/close ALSA continuosly -echo autospawn = no > $HOME/.config/pulse/client.conf -pulseaudio --kill >/dev/null 2>&1 -rm $HOME/.config/pulse/client.conf -#disable pulseaudio -systemctl --user stop pulseaudio.socket > /dev/null 2>&1 -systemctl --user stop pulseaudio.sservice > /dev/null 2>&1 +if [ -x /usr/bin/pulseaudio ]; then + #stop pulseaudio, this seems to open/close ALSA continuosly + echo autospawn = no > $HOME/.config/pulse/client.conf + pulseaudio --kill >/dev/null 2>&1 + rm $HOME/.config/pulse/client.conf + #disable pulseaudio + systemctl --user stop pulseaudio.socket > /dev/null 2>&1 + systemctl --user stop pulseaudio.sservice > /dev/null 2>&1 +fi #install kernel module sudo insmod 3rdparty/ravenna-alsa-lkm/driver/MergingRavennaALSA.ko @@ -74,7 +76,7 @@ sleep 30 #starting recording on sink echo "Starting to record 60 secs from sink ..." -arecord -D hw:1,0 -f cd -d 60 -r 44100 -c 2 -t wav ./demo/sink_test.wav > /dev/null 2>&1 & +arecord -D hw:1,0 -f cd -d 60 -r 44100 -c 2 -t wav /tmp/sink_test.wav > /dev/null 2>&1 & sleep 10 #starting playback on source @@ -85,7 +87,8 @@ while killall -0 arecord 2>/dev/null ; do sleep 1 done killall speaker-test -if [ -f ./demo/sink_test.wav ] ; then +if [ -f /tmp/sink_test.wav ] ; then + mv /tmp/sink_test.wav demo/ echo "Recording to file \"demo/sink_test.wav\" successfull" else echo "Recording failed"