You are here

FLAC support for Motorola Milestone

Updated libraries:
29 June 2010: fixed the flac duration reported by the mediascanner (fixes also the flac seeking in the bTunes player)

(media database needs to be rebuilt for this fix to have an effect on the flac files already present on your SD card: menu>Settings>Applications>Manage applications>menu>Filter>All>Media Storage>Clear data - custom ringtones will need to be reassigned afterwards)
26 June 2010: applied FLAC decoder lock contention fix by Glenn Maynard

Native support for the Free Lossless Audio Codec in Android system. FLAC files can be used also as ring tones.
FLAC files will 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: http://the-b.org/FLAC_on_Android
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 classes in android/media)

Instructions

Automatic installation from OpenRecovery:
Copy the extracted libraries and the framework.jar to /OpenRecovery/flac folder on your SD card.
Copy the extracted FLACinstall.sh script to /OpenRecovery/scripts folder on your SD card.
Boot to recovery, launch the OpenRecovery and in the Run Script menu select FLACinstall.sh.

Automatic installation from G.O.T.’s OpenRecovery:
Copy the updated libraries and the framework.jar to /OpenRecovery/GOT/ocflac folder on your SD card.
Boot to recovery, launch the OpenRecovery and in the G.O.T. Modding Menu select Install FLAC support.
UPDATE: GOT OR 1.04a already contains the up to date libraries.

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:
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:
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 differs between different builds of Milestone system so I've assembled several versions, use the one appropriate for your build.

Download FLAC for 2.1 system:

updated libraries (w/o framework.jar) [29.6.2010]:
http://www.mediafire.com/?givumgnjmni

framework.jar + older libraries:
SHOLS_U2_02.38.0 (ES/FR/IT 2.1 fix)
http://www.mediafire.com/?zoolm5mhmzw

SHOLS_U2_02.36.0 and SHOLS_U2_03.11.0 (CA/DE/Central Europe/HK/SG/TH/UK 2.1 fix)
http://www.mediafire.com/?vdy2vkiinoy

SHOLS_U2_02.34.3 (HK 2.1 fix)
http://www.mediafire.com/?mjnzz2i2nmy

SHOLS_U2_02.31.0, SHOLS_U2_02.34.0 and SHOLS_U2_03.10.0 (CA/Central Europe/DE/FR/HK/IT/TH/UK 2.1)
http://www.mediafire.com/?injnlcnujzq

SHOLS_U2_02.27.6 (Arabia/Israel 2.1)
http://www.mediafire.com/?2gijztfozww

SHOLS_U2_02.27.7 (RU 2.1)
http://www.mediafire.com/?tmnnznyyndm

SHLA_U2_03.05.0 (AR/BR/VE 2.1)
http://www.mediafire.com/?mn0j3tnmizz

For those who want to incorporate the FLAC support into their framework.jar by themselves (usually because their framework.jar has been already modified or they use a firmware version that is not listed above), here are the smali files that need to be replaced in /android/media with the help of smali/baksmali:

Comments

Copy to /sdcard/openrecovery/updates. Apply with Open Recovery. :)
Framework.jar included
FLAC libraries up to date
Hope this helps

http://www.4shared.com/file/MsyFQuWf/updateFLAC.html

After I cleared the media database as suggested every ring tone I had set got blanked out and just defaulted to playing my music until I reset everything individually.

Affected ring tones and notifications all the way down to it playing music just plugging it to charge.

Oh yes, I should have mentioned that. The effect of rebuilding of the database is the same as when you change (upgrade) your SD card - you need to reassign all the custom ringtones and notification sounds, as they will be messed up.
More gentle approach might be to move all the flac files away from the SD card, then let the phone to scan the card without the flac files (it happens as soon as you change the USB connection from "Memory card access" to e.g. "Charge only"), then finally put them back - the database entries should be renewed afterwards.
That way, at least the mp3 and ogg files on SD card will retain their database indexes...

Any hope for a release of a framework.jar by tomorrow for SHOLS_U2_03.11.0 (New version for Canada Telus that was just released by GOT) I will understand if it is not ready but I would like it before I go away for the weekend.

The SHOLS_U2_03.11.0 framework is identical with the framework from SHOLS_U2_02.36.0. So you can safely use the framework.jar from the already uploaded FLACv3_for_MM2.36.0.zip archive (remember that the libraries in that archive are the older v3, better use the updated v4 ones from 29.6.2010). I've updated the listing above.

Will any of this work for people using the newly released hacked together Froyo for Milestone EU 2.36 kernel with Nexus One 2.2 software on top.

The 2.2 system will surely need a new version of the FLAC support. I'll work on it.

Hi, any chance on a FLAC version for the final 2.2?

If i edit the framework the current lib will work or a new lib is required?

Cheers...

To be honest, the last time I checked, the hacked 2.2 was a real mess.
Until the release somehow stabilizes and cleans up, I see no point in trying to adapt the FLAC support for it, as it can stop working as soon as the next update to this release is out.
I see too many chaotic replacements there and there is no track of the changes made...

are you going to release an update for 2.2.1?thank you

sorry, is this "Download FLAC for 2.1 system" can be used on HTC Hero GSM Stock Sense 2.1 ROM? so should I download the "updated libraries (w/o framework.jar) [29.6.2010]:" with file under attachments (MediaFile.smali and MediaScanner$MyMediaScannerClient.smali)?

Give me a suggestion if that is real to receive the middle east essays paper at the writing services, or maybe that's much better to order term papers for cheap?

Do not you get know that you are really very professional history dissertation writer and the custom dissertation services won’t compare with your writing skillfulness. If you continue to do the things like that, some guys would buy theses relating with this good topic not from custom thesis writing services, but buy from you also.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.