[flac-dev] implementing flac on an embedded device

Martijn van Beurden mvanb1 at gmail.com
Thu Feb 9 13:35:58 PST 2012


Op 09-02-12 15:50, Voit, Florian schreef:
>
> Hi everyone,
>
> I'm currently working on project trying to send sensor data from a 
> microcontroller over radio to another device.
>
> I need compression because the radio has not enough bandwidth to send 
> it without.
>
> Because the sensor data quiet much resembles audio data I got the best 
> compression results using lossless audio codecs instead of data 
> compression algorithms like Lempel-Ziv.
>

Biggest problem here is that you won't get a 'guaranteed compression', 
as it is lossless. If you would feed the thing random data, it won't be 
any more compact than uncompressed and what should the device behave 
like then? FLAC compression is to save overall traffic or disk space, 
not to push data over a small channel.

However, I you would come up with some idea to handle those overflows, 
it might well be a solution.

> I won't have an OS on the microprocessor so  I'll have to get the 
> streaming encoder to work 'bare metal'. The situation will be that the 
> senor will constantly deliver samples which will be stored in a 
> buffer. The buffer should then be compressed and sent.
>

So, is there a buffer *after* conversion for sending? See the problem above.

> Here is my question:
>
> Do you think it is possible to use FLAC compression in this use-case? 
> Is it possible to customize the codec to my needs without having to 
> rewrite the whole thing?
>

I guess that would depend on the architecture, as you're working 
OS-less. I think I do have a better idea for you: can you just try to 
reduce the amount of data your sending? Do you need 16-bit audio or 
would 8 bit suffice? Or something in between? What about reducing the 
samplerate? If you do need a large dynamic range but only a fairly low 
resolution, you could try to send using a non-standard floating-point 
format or something like ADPCM? That would be far easier to program and 
could probably be sufficient.

Good luck!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20120209/186c311f/attachment.htm 


More information about the flac-dev mailing list