节点文献
嵌入式音频播放系统设计与实现
Design and Implementaion of Embedded Audio Player System
【作者】 张波;
【导师】 王澄;
【作者基本信息】 上海交通大学 , 通信与信息系统, 2009, 硕士
【摘要】 嵌入式系统以应用为中心,以计算机技术为基础,并且软硬件可裁剪的专用计算机系统。嵌入式系统一般由嵌入式微处理器,外围硬件设备,嵌入式操作系统以及用户应用程序四个不同组成,用于实现对其他设备的控制,监视或者管理等功能。本文实现的是在嵌入式平台上完成音频播放系统的方案,根据以ARM9为核的嵌入式SoC,本文按照软件体系提出了硬件基础之上的整个软件方案,包括底层设备驱动,中间层任务管理,上层应用程序。并对于应用层的解码程序进行的性能优化。本文采用链接脚本的方式对设备驱动进行注册,所有驱动采用结构体注册的方式管理,任何上层的调用都通过驱动的调用接口来调用驱动结构体注册的函数。本文提出了特定的任务管理系统的设计,设计了任务管理结构体,包括此任务的初始化资源,运行函数,私有资源管理,任务进入退出处理等,所有的结构体采用任务结构体链的方式进行管理,各个链表代表不同的状态进行不同的管理,任务状态的切换实质上是转移任务结构体到相应的任务链表。本文的内存管理对不同类型的内存分别设定独立的内存池,内存池内部的内存分配方法采用循环首次适应法。本文分析了音频硬件的特征,根据硬件特征设计了音频多缓存驱动,多缓存通过中断进行衔接能够轮流接收上层数据,同时负责数据的输出。本文针对硬件的噪声问题提出了软件的空缓存解决方法,即在初始化硬件的时候,用零数据进行传输,因而可以最大程度减小电平变化,进而达到去除噪声。解码程序是实现音频播放的应用程序,本文将开源的解码库移植到自行设计的任务管理系统平台上完成了MP3的解码,并对其解码性能进行了优化,优化的依据和方向一是根据嵌入式硬件的特点对MP3解码过程中的关键数据进行读写加速,二是引入ARM9中的乘加指令,对计算复杂度很高的解码程序进行汇编优化。依靠上文所述的软件平台的实现,经过对音频播放性能进行对比,优化后与优化前的解码性能有了较大的提升。
【Abstract】 The embedded system is a computer system which is oriented to application, based on computer technology, and can be configured in software and hardware. The embedded system is usually composed by four different parts, the embedded microprocessor, the hardware device, the embedded operating system and the application program. It is used for controlling, surveying and managing other devices. This paper describes the finish of the audio playing solution on a embedded platform. On the basis of a SoC with core of ARM9, this paper gives the software structure above the hardware, which includes the bottom device driver, the mesosphere task management and the application program. And this paper gives the optimization method of decoding program.First, in this paper, the device registration is implemented using the linking script, and all the devices are managed through the device structure registration. Any call of device function from the application should use the registered device structure. This paper gives a task management system design and designs task management structure which includes the initial recourse, running functions, private resource and the task in and out disposal, and all the task structure is under the administration of the task chain, different chain means different task status, so the task status switching in fact need transfer the task structure to corresponding chain. In this paper, the management of different type memory depends on independent memory pools, inside the memory pool, the memory allocation method is the next fit method.In this paper we analyze the character of hardware and then design the multi buffer audio driver according to the hardware. The multi buffers get the data from the caller of driver and then put the data out, different buffers are connected by the interrupt when one buffer finished. For the noise from hardware, This paper gives the software solution of empty buffer, that is when the hardware initialized, we first transfer zero data, thus the voltage to hardware can be stable, and the noise is diminished.The decoding program is the application of audio playing, this paper transplant the open source code to our task management to complete the MP3 decoding, and optimize the performance of decoding. The optimization concerns to two aspects. First according to the embedded hardware, we accelerate the read and write speed of key data in MP3 decoding. Second, we use the ARM9 multiply-accumulation instruction to optimize the code which focuses on add and multiply computing, and replace the original c code with assembly code. Thus, with the software platform implemented above, on the comparison of audio playing, the decoding performance after optimization has a significant improvement.
【Key words】 embedded; driver; task management; task structure chain; audio decoding; multiply-accumulation instruction;