TLV320AIC326x Android Integration

July 2011

Android 2.3 Integration with TLV320AIC326x Linux Audio Driver
ABSTRACT
The Android is an application framework from Google for embedded Devices. This datasheet discusses the Android Demo Image and the steps required for getting the Android built for the Custom OMAP4 Evaluation Module running the Linux 2.6.35 Kernel along with AIC326x Linux ASoC Audio Driver. TLV320AIC326x Android Datasheet
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

This section explains the Hardware/Software setup required for testing the Android Demo Image. 2. This device is ideal for portable audio and telephony applications. This application report discusses the driver for the AIC3262. The CODEC driver described in this document was run and tested on TLV320AIC3262 EVM REV. and use the codec device with the Linux 2.To support other frequencies for new platforms the source files have to be modified.July 2011 TLV320AIC326x Android Integration for OMAP4430 2 TLV320AIC326x Android Datasheet July 2011 1 Introduction Texas Instrument’s TLV320AIC3262 is a flexible. The AIC3262 driver was coded to support the latest ASoC architecture to make port into different host processors. integrated PLL. in which an embedded operating system (OS). and use the codec device with the Linux OS and Android applications . configure and download the Android Images into an SD/eMMC Card for final testing. Before exercising the manual configuration and download. run. low-power. run. The CODEC driver described in this document was developed and tested using the custom PANDA-AIC OMAP4 EVM.3 Integration with the AIC326x codec that was developed to enable users to quickly set up.2 Software Required Components  Binary image with all components for Android support. fully-programmable mini-DSP. such as Linux often resides and operates. 24 MHz and 38 Mz and has been tested with 12 Mhz and 38.1 Hardware  Custom OMAP4EVM – PANDA-AIC  MMC/SD Card  USB Card reader to format/program the MMC/SD Card  Optional  Self powered USB Hub  USB Keyboard and mouse Note : This code base supports 12 MHz .6. ready for programming  miniDsp Firmware  X-loader (mlo)  U-boot (u-boot. codec that was developed to enable users to quickly set up. and flexible digital interfaces. July 2011 TLV320AIC326x Android Integration for OMAP4430 3 TLV320AIC326x Android Datasheet July 2011 2. it is advised to test the demo Android SD/eMMC Card based Images for the initial Android usage. fixed predefined and parameter customizable signal processing blocks.4 Mhz clock frequencies . low-voltage stereo audio codec with digital microphone inputs and programmable outputs.35. This data-sheet discusses the Android 2. 2 Getting Started This release provides the pre-built Android SD/eMMC Card based Images and also the steps required to manually build.bin)  Linux kernel (uImage) . B and OMAP4 Panda-AIC Revision A. Power-tune capabilities. This version of the Linux Audio Driver can also be used on other variant of the codec such as the AIC3202 with minor reconfiguration.

0" Note: The Android rootfs released along with this document includes this change.org/platform/omapmanifest.Required Packages a. zlib1g-dev July 2011 TLV320AIC326x Android Integration for OMAP4430 4 TLV320AIC326x Android Datasheet July 2011 xii. Operating System : i.0" #define MM_LP_DEVICE "plughw:0.35 Applications  Root File System for Android  Media files (*. Java Development Platform : i./repo  chmod a+x repo  repo init -u git://git. Linux Kernel: i. CodeSourcery compiler version Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux.org/repo > . Serial terminal emulation program (minicom or kermit on Linux / HyperTerminal on Windows) f.git -b 27.git.1-P2/mydroid”  cd mydroid  curl http://Android. gperf iv.org/wiki/PandaBoardL27.6. flex ii.12. The full source of Android Gingerbread configured for custom PANDAAIC OMAP4 EVM.omapzoom. build-essential viii. Linux – Ubuntu version 10. libsdl-dev v.2. sun-java6-jdk d. July 2011 TLV320AIC326x Android Integration for OMAP4430 5 TLV320AIC326x Android Datasheet July 2011 .04 is recommended b. c. libesd0-dev vi.6-dev vii.h #define MM_DEFAULT_DEVICE "plughw:0.1-P2_Release_Notes  Create a new folder “L27. tofrodos e. libncurses5-dev xi.1-P2_Gingerbread.wav) required on the SD Card for testing Audio. curl x.kernel. The procedure for setting up the git and the tools are listed in the link below http://omappedia. bison iii. g. libwxgtk2.1 Downloading the sources Before downloading the source.12.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. Other Dependent Packages : i.x -m RLS27.zip ix. Cross Compilation Tool Chain : i. A full Linux kernel source of version 2. 2. Android Gingerbread Source: i. we need git and repo tools.12.

