Giter Site home page Giter Site logo

lpcnet's Introduction

LPCNet for FreeDV

Experimental version of LPCNet that has been used to develop FreeDV 2020 - a HF radio Digital Voice mode for over the air experimentation with Neural Net speech coding. Possibly the first use of Neural Net speech coding in real world operation.

Quickstart

$ cd ~
$ git clone https://github.com/drowe67/LPCNet.git
$ cd LPCNet && mkdir build_linux && cd build_linux
$ cmake ..
$ make

Unquantised LPCNet:

$ cd ~/LPCNet/build_linux/src
$ sox ../../wav/wia.wav -t raw -r 16000 - | ./dump_data --c2pitch --test - - | ./test_lpcnet - - | aplay -f S16_LE -r 16000

LPCNet at 1733 bits/s using direct-split quantiser:

sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s | aplay -f S16_LE -r 16000

Manually Selecting SIMD Technology

Cmake will select the fastest SIMD available (AVX/SSSE/None), however you can manually select e.g.:

make -DDISABLE_CPU_OPTIMIZATION=ON -DSSE=ON ..

CTests

$ cd ~/LPCNet/build_linux
$ ctest

Note, due to precision/library issues several tests (1-3) will only pass on some machines.

Building Debian packages

To build Debian packages, simply run the "cpack" command after running "make". This will generate the following packages:

  • lpcnet: Contains the .so and .a files for linking/executing applications dependent on LPCNet.
  • lpcnet-dev: Contains the header files for development using LPCNet.
  • lpcnet-tools: Contains tools for use with LPCNet.

Once generated, they can be installed with "dpkg -i".

Reading Further

  1. Original LPCNet Repo with more instructions and background
  2. LPCNet: DSP-Boosted Neural Speech Synthesis
  3. Sample model files

Credits

Thanks Jean-Marc Valin for making LPCNet available, and Richard for the CMake build system.

Cross Compiling for Windows

This code has been cross compiled to Windows using Fedora Linux 30, see the freedv-gui README.md, and build_windows.sh script.

Speech Material for Training

Suitable training material can be obtained from the McGill University Telecommunications & Signal Processing Laboratory. Download the ISO and extract the 16k-LP7 directory, the src/concat.sh script can be used to generate a headerless file of training samples.

cd 16k-LP7
sh /path/to/LPCNet/src/concat.sh

Quantiser Experiments

The quantiser files used for these experiments (pred_v2.tgz and split.tgz) are here

Exploring Features

Install GNU Octave (if thats your thing).

Extract a feature file, fire up Octave, and mesh plot the 18 cepstrals for the first 100 frame (1 second):

$ ./dump_data --test speech_orig_16k.s16 speech_orig_16k_features.f32
$ cd src
$ octave --no-gui
octave:3> f=load_f32("../speech_orig_16k_features.f32",55);
nrows: 1080
octave:4> mesh(f(1:100,1:18))

Uniform Quantisation

Listen to the effects of 4dB step uniform quantisation on cepstrals:

$ cat ~/Downloads/wia.wav | ./dump_data --test - - | ./quant_feat -u 4 | ./test_lpcnet - - | play -q -r 16000 -s -2 -t raw -

This lets us listen to the effect of quantisation error. Once we think it sounds OK, we can compute the variance (average squared quantiser error). A 4dB step size means the error PDF is uniform in the range of -2 to +2 dB. A uniform PDF has variance of (b-a)^2/12, so (2--2)^2/12 = 1.33 dB^2. We can then try to design a quantiser (e.g. multi-stage VQ) to achieve that variance.

Training a Predictive VQ

Clone and build codec2:

$ git clone https://github.com/drowe67/codec2.git
$ cd codec2 && mkdir build_linux && cd build_linux && cmake ../ && sudo make install

In train_pred2.sh, adjust PATH for the location of codec2-dev on your machine.

Generate 5E6 vectors using the -train option on dump_data to apply a bunch of different filters, then run the predictive VQ training script

$ cd LPCNet
$ ./dump_data --train all_speech.s16 all_speech_features_5e6.f32 /dev/null
$ ./train_pred2.sh

Mbest VQ search

Keeps M best candidates after each stage:

cat ~/Downloads/speech_orig_16k.s16 | ./dump_data --test - - | ./quant_feat --mbest 5 -q pred2_stage1.f32,pred2_stage2.f32,pred2_stage3.f32 > /dev/null

In this example, the VQ error variance was reduced from 2.68 to 2.28 dB^2 (I think equivalent to 3 bits), and the number of outliers >2dB reduced from 15% to 10%.

Streaming of WIA broadcast material

Interesting mix of speakers and recording conditions, some not so great microphones. Faster speech than the training material.

Basic unquantised LPCNet model:

sox -r 16000 ~/Downloads/wianews-2019-01-20.s16 -t raw - trim 200 | ./dump_data --c2pitch --test - - | ./test_lpcnet - - | aplay -f S16_LE -r 16000

Fully quantised at (44+8)/0.03 = 1733 bits/s:

sox -r 16000 ~/Downloads/wianews-2019-01-20.s16 -t raw - trim 200 | ./dump_data --c2pitch --test - - | ./quant_feat -g 0.25 -o 6 -d 3 -w --mbest 5 -q pred_v2_stage1.f32,pred_v2_stage2.f32,pred_v2_stage3.f32,pred_v2_stage4.f32 | ./test_lpcnet - - | aplay -f S16_LE -r 16000

Fully quantised encoder/decoder programs

Same thing as above with quantisation code packaged up into library functions. Between quant_enc and quant_dec are 52 bit frames every 30ms:

