国产日韩欧美一区二区三区三州_亚洲少妇熟女av_久久久久亚洲av国产精品_波多野结衣网站一区二区_亚洲欧美色片在线91_国产亚洲精品精品国产优播av_日本一区二区三区波多野结衣 _久久国产av不卡

?

Design of a Linux Audio Driver Based on the SEP6200*

2014-09-26 08:58YANGLiyuanWANGPengWUXiaofeiLINGMing
電子器件 2014年2期
關(guān)鍵詞:嵌入式碩士音頻

YANG Liyuan,WANG Peng,WU Xiaofei,LING Ming

(National Engineering Research Center for ASIC,Southeast University,Nanjing 210096,China)

Design of a Linux Audio Driver Based on the SEP6200*

YANG Liyuan*,WANG Peng,WU Xiaofei,LING Ming

(National Engineering Research Center for ASIC,Southeast University,Nanjing 210096,China)

Currently,embedded devices has penetrated every aspect of people’s lives,but embedded devices based on domestic CPU core SOCs are still in their infancy.SEP6200 processor designed by Southeast University National ASIC Engineering Research Center is a self-developed high-performance SOC chip using Unicore core architecture of Peking University.This new Linux audio decoder driver has been proposed and designed,which is based on the hardware of SEP6200,CS3700 and software of ALSA,ASOC architecture.We port the MPlayer to the platform,in order to achieve sound and make recording test.Experiments show that the driver system runs on the platform of SEP6200 steadily and achieve the desired results.

embedded;Unicore;Linux;SEP6200;ALSA;ASOC;audio driver

Now,various electronic products based on embedded technologies,including MP3,MP4,Smart Phones,Tablet PCs etc,have been widely used in our daily life.Domestic CPU core based on electronic products is still in their infancy,so the autonomous SOC(System On Chip)SEP6200 based the CPU of unicore must promote the development of China-made electronic products.Current traditional audio driver system is mostly designed and developed based on the ARM family CPU cores.Unicore CPU as a domestic self-developed processor core is different from the ARM architecture,so the audio system based on the hardware platform of SEP6200 must be re-designed and developed.The purpose of this paper is to design and implement a linux audio driver system that can run on the platform of SEP6200 and CS3700 steadily.Through porting MPlayer to the platform,both playback and recording can achieve stable results which prove that the system works properly.

1 Hardware Design

1.1 SEP6200

SEP6200[1]is independently developed by National Engineering Research Center for ASIC of Southeast University.SEP6200 uses unicore of Peking University as the kernel.It has a 32 high-performance RISC core,up to 800 MHz,supports floating point unit;has a 16-bit SRAM/ NOR Flash interface,supports to boot from Nand;has 16/ 32-bit DDR2/DDR3 interface;maximum supports 512 MB,800 MHz bit rate;supports MPEG 1/2/4/H.264/Divx/RV/AVS/VC1/VP6/7/8 and other formats;up to1 920×1 080 resolution;supports color TFT LCD,supports 16,18,24 bit RGB output;integrated HDMI Transmitter,compatible with HDMI 1.3 specifica-tion.It has 1-way USB2.0 OTG controller,2-way SDIO interface,3-way SPI interface,4-way UART interface,I2C interface,I2S interface,I2S interfaces,16-way GPIO interface;16-channel DMA,2-channel DMA.It uses digital chips TSMC 65 nm LP process,TFBGA package.

1.2 Architecture Design

CS3700 is a low power,high-performance audio decoder chip.It is often used for portable multimedia electronic products.It can provide high quality audio,while eliminating the use of large-capacitor headphones.It not only can perform basic D/A and A/D conversion function,but also audio controlling and digital signal processing functions.It supports I2S[2]bus data format.The audio system hardware framework shown in Fig.1.

Fig.1 Hardware architecture

SEP6200 is connected with the audio decoder chip CS3700 via I2C and I2S bus.The principle of playing audio:SEP6200 transmits control signal to the CS3700 through I2C,configuring some register value of CS3700,while the audio signal is transmitted through I2S.CS3700 completes audio signal D/A conversion.The analog signal is played back through a microphone.Recording has used the same principle.It is the inverse process of playback.

2 Audio Software System

2.1 ALSA system architecture

Before ALSA(Advanced Linux Sound Architecture)[3]audio system,OSS(Open Sound System)[4]audio system has been developed for a long time and is very mature.But it is still a commercial product that is not completely open source,and has been largely lost in the Linux mainline updates.ALSA just to make up the deficiencies of OSS.It is a completely open source audio system,compatible with GPL.It is an alternative sound card driver architecture.

Compared with OSS,ALSA in addition provides a set of kernel driver modules,and also provides a rich interface function library ALSA-lib[5]to simplify the preparation of applications specifically.Compared to the original ioctl-based programming interface provided by OSS,ALSA-lib library is more convenient and more abundant in use.In linux2.6 kernel,ALSA has become the default sound subsystem,used to replace OSS in the linux2.4.

ALSA’s main features are as follows:

