diff --git a/meson.build b/meson.build index f22406c9..78c20976 100644 --- a/meson.build +++ b/meson.build @@ -73,8 +73,14 @@ minmea_inc = ['lib/minmea/include'] qdec_inc = ['lib/qdec/include'] # CODEC2, open source speech codec -codec2_proj = subproject('codec2') -codec2_dep = codec2_proj.get_variable('codec2_dep') +# Compile from sources only when targeting a platform different from x86/x64 +if meson.is_cross_build() + codec2_proj = subproject('codec2') + codec2_dep = codec2_proj.get_variable('codec2_dep') +else + codec2_dep = dependency('codec2') +endif + ## ## RTOS @@ -212,6 +218,7 @@ linux_src = src + ['platform/targets/linux/emulator/emulator.c', 'platform/mcu/x86_64/drivers/rtc.c', 'platform/drivers/baseband/radio_linux.cpp', 'platform/drivers/audio/audio_linux.c', + 'platform/drivers/audio/inputStream_linux.c', 'platform/targets/linux/platform.c'] @@ -226,9 +233,9 @@ linux_inc = inc + ['platform/targets/linux', if not meson.is_cross_build() sdl_dep = dependency('SDL2') threads_dep = dependency('threads') - linux_dep = [sdl_dep, threads_dep] + linux_dep = [sdl_dep, threads_dep, codec2_dep] else - linux_dep = [] + linux_dep = [ ] endif ## diff --git a/platform/drivers/audio/inputStream_linux.c b/platform/drivers/audio/inputStream_linux.c new file mode 100644 index 00000000..d34467c4 --- /dev/null +++ b/platform/drivers/audio/inputStream_linux.c @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 2021 by Federico Amedeo Izzo IU2NUO, * + * Niccolò Izzo IU2KIN * + * Frederik Saraci IU2NRO * + * Silvano Seva IU2KWO * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see * + ***************************************************************************/ + +#include +#include +#include + +streamId inputStream_start(const enum AudioSource source, + const enum AudioPriority prio, + stream_sample_t * const buf, + const size_t bufLength, + const enum BufMode mode, + const uint32_t sampleRate) +{ + (void) source; + (void) prio; + (void) buf; + (void) bufLength; + (void) mode; + (void) sampleRate; + + return -1; +} + +dataBlock_t inputStream_getData(streamId id) +{ + (void) id; + + dataBlock_t block; + block.data = NULL; + block.len = 0; + return block; +} + +void inputStream_stop(streamId id) +{ + (void) id; +}