Wednesday, May 7, 2014

Amazon Kindle 3.3 Sound Output FFMPEG

The following command is great for creating sound files for the Kindle:
ffmpeg -i 8bp027-04-nullsleep-playful_panda.mp3 -ar 8000 -ac 1 -acodec pcm_u8 panda.wav

Play the sound with the following:
aplay /tmp/panda.wav

Sunday, May 4, 2014

Compiling Linux kindle 2.6.26-rt-lab126 armv6l for Kindle 3

Device Supported

These instructions are specifically for the Kindle 3, the kernel version on the original device must be exactly: Linux kindle 2.6.26-rt-lab126 after the 3.3 firmware update from Amazon.

ARM x64 Cross Compile Toolchain

I found and extracted the arm-2008q3 code sorcery tool-chain. (This one is older and most certainly compatible with the kernel verison)

Linux Kernel Source

Get and Extract the linux-2.6.26-lab126.tar.bz2  from Amazon sources (under Kindle 3) Kindle_src_3.3_611680021.tar.gz

Apply kindle-3.3-kernel-buildfix.patch
patch -p1 < ./kindle-3.3-kernel-buildfix.patch

Generate .config file
make imx35_luigi_defconfig

Modify the following config setting to the following

Setup Build ENV
export ARCH=arm
export CROSS_COMPILE=/home/thomas/workspace/arm-2008q3/bin/arm-none-linux-gnueabi-

Build Script
echo "=============Making make"

echo "=============Making uImage"
make uImage

echo "=============Making modules"
make modules

echo "=============Making modules tar at linux-2.6.26-rt-lab126.tar.gz"
make targz-pkg

echo "=============Making modules.dep"
depmod -ae -F -b tar-install -r 2.6.26-rt-lab126 -n > modules.dep

# replace /kernel with /lib/modules/2.6.26-rt-lab126/kernel/
echo "=============Applying /kernel directory remapping"
perl -pi -e 's/kernel\//\/lib\/modules\/2.6.26-rt-lab126\/kernel\//g' modules.dep

echo "=============Outputing uImage, modules.dep and tared modules into ./export directory"
mkdir ./export
cp arch/arm/boot/uImage ./export/.
cp modules.dep ./export/.
cp linux-2.6.26-rt-lab126.tar.gz ./export/. 

Flashing Kernel on Kindle

SCP the ./export folder contents to /tmp/. on your kindle
Extract linux-2.6.26-rt-lab126.tar.gz to /lib/modules
Extract modules.dep to /lib/modules/2.6.26-rt-lab126

chmod 644 /lib/modules/2.6.26-rt-lab126/modules.dep
/test/flashtools/luigi/update /tmp/uImage