Professional Documents
Culture Documents
July 2011
Table of contents 1 Introduction.............................................................................................. ........................3 2 Getting Started..................................................................................................... .............3 2.1 Hardware................................................................................................. ...................4 2.2 Software................................................................................................... ..................4 2.2.1 Downloading the sources...................................................................................5 3 PANDA-AIC OMAP4 EVM Android Build....................................................................7 3.1 Android Kernel and File system Build......................................................................7 4 Manual Configuration of SD/MMC Card.........................................................................8 4.1 Format and Partition the MMC/SD Card...................................................................9 4.2 Installing Android Rootfs .......................................................................................12 5 Android on PANDA-AIC OMAP4 EVM.......................................................................14 5.1 Using the Demo Contents........................................................................................14 5.2 Music Player....................................................................................................... .....17 5.3 Sound Recorder.................................................................................................. ......19
1 Introduction
Texas Instruments TLV320AIC3262 is a flexible, low-power, low-voltage stereo audio codec with digital microphone inputs and programmable outputs, Power-tune capabilities, fully-programmable mini-DSP, fixed predefined and parameter customizable signal processing blocks, integrated PLL, and flexible digital interfaces. This device is ideal for portable audio and telephony applications, in which an embedded operating system (OS), such as Linux often resides and operates. This application report discusses the driver for the AIC3262, codec that was developed to enable users to quickly set up, run, and use the codec device with the Linux OS and Android applications . The AIC3262 driver was coded to support the latest ASoC architecture to make port into different host processors. The CODEC driver described in this document was run and tested on TLV320AIC3262 EVM REV. B and OMAP4 Panda-AIC Revision A. This version of the Linux Audio Driver can also be used on other variant of the codec such as the AIC3202 with minor reconfiguration. This data-sheet discusses the Android 2.3 Integration with the AIC326x codec that was developed to enable users to quickly set up, run, and use the codec device with the Linux 2.6.35. The CODEC driver described in this document was developed and tested using the custom PANDA-AIC OMAP4 EVM.
2 Getting Started
This release provides the pre-built Android SD/eMMC Card based Images and also the steps required to manually build, configure and download the Android Images into an SD/eMMC Card for final testing. Before exercising the manual configuration and download, it is advised to test the demo Android SD/eMMC Card based Images for the initial Android usage. This section explains the Hardware/Software setup required for testing the Android Demo Image.
July 2011 TLV320AIC326x Android Integration for OMAP4430 3
2.1 Hardware
Custom OMAP4EVM PANDA-AIC
Optional Self powered USB Hub USB Keyboard and mouse Note : This code base supports 12 MHz , 24 MHz and 38 Mz and has been tested with 12 Mhz and 38.4 Mhz clock frequencies .To support other frequencies for new platforms the source files have to be modified.
2.2 Software
Required Components Binary image with all components for Android support, ready for programming miniDsp Firmware X-loader (mlo) U-boot (u-boot.bin) Linux kernel (uImage)
Required Packages a. Operating System : i. Linux Ubuntu version 10.04 is recommended b. Cross Compilation Tool Chain : i. CodeSourcery compiler version Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux. c. Java Development Platform : i. sun-java6-jdk d. Other Dependent Packages : i. flex ii. bison iii. gperf iv. libsdl-dev v. libesd0-dev vi. libwxgtk2.6-dev vii. build-essential viii.zip ix. curl x. libncurses5-dev xi. zlib1g-dev
July 2011 TLV320AIC326x Android Integration for OMAP4430 4
xii. tofrodos e. Serial terminal emulation program (minicom or kermit on Linux / HyperTerminal on Windows) f. Android Gingerbread Source: i. The full source of Android Gingerbread configured for custom PANDAAIC OMAP4 EVM. g. Linux Kernel: i. A full Linux kernel source of version 2.6.35 Applications Root File System for Android Media files (*.wav) required on the SD Card for testing Audio. 2.2.1 Downloading the sources Before downloading the source, we need git and repo tools. The procedure for setting up the git and the tools are listed in the link below http://omappedia.org/wiki/PandaBoardL27.12.1-P2_Release_Notes Create a new folder L27.12.1-P2/mydroid cd mydroid curl http://Android.git.kernel.org/repo > ./repo chmod a+x repo repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b 27.x -m RLS27.12.1-P2_Gingerbread.xml repo sync Apply all the patches mentioned in the release notes relevant Android source The following changes have to be made in the file alsa_omap4.h #define MM_DEFAULT_DEVICE "plughw:0,0" #define MM_LP_DEVICE "plughw:0,0" Note: The Android rootfs released along with this document includes this change.
July 2011 TLV320AIC326x Android Integration for OMAP4430 5
The following command will get the u-boot and sync the Android repo with the git repository. Create a new folder u-boot in mydroid git clone git://git.omapzoom.org/repo/u-boot.git u-boot cd u-boot git checkout 601ff71c8d46b5e90e13613974a16d10f2006b make distclean make ARCH=arm omap4430panda_config make The following command will get the x-loader and sync the Android repo with the git repository. create a new folder x-loader in mydroid git clone git://git.omapzoom.org/repo/x-loader.git x-loader cd x-loader git checkout c8855fa6b85bd44073bd1b25dbffa99f02cbeeed make distclean make ARCH=arm omap4430panda_config make The following command will download Android 2.6.35 kernel Create a folder kernel in L27.12.1-P2 folder git clone git://git.omapzoom.org/kernel/omap.git kernel/Android-2.6.35 cd kernel/Android-2.6.35 git checkout ec895072ad0b686d2c130e5d80a3076a03042033 Apply the kernel patches listed in the links below cd {YOUR PATH}/L27.12.1-P2/kernel/Android-2.6.35 1. For updating the PANDA_DEFCONFIG to support Android
July 2011 TLV320AIC326x Android Integration for OMAP4430 6
o git fetch http://review.omapzoom.org/p/kernel/omap/ refs/changes/29/13029/3 && git cherry-pick FETCH_HEAD o git fetch http://review.omapzoom.org/p/kernel/omap refs/changes/61/13861/1 && git cherry-pick FETCH_HEAD 2. For Mouse and Keyboard Support only if required o git fetch http://review.omapzoom.org/p/kernel/omap refs/changes/17/13617/1 && git cherry-pick FETCH_HEAD
5. Modify the makefile and the kconfig files situated under the sound/soc/omap folder of the Linux Kernel Tree. For building Android root files system execute the following commands below 6. cd $MYDROID 7. cp -Rfp device/ti/pandaboard/buildspec.mk.default buildspec.mk 8. make clean #(required for rebuild only) 9. make TARGET_PRODUCT=pandaboard -j4
July 2011 TLV320AIC326x Android Integration for OMAP4430 7
This will build the Android file system For Building Linux image execute the following command given below 10. cd kernel 11. set appropriate path of the tool chain 12.make panda_defconfig 13.make menuconfig . Enable the aic3262 codec related drivers. 14. make uImage
[root@host]# dmesg /dev/sda1 on /media/ACER type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096) ... /dev/sdc1 on /media/disk-3 type ext3 (rw,nosuid,nodev,uhelper=hal) /dev/sdc2 on /media/disk-4 type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=500) [root@host]# [root@host]# umount /media/disk-3 [root@host]# umount /media/disk-4 TLV320AIC326x Android Datasheet
July 2011
Remove all existing partitions. The user would have to run a delete command for each partition Create two new partitions Set the first partition size set to 128MB, filesytem as FAT32 and enable it as an active partition
July 2011 TLV320AIC326x Android Integration for OMAP4430 10
[root@host]# fdisk /dev/sdc Command (m for help):[p] Disk /dev/sdc: 2021 MB, 2021654528 bytes 255 heads, 63 sectors/track, 245 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 130 1016 1732311 c W95 FAT32 (LBA)
Verify the two partitions created on the MMC/SD card. The output must resemble the following
July 2011 TLV320AIC326x Android Integration for OMAP4430 11
Command (m for help): [n] Command action e extended p primary partition (1-4) [p] Partition number (1-4): [1] First cylinder (1-247, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-247, default 247): [+128M] Command (m for help): [t] Selected partition 1 Hex code (type L to list codes): [c] Changed system type of partition 1 to c (W95 FAT32 (LBA)) Command (m for help): [a] Partition number (1-4): [1] Command (m for help): [n] Command action e extended
p primary partition (1-4) [p] Partition number (1-4): [2] First cylinder (18-247, default 18): Using default value 18 Last cylinder or +size or +sizeM or +sizeK (18-247, default 247): [] Using default value 247
Write the changes with new partition layout information to the MMC/SD card Create FAT32 and EXT3 file systems on the respective partitions
July 2011 TLV320AIC326x Android Integration for OMAP4430 12
Command (m for help): [p] Disk /dev/sdb: 2032 MB, 2032664576 bytes 255 heads, 63 sectors/track, 247 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x009cd1b0 Device Boot Start End Blocks Id System /dev/sdc1 * 1 17 136521 c W95 FAT32 (LBA) /dev/sdc2 18 247 1847475 83 Linux Command (m for help): Command (m for help): [w] The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: If you have created or modified any DOS 6.x partitions, please see the fdisk manual page for additional information. Syncing disks. [root@host] # [root@host] # mkfs.vfat F 32 n boot /dev/sdc1 [root@host] # mkfs.ext3 filesystem /dev/sdc2 TLV320AIC326x Android Datasheet
July 2011
The following command will copy the Android file system into the file system partition of the eMMC card. In /L27.12.1-P2 create a folder named myfs $sudo mkdir myfs cp -ax $MYDROID/device/ti/proprietary-open/graphics/omap4/* $MYDROID/out/target/product/pandaboard/ $sudo cp R /out/target/product/pandaboard/root/* $sudo cp R /out/target/product/pandaboard/system .
July 2011 TLV320AIC326x Android Integration for OMAP4430 13
[user@host ~]$ mount /dev/root on / type ext3 (rw) proc on /proc type proc (rw) ... /dev/sdc2 on /media/disk-3 type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=500) /dev/sdc1 on /media/disk-4 type ext3 (rw,nosuid,nodev,uhelper=hal) [user@host ~]$ TLV320AIC326x Android Datasheet
July 2011
$sudo cp R /out/target/product/pandaboard/data. $sudo cp -R myfs/* /media/rootfs Similarly copy the required media files into the eMMC card. Note: For SD card replace the string adb push with cp in all commands and execute the same
July 2011 TLV320AIC326x Android Integration for OMAP4430 14
When Android comes up on the PANDA-AIC OMAP4 EVM, it presents the user with the default opening screen as shown below. Figure 1: Main Android Gingerbread Screen
July 2011 TLV320AIC326x Android Integration for PANDA-AIC OMAP4430 15
Drag up the lock icon to unlock the screen. On successful unlocking, the Android desktop should be visible. Figure 2: Android Screen after the user unlocks the device
July 2011 TLV320AIC326x Android Integration for PANDA-AIC OMAP4430 16
Bring up the Applications Screen by clicking on the square shaped icon seen at the
Click on Songs to bring up a list of Songs on the custom PANDA-AIC OMAP4 EVM Figure 5: Songs being enumerated by MUSIC Application Selecting any of the tracks displayed will initiate a playback of the selected Audio file. During Playback, the user may adjust the volume using the Volume Up or Volume Down keys. Figure 6: Music being played from Android
July 2011 TLV320AIC326x Android Integration for PANDA-AIC OMAP4430 19