Updated libraries:
29 June 2010: fixed the flac duration reported by the mediascanner
26 June 2010: applied FLAC decoder lock contention fix by Glenn Maynard
Link: FLAC for Milestone homepage
Native support for Free Lossless Audio Codec in Android system. FLAC files can be used also as ring tones.
FLAC files play in the Music.apk and any other players that use the standard system services.
Kenny Root's patches adjusted and applied to 2.1_r2 platform source: FLAC on Android - Kenny Root
Compiled for compatibility with other Milestone system libraries.
Consists of:
/system/lib/libFLAC.so
/system/lib/libmediaplayerservice.so
/system/lib/libopencore_player.so
/system/framework/framework.jar - modified MediaScanner and MediaFile in android/media
Instructions
Automatic installation from ADBRecovery
Copy the unpacked ocflac folder to your sdcard.
Copy the included install.sh script to the recovery folder on your sdcard (so it's like this: recovery/install.sh - do not put it in the scripts subfolder).
Boot to recovery (power off,hold camera or X + power, then volume up+camera), apply update.zip (use d-pad and enter), then reboot.
Remove the install.sh file from the recovery folder.
Manual installation
Copy the unpacked ocflac folder to your sdcard.
From adb shell or terminal on the phone do:
backup: Code:
mkdir /sdcard/ocflacbackup
cp /system/framework/framework.jar /sdcard/ocflacbackup
cp /system/lib/libmediaplayerservice.so /sdcard/ocflacbackup
cp /system/lib/libopencore_player.so /sdcard/ocflacbackup
modification: Code:
su
mount -o remount,rw /dev/mtd/mtdblock6 /system
cp -f /sdcard/ocflac/framework.jar /system/framework
cp -f /sdcard/ocflac/libFLAC.so /system/lib
cp -f /sdcard/ocflac/libmediaplayerservice.so /system/lib
cp -f /sdcard/ocflac/libopencore_player.so /system/lib
chmod 644 /system/framework/framework.jar
chmod 644 /system/lib/libFLAC.so
chmod 644 /system/lib/libmediaplayerservice.so
chmod 644 /system/lib/libopencore_player.so
mount -o remount,ro /dev/mtd/mtdblock6 /system
Then reboot the phone. The first reboot will take longer than usual, be patient. Second reboot might be needed for everything to settle down.
The framework.jar has been disassembled and reassembled by JesusFreke's smali/baksmali.
The framework.jar might differ between different builds of Milestone system so I've assembled several versions, use the one appropriate for your build.
Download FLAC for 2.1
updated libraries (w/o framework.jar) [29.6.2010]:
FLAClibsv4.zip
framework.jar + older libraries:
SHOLS_U2_02.31, SHOLS_U2_02.34.0 and SHOLS_U2_03.10 (CA/Central Europe/DE/FR/HK/IT/TH/UK 2.1)
FLACv3_for_MM2.31.zip
SHOLS_U2_02.34.3 (HK 2.1 fix)
FLACv3_for_MM2.34.3.zip
SHOLS_U2_02.36.0 (DE/Central Europe/UK 2.1 fix)
FLACv3_for_MM2.36.0.zip
SHOLS_U2_02.38.0 (ES/IT 2.1 fix)
FLACfrmwrk2.38.0.zip
SHOLS_U2_02.27.6 (Arabic 2.1)
FLACv3_for_MM2.27.zip
SHOLS_U2_02.27.7 (RU 2.1)
FLACv3_for_MM2.27.7.zip
SHLA_U2_03.05 (BR 2.1)
FLACv3_for_MM3.05.zip
UPDATE: updated libraries
- fix the flac duration reported by mediascanner
- FLAC decoder lock contention fix by Glenn Maynard