(1)Supporting all audio interfaces from consumer sound cards to professional sound equipment;

(2)Modular kernel driver;

(3)Supporting for symmetric multiprocessing(SMP) and multithreading;

(4)Providing a rich application development library to simplify application development;

(5)Supporting OSS API,compatible with OSS applications.

ALSA system can be roughly divided into the driver package(alsa-driver)and development package(alsalib).The alsa-driver[6]is divided into the core layer and the hardware-related underlying hardware layer.Usually,we only need to port the underlying hardware layer. The realization of the core layer can isolate from underlying hardware.It belongs to the ALSA standard framework,and does not require developers to implement their own transplants.Framework is shown in Fig.2.

2.2 ASOC Driver Design

The audio system uses ASOC(ALSA System on Chip))framework.ASOC[7]is the development and evolution of ALSA audio system in SOC.So it still belongs to ALSA in essence.But it separates the CPU-related code framework,making ASOC framework for better portability.

Fig.2 ALSA architecture

ASOC is mainly composed of three parts:

(1)Codec driver This section is only concerned about Codec itself,characteristics associated with the CPU platform has nothing to with this part[8];

(2)Platform driver This part is related to the CPU platform,and has nothing to do with Codec.it mainly deals with two problems:DMA engine and PCM,I2S control integrated in SOC[9];

(3)Board-level driver(also known as machine driver)This part binds the platform-driver and Codec driver,describing the board-level hardware features specifically[10].

These three parts are ASOC core layers,they come true by kernel/sound/soc-core.c in the kernel source. In the case of sound card driver based on ASOC framework,ALSA-libs as well as a series of utility are still available.

2.3 ASOC Driver Registration

Firstly,it enters by the function of snd_soc_init() in the ASOC driver core layer.Then,it calls the platform driver registration function platform_driver_register(). Secondly,it probes the driver by the function of soc_ probe().after probed the driver,it register card driver for the core layer[11],achieving by the function of snd_ soc_register_card().After registering the core sound card,it begins to detect the hardware in three parts:

(1)Board-level detection By the function of sep0611_board_probe()to complete,it is responsible for setting the Codec’s gpio,enabling the codec,checking the headphone plug,setting the speaker and headphone;

(2)I2S detection By the function of sep0611_i2s _probe()to complete,it is responsible for setting i2s,dma initialization,application for dma interruption;

(3)Codec detection By the function of cs3700_ probe()to complete,functions called by it include i2c_ add_driver(),cs3700_i2s_probe and cs3700_init().

Function cs3700_init()mainly completes for three things,function snd_soc_new_pcms()registers the stream of pcm;snd_soc_init_card()registers card,which includes two devices:control device and pcm device; sep0611_cs3700_init()completes cs3700’s hardware initialization.

Static void sep0611_cs3700_init(struct snd_soc_codec*codec)

An important structural body sep0611_i2s_dai needs detailed explanation.All operations to codec of I2S are with this structure as objects,including the probe,suspend,resume and other operations.It specifies the minimum and maximum number of channels,sample rate and data format when it reads and writes data.

Contents with“sep0611”is closely related to SOC chip,they are underlying driver that must be implemented by yourself.

2.4 Process of Writing Data

Applications write data by calling API function and_ pcm_write()in ALSA-lib,then wait the function snd_pcm _wait()to be called by ALSA-lib.After the bottom can be written,it comes into the ALSA-driver underlying driver by calling the poll system,poll signal enters the sleep queue blocking process[12].Interrupt signal of hardware triggers interrupt handler registered in ALSA-driver layer. Interrupt function then calls the related functions in ALSA-driver to determine whether to write data.ALSA-driver needs to do two things at this time:first,call the underlying hardware drivers to get the hardware current data size;secondly,determine the size of the idle data area.After completed,if it satisfied the condition,awaken the sleep queue,awaken the poll signals,and finally return to the ALSA-lib.After ALSA-lib signal is received,the data will be written into buffer.

Data read is controlled by a DMA transfer[13].ALSA-lib map memory applied by hardware to user space through the mechanism of mmap.After the application write data to a memory space,hardware is able to read the data directly.When there is data in map memory,DMA performs related actions,transmitting data to codec.Codec begins to play a sound decoding after reading data.These are the details writing and playing the audio on the layer of a user process.Reading and recording process is similar,just the API functions called by applications are different.

3 Conclusion

After experimental tests,in linux2.6.32 system,using SEP6200 and CS3700 as the hardware platform,this audio driver based on ASOC architecture works properly.

Two-channel differential input,and mono input have achieved recording;single-channel stereo output and two-channel output have achieve a normal playback.At present,the driver has been successfully applied in embedded system based on SEP6200 and CS3700,and stable,reaching the expected results.

Refereces:

[1] SEP6200 User Manual.

[2] Zhou Peng,Wang Cheng, ,et al.Design of WM8976 Audio Driver Based on ALSA[J].Journal of WUT(Information and Management engineering),2011,33(4):517-520.

