18-09-2012, 04:14 PM
TMS320DM365 Preview of Codec Porting on Linux
Codec porting on linux.pdf (Size: 99.15 KB / Downloads: 17)
ABSTRACT
TI codec software was traditionally run on a DSP, which had DSP/BIOS™ software kernel foundation as
an operating system. With the new range of upcoming SOCs, where the architecture is getting more
hardware accelerator centric, the use of digital signal processing (DSP) is reduced. The codec can
operate directly from the main processor, which also hosts the primary operating system. Therefore, the
interaction of codecs with operating system integrities becomes inevitable. DM365 is one such where the
Host ARM926 runs the operating system and application and also has a portion of codec software. This
application report discusses in detail the various steps to make the codec work in such an environment. It
considers Linux® as the operating system running on the Host ARM926. This application report is written
with respect to the DM365 codec and software architecture, but would also be helpful to users who want
to port their Code Composer Studio™ standalone/other OS-based codec/algorithm on Linux on DM365 or
related platforms.
Introduction
DM365 is a digital multimedia SOC that is primarily targeting video security, video conferencing, PMP and
other related applications. It has an ARM subsystem, two video co-processor sub-systems and scores of
peripherals. This application report is also helpful to users who want to port their Code Composer Studio
standalone/other OS-based codec/algorithm on Linux. For more details, see the TMS320DM365 Digital
Media System-on-Chip (DMSoC) Data Manual (SPRS457).
As part of the software offering in the DM365 digital video software development kit (DVSDK), the ARM
subsystem hosts a wide range of codec and integrated sample demo application running on Linux.
Codecs are important components in the overall software ecosystem. Many times the codec and
application run on Linux, which is an open-source operating system that comes with a reasonable
licensing agreement.
This application report discusses the various issues and points of porting a codec on Linux.
DM365 Software Architecture
The DM365 DVSDK consists of multiple components stitched together in a demo application. It includes
Linux as the operating system, device drivers, codecs, framework component and a demo application.
Overview
DM365 codecs running on Linux interact with FC for resource allocation and fulfilling its operating system
specific needs. The framework component, in turn, interacts with the operating system drivers using Linux
utilities making the codec implementation operating system agonistic. Figure 1 explains the interaction of
codec related software components in the Linux system.
Virtual and Physical Address
All software running on Linux operates in virtual address space. But the HDVICP ARM968 or the IMCOP
sequencer would need addresses in physical space for its operation. Similarly, DMA param space also
needs source and destination addresses in physical space. Therefore, you need to maintain dual address
space in the codecs.
Memory access that needs virtual address:
• Code running on ARM926 and doing memory access using CPU
Memory access that needs physical address:
• DMA source and destination on both ARM926 and ARM968
• All memory access in ARM968
When HDVICP, VICP or EDMA resources are requested by framework components, it provides
virtual-base address pointers for these resources. To facilitate getting the physical address of the various
addresses, framework component provides an API that converts physical address to virtual address.
• API to convert virtual to physical address: * void MEMUTILS_getPhysicalAddr(* void)
For an optimized implementation, whenever possible, it is advisable to store all the needed physical
address in some internal data structure so that multiple calls to this API are avoided, as the API intern
calls the Linux system call is more cycle consuming.