From e56af33aa3f9b1b5758fc8104f13f2127d751d5e Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Wed, 7 Aug 2019 10:48:25 +0100 Subject: [PATCH 01/19] Document composite driver workaround --- .../src/core/endpoint0/xua_ep0_descriptors.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index b89c8c8c..0a84d4ee 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -414,7 +414,22 @@ USB_Descriptor_Device_t devDesc_Audio1 = #endif #if (AUDIO_CLASS == 2) -/* Device Descriptor for Audio Class 2.0 (Assumes High-Speed ) */ +/* Device Descriptor for Audio Class 2.0 (Assumes High-Speed ) + * + * The use of two configurations dates back to Windows XP (could be SP2). This + * lacked some standards support and incorrectly parsed the full audio class 2.0 + * descriptor with its IADs (Interface Association Descriptors). The observed + * behaviour included loading the built-in audio class 1.0 driver on some + * interfaces (possibly the wrong ones, too), and hanging. + * + * Presenting a blank configuration first prevented loading the composite driver + * and issues arising from it, while still allowing to load a vendor driver on + * the actual configuration. + * + * Recent Windows subsystem can parse our class 2.0 descriptor correctly + * (certainly Windows 7 and onwards). It may be possible to remove this + * workaround. + */ USB_Descriptor_Device_t devDesc_Audio2 = { .bLength = sizeof(USB_Descriptor_Device_t), From 9cb697f5de7fca487f5bbc0ee442cf32e46cdad1 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 13:03:45 +0100 Subject: [PATCH 02/19] Update Jenkins Pipeline to use new agents --- .gitignore | 1 + Brewfile | 7 +++++++ Jenkinsfile | 59 ++++++++++++++++++++++++++++++++++++++++++----------- Pipfile | 7 +++++++ cpanfile | 2 ++ 5 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 Brewfile create mode 100644 Pipfile create mode 100644 cpanfile diff --git a/.gitignore b/.gitignore index e7e76877..d38743a7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ .DS_Store test_results.csv _build* +**/.venv/** # waf build files .lock-waf_* diff --git a/Brewfile b/Brewfile new file mode 100644 index 00000000..2fd6d0b8 --- /dev/null +++ b/Brewfile @@ -0,0 +1,7 @@ +tap 'homebrew/core' + +brew 'perl' +brew 'cpanm' + +brew 'python@2' +brew 'pipenv' diff --git a/Jenkinsfile b/Jenkinsfile index f2e9dbad..53498dbe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,52 @@ -@Library('xmos_jenkins_shared_library@master') _ +@Library('xmos_jenkins_shared_library@develop') _ + +getApproval() + pipeline { agent { - label 'x86&&macOS&&Apps' + label 'x86_64&&brew&&macOS' } environment { - VIEW = 'xua' REPO = 'lib_xua' + VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" + } + triggers { + /* Trigger this Pipeline on changes to the repos dependencies + * + * If this Pipeline is running in a pull request, the triggers are set + * on the base branch the PR is set to merge in to. + * + * Otherwise the triggers are set on the branch of a matching name to the + * one this Pipeline is on. + */ + upstream( + upstreamProjects: + (env.JOB_NAME.contains('PR-') ? + "../lib_device_control/${env.CHANGE_TARGET}," + + "../lib_dsp/${env.CHANGE_TARGET}," + + "../lib_i2c/${env.CHANGE_TARGET}," + + "../lib_logging/${env.CHANGE_TARGET}," + + "../lib_mic_array/${env.CHANGE_TARGET}," + + "../lib_spdif/${env.CHANGE_TARGET}," + + "../lib_xassert/${env.CHANGE_TARGET}," + + "../lib_xud/${env.CHANGE_TARGET}," + + "../tools_released/${env.CHANGE_TARGET}," + + "../tools_xmostest/${env.CHANGE_TARGET}," + + "../xdoc_released/${env.CHANGE_TARGET}" + : + "../lib_device_control/${env.BRANCH_NAME}," + + "../lib_dsp/${env.BRANCH_NAME}," + + "../lib_i2c/${env.BRANCH_NAME}," + + "../lib_logging/${env.BRANCH_NAME}," + + "../lib_mic_array/${env.BRANCH_NAME}," + + "../lib_spdif/${env.BRANCH_NAME}," + + "../lib_xassert/${env.BRANCH_NAME}," + + "../lib_xud/${env.BRANCH_NAME}," + + "../tools_released/${env.BRANCH_NAME}," + + "../tools_xmostest/${env.BRANCH_NAME}," + + "../xdoc_released/${env.BRANCH_NAME}"), + threshold: hudson.model.Result.SUCCESS + ) } options { skipDefaultCheckout() @@ -13,7 +54,7 @@ pipeline { stages { stage('Get view') { steps { - prepareAppsSandbox("${VIEW}", "${REPO}") + xcorePrepareSandbox("${VIEW}", "${REPO}") } } stage('Library checks') { @@ -28,14 +69,8 @@ pipeline { } stage('Host builds') { steps { - dir("${REPO}") { - dir("${REPO}") { - dir('host') { - dir('xmosdfu') { - sh 'make -f Makefile.OSX64' - } - } - } + dir("${REPO}/${REPO}/host/xmosdfu") { + sh 'make -f Makefile.OSX64' } } } diff --git a/Pipfile b/Pipfile new file mode 100644 index 00000000..6d52bfd2 --- /dev/null +++ b/Pipfile @@ -0,0 +1,7 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] +flake8 = "*" diff --git a/cpanfile b/cpanfile new file mode 100644 index 00000000..071f5e6a --- /dev/null +++ b/cpanfile @@ -0,0 +1,2 @@ +requires 'File::Copy::Recursive'; +requires 'LWP::Simple' From 344d87342ca0f3c6b85d4ffe1138e60fa8f89398 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 13:17:06 +0100 Subject: [PATCH 03/19] Build host apps on both Linux and macOS --- Jenkinsfile | 111 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 78 insertions(+), 33 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 53498dbe..5e404793 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,9 +3,7 @@ getApproval() pipeline { - agent { - label 'x86_64&&brew&&macOS' - } + agent none environment { REPO = 'lib_xua' VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" @@ -52,45 +50,92 @@ pipeline { skipDefaultCheckout() } stages { - stage('Get view') { - steps { - xcorePrepareSandbox("${VIEW}", "${REPO}") + stage('Basic tests') { + agent { + label 'x86_64&&brew' } - } - stage('Library checks') { - steps { - xcoreLibraryChecks("${REPO}") + stages { + stage('Get view') { + steps { + xcorePrepareSandbox("${VIEW}", "${REPO}") + } + } + stage('Library checks') { + steps { + xcoreLibraryChecks("${REPO}") + } + } + stage('Tests') { + steps { + runXmostest("${REPO}", 'tests') + } + } + stage('xCORE builds') { + steps { + dir("${REPO}") { + xcoreAllAppNotesBuild('examples') + dir("${REPO}") { + runXdoc('doc') + } + } + } + } } - } - stage('Tests') { - steps { - runXmostest("${REPO}", 'tests') - } - } - stage('Host builds') { - steps { - dir("${REPO}/${REPO}/host/xmosdfu") { - sh 'make -f Makefile.OSX64' + post { + cleanup { + xcoreCleanSandbox() } } } - stage('xCORE builds') { - steps { - dir("${REPO}") { - xcoreAllAppNotesBuild('examples') - dir("${REPO}") { - runXdoc('doc') + stage('Build host apps') { + failFast true + parallel { + stage('Build Linux host app') { + agent { + label 'x86_64&&brew&&linux' + } + steps { + xcorePrepareSandbox("${VIEW}", "${REPO}") + dir("${REPO}/${REPO}/host/xmosdfu") { + sh 'make -f Makefile.Linux64' + } + } + post { + cleanup { + xcoreCleanSandbox() + } + } + } + stage('Build Mac host app') { + agent { + label 'x86_64&&brew&&macOS' + } + steps { + xcorePrepareSandbox("${VIEW}", "${REPO}") + dir("${REPO}/${REPO}/host/xmosdfu") { + sh 'make -f Makefile.OSX64' + } + } + post { + cleanup { + xcoreCleanSandbox() + } } } } } - } - post { - success { - updateViewfiles() - } - cleanup { - cleanWs() + stage('Update') { + agent { + label 'x86_64&&brew' + } + steps { + updateViewfiles() + } + post { + cleanup { + cleanWs() + } + } } } } From 636803d5d4cbc9fd00ea1704c2aa2c5c23ca1480 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 18:49:45 +0100 Subject: [PATCH 04/19] Update dependency info in release notes --- CHANGELOG.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a5b83a91..b021b965 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,13 +15,13 @@ lib_xua Change Log * RESOLVED: wChannelConfig in UAC1 descriptor set according to output channel count * RESOLVED: Indexing of ADAT channel strings (#18059) - * RESOLVED: Rebooting device fails when PLL config "not reset" bit is set + * RESOLVED: Rebooting device fails when PLL config "not reset" bit is set * Changes to dependencies: - - lib_spdif: Added dependency 3.0.0 + - lib_spdif: Added dependency 3.1.0 - - lib_xassert: Added dependency 3.0.1 + - lib_xassert: Added dependency 4.0.0 0.1.2 ----- From 40f4c2f8abbda711ee79e6b20136e6046cedd400 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 18:50:25 +0100 Subject: [PATCH 05/19] Update copyright date --- lib_xua/src/core/endpoint0/xua_ep0_descriptors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index 0a84d4ee..4c85c56c 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved /** * @file xua_ep0_descriptors.h * @brief Device Descriptors From 204c695434c56b886a3f637db0c776fa8d151f50 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 19:02:53 +0100 Subject: [PATCH 06/19] Correct dependency info in release notes --- CHANGELOG.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b021b965..232e19a7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -21,7 +21,7 @@ lib_xua Change Log - lib_spdif: Added dependency 3.1.0 - - lib_xassert: Added dependency 4.0.0 + - lib_xassert: Added dependency 3.0.1 0.1.2 ----- @@ -95,7 +95,7 @@ Legacy release history 7.3.0 ----- - - CHANGE: Example OSX DFU host app updated to now take PID as runtime + - CHANGE: Example OSX DFU host app updated to now take PID as runtime argument. This enabled multiple XMOS devices to be attached to the host during DFU process From a120d7a83e59d1eab4f4b40adfe41519ea4cd9a9 Mon Sep 17 00:00:00 2001 From: Oscar Bailey Date: Fri, 23 Aug 2019 09:30:05 +0100 Subject: [PATCH 07/19] Added audio stream start/stop callbacks for input/output --- CHANGELOG.rst | 1 + lib_xua/src/core/endpoint0/xua_endpoint0.c | 51 +++++++++++++++---- .../src/core/user/audiostream/audiostream.c | 29 ++++++++++- .../src/core/user/audiostream/audiostream.h | 12 +++++ 4 files changed, 81 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 232e19a7..35975793 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,7 @@ lib_xua Change Log * ADDED: Initial library documentation * ADDED: Application note AN00247: Using lib_xua with lib_spdif (transmit) + * ADDED: Callbacks for input/output audio stream start/stop * CHANGE: I2S hardware resources no longer used globally and must be passed to XUA_AudioHub() * CHANGE: XUA_AudioHub() no longer pars S/PDIF transmitter task diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index b3ef87a0..5ebdfbd0 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -409,23 +409,48 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl, } #if (NUM_USB_CHAN_OUT > 0) && (NUM_USB_CHAN_IN > 0) - if ((sp.wIndex == INTERFACE_NUMBER_AUDIO_OUTPUT) || (sp.wIndex == INTERFACE_NUMBER_AUDIO_INPUT)) + unsigned num_input_interfaces = g_interfaceAlt[INTERFACE_NUMBER_AUDIO_INPUT]; + unsigned num_output_interfaces = g_interfaceAlt[INTERFACE_NUMBER_AUDIO_OUTPUT]; + if (sp.wIndex == INTERFACE_NUMBER_AUDIO_INPUT) { - /* Check for stream start stop on output and input audio interfaces */ - if(sp.wValue && !g_interfaceAlt[INTERFACE_NUMBER_AUDIO_OUTPUT] && !g_interfaceAlt[INTERFACE_NUMBER_AUDIO_INPUT]) + // in: 0 -> 1 + if (sp.wValue && !num_input_interfaces) { - /* If start and input AND output not currently running */ - UserAudioStreamStart(); + UserAudioInputStreamStart(); + if (!num_output_interfaces) + { + UserAudioStreamStart(); + } } - else if(((sp.wIndex == 1) && (!sp.wValue)) && g_interfaceAlt[INTERFACE_NUMBER_AUDIO_OUTPUT] && (!g_interfaceAlt[INTERFACE_NUMBER_AUDIO_INPUT])) + // in: 1 -> 0 + else if (!sp.wValue && num_input_interfaces) { - /* if output stop and output running and input not running */ - UserAudioStreamStop(); + UserAudioInputStreamStop(); + if (!num_output_interfaces) + { + UserAudioStreamStop(); + } } - else if(((sp.wIndex == 2) && (!sp.wValue)) && g_interfaceAlt[INTERFACE_NUMBER_AUDIO_INPUT] && (!g_interfaceAlt[INTERFACE_NUMBER_AUDIO_OUTPUT])) + } + else if (sp.wIndex == INTERFACE_NUMBER_AUDIO_OUTPUT) + { + // out: 0 -> 1 + if (sp.wValue && !num_output_interfaces) { - /* if input stop and input running and output not running */ - UserAudioStreamStop(); + UserAudioOutputStreamStart(); + if (!num_input_interfaces) + { + UserAudioStreamStart(); + } + } + // out: 1 -> 0 + else if (!sp.wValue && num_output_interfaces) + { + UserAudioOutputStreamStop(); + if (!num_input_interfaces) + { + UserAudioStreamStop(); + } } } #elif (NUM_USB_CHAN_OUT > 0) @@ -435,11 +460,13 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl, { /* if start and not currently running */ UserAudioStreamStart(); + UserAudioOutputStreamStart(); } else if (!sp.wValue && g_interfaceAlt[INTERFACE_NUMBER_AUDIO_OUTPUT]) { /* if stop and currently running */ UserAudioStreamStop(); + UserAudioOutputStreamStop(); } } #elif (NUM_USB_CHAN_IN > 0) @@ -449,11 +476,13 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl, { /* if start and not currently running */ UserAudioStreamStart(); + UserAudioInputStreamStart(); } else if (!sp.wValue && g_interfaceAlt[INTERFACE_NUMBER_AUDIO_INPUT]) { /* if stop and currently running */ UserAudioStreamStop(); + UserAudioInputStreamStop(); } } #endif diff --git a/lib_xua/src/core/user/audiostream/audiostream.c b/lib_xua/src/core/user/audiostream/audiostream.c index d07491df..de729e39 100644 --- a/lib_xua/src/core/user/audiostream/audiostream.c +++ b/lib_xua/src/core/user/audiostream/audiostream.c @@ -1,6 +1,9 @@ // Copyright (c) 2013-2018, XMOS Ltd, All rights reserved -/* Deafult implementations of AudioStreamStop() and AudioStreamStart(). Both can be over-ridden */ +/* Default implementations of AudioStreamStop() and AudioStreamStart() + * callbacks. + */ + void UserAudioStreamStop() __attribute__ ((weak)); void UserAudioStreamStop() { @@ -12,3 +15,27 @@ void UserAudioStreamStart() { return; } + +void UserAudioInputStreamStop() __attribute__ ((weak)); +void UserAudioInputStreamStop() +{ + return; +} + +void UserAudioInputStreamStart() __attribute__ ((weak)); +void UserAudioInputStreamStart() +{ + return; +} + +void UserAudioOutputStreamStop() __attribute__ ((weak)); +void UserAudioOutputStreamStop() +{ + return; +} + +void UserAudioOutputStreamStart() __attribute__ ((weak)); +void UserAudioOutputStreamStart() +{ + return; +} diff --git a/lib_xua/src/core/user/audiostream/audiostream.h b/lib_xua/src/core/user/audiostream/audiostream.h index 60942914..f1c5060f 100644 --- a/lib_xua/src/core/user/audiostream/audiostream.h +++ b/lib_xua/src/core/user/audiostream/audiostream.h @@ -14,5 +14,17 @@ void UserAudioStreamStart(void); /* Any actions required on stream stop e.g. DAC mute - run every steam stop */ void UserAudioStreamStop(void); +/* Any actions required on input stream start */ +void UserAudioInputStreamStart(void); + +/* Any actions required on input stream stop */ +void UserAudioInputStreamStop(void); + +/* Any actions required on output stream start */ +void UserAudioOutputStreamStart(void); + +/* Any actions required on output stream stop */ +void UserAudioOutputStreamStop(void); + #endif From 3fc2729db853ae4ba8e24c11d25740b09f1130bd Mon Sep 17 00:00:00 2001 From: Oscar Bailey Date: Fri, 23 Aug 2019 09:52:53 +0100 Subject: [PATCH 08/19] Update Copyright --- lib_xua/src/core/endpoint0/xua_endpoint0.c | 2 +- lib_xua/src/core/user/audiostream/audiostream.c | 2 +- lib_xua/src/core/user/audiostream/audiostream.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index 5ebdfbd0..a66088f0 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved /** * @brief Implements endpoint zero for an USB Audio 1.0/2.0 device * @author Ross Owen, XMOS Semiconductor diff --git a/lib_xua/src/core/user/audiostream/audiostream.c b/lib_xua/src/core/user/audiostream/audiostream.c index de729e39..863bb1a0 100644 --- a/lib_xua/src/core/user/audiostream/audiostream.c +++ b/lib_xua/src/core/user/audiostream/audiostream.c @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2013-2019, XMOS Ltd, All rights reserved /* Default implementations of AudioStreamStop() and AudioStreamStart() * callbacks. diff --git a/lib_xua/src/core/user/audiostream/audiostream.h b/lib_xua/src/core/user/audiostream/audiostream.h index f1c5060f..bb218fd5 100644 --- a/lib_xua/src/core/user/audiostream/audiostream.h +++ b/lib_xua/src/core/user/audiostream/audiostream.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved #ifndef _AUDIOSTREAM_H_ #define _AUDIOSTREAM_H_ From 5b05e4e32e06107b228dd380f169110c9cf3f47e Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Tue, 27 Aug 2019 11:06:44 +0100 Subject: [PATCH 09/19] Update CHANGELOG.rst --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 35975793..1f871966 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,7 +6,7 @@ lib_xua Change Log * ADDED: Initial library documentation * ADDED: Application note AN00247: Using lib_xua with lib_spdif (transmit) - * ADDED: Callbacks for input/output audio stream start/stop + * ADDED: Separate callbacks for input/output audio stream start/stop * CHANGE: I2S hardware resources no longer used globally and must be passed to XUA_AudioHub() * CHANGE: XUA_AudioHub() no longer pars S/PDIF transmitter task From 9d84debefdf6c0a2d972b32e642e155704bc0df7 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 13 Aug 2019 12:44:22 +0100 Subject: [PATCH 10/19] Update to support "xwaf.xcommon" builds --- lib_xua/module_build_info | 87 ++++++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 29 deletions(-) diff --git a/lib_xua/module_build_info b/lib_xua/module_build_info index 2a36dedf..c3221cf1 100644 --- a/lib_xua/module_build_info +++ b/lib_xua/module_build_info @@ -1,37 +1,66 @@ -# You can set flags specifically for your module by using the MODULE_XCC_FLAGS -# variable. So the following -# -# MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3 -# -# specifies that everything in the modules should have the application -# build flags with -O3 appended (so the files will build at -# optimization level -O3). -# -# You can also set MODULE_XCC_C_FLAGS, MODULE_XCC_XC_FLAGS etc.. +VERSION = 0.2.0 -MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3 -DREF_CLK_FREQ=100 -fasm-linenum -fcomment-asm +DEPENDENT_MODULES = lib_logging(>=2.1.0) \ + lib_xassert(>=2.0.0) \ + lib_xud(>=0.1.0) \ + lib_spdif(>=3.0.0) \ + lib_mic_array(>=3.2.0) + +MODULE_XCC_FLAGS = $(XCC_FLAGS) \ + -O3 \ + -DREF_CLK_FREQ=100 \ + -fasm-linenum \ + -fcomment-asm + +# Core +XCC_FLAGS_xua_endpoint0.c = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue +XCC_FLAGS_xua_ep0_uacreqs.xc = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue +XCC_FLAGS_dbcalc.xc = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue +XCC_FLAGS_audioports.c = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue +XCC_FLAGS_audioports.xc = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue + +# DFU +XCC_FLAGS_dfu.xc = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue +XCC_FLAGS_flash_interface.c = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue +XCC_FLAGS_flashlib_user.c = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue OPTIONAL_HEADERS += xua_conf.h -VERSION = 0.2.0 +EXPORT_INCLUDE_DIRS = api \ + src/core \ + src/core/audiohub \ + src/core/buffer/ep \ + src/core/endpoint0 \ + src/dfu -DEPENDENT_MODULES = lib_logging(>=2.1.0) lib_xassert(>=2.0.0) lib_xud(>=0.1.0) lib_spdif(>=3.0.0) +INCLUDE_DIRS = $(EXPORT_INCLUDE_DIRS) \ + src/core/buffer/decouple \ + src/core/clocking \ + src/core/mixer \ + src/core/pdm_mics \ + src/core/ports \ + src/core/support \ + src/core/support/powersave \ + src/core/user \ + src/core/user/audiostream \ + src/core/user/hostactive \ + src/midi -INCLUDE_DIRS = api src/* +SOURCE_DIRS = src/core \ + src/core/audiohub \ + src/core/buffer/decouple \ + src/core/buffer/ep \ + src/core/clocking \ + src/core/endpoint0 \ + src/core/mixer \ + src/core/pdm_mics \ + src/core/ports \ + src/core/support \ + src/core/support/powersave \ + src/core/user/audiostream \ + src/core/user/hostactive \ + src/core/xuduser \ + src/dfu \ + src/midi -#ignore host dir -SOURCE_DIRS = src/* - -# The following file specific flags are not automatically kept in sync with the wscript file -# Core EXCLUDE_FILES += descriptors_2.rst -XCC_FLAGS_xua_endpoint0.c = -Os -mno-dual-issue $(XCC_FLAGS) -XCC_FLAGS_xua_ep0_uacreqs.xc = -Os -mno-dual-issue $(XCC_FLAGS) -XCC_FLAGS_dbcalc.xc = -Os -mno-dual-issue $(XCC_FLAGS) -XCC_FLAGS_audioports.c = -Os -mno-dual-issue $(XCC_FLAGS) -XCC_FLAGS_audioports.xc = -Os -mno-dual-issue $(XCC_FLAGS) - -# DFU -XCC_FLAGS_dfu.xc = -Os -mno-dual-issue $(XCC_FLAGS) -XCC_FLAGS_flash_interface.c = -Os -mno-dual-issue $(XCC_FLAGS) -XCC_FLAGS_flashlib_user.c = -Os -mno-dual-issue $(XCC_FLAGS) From f1ba1dace8595dfbb7e20e0fb788336373fd37e6 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 13 Aug 2019 12:46:33 +0100 Subject: [PATCH 11/19] Bump version --- CHANGELOG.rst | 5 ++ lib_xua/module_build_info | 2 +- lib_xua/wscript | 109 -------------------------------------- 3 files changed, 6 insertions(+), 110 deletions(-) delete mode 100644 lib_xua/wscript diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1f871966..75003253 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ lib_xua Change Log ================== +0.3.0 +----- + + * CHANGED: Build files updated to support new "xcommon" behaviour in xwaf. + 0.2.0 ----- diff --git a/lib_xua/module_build_info b/lib_xua/module_build_info index c3221cf1..2935f960 100644 --- a/lib_xua/module_build_info +++ b/lib_xua/module_build_info @@ -1,4 +1,4 @@ -VERSION = 0.2.0 +VERSION = 0.3.0 DEPENDENT_MODULES = lib_logging(>=2.1.0) \ lib_xassert(>=2.0.0) \ diff --git a/lib_xua/wscript b/lib_xua/wscript deleted file mode 100644 index 76f039b3..00000000 --- a/lib_xua/wscript +++ /dev/null @@ -1,109 +0,0 @@ -import os.path - - -def create_list_from_make_flag(bld, list_of_flags): - for i, flag in enumerate(list_of_flags): - if flag.startswith('$('): - for f in bld.env[flag.strip('$()')]: - list_of_flags.insert(i, f) - i += 1 - list_of_flags.remove(flag) - return list_of_flags - - -def create_list_of_strings(whitespace_seperated_list): - list_of_strings = whitespace_seperated_list.split(' ') - for item in list_of_strings: - item = "'{}'".format(item) - return list_of_strings - - -def read_module_build_info(bld): - with open(os.path.join(bld.path.abspath(), 'module_build_info')) as file: - module_build_info = {} - for line in file.readlines(): - line = line.strip() - if line and not line.startswith('#'): - key, value = line.split('=', 1) - module_build_info[key.strip(' +')] = value.strip() - - try: - module_build_info['OPTIONAL_HEADERS'] = ( - create_list_of_strings(module_build_info['OPTIONAL_HEADERS'])) - except KeyError: - pass - - try: - module_build_info['DEPENDENT_MODULES'] = ( - create_list_of_strings(module_build_info['DEPENDENT_MODULES'])) - except KeyError: - pass - - try: - module_build_info['MODULE_XCC_FLAGS'] = ( - create_list_from_make_flag(bld, - create_list_of_strings(module_build_info['MODULE_XCC_FLAGS']))) - except KeyError: - pass - - try: - module_build_info['MODULE_XCC_XC_FLAGS'] = ( - create_list_from_make_flag(bld, - create_list_of_strings(module_build_info['MODULE_XCC_XC_FLAGS']))) - except KeyError: - pass - - try: - module_build_info['MODULE_XCC_C_FLAGS'] = ( - create_list_from_make_flag(bld, - create_list_of_strings(module_build_info['MODULE_XCC_C_FLAGS']))) - except KeyError: - pass - - try: - module_build_info['MODULE_XCC_CPP_FLAGS'] = ( - create_list_from_make_flag(bld, - create_list_of_strings(module_build_info['MODULE_XCC_CPP_FLAGS']))) - except KeyError: - pass - - try: - module_build_info['MODULE_XCC_ASM_FLAGS'] = ( - create_list_from_make_flag(bld, - create_list_of_strings(module_build_info['MODULE_XCC_ASM_FLAGS']))) - except KeyError: - pass - - try: - module_build_info['INCLUDE_DIRS'] = ( - create_list_of_strings(module_build_info['INCLUDE_DIRS'])) - except KeyError: - pass - - return module_build_info - - -def use_module(bld): - module_build_info = read_module_build_info(bld) - source = bld.path.ant_glob(['src/**/*.xc', 'src/**/*.c', 'src/**/*.S'], - excl=['**/descriptors_2.rst']) - bld.env.MODULE_XCC_FLAGS = module_build_info['MODULE_XCC_FLAGS'] - - # The following file specific flags are not automatically kept in sync with the module_build_info file - # Core - bld.env['XCC_FLAGS_endpoint0.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_xua_ep0_uacreqs.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_dbcalc.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_audioports.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_audioports.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - # DFU - bld.env['XCC_FLAGS_dfu.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_flash_interface.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_flashlib_user.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - - bld.module( - source=source, - depends_on=module_build_info['DEPENDENT_MODULES'], - includes=module_build_info['INCLUDE_DIRS'], - optional_headers=module_build_info['OPTIONAL_HEADERS'], - version=module_build_info['VERSION']) \ No newline at end of file From 8d3cc039f7896e90bd7c0f60a3b2f176c80bc7c6 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 13 Aug 2019 15:04:41 +0100 Subject: [PATCH 12/19] Update dependency requirements --- CHANGELOG.rst | 6 ++++++ lib_xua/module_build_info | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 75003253..5e0532e6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,12 @@ lib_xua Change Log * CHANGED: Build files updated to support new "xcommon" behaviour in xwaf. + * Changes to dependencies: + + - lib_dsp: Added dependency 5.0.0 + + - lib_mic_array: Added dependency 4.0.0 + 0.2.0 ----- diff --git a/lib_xua/module_build_info b/lib_xua/module_build_info index 2935f960..2a96c9f5 100644 --- a/lib_xua/module_build_info +++ b/lib_xua/module_build_info @@ -1,10 +1,10 @@ VERSION = 0.3.0 -DEPENDENT_MODULES = lib_logging(>=2.1.0) \ - lib_xassert(>=2.0.0) \ - lib_xud(>=0.1.0) \ - lib_spdif(>=3.0.0) \ - lib_mic_array(>=3.2.0) +DEPENDENT_MODULES = lib_logging(>=3.0.0) \ + lib_xassert(>=4.0.0) \ + lib_xud(>=0.2.0) \ + lib_spdif(>=4.0.0) \ + lib_mic_array(>=4.0.0) MODULE_XCC_FLAGS = $(XCC_FLAGS) \ -O3 \ From a7a577acad6411f60ffef4331bbfe437b056753e Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Wed, 21 Aug 2019 18:37:07 +0100 Subject: [PATCH 13/19] Update cleanup call --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5e404793..044d9bfe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -133,7 +133,7 @@ pipeline { } post { cleanup { - cleanWs() + xcoreCleanSandbox() } } } From 244232d3e1c65b8ac01117883b3a3b77681af9f1 Mon Sep 17 00:00:00 2001 From: Oscar Bailey Date: Thu, 29 Aug 2019 10:01:03 +0100 Subject: [PATCH 14/19] Change view to lib_xua_xwaf_xcommon --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 044d9bfe..85251dcd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,8 @@ pipeline { agent none environment { REPO = 'lib_xua' - VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" + VIEW = 'lib_xua_xwaf_xcommon' + //VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" } triggers { /* Trigger this Pipeline on changes to the repos dependencies From eafcc89a6b9943c15a1bb57ad84a9dfcda5bf192 Mon Sep 17 00:00:00 2001 From: Oscar Bailey Date: Thu, 5 Sep 2019 15:52:51 +0100 Subject: [PATCH 15/19] Change XUA to use new mic array API --- lib_xua/src/core/pdm_mics/pdm_mic.xc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib_xua/src/core/pdm_mics/pdm_mic.xc b/lib_xua/src/core/pdm_mics/pdm_mic.xc index 2221d1f7..2bb37bff 100644 --- a/lib_xua/src/core/pdm_mics/pdm_mic.xc +++ b/lib_xua/src/core/pdm_mics/pdm_mic.xc @@ -88,7 +88,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio) fir_coefs[6] = g_third_stage_div_12_fir; //dcc = {MIC_ARRAY_MAX_FRAME_SIZE_LOG2, 1, 0, 0, decimationfactor, fir_coefs[decimationfactor/2], 0, 0, DECIMATOR_NO_FRAME_OVERLAP, 2}; - dcc.frame_size_log2 = MIC_ARRAY_MAX_FRAME_SIZE_LOG2; + dcc.len = MIC_ARRAY_MAX_FRAME_SIZE_LOG2; dcc.apply_dc_offset_removal = 1; dcc.index_bit_reversal = 0; dcc.windowing_function = null; @@ -107,6 +107,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio) dc[0].mic_gain_compensation[2]=0; dc[0].mic_gain_compensation[3]=0; dc[0].channel_count = 4; + dc[0].async_interface_enabled = 0; dc[1].dcc = &dcc; dc[1].data = mic_decimator_fir_data[4]; dc[1].mic_gain_compensation[0]=0; @@ -114,6 +115,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio) dc[1].mic_gain_compensation[2]=0; dc[1].mic_gain_compensation[3]=0; dc[1].channel_count = 4; + dc[0].async_interface_enabled = 0; mic_array_decimator_configure(c_ds_output, decimatorCount, dc); From a682ed7d19438478920f2621f53d4e17a84477be Mon Sep 17 00:00:00 2001 From: Oscar Bailey Date: Thu, 5 Sep 2019 16:03:31 +0100 Subject: [PATCH 16/19] Update copyright --- lib_xua/src/core/pdm_mics/pdm_mic.xc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/pdm_mics/pdm_mic.xc b/lib_xua/src/core/pdm_mics/pdm_mic.xc index 2bb37bff..b853f2d0 100644 --- a/lib_xua/src/core/pdm_mics/pdm_mic.xc +++ b/lib_xua/src/core/pdm_mics/pdm_mic.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2015-2019, XMOS Ltd, All rights reserved #include "xua.h" From 508c62af000d766fc66268ccb78b130d75ea1460 Mon Sep 17 00:00:00 2001 From: Oscar Bailey Date: Thu, 5 Sep 2019 16:34:59 +0100 Subject: [PATCH 17/19] Keep version on 0.2.0 --- CHANGELOG.rst | 16 +++++----------- lib_xua/module_build_info | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5e0532e6..a113f942 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,17 +1,6 @@ lib_xua Change Log ================== -0.3.0 ------ - - * CHANGED: Build files updated to support new "xcommon" behaviour in xwaf. - - * Changes to dependencies: - - - lib_dsp: Added dependency 5.0.0 - - - lib_mic_array: Added dependency 4.0.0 - 0.2.0 ----- @@ -24,6 +13,7 @@ lib_xua Change Log * CHANGE: Moved to lib_spdif (from module_spdif_tx & module_spdif_rx) * CHANGE: Define NUM_PDM_MICS renamed to XUA_NUM_PDM_MICS * CHANGE: Define NO_USB renamed to XUA_USB_EN + * CHANGE: Build files updated to support new "xcommon" behaviour in xwaf. * RESOLVED: wChannelConfig in UAC1 descriptor set according to output channel count * RESOLVED: Indexing of ADAT channel strings (#18059) @@ -35,6 +25,10 @@ lib_xua Change Log - lib_xassert: Added dependency 3.0.1 + - lib_dsp: Added dependency 5.0.0 + + - lib_mic_array: Added dependency 4.0.0 + 0.1.2 ----- diff --git a/lib_xua/module_build_info b/lib_xua/module_build_info index 2a96c9f5..ce383df3 100644 --- a/lib_xua/module_build_info +++ b/lib_xua/module_build_info @@ -1,4 +1,4 @@ -VERSION = 0.3.0 +VERSION = 0.2.0 DEPENDENT_MODULES = lib_logging(>=3.0.0) \ lib_xassert(>=4.0.0) \ From eb1ca1eb8d99ea06643766e4235ba5f9391c4d3b Mon Sep 17 00:00:00 2001 From: Oscar Bailey Date: Fri, 6 Sep 2019 09:13:09 +0100 Subject: [PATCH 18/19] Update CHANGELOG --- CHANGELOG.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a113f942..2a114f45 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -21,14 +21,14 @@ lib_xua Change Log * Changes to dependencies: - - lib_spdif: Added dependency 3.1.0 - - - lib_xassert: Added dependency 3.0.1 - - lib_dsp: Added dependency 5.0.0 - lib_mic_array: Added dependency 4.0.0 + - lib_spdif: Added dependency 3.1.0 + + - lib_xassert: Added dependency 3.0.1 + 0.1.2 ----- From a1aca010fb95d193506f846ac86c6ce808c37406 Mon Sep 17 00:00:00 2001 From: shuchitak <38428600+shuchitak@users.noreply.github.com> Date: Fri, 13 Sep 2019 10:20:23 +0100 Subject: [PATCH 19/19] Update Jenkinsfile --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 85251dcd..044d9bfe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,8 +6,7 @@ pipeline { agent none environment { REPO = 'lib_xua' - VIEW = 'lib_xua_xwaf_xcommon' - //VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" + VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" } triggers { /* Trigger this Pipeline on changes to the repos dependencies