[3] Zhou Peng,Wang Cheng,et al.Design of WM8976 Audio Driver Based on ALSA[J].Journal of WUT(Information and Management Engineering),2011,33(4):517-520.

[4] Jaya Kumar,Liam Girdwood.ALSA,OLPC Audio and ASoC/DAPM. 2006.https://foss.in/2006/cfp/slides/ALSA_and_OLPC_audio _82.pdf.

[5] Liam Girdwood.Alsa for System on Chip.2006.https://www.embedded-kernel-track.org/2006/ASoC.pdf.

[6] Sreekrishnan Venkateswara.Essential Linux Device Driver[M].1st E-dition.New Jersey:Prentice Hall,2008.

[7] Ding Yong,Zhou Yu,Du Sidan.on Linux 2.6 Based Embedded ASoC Audio Driver and Its Implementation[J].Computer Applications and Software,2010,27(4):267-270.

[8] <linux-2.6.32>/Documentation/sound/alsa/soc/Codec.txt.

[9] <linux-2.6.32>/Documentation/sound/alsa/soc/platform.txt.

[10] <linux-2.6.32.>/Documentation/sound/alsa/soc/machine.txt.

[11] Qian Hong,Hu Chen.Design and Implementation of Audio Driver Based on Audio Codec’97 for Embedded System[J].Chinese Journal of Electron Devices,2006,29(02):500-504.

[12] Corbet J.Alessandro Rubini Linux Device Drivers[M].Sebastpol: OReilly and Associates,2005:137-142.

[13] Yu Yue,Yao Guoliang.Design and Implementation of Audio Driver for Embedded Linux System[J].Chinese Journal of Electron Devices,2008,31(2):709-711.

楊鯉源(1988- ),男,碩士研究生,主要研究方向為嵌入式系統(tǒng)設(shè)計,Linux驅(qū)動設(shè)計,SOC異構(gòu)計算;

吳曉飛(1990- ),男,碩士研究生,主要研究方向為嵌入式系統(tǒng)設(shè)計,GPU訪存特性研究

王 鵬(1988- ),男,碩士研究生,主要研究方向為Linux應用開發(fā),DDR控制器調(diào)度算法研究;

凌 明(1972- ),男,副教授,主要研究方向為嵌入式實時操作系統(tǒng)、SOC設(shè)計方法學、SOC存儲子系統(tǒng)設(shè)計。

基于SEP6200的LINUX音頻驅(qū)動設(shè)計*

楊鯉源*,王 鵬,吳曉飛,凌 明

(東南大學國家專用集成電路工程研究中心,南京210096)

當前,嵌入式設(shè)備已經(jīng)深入人們生活的各個方面,但基于國產(chǎn)內(nèi)核的SOC嵌入式設(shè)備尚處于起步階段。SEP6200是由東南大學國家專用集成電路工程研究中心采用北大UNICORE內(nèi)核架構(gòu)自主設(shè)計研發(fā)的高性能SOC芯片,我們提出并設(shè)計了以SEP6200及CS3700芯片為硬件基礎(chǔ),詳細介紹了ALSA及ASOC軟件架構(gòu),并以此為基礎(chǔ)設(shè)計了LINUX系統(tǒng)音頻驅(qū)動。通過在平臺上移植MPLAYER播放器,以實現(xiàn)放音及錄音測試,實驗表明該驅(qū)動系統(tǒng)在SEP6200平臺上運行穩(wěn)定,達到了預期效果。

嵌入式;Unicore;Linux;SEP6200;ALSA;ASOC;音頻驅(qū)動

TN713

A

1005-9490(2014)02-0266-04

2013-11-09修改日期:2013-12-04

EEACC:8510;1210

10.3969/j.issn.1005-9490.2014.02.021

項目來源:“核、高、基”國家科技重大專項項目

猜你喜歡
嵌入式碩士音頻
昆明理工大學工商管理碩士(MBA)簡介
必須了解的音頻基礎(chǔ)知識 家庭影院入門攻略:音頻認證與推薦標準篇
基于Daubechies(dbN)的飛行器音頻特征提取
如何寫好碩士博士學位論文
搭建基于Qt的嵌入式開發(fā)平臺
音頻分析儀中低失真音頻信號的發(fā)生方法
嵌入式軟PLC在電鍍生產(chǎn)流程控制系統(tǒng)中的應用
Pro Tools音頻剪輯及修正
改進碩士研究生解剖教學的探索丁
Altera加入嵌入式視覺聯(lián)盟
民乐县| 天峨县| 潼南县| 石阡县| 宜兴市| 大理市| 克东县| 玛曲县| 双城市| 琼海市| 尖扎县| 司法| 二连浩特市| 新宾| 清水县| 玉田县| 锦州市| 北海市| 水城县| 吉首市| 宁德市| 伊金霍洛旗| 鄂伦春自治旗| 长子县| 庄浪县| 武冈市| 古交市| 云南省| 阿拉善盟| 大英县| 苏尼特左旗| 呈贡县| 四子王旗| 广汉市| 南投市| 松阳县| 都江堰市| 万全县| 大港区| 乐亭县| 称多县|