cat ~/Downloads/speech_orig_16k.s16 | ./dump_data --c2pitch --test - - | ./quant_enc | ./quant_dec | ./test_lpcnet - - | aplay -f S16_LE -r 16000

Same thing with everything integrated into stand alone encoder and decoder programs:

cat ~/Downloads/speech_orig_16k.s16 | ./lpcnet_enc | ./lpcnet_dec | aplay -f S16_LE -r 16000

The bit stream interface is 1 bit/char, as I find that convenient for my digital voice over radio experiments. The decimation rate, number of VQ stages, and a few other parameters can be set as command line options, for example 20ms frame rate, 3 stage VQ (2050 bits/s):

cat ~/Downloads/speech_orig_16k.s16 | ./lpcnet_enc -d 2 -n 3 | ./lpcnet_dec -d 2 -n 3 | aplay -f S16_LE -r 16000

You'll need the same set of parameters for the encoder as decoder.

Useful additions would be:

  1. Run time loading of .h5 NN models.
  2. A --packed option to pack the quantised bits tightly, which would make the programs useful for storage applications.

Direct Split VQ

Four stage VQ of log magnitudes (Ly), 11 bits (2048 entries) per stage, First 3 stages 18 elements wide; final stage 12 elements wide. During training this acheived similar variance to 4 stage predictive quantiser (measured on 12 bands). Same bit rate, but direct quantisation means more robust to bit errors and especially packet loss.

sox ~/Desktop/deep/quant/wia.wav -t raw - | ./dump_data --c2pitch --test - - | ./quant_feat -d 3 -i -p 0 --mbest 5 -q split_stage1.f32,split_stage2.f32,split_stage3.f32,split_stage4.f32 | ./test_lpcnet - - | aplay -f S16_LE -r 16000

Compare this to four stage predictive VQ of Cepstrals (DCT of Ly), 11 bits (2048 entries) per stage, 18 element wide vectors. We quantise the predictor output.

sox ~/Desktop/deep/quant/wia.wav -t raw -  | ./dump_data --c2pitch --test - - | ./quant_feat -d 3 -w --mbest 5 -q pred_v2_stage1.f32,pred_v2_stage2.f32,pred_v2_stage3.f32,pred_v2_stage4.f32 | ./test_lpcnet - - | aplay -f S16_LE -r 16000

Both are decimated by a factor of 3 (so 30ms update of parameters, 30*44=1733 bits/s).

Effect of Bit Errors

Random 1 Bit Error Rate (BER):

Predictive: sox wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc | ./lpcnet_dec -b 0.01 | aplay -f S16_LE -r 16000

Direct-split: sox wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s -b 0.01 | aplay -f S16_LE -r 16000

lpcnet's People

Contributors

darksidelemm avatar dave-g8kbb avatar drowe67 avatar hobbes1069 avatar jg1uaa avatar jmvalin avatar ra1nb0w avatar tmiw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lpcnet's Issues

0.3: test suite is failing in 3 units

cmake config:

-- Cache values
AVX:BOOL=ON
AVX2:BOOL=OFF
BUILD_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=/usr
CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9
DISABLE_CPU_OPTIMIZATION:BOOL=TRUE
FETCHCONTENT_BASE_DIR:PATH=/home/tkloczko/rpmbuild/BUILD/LPCNet-0.3/x86_64-redhat-linux-gnu/_deps
FETCHCONTENT_FULLY_DISCONNECTED:BOOL=OFF
FETCHCONTENT_QUIET:BOOL=ON
FETCHCONTENT_SOURCE_DIR_LPCNET:PATH=
FETCHCONTENT_UPDATES_DISCONNECTED:BOOL=OFF
FETCHCONTENT_UPDATES_DISCONNECTED_LPCNET:BOOL=OFF
NEON:BOOL=OFF
SSE:BOOL=OFF
codec2_DIR:PATH=/usr/lib64/cmake/codec2

and test suite is failing with:

+ cd LPCNet-0.3
+ /usr/bin/ctest --test-dir x86_64-redhat-linux-gnu --output-on-failure --force-new-ctest-process -j48
Internal ctest changing into directory: /home/tkloczko/rpmbuild/BUILD/LPCNet-0.3/x86_64-redhat-linux-gnu
Test project /home/tkloczko/rpmbuild/BUILD/LPCNet-0.3/x86_64-redhat-linux-gnu
    Start 1: core_synthesis_default
    Start 2: core_synthesis_load_20h
    Start 3: core_synthesis_mag
    Start 4: nnet2f32
    Start 5: SIMD_functions
1/5 Test #1: core_synthesis_default ...........***Failed    0.01 sec
+ '[' '!' -z ']'
+ '[' '!' -z 1 ']'
+ ../build_linux/src/dump_data --test --c2pitch ../wav/birch.wav birch.f32
./test_core_nn.sh: line 28: ../build_linux/src/dump_data: No such file or directory
+ diff birch_targ.f32 birch.f32
diff: birch.f32: No such file or directory
+ echo 'ERROR in synth .f32 output! Exiting...'
ERROR in synth .f32 output! Exiting...
+ exit 1

2/5 Test #2: core_synthesis_load_20h ..........***Failed    0.01 sec
+ '[' '!' -z ']'
+ '[' '!' -z ']'
+ '[' '!' -z 1 ']'
+ ../build_linux/src/dump_data --test --c2pitch ../wav/birch.wav birch.f32
./test_core_nn.sh: line 44: ../build_linux/src/dump_data: No such file or directory
+ diff birch_targ.f32 birch.f32
diff: birch.f32: No such file or directory
+ echo 'ERROR in synth .f32 output! Exiting...'
ERROR in synth .f32 output! Exiting...
+ exit 1

3/5 Test #5: SIMD_functions ...................   Passed    0.00 sec
4/5 Test #3: core_synthesis_mag ...............***Failed    0.01 sec
+ '[' '!' -z ']'
+ '[' '!' -z ']'
+ '[' '!' -z ']'
+ '[' '!' -z 1 ']'
+ ../build_linux/src/dump_data --mag --test --c2pitch ../wav/c01_01.wav c01_01.f32
./test_core_nn.sh: line 60: ../build_linux/src/dump_data: No such file or directory
+ diff c01_01_mag.f32 c01_01.f32
diff: c01_01.f32: No such file or directory
+ echo 'ERROR in synth .f32 output! Exiting...'
ERROR in synth .f32 output! Exiting...
+ exit 1

5/5 Test #4: nnet2f32 .........................   Passed    0.06 sec

40% tests passed, 3 tests failed out of 5

Total Test time (real) =   0.06 sec

The following tests FAILED:
          1 - core_synthesis_default (Failed)
          2 - core_synthesis_load_20h (Failed)
          3 - core_synthesis_mag (Failed)
Errors while running CTest

global structure causes crash when 2 using 2 channels

Hi David

Think I found another one (well, 2 actually).

First the main issue....
It's a bit like the one with codec2.
Quisk opens 2 channels. Buried in the code there is a data structure with a pointer. It's a static. Initialising it, it carefully checks to see if already initialised and if it is, skips doing it a second time, however when it is freed, there is no such check. This causes a pointer to memory to be freed that does not point to valid memory.
Details below.

The second one was a doozie. Occasional random crashes with avx in exp8_approx() in vec_avx.h with a segmentation error.
I finally found that if I inlined the function call, the problem vanished.
I changed this
static __m256 exp8_approx(__m256 X).........
to this
static inline __m256 exp8_approx(__m256 X).......
Then I went looking at the CPU. My processor is an AMD FX-6100. Checking the AMD website it does not support AVX or AVX2 but when the code tests to see if AVX is supported the result is yes. However I get the weird crashes but AVX instructions do in fact work! So it looks like AVX is supported by the FX-6100 but not without issues. For some reason inlining that function keeps it happy. Most weird. The function is only used 4 times so the code penalty is small and it increases 2020 mode support for these processors.

In regard of the bug....

In freq.c at line 51 this structure is defined:

typedef struct {
int init;
kiss_fft_state kfft;
float half_window[OVERLAP_SIZE];
float dct_table[NB_BANDS
NB_BANDS];
} CommonState;

This is used to create a static structure at line 125:

CommonState common;

It’s initilialised and freed thus:

static void check_init() {
int i;
if (common.init) return;
common.kfft = opus_fft_alloc_twiddles(WINDOW_SIZE, NULL, NULL, NULL, 0);
for (i=0;i<OVERLAP_SIZE;i++)
common.half_window[i] = sin(.5M_PIsin(.5M_PI(i+.5)/OVERLAP_SIZE) * sin(.5M_PI(i+.5)/OVERLAP_SIZE));
for (i=0;i<NB_BANDS;i++) {
int j;
for (j=0;j<NB_BANDS;j++) {
common.dct_table[iNB_BANDS + j] = cos((i+.5)jM_PI/NB_BANDS);
if (j==0) common.dct_table[i
NB_BANDS + j] *= sqrt(.5);
}
}
common.init = 1;
}

void freq_close() {
opus_fft_free(common.kfft,0);
}

If there are two open channels, then init is skipped on the second call because of common.init.
However closing the second channel calls free() a second time with the already freed pointer. This causes a crash (probably compiler dependent).

A simple solution is to change the close function to make use of the init structure member thus:

void freq_close() {
if( common.init ) {
opus_fft_free(common.kfft,0);
common.init = 0;
}
}

Regards
Dave

License?

Hi,

I am trying to package LPCNet into Fedora, but I am confused about the license. Is it BSD?
And what's the license of the model data (lpcnet_191005_v1.0.tgz)? What's the reason for the model data being hosted elsewhere?

In Fedora we are building packages offline in the sandbox, so we cannot download the model data during the build. If the license is compatible, I could predownload and bundle the model data, but I am curious what's the reason behind the split.

a lower bit rate?

How should I modify to achieve a lower bit rate? I think your lowest bit rate is 1733? I would appreciate it if you could share your solution

[Win32] Generating nnet_data.[ch]

I'm on Windows trying to build this library using a hacked up GNU-makefile (since Cmake fails).

In the process I need to generate src/nnet_data.c and src/nnet_data.h using the Python script src/dump_lpcnet.py.
I already managed to pip install keras, but the requirement tensorflow seems impossible:

Collecting tensorflow
  ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow

What? How are we supposed to generate these files?

Tests fail

ctest fails for me with:

Test project /build/source/build
    Start 1: core_synthesis_default
    Start 2: core_synthesis_load_20h
    Start 3: core_synthesis_mag
    Start 4: nnet2f32
1/5 Test #1: core_synthesis_default ...........***Failed    0.13 sec
Binary files birch_targ.f32 and birch.f32 differ
ERROR in synth .f32 output! Exiting...

    Start 5: SIMD_functions
2/5 Test #5: SIMD_functions ...................   Passed    0.00 sec
3/5 Test #3: core_synthesis_mag ...............***Failed    0.13 sec
logmag: 1
Binary files c01_01_mag.f32 and c01_01.f32 differ
ERROR in synth .f32 output! Exiting...

4/5 Test #4: nnet2f32 .........................   Passed    0.14 sec
5/5 Test #2: core_synthesis_load_20h ..........***Failed    0.16 sec
Binary files birch_targ.f32 and birch.f32 differ
ERROR in synth .f32 output! Exiting...


40% tests passed, 3 tests failed out of 5

Total Test time (real) =   0.18 sec

The following tests FAILED:
          1 - core_synthesis_default (Failed)
          2 - core_synthesis_load_20h (Failed)
          3 - core_synthesis_mag (Failed)
Errors while running CTest
make: *** [Makefile:130: test] Error 8

Any ideas how to debug this?

Intel flags are applied to PowerPC and break the build: cc1: error: unrecognized command line option "-mavx"

--->  Configuring lpcnetfreedv
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DDISABLE_CPU_OPTIMIZATION=ON -DCMAKE_OSX_ARCHITECTURES="ppc" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.6" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5 
-- The C compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc-4.2 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- LPCNet version: 0.5
-- Host system arch is: powerpc
-- avx processor flags found or enabled.
-- Compilation date = XX20230717XX
-- Configuring done (23.3s)
-- Generating done (0.4s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_OBJCXX_COMPILER
    CMAKE_OBJC_COMPILER
    CMAKE_POLICY_DEFAULT_CMP0025


-- Build files have been written to: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build
--->  Building lpcnetfreedv
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build" && /usr/bin/make -j6 -w all VERBOSE=ON 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
/opt/local/bin/cmake -S/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5 -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build --check-build-system CMakeFiles/Makefile.cmake 0
/opt/local/bin/cmake -E cmake_progress_start /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/CMakeFiles /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build//CMakeFiles/progress.marks
/usr/bin/make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
/usr/bin/make  -f src/CMakeFiles/lpcnetfreedv.dir/build.make src/CMakeFiles/lpcnetfreedv.dir/depend
/usr/bin/make  -f src/CMakeFiles/test_vec.dir/build.make src/CMakeFiles/test_vec.dir/depend
/usr/bin/make  -f src/CMakeFiles/weight.dir/build.make src/CMakeFiles/weight.dir/depend
/usr/bin/make  -f src/CMakeFiles/quant2c.dir/build.make src/CMakeFiles/quant2c.dir/depend
/usr/bin/make  -f src/CMakeFiles/diff32.dir/build.make src/CMakeFiles/diff32.dir/depend
/usr/bin/make  -f src/CMakeFiles/ramp.dir/build.make src/CMakeFiles/ramp.dir/depend
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src/CMakeFiles/lpcnetfreedv.dir/DependInfo.cmake --color=
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src/CMakeFiles/test_vec.dir/DependInfo.cmake --color=
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src/CMakeFiles/quant2c.dir/DependInfo.cmake --color=
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src/CMakeFiles/diff32.dir/DependInfo.cmake --color=
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src/CMakeFiles/weight.dir/DependInfo.cmake --color=
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src/CMakeFiles/ramp.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
/usr/bin/make  -f src/CMakeFiles/ramp.dir/build.make src/CMakeFiles/ramp.dir/build
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
/usr/bin/make  -f src/CMakeFiles/lpcnetfreedv.dir/build.make src/CMakeFiles/lpcnetfreedv.dir/build
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
/usr/bin/make  -f src/CMakeFiles/quant2c.dir/build.make src/CMakeFiles/quant2c.dir/build
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
/usr/bin/make  -f src/CMakeFiles/diff32.dir/build.make src/CMakeFiles/diff32.dir/build
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
/usr/bin/make  -f src/CMakeFiles/weight.dir/build.make src/CMakeFiles/weight.dir/build
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
/usr/bin/make  -f src/CMakeFiles/test_vec.dir/build.make src/CMakeFiles/test_vec.dir/build
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
[  1%] Building C object src/CMakeFiles/lpcnetfreedv.dir/freq.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /usr/bin/gcc-4.2 -DGIT_HASH=\"None\" -Dlpcnetfreedv_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/_deps/lpcnet-src -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -fPIC -mavx -MD -MT src/CMakeFiles/lpcnetfreedv.dir/freq.c.o -MF CMakeFiles/lpcnetfreedv.dir/freq.c.o.d -o CMakeFiles/lpcnetfreedv.dir/freq.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src/freq.c
[  3%] Building C object src/CMakeFiles/ramp.dir/ramp.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /usr/bin/gcc-4.2 -DGIT_HASH=\"None\" -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/_deps/lpcnet-src -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -MD -MT src/CMakeFiles/ramp.dir/ramp.c.o -MF CMakeFiles/ramp.dir/ramp.c.o.d -o CMakeFiles/ramp.dir/ramp.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src/ramp.c
cc1: error: unrecognized command line option "-mavx"
make[2]: *** [src/CMakeFiles/lpcnetfreedv.dir/freq.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make[1]: *** [src/CMakeFiles/lpcnetfreedv.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  4%] Building C object src/CMakeFiles/quant2c.dir/quant2c.c.o
[  6%] Building C object src/CMakeFiles/diff32.dir/diff32.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /usr/bin/gcc-4.2 -DGIT_HASH=\"None\" -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/_deps/lpcnet-src -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -MD -MT src/CMakeFiles/diff32.dir/diff32.c.o -MF CMakeFiles/diff32.dir/diff32.c.o.d -o CMakeFiles/diff32.dir/diff32.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src/diff32.c
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /usr/bin/gcc-4.2 -DGIT_HASH=\"None\" -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/_deps/lpcnet-src -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -MD -MT src/CMakeFiles/quant2c.dir/quant2c.c.o -MF CMakeFiles/quant2c.dir/quant2c.c.o.d -o CMakeFiles/quant2c.dir/quant2c.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src/quant2c.c
[  8%] Building C object src/CMakeFiles/weight.dir/weight.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /usr/bin/gcc-4.2 -DGIT_HASH=\"None\" -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/_deps/lpcnet-src -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -MD -MT src/CMakeFiles/weight.dir/weight.c.o -MF CMakeFiles/weight.dir/weight.c.o.d -o CMakeFiles/weight.dir/weight.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src/weight.c
[  9%] Building C object src/CMakeFiles/test_vec.dir/test_vec.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /usr/bin/gcc-4.2 -DGIT_HASH=\"None\" -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/_deps/lpcnet-src -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -mavx -MD -MT src/CMakeFiles/test_vec.dir/test_vec.c.o -MF CMakeFiles/test_vec.dir/test_vec.c.o.d -o CMakeFiles/test_vec.dir/test_vec.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src/test_vec.c
cc1: error: unrecognized command line option "-mavx"
make[2]: *** [src/CMakeFiles/test_vec.dir/test_vec.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make[1]: *** [src/CMakeFiles/test_vec.dir/all] Error 2
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src/quant2c.c: In function ‘main’:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/LPCNet-0.5/src/quant2c.c:59: warning: unused variable ‘rd’
[ 11%] Linking C executable weight
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/weight.dir/link.txt --verbose=ON
[ 12%] Linking C executable ramp
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/ramp.dir/link.txt --verbose=ON
[ 14%] Linking C executable quant2c
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/quant2c.dir/link.txt --verbose=ON
[ 16%] Linking C executable diff32
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/diff32.dir/link.txt --verbose=ON
/usr/bin/gcc-4.2 -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names CMakeFiles/weight.dir/weight.c.o -o weight  -Wl,-rpath,/opt/local/lib -lm 
/usr/bin/gcc-4.2 -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names CMakeFiles/ramp.dir/ramp.c.o -o ramp  -Wl,-rpath,/opt/local/lib -lm 
/usr/bin/gcc-4.2 -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names CMakeFiles/quant2c.dir/quant2c.c.o -o quant2c  -Wl,-rpath,/opt/local/lib -lm 
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
/usr/bin/gcc-4.2 -Wall -W -Wextra -Wno-unused-function -O3 -g -I. -MD -pipe -Os -DNDEBUG -I/opt/local/include -DENABLE_ASSERTIONS -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names CMakeFiles/diff32.dir/diff32.c.o -o diff32  -Wl,-rpath,/opt/local/lib -lm 
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
[ 16%] Built target weight
[ 16%] Built target ramp
[ 16%] Built target quant2c
[ 16%] Built target diff32
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_lpcnetfreedv/lpcnetfreedv/work/build'
make: *** [all] Error 2

Build breakage on Raspberry Pi

I'm attaching a build log from the Raspberry Pi which shows the master branch is unable to complete build. Hoping you can fix this issue with the missing symbol:

pi@hampi:~/hamradio/LPCNet $ git checkout master
Previous HEAD position was 7ee18d4 Disable AVX2 by default even on supported machines.
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
pi@hampi:~/hamradio/LPCNet $ git log
pi@hampi:~/hamradio/LPCNet $ git log -1
commit 101d925fcf8929575ee53755db16dcaac8f08daf (HEAD -> master, origin/master, origin/HEAD)
Merge: ae7b359 855b0a6
Author: drowe67 <[email protected]>
Date:   Sat Dec 17 09:16:33 2022 +1030

    Merge pull request #51 from drowe67/ms-integrate-from-xiph
    
    Integrate latest vec_*.h from xiph/LPCNet
pi@hampi:~/hamradio/LPCNet $ cd build
pi@hampi:~/hamradio/LPCNet/build $ cmake ..
-- The C compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- LPCNet version: 0.4
-- freedv-gui current git hash: 101d925
-- Host system arch is: aarch64
-- Looking for available CPU optimizations on Linux/BSD system...
-- Compilation date = XX20221230XX
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/hamradio/LPCNet/build
pi@hampi:~/hamradio/LPCNet/build $ make -j1
[  1%] Building C object src/CMakeFiles/lpcnetfreedv.dir/freq.c.o
[  3%] Building C object src/CMakeFiles/lpcnetfreedv.dir/kiss_fft.c.o
[  4%] Building C object src/CMakeFiles/lpcnetfreedv.dir/celt_lpc.c.o
[  6%] Building C object src/CMakeFiles/lpcnetfreedv.dir/pitch.c.o
[  8%] Building C object src/CMakeFiles/lpcnetfreedv.dir/codec2_pitch.c.o
[  9%] Building C object src/CMakeFiles/lpcnetfreedv.dir/mbest.c.o
[ 11%] Building C object src/CMakeFiles/lpcnetfreedv.dir/lpcnet_quant.c.o
[ 12%] Building C object src/CMakeFiles/lpcnetfreedv.dir/lpcnet_dump.c.o
[ 14%] Building C object src/CMakeFiles/lpcnetfreedv.dir/4stage_pred_vq.c.o
[ 16%] Building C object src/CMakeFiles/lpcnetfreedv.dir/4stage_direct_split_vq.c.o
[ 17%] Building C object src/CMakeFiles/lpcnetfreedv.dir/4stage_direct_split_indopt_vq.c.o
[ 19%] Building C object src/CMakeFiles/lpcnetfreedv.dir/lpcnet.c.o
[ 20%] Building C object src/CMakeFiles/lpcnetfreedv.dir/lpcnet_freedv.c.o
[ 22%] Building C object src/CMakeFiles/lpcnetfreedv.dir/nnet.c.o
/home/pi/hamradio/LPCNet/src/nnet.c:51:2: warning: #warning Compiling without any vectorization. This code will be very slow [-Wcpp]
   51 | #warning Compiling without any vectorization. This code will be very slow
      |  ^~~~~~~
[ 24%] Building C object src/CMakeFiles/lpcnetfreedv.dir/__/_deps/lpcnet-src/nnet_data.c.o
[ 25%] Building C object src/CMakeFiles/lpcnetfreedv.dir/from_codec2/sine.c.o
/home/pi/hamradio/LPCNet/src/from_codec2/sine.c: In function ‘__codec2__estimate_amplitudes’:
/home/pi/hamradio/LPCNet/src/from_codec2/sine.c:406:57: warning: unused parameter ‘W’ [-Wunused-parameter]
  406 | void estimate_amplitudes(MODEL *model, COMP Sw[], float W[], int est_phase)
      |                                                   ~~~~~~^~~
[ 27%] Building C object src/CMakeFiles/lpcnetfreedv.dir/from_codec2/nlp.c.o
/home/pi/hamradio/LPCNet/src/from_codec2/nlp.c: In function ‘__codec2__nlp’:
/home/pi/hamradio/LPCNet/src/from_codec2/nlp.c:255:10: warning: unused parameter ‘Sw’ [-Wunused-parameter]
  255 |   COMP   Sw[],                  /* Freq domain version of Sn[]                        */
      |   ~~~~~~~^~~~
/home/pi/hamradio/LPCNet/src/from_codec2/nlp.c:256:10: warning: unused parameter ‘W’ [-Wunused-parameter]
  256 |   float  W[],                   /* Freq domain window                                 */
      |   ~~~~~~~^~~
/home/pi/hamradio/LPCNet/src/from_codec2/nlp.c: In function ‘__codec2__post_process_sub_multiples’:
/home/pi/hamradio/LPCNet/src/from_codec2/nlp.c:431:10: warning: unused parameter ‘pmin’ [-Wunused-parameter]
  431 |      int pmin, int pmax, float gmax, int gmax_bin,
      |      ~~~~^~~~
[ 29%] Building C object src/CMakeFiles/lpcnetfreedv.dir/from_codec2/codec2_fft.c.o
[ 30%] Building C object src/CMakeFiles/lpcnetfreedv.dir/from_codec2/kiss_fft.c.o
[ 32%] Building C object src/CMakeFiles/lpcnetfreedv.dir/from_codec2/kiss_fftr.c.o
[ 33%] Linking C shared library liblpcnetfreedv.so
[ 33%] Built target lpcnetfreedv
[ 35%] Building C object src/CMakeFiles/dump_data.dir/dump_data.c.o
[ 37%] Linking C executable dump_data
[ 37%] Built target dump_data
[ 38%] Building C object src/CMakeFiles/test_lpcnet.dir/test_lpcnet.c.o
[ 40%] Building C object src/CMakeFiles/test_lpcnet.dir/nnet_rw.c.o
[ 41%] Linking C executable test_lpcnet
[ 41%] Built target test_lpcnet
[ 43%] Building C object src/CMakeFiles/test_vec.dir/test_vec.c.o
/home/pi/hamradio/LPCNet/src/test_vec.c: In function ‘test_sgemv_accum16’:
/home/pi/hamradio/LPCNet/src/test_vec.c:81:5: warning: implicit declaration of function ‘sgemv_accum16_fast’; did you mean ‘sgemv_accum16’? [-Wimplicit-function-declaration]
   81 |     sgemv_accum16_fast(out_fast, weights, ROWS, COLS, 1, x);
      |     ^~~~~~~~~~~~~~~~~~
      |     sgemv_accum16
/home/pi/hamradio/LPCNet/src/test_vec.c: In function ‘test_sparse_sgemv_accum16’:
/home/pi/hamradio/LPCNet/src/test_vec.c:115:5: warning: implicit declaration of function ‘sparse_sgemv_accum16_fast’; did you mean ‘sparse_sgemv_accum16’? [-Wimplicit-function-declaration]
  115 |     sparse_sgemv_accum16_fast(out_fast, w, rows, indx, x);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
      |     sparse_sgemv_accum16
[ 45%] Linking C executable test_vec
/usr/bin/ld: CMakeFiles/test_vec.dir/test_vec.c.o: in function `test_sgemv_accum16':
/home/pi/hamradio/LPCNet/src/test_vec.c:81: undefined reference to `sgemv_accum16_fast'
/usr/bin/ld: CMakeFiles/test_vec.dir/test_vec.c.o: in function `test_sparse_sgemv_accum16':
/home/pi/hamradio/LPCNet/src/test_vec.c:115: undefined reference to `sparse_sgemv_accum16_fast'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/test_vec.dir/build.make:97: src/test_vec] Error 1
make[1]: *** [CMakeFiles/Makefile2:970: src/CMakeFiles/test_vec.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
pi@hampi:~/hamradio/LPCNet/build $ uname -a
Linux hampi 5.15.76-v8+ #1597 SMP PREEMPT Fri Nov 4 12:16:41 GMT 2022 aarch64 GNU/Linux
pi@hampi:~/hamradio/LPCNet/build $ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

SSE support (for testing)

For performance reason, LPCNet (lpcnet_dec) requires AVX FMA instruction.
But cheap Intel processor (Pentium/Celeron) does not support AVX still now.

I tried SSE-vectorized LPCNet on OpenBSD-6.6/amd64 (clang 8.0.1) with AMD's A10-7860K processor PC, its performance barely achieved with enabling -msse4.1 clang option. Old SSE (SSE3 or former) SSE shown lower performance.

Testing code is at my repository, https://github.com/jg1uaa/LPCNet/ .
Can you evaluate SSE-vectorize is usable or not?

Allow building with the system codec2

I am trying to package LPCNet to Fedora, but we cannot bundle code. Would be possible to allow building with the system installed codec2? I.e. not detecting the codec2.cmake, but e.g. codec2.pc and linking with the libcodec2.so?

benchmarking between AVX/SSE4.1

SSE support is renewed, I took benchmark.

method:

$ cd LPCNet/build_dir/src
$ cat ../../wav/all.wav | ./lpcnet_enc -s > test.out
$ time cat test.out | ./lpcnet_dec -s > /dev/null

results:

CPU build time(real) Note
Intel Core i7-7700 AVX 7.132s *1
Intel Core i7-7700 SSE4.1 8.941s *1
AMD A8-7600 AVX 15.146s *1
AMD A8-7600 SSE4.1 16.453s *1
Intel Core i3-13100 AVX 3.730s *2
Intel Core i3-13100 SSE4.1 4.870s *2
Intel Core i7-7700 AVX N/A *3
Intel Core i7-7700 SSE4.1 29.428s *3
Intel Core i7-7700 SSE4.1 10.858s *4

(*1)Debian-12.1/x86_64, gcc-12.2.0
(*2)Ubuntu-22.04.3/x86_64 LTS on WSL2, gcc-11.4.0
(*3)Slackware-15.0/i686 on QEMU-7.2.4/KVM, gcc-11.2.0
(*4)Slackware-15.0/i686 on QEMU-7.2.4/KVM, clang-13.0.0

QEMU on Slackware did not support AVX instruction.

conclusion:
on x86_64, SSE4.1 build is slightly slower than AVX but we can ignore this disadvantage.

on i686, SSE4.1 build depends with compiler.

suggestion:
we can use SSE4.1 as default on x86_64 environment.
with clever compiler, we will be able to do same things for i686.

segfault with errored frames

While testing freedv_tx/freedv_rx with test frames and noise:

dd bs=32000 count=10 if=/dev/zero | ./freedv_tx 2020 - t.raw --testframes && ./cohpsk_ch t.raw t1.raw -10 --Fs 8000 && ./freedv_rx 2020 t1.raw /dev/null --testframes

I discovered some segfaults in in lpcnet_decode. It may still be having problems with garbage data pushing array lookups out of range (pitch decoding has cause a lot of problems in the past).

No compilation on RPi

In src/CMakeLists.txt you read

if(SSE OR AVX OR AVX2 OR CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
add_executable(test_vec test_vec.c)
target_link_libraries(test_vec m)
else()
message(WARNING "No SSE/AVX/AVX2 CPU flags identified, not building test_vec.")
endif()

but this should replace

SSE ==> SSE_PRESENT GREATER 0

in the if condition (the same for AVX and AVX2).

Note:
SSE means: SSE is used if it is detected (is ON on non-SSE systems by default!)
SSE_PRESENT means: SSE is present (detected in /proc/cpuinfo)

consequence when compiling on a non-SSE system: test_vec.c is compiled and this results in errors
if no include file defines sgemv_accum16_fast.

With the indicated change, it compiles on my RPi.

P.S.: If NEON were a standard cpp #define on my system, the problem would not have popped up.
But linking test_vec.c can only be done if one (or more) of the

#ifdef AVX
#ifdef AVX2
#elif SSE
#elif ARM_NEON || aarch64

evaluates "true".

Transition away from GitHub

Now that we're under the Software Freedom Conservancy (SFC), we'll need to figure out a plan for transitioning away from GitHub (context here). This issue is being created to track this task.

TODO:

  • Research Git hosting providers (GitLab, SFC's own, etc.)
  • Select Git hosting provider (w/vote by the Leadership Team)
  • Clone current repo at new provider
  • Re-enable/port CI tasks as appropriate
  • Add link from GitHub to new location
  • Make repository read-only mirror of new location
  • Determine future date when to delete GitHub repository entirely

Related issues on other projects: codec2 (https://github.com/drowe67/codec2/issues/354), freedv-gui (drowe67/freedv-gui#281), ezDV (tmiw/ezDV#13)

[Win32] __cpuid() problem

Trying to compile main.cpp using clang-cl, yields this error:

main.cpp(271,5): error: no matching function for call to '__cpuid'
    __cpuid(1, eax, ebx, ecx, edx);
    ^~~~~~~
f:\ProgramFiler\LLVM-16.0.0\win64\lib\clang\16\include\intrin.h(60,6): note: candidate function not viable: requires 2 arguments, but 5 were
      provided
void __cpuid(int[4], int);
     ^
1 error generated.

I fixed it by this patch:

--- a/src/main.cpp 2023-09-02 11:02:53
+++ b/src/main.cpp 2023-09-02 12:12:57
@@ -268,7 +268,16 @@
     // cause crashes.
     uint32_t eax, ebx, ecx, edx;
     eax = ebx = ecx = edx = 0;
+#ifdef __GNUC__
     __cpuid(1, eax, ebx, ecx, edx);
+#else
+    int regs[4];
+    __cpuid(regs, 1);
+    eax = regs[0];
+    ebx = regs[1];
+    ecx = regs[2];
+    edx = regs[3];
+#endif

     if (ecx & (1<<27) && ecx & (1<<28)) {
         // CPU supports XSAVE and AVX

But I have to ask; does this project absolutely require MinGW or something?
Strange that petty things like this fails in 2023.

[Proposal] Build multiple lpcnet libraries with and without SIMD

Ok, while trying to figure out crazy and mostly unworkable ways to make this work for both developers and distros I came up with this idea:

Build the lpcnetfreedv library multiple times with and without optimizations. Because of its size, it would be good to separate the nndata into a separate library unless you think that will hurt performance. Otherwise that's tens of MB added to each library.

Then FreeDV could check for multiple libraries and load the "best" candidate.

I'm also experimenting with a different method of downloading the nnet data by creating a custom target so you can "make download" or it will download on the fly during make instead of during configuring.

Compile error on 32 bit Linux Mint machine without vector ops

As reported on the digitalvoice mailing list:

[ 78%] Building C object src/CMakeFiles/test_vec.dir/test_vec.c.o
/home/curt/freedv-gui/LPCNet/src/test_vec.c: In function ‘test_sgemv_accum16’:
/home/curt/freedv-gui/LPCNet/src/test_vec.c:75:5: warning: implicit declaration of function ‘sgemv_accum16_fast’; did you mean ‘sgemv_accum16’? [-Wimplicit-function-declaration]
     sgemv_accum16_fast(out_fast, weights, ROWS, COLS, 1, x);
     ^~~~~~~~~~~~~~~~~~
     sgemv_accum16
/home/curt/freedv-gui/LPCNet/src/test_vec.c: In function ‘test_sparse_sgemv_accum16’:
/home/curt/freedv-gui/LPCNet/src/test_vec.c:109:5: warning: implicit declaration of function ‘sparse_sgemv_accum16_fast’; did you mean ‘sparse_sgemv_accum16’? [-Wimplicit-function-declaration]
     sparse_sgemv_accum16_fast(out_fast, w, rows, indx, x);
     ^~~~~~~~~~~~~~~~~~~~~~~~~
     sparse_sgemv_accum16
[ 80%] Linking C executable test_vec
CMakeFiles/test_vec.dir/test_vec.c.o: In function `test_sgemv_accum16':
/home/curt/freedv-gui/LPCNet/src/test_vec.c:75: undefined reference to `sgemv_accum16_fast'
CMakeFiles/test_vec.dir/test_vec.c.o: In function `test_sparse_sgemv_accum16':
/home/curt/freedv-gui/LPCNet/src/test_vec.c:109: undefined reference to `sparse_sgemv_accum16_fast'
collect2: error: ld returned 1 exit status
src/CMakeFiles/test_vec.dir/build.make:94: recipe for target 'src/test_vec' failed
make[2]: *** [src/test_vec] Error 1
CMakeFiles/Makefile2:1537: recipe for target 'src/CMakeFiles/test_vec.dir/all' failed
make[1]: *** [src/CMakeFiles/test_vec.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

We probably just need to change the function names used to get it to build on x86 machines without any sort of vectorization (e.g. no AVX/SSE).

Illegal instruction exception inside nlp_create() on multiple platforms

There have been reports of recent freedv-gui builds crashing on startup inside the code brought in by #43. Example crash dump from macOS (posted to the freetel-codec2 mailing list):

Process:               FreeDV [1050]
Path:                  /Applications/FreeDV.app/Contents/MacOS/FreeDV
Identifier:            org.freedv.freedv
Version:               ??? (1.8.5)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           FreeDV [1050]
User ID:               501

Date/Time:             2022-11-15 16:57:48.889 +1100
OS Version:            Mac OS X 10.15.3 (19D76)
Report Version:        12
Anonymous UUID:        E215C155-F950-4ED2-AF3A-7CB392630AD3


Time Awake Since Boot: 31000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [1050]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   liblpcnetfreedv.0.4.dylib     	0x000000010512c2ce __codec2__nlp_create + 254
1   liblpcnetfreedv.0.4.dylib     	0x000000010511d16c codec2_pitch_create + 108
2   liblpcnetfreedv.0.4.dylib     	0x0000000105121b6f lpcnet_dump_create + 159
3   liblpcnetfreedv.0.4.dylib     	0x00000001051239e1 lpcnet_freedv_create + 33
4   libcodec2.1.0.dylib           	0x0000000104fc78d7 freedv_2020x_open + 1095
5   libcodec2.1.0.dylib           	0x0000000104fc1775 freedv_open_advanced + 101

and one from Linux at drowe67/freedv-gui#292. At least with the latter, the workaround seems to be for the user to build freedv-gui/codec2/LPCNet themselves using the provided build scripts, so the issue seems to be build related and may be able to be mitigated with CMake changes.

Unfortunately I'm not able to duplicate this locally thus far and attempted debugging with libasan instrumentation doesn't seem to make it any easier to do so, either. Help along those lines would be good.

test_vec.c fails with no SSE, no AVX, no NEON

With no SSE, no AVX, no NEON, compile fails:

/home/kabe/r9builds/lpcnetfreedv-epel-r9/BUILD/LPCNet-0.2/src/test_vec.c:109: undefined reference to `sparse_sgemv_accum16_fast'
collect2: error: ld returned 1 exit status

patch-no-sse.patch
Above patch seems to fix this. #include "vec.h" was missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.