Extract the AIC326x_asoc_driver_sources.omapzoom.org/repo/x-loader.6.The following command will get the u-boot and sync the Android repo with the git repository.org/repo/u-boot.  create a new folder “x-loader” in mydroid  git clone git://git.org/p/kernel/omap refs/changes/17/13617/1 && git cherry-pick FETCH_HEAD 3 PANDA-AIC OMAP4 EVM Android Build This section explains the build procedure of the custom omp4evm kernel and Android file system.35 kernel  Create a folder” kernel” in L27.6.12.gz file provided by the Mistral 2. .omapzoom. For updating the PANDA_DEFCONFIG to support Android July 2011 TLV320AIC326x Android Integration for OMAP4430 6 TLV320AIC326x Android Datasheet July 2011 o git fetch http://review. 1.35 1. 3.omapzoom.12.1-P2/kernel/Android-2. Copy the contents of the Machine_driver folder into the sound/soc/omap folder of the Linux Kernel Tree.org/p/kernel/omap refs/changes/61/13861/1 && git cherry-pick FETCH_HEAD 2.  Create a new folder “u-boot” in mydroid  git clone git://git. Please ensure that the codesourcery cross compiler or any other compatible toolchain is present and environment variables are set.omapzoom. 3. For Mouse and Keyboard Support only if required o git fetch http://review.tar.35  cd kernel/Android-2.35  git checkout ec895072ad0b686d2c130e5d80a3076a03042033  Apply the kernel patches listed in the links below cd {YOUR PATH}/L27.1 Android Kernel and File system Build This section explains the steps to be followed for buildng the kernel where we have to add the sources released from Mistral to get the Linux Kernel which is compatible for the Android development.omapzoom. 4.6.git kernel/Android-2.org/p/kernel/omap/ refs/changes/29/13029/3 && git cherry-pick FETCH_HEAD o git fetch http://review.git x-loader  cd x-loader  git checkout c8855fa6b85bd44073bd1b25dbffa99f02cbeeed  make distclean  make ARCH=arm omap4430panda_config  make The following command will download Android 2.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.omapzoom.6. Modify the makefile and kconfig files situated under the sound/soc/codecs folder of the Linux Kernel Tree. Copy the contents of the Codec_driver Folder into the sound/soc/codecs folder of the Linux Kernel Tree.1-P2 folder  git clone git://git.org/kernel/omap.

mk.mk 8. The output seen by the user need not be exactly as shown below since it depends on the current partition layout of the MMC/SD card. cp -Rfp device/ti/pandaboard/buildspec. Media Files and Android Root FS) The steps mentioned here need to be followed only if the user chooses to program Android to the MMC/SD card using individual software components. For building Android root files system execute the following commands below 6. It requires the individual components that make up the software system on the custom OMAP4EVM (Boot loaders.make menuconfig . cd $MYDROID 7.04) in order to successfully format the MMC/SD card for programming Android.  Connect the card reader to the Host system running Linux (Ubuntu 10. 1. Boot partition: ◦ Type: FAT32 ◦ Label: boot or BOOT ◦ Flags: boot.default buildspec. July 2011 TLV320AIC326x Android Integration for OMAP4430 8 TLV320AIC326x Android Datasheet July 2011 4. Enable the aic3262 codec related drivers. cd kernel 11. Check if the device has automatically been mounted by the system.make panda_defconfig 13. It can be seen that the device has been detected as ‘/dev/sdc1’ and ‘/dev/sdc2’ • Create the partitions by using the fdisk command. In the following steps. ‘[ ]’ indicates that a user input is required. use the pre-built binaries provided. July 2011 TLV320AIC326x Android Integration for OMAP4430 9 . • Check the existing partition layout. make TARGET_PRODUCT=pandaboard -j4 July 2011 TLV320AIC326x Android Integration for OMAP4430 7 TLV320AIC326x Android Datasheet July 2011 This will build the Android file system For Building Linux image execute the following command given below 10. You can use any of your available partition managers with or without GUI to create the necessary partitions. File system Partition: ◦ Type: EXT3 ◦ Label: rootfs ◦ Flags: none To simply program Android on the MMC/SD card for use on the OMAP4EVM. make clean #(required for rebuild only) 9. The end result should be one SD/eMMC card with following partitions. Modify the makefile and the kconfig files situated under the sound/soc/omap folder of the Linux Kernel Tree.1 Format and Partition the MMC/SD Card You would need a Host PC running Linux (Ubuntu 10. Linux kernel. set appropriate path of the tool chain 12. “make uImage” 4 Manual Configuration of SD/MMC Card This section provides a step-by-step approach to formatting and programming an MMC/SD card with Android for the custom OMAP4EVM. • Unmount the partition if it is already mounted.lba 2.04). 14.5.

nosuid. 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. 63 sectors/track. /dev/sdc1 on /media/disk-3 type ext3 (rw.nosuid.uhelper=hal) /dev/sdc2 on /media/disk-4 type vfat (rw.nodev. The user would have to run a delete command for each partition • Create two new partitions • Set the first partition size set to 128MB.uhelper=hal.blksize=4096) .nosuid.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.nodev.. default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-247.nodev. 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.allow_other.shortname=lower. 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) Command (m for help): Command (m for help): [d] Selected partition 1 Command (m for help): TLV320AIC326x Android Datasheet July 2011 • Verify the two partitions created on the MMC/SD card.. 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 .[root@host]# dmesg /dev/sda1 on /media/ACER type fuseblk (rw.

$ sudo cp /mydroid/x-loader/MLO /media/boot The following command will copy the u-boot. $sudo cp /mydroid/u-boot/u-boot.35/arch/arm/boot/uImage /media/boot .bin /media/boot The following command will copy the kernel image into the boot partition of the eMMC card. The following command will copy the x-loader image into your eMMC-card. 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.bin into the boot partition of your eMMC card.x partitions. 2032664576 bytes 255 heads.p primary partition (1-4) [p] Partition number (1-4): [2] First cylinder (18-247. Program the Android File System to the EXT3 partition of the MMC/SD card. default 18): Using default value 18 Last cylinder or +size or +sizeM or +sizeK (18-247. from there execute the following commands.vfat –F 32 –n boot /dev/sdc1 [root@host] # mkfs. Stick to the command line.2 Installing Android Rootfs Connect the USB Card reader to the Host System running Linux. [root@host] # [root@host] # mkfs. 63 sectors/track. Do “cd” to your git root directory. Insert the MMC/SD card partitioned and formatted for Android into the card reader. You are advised not to use the GUI as the ext3 partition will need root access while programming.ext3 filesystem /dev/sdc2 TLV320AIC326x Android Datasheet July 2011 4. please see the fdisk manual page for additional information. The Linux system should detect the two partitions and mount them. $sudo cp kernel-2. default 247): [] Using default value 247 Command (m for help): TLV320AIC326x Android Datasheet July 2011 • 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. WARNING: If you have created or modified any DOS 6. Syncing disks.6. If the partitioning is proper. This can be verified with the ‘mount’ command. the two partitions should auto mount and open in two separate windows under your GUI.

vram=0:16M. On successful unlocking. the card now has Android installed on it and the capability to boot custom OMAP4EVM.nodev.fatload mmc 0 0x80000000 uImage. it presents the user with the default opening screen as shown below.1 Using the Demo Contents When Android comes up on the PANDA-AIC OMAP4 EVM.12. bootm 0x80000000' 3. /dev/sdc2 on /media/disk-3 type vfat (rw.1:16M consoleblank=0' 2.115200n8 mem=456M@0x80000000 mem=512M@0xA0000000 root=/dev/mmcblk0p2 rw rootdelay=2 init=/init vram="32M" omapfb. July 2011 TLV320AIC326x Android Integration for OMAP4430 13 [user@host ~]$ mount /dev/root on / type ext3 (rw) proc on /proc type proc (rw) . Set the bootargs setenv bootargs 'console=ttyO2.. Insert the MMC/SD card to the custom OMAP4EVM and power on the board and issue the following commands on boot loader command prompt 1. In /L27. the Android desktop should be visible.The following command will copy the Android file system into the file system partition of the eMMC card. Figure 1: Main Android Gingerbread Screen July 2011 TLV320AIC326x Android Integration for PANDA-AIC OMAP4430 15 TLV320AIC326x Android Datasheet July 2011 Drag up the lock icon to unlock the screen. $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 TLV320AIC326x Android Datasheet July 2011 5 Android on PANDA-AIC OMAP4 EVM On successful programming of the MMC/SD card.uhelper=hal) [user@host ~]$ TLV320AIC326x Android Datasheet July 2011 $sudo cp –R /out/target/product/pandaboard/data.nosuid. run boot Android should come up and the user should see the startup screen of Android. To boot the image from the MMC/SDCARD. 5..nosuid.uid=500) /dev/sdc1 on /media/disk-4 type ext3 (rw. Figure 2: Android Screen after the user unlocks the device July 2011 TLV320AIC326x Android Integration for PANDA-AIC OMAP4430 16 TLV320AIC326x Android Datasheet July 2011 Bring up the Applications Screen by clicking on the square shaped icon seen at the .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 .uhelper=hal.nodev.shortname=lower. issue following command setenv bootcmd 'mmcinit 0.

Ensure that the MIC-Input has been enabled from the Audio Driver (This is enabled by default).middle of the tab.2 Music Player Initiate the Music Player by clicking on the Music icon on the Application icons. During Playback. On successful launch. Once the Recording starts. the Time-stamp keeps increasing to denote that recording is in progress and when the user is done with the Audio Recording.3 Sound Recorder Initiate the Sound recorder by clicking on the Sound Recorder icon on the Application icons. Figure 7: Sound Recorder Application in Android Before executing the Start/Record button on the Sound Recorder Application. it is possible to play-out the recorded file. Figure 4: MUSIC Application in Android July 2011 TLV320AIC326x Android Integration for PANDA-AIC OMAP4430 18 TLV320AIC326x Android Datasheet July 2011 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. On successful launch. the user will be presented with the default screen of the Music Player. After the stop button is pressed. 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 TLV320AIC326x Android Datasheet July 2011 5. July 2011 TLV320AIC326x Android Integration for PANDA-AIC OMAP4430 20 . the user will be presented with the default screen of the Sound recorder. It is required to provide an Audio Input source and then start the Record button. the Stop button can be pressed. Figure 3: Android Application Screen July 2011 TLV320AIC326x Android Integration for PANDA-AIC OMAP4430 17 TLV320AIC326x Android Datasheet July 2011 5.

Sign up to vote on this title
UsefulNot useful