release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Wiki > Main > StandaloneAudioLibrary (compare)

Difference: StandaloneAudioLibrary (r5 vs. r4)

This project is part of the Google Summer of Code 2011 project.

Project nameStudentMentorBackup mentor
Standalone audio library Sean BartellMichael Giacomelli  

Description

My project is to separate out Rockbox's codecs, metadata parsing, and DSP code into a separate library. I'll add an automated testing suite, make the library usable by other embedded software, and perform some other improvements. My project will make codec development easier, and hopefully external projects will use and make contributions to the library.

In progress

Remove dependencies on other Rockbox code

The library currently has various dependencies on other Rockbox code, especially headers. These need to be removed so that external users need not build the whole of Rockbox in order to use the library. This is complicated by embedded devices' need for efficiency, which means it's best to avoid layers of wrapper functions.

I plan to remove dependencies on Rockbox by having a user‐provided header file (rbcodecconfig.h, say) that provides a #define for every function needed by the library. If a portable implementation of the function is possible (e.g. for strlcpy), and it isn't defined in the header file, a default implementation will be compiled.

Future work

Write test suite

This will be my project's most direct benefit to Rockbox. I plan to write a Python driver that will decode each test file and do an exact comparison against known correct output. For new test files, where there's no known output, I'll use fuzzy comparisons (e.g. PSNR) against other libraries and tools. The driver will also check the results of seeking, and test the other library features.

It may be possible to test platform-dependent assembly code with qemu or another emulator. I'm also interested in checking coverage and using other techniques, like Valgrind.

Clean up the API

The initial focus will be on getting the library working, not on a nice API. In order to appeal to software other than Rockbox, I'll change the API to make it cleaner and more flexible. I'll examine other codec software (both proprietary and open), talk to interested projects (if any), and make a big list of features the ideal library would have. This includes anything from documentation (essential) to reading lyrics files (feature creep). We can then figure out which items are feasible and important enough to implement this summer.

If there's still time left, further work may include performance optimization and bughunting.

Completed work

Write test program

I have written a codec test program ( that can play files with SDL, convert them to WAV, and apply some DSP effects. This program will become the basis for the test suite. I've already found one bug (FS#12164) with this program and Valgrind. FS#12190, requires FS#12189) that can play files with SDL, convert them to WAV, and apply some DSP effects. This program will become the basis for the test suite. I've already found one bug (FS#12164) with this program and Valgrind.

Compile audio code as a library

The library includes the decoders, encoders, metadata parsers, and DSP code (resampling, equalization, and timestretching). The library has its own makefile, which can be used either by a normal Rockbox build or by a separate application such as the test program. However, building it separately is very complicated, requiring many #defines and makefile rules—cleaning this up is the next step. The code is not yet available.

Refactoring Codec cleanup

As a warmup task, I removed or commented unused codec code, and made other parts static: FS#12140, FS#12141, FS#12142, FS#12143.

Miscellaneous

Codec I bugs found and fixed: fixed several codec bugs and made a few updates to the build system. FS#12130 (ADX), FS#12146 (Cook), FS#12163 (AIFF), FS#12164 (Cook, ATRAC-3 RM).

Other fixes not related to codecs: FS#12121, FS#12188.

  Patch Committed Title
Test program FS#12189choice-no no (since 2011-07-11) Simplify the codec API and don't always loop MODs
FS#12190choice-no no (requires FS#12189 and discussion) Add the 'warble' codec test program
Codec cleanup FS#12140DONE r29942 2011-06-01 Make various codec stuff static
FS#12141DONE r29945 2011-06-02 Remove/comment unused codec code
FS#12142DONE r30065 2011-06-24 Remove unused code and irrelevant files from libmad
FS#12143DONE r29972 2011-06-05 Clean up the NSF codec
Codec bugs FS#12130DONE r29927 2011-05-26 Fix ADX decoding on 64-bit systems
FS#12146DONE r29973 2011-06-05 Fix libcook bugs introduced in r22055
FS#12163choice-no no (since 2011-06-22) Fix AIFF on 64-bit systems
FS#12164DONE r30060 2011-06-24 Fix subtle buffering bug in cook and atrac3_rm
Other fixes FS#12121DONE r29928 2011-05-27 rockboxdev.sh fails with host GCC 4.6.0 due to new warnings
FS#12188DONE r30169 2011-07-19 Fix Perl scripts that used Switch

-- SeanBartell

r5 - 21 Jul 2011 - 06:02:38 - SeanBartell

Revision r5 - 21 Jul 2011 - 06:02 - SeanBartell
Revision r4 - 13 Jul 2011 - 07:30 - SeanBartell
Copyright by the contributing authors.