From kenny at understoryweather.com Thu Oct 19 03:25:18 2017 From: kenny at understoryweather.com (Kenny Koller) Date: Thu, 19 Oct 2017 03:25:18 +0000 Subject: [Flac] FLAC on ARM Cortex-M4 Message-ID: I'd like to compress a 32 kHz 16-bit mono using an STM32F4 microcontroller. My plan is to capture from 500-1000 ms of data, compress, and send the result over a UART. I have the arm-none-eabi tools installed on MacOS. I used homebrew to install autoconf, automake, and libtool. autogen.sh succeeded and I was able to create my makefiles using the following: *./configure --build=x86_64-apple-darwin16.7.0 --host=arm-none-eabi --prefix=$PWD/export CFLAGS="-O3 -mthumb -mcpu=cortex-m4 -lc -lrdimon -specs=rdimon.specs" --disable-cpplibs --disable-ogg --disable-oggtest --disable-examples --disable-xmms-plugin* * Configuration summary :* * FLAC version : ........................ 1.3.2* * Host CPU : ............................ arm* * Host Vendor : ......................... none* * Host OS : ............................. eabi* * Compiler is GCC : ..................... yes* * GCC version : ......................... 5.4.1* * Compiler is Clang : ................... no* * SSE optimizations : ................... yes* * Asm optimizations : ................... no* * Ogg/FLAC support : .................... no* I'm getting some errors around type mismatches between the declarations and definitions for example: *grabbag/cuesheet.c:32:10: error: conflicting types for 'grabbag__cuesheet_msf_to_frame'* * uint32_t grabbag__cuesheet_msf_to_frame(uint32_t minutes, uint32_t seconds, uint32_t frames)* * ^* *In file included from ../../include/share/grabbag.h:24:0,* * from grabbag/cuesheet.c:29:* *../../include/share/grabbag/cuesheet.h:32:10: note: previous declaration of 'grabbag__cuesheet_msf_to_frame' was here* * unsigned grabbag__cuesheet_msf_to_frame(unsigned minutes, unsigned seconds, unsigned frames);* I can see that the variables in the header are not declared using the values. More broadly though: Assuming I can sort out these errors, am I on the right track/ My experiments have shown that a compression level of zero will meet my needs and I have read that encoding is faster than real-time. Once I have the library built I plan to measure things. But I'm seeing calls to fprintf etc that I don't need. If I just want encodying functions but not the general purpose flac tool is there any advice as to how to pare this back further so I'm only building what I need. I'm not too concerned about library size as the linker should just pull in what is needed. It's more that I would like fewer things to debug in the build. Is it possible to encode on-the-fly? I have 192 KB of RAM. It'd be nice if I could compress straight to a buffer. Thanks for reading, Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenny at understoryweather.com Fri Oct 20 00:05:02 2017 From: kenny at understoryweather.com (Kenny Koller) Date: Fri, 20 Oct 2017 00:05:02 +0000 Subject: [Flac] Removing Metadata Interface Message-ID: I've read the notes for embedded developers: Unused parts may be pruned by some simple editing of src/libFLAC/Makefile.am It's not clear to me how to remove the metadata interface. I tried commenting some source files and then running automake: * #metadata_iterators.c \* * #metadata_object.c \* When I build I get linker errors. Linux calls that I don't want/need as I am running on an RTOS: *metadata_iterators.c:(.text+0x52c): undefined reference to `chmod'metadata_iterators.c:(.text+0x534): undefined reference to `utime'metadata_iterators.c:(.text+0x540): undefined reference to `chown'metadata_iterators.c:(.text+0x552): undefined reference to `chown'* -------------- next part -------------- An HTML attachment was scrubbed... URL: