Digital multi-channel voice recorder based on ARM9 processor S3C2410

Publisher:之敖赵先生Latest update time:2011-06-06 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

Digital multi-channel voice recorders have many applications in security and monitoring. Some traditional design solutions are based on industrial computers, using data acquisition cards to achieve voice A/D conversion and software to achieve voice encoding and decoding. This solution is costly and power-hungry. If an embedded design solution is adopted, the same function can be achieved with low cost and low power consumption.

Ordinary low-cost embedded processors have low performance and are not enough to achieve real-time encoding and decoding of multi-channel voices. A special voice processing chip is required to complete this task. Self-designing a voice encoder based on DSP is one method, but the workload is large. AC48304 is widely used in various small VOIP gateways and is inexpensive, making it a good alternative. At the same time, AC48304 also has functions such as DTMF recognition and silence detection, which facilitates the realization of telephone number recognition and automatic voice recording.

ARM is a widely used embedded processor. ARM processors produced by manufacturers such as Samsung and Atmel have rich interfaces and comprehensive technical support. ARM processors are low-priced and cost-effective. They have replaced a large number of single-chip microcomputer applications and penetrated the market of high-end embedded processors. In this multi-channel voice recorder, Samsung's ARM9 processor S3C2410 is used, and the operating system uses embedded Linux.

2. System structure

The voice recorder includes voice processing module, ARM system module, hard disk recording module, and network interface module. In order to make the system configuration flexible, the system is designed to be divided into two parts: the main control board and the expansion board. 16 voice channels are implemented on the main control board, and a 16-channel voice expansion board is designed. The entire system can expand the voice channel by multiples of 4, up to 32 voice channels. The computer control part integrates the S3C2410 processor, 64MB SDRAM and 16MB FLASH to form an embedded small system.

The voice CODEC uses AMD's LE58QL021, which is a 3.3V single-voltage user line voice processor. It is a common combination of AC48304 in small voice gateways. It supports 4-channel voice AD/DA and E1 PCM Highway, and can achieve seamless connection with AC48304. The working mode of LE58QL021 can be controlled by software programming. ARM sets various working parameters of LE58QL021 through MPI (Microprocessor Interface) serial control bus.

Based on DM9000 network controller, the system realizes 10/100Mbps adaptive Ethernet interface, and Linux operating system provides device driver support. IDE interface is realized by a CPLD, and hard disk is used for local recording of voice. The circuit principle of the main part is shown in Figure 1.



Figure 1 Hardware circuit principle diagram of voice processing module

3. AC48304 voice processor

AC48304 is a four-channel voice processor designed by AudioCodes based on DSP. It supports G series voice encoders with multiple standards and multiple bit rates, such as G.723.1, G.711, G.726 and G.729, and supports T.38 fax relay and other voice signal processing functions. In the system, ARM realizes control and data exchange of AC48304 through CPU local bus. AC48304 and LE58QL021 realize multi-channel digital voice interface through E1 PCM Highway interface. The E1 interface is driven by a 2.048Mhz clock and has 32 8-bit time slots from 0 to 31. The working sequence is shown in Figure 2.



Figure 2 PCM Highway sequence [page]

AC48304 is a dedicated voice processing DSP chip that needs to run the corresponding DSP program. Before normal operation, AC48304 has two programs that need to be downloaded: kernel program and application program. The kernel program is a small program of only a few hundred bytes, which completes the initialization of the DSP and prepares for downloading the application program. The application program completes all the functions of AC48304. The application program can only be downloaded after the kernel program is downloaded. AC48304 has 4 working modes: kernel download mode, program download mode, initialization mode, and running mode. The running mode has two states: idle state and active state. The user can only change the working parameters of the chip in the idle state.

4. Software Design

4.1 Driver Design in Linux

The operating system uses an embedded Linux operating system. Linux has the advantages of high efficiency and small kernel, and it is open source and completely free. Under the Linux operating system, applications cannot directly access hardware. Although Linux has a relatively complete board support package on the ARM platform, the driver design of some devices still needs to be completed in the development of this system, including the AC48304 driver, LE58QL021 driver, S-EEPROM driver, etc.

The device driver should provide the application software with interfaces such as device opening, closing, device control, and data reading/writing, that is, some functions similar to open, close, read, and write. In the main program, the file reading and writing method is directly used to realize the data transmission and reception. The MPI serial control bus is used between LE58QL021 and the ARM processor. The MPI driver interface structure is defined as follows:

static file_operations mpi_ctl_fops = {

ioctl:mpi_ctl_ioctl, //Device control

open:mpi_open, //Open device

close:mpi

_ close, //Close device

}

Linux provides the ioremap function to map the physical address of the I/O memory resource to the core virtual address space, and then data can be read and written like registers. When writing a driver, two functions must be provided. One is module_init(), which is automatically called by insmod when loading this module and is responsible for initializing the device driver. The other function is module_exit, which is called when the module is unloaded and is responsible for clearing the device driver.

4.2 Data reading and writing implementation of AC48304

Each AC48304 can perform voice encoding/decoding of 4 channels at the same time. There is a data buffer area on the chip. The encoded voice data is first stored in the buffer area of ​​each channel and then copied to the output buffer in sequence. Table 1 shows the relevant parameters of several major voice encoding formats supported by this system. Among them, the maximum data volume of G.711 A/u law is 64kbps, and each channel has 8000 bytes of data per second. The effective amount of the data reading area of ​​AC48304 is 80 bytes, that is, 100 read operations are required per second. For each AC48304, 400 read operations are required per second to ensure timely data reading. Since the voice encoding packet is generated at a constant rate, the DSP must be read once every 2.5 milliseconds. In the Linux kernel of this platform,
the time unit of the process scheduling algorithm is 10 milliseconds. It is difficult to ensure timely data reading when executing data reading operations in the process. If a service process or a control operation in this process takes too long to execute, voice data will be lost.

Table 1: Voice data characteristics


The environment in which programs run in Linux is divided into kernel space and user space. The program priority in kernel space is higher than that in user space. To ensure that the encoded data is read in time, the data generated by AC48304 needs to be read regularly in the kernel-level process. There are two ways to add user programs to the kernel space for operation: modify the Linux kernel source code and directly compile the user program code into the kernel; use the Linux module mechanism to dynamically add the user program code to the kernel space for operation. The first method is more difficult to implement and prone to errors. The second method is less difficult to implement and has the same effect as the first method. The second method is used in this system.

The read operation of AC48304 is designed as a driver, dynamically loaded into the kernel using the insmod command, and the data of AC48304 is read in the service function of the timer interrupt. There are 5 user-programmable clock interrupts in S3C2410, with high interrupt priority and programmable interrupt frequency. Clock interrupt Timer3 is used for DMA control, and Timer4 is used for process scheduling. Timer2 is used in the program design of this system. The interrupt frequency of Timer2 is set to 500HZ by configuring the relevant control registers, and the read query operation frequency is appropriately increased to ensure timely data reading. The interrupt service function is executed by the kernel, with a higher priority than the user program, which can ensure the real-time nature of the read operation. A data buffer is allocated for each channel of AC48304. The data read in the timing interrupt function is first saved in the buffer. The user program obtains voice data by reading the buffer. In this way, for external users, voice data is not lost, and the voice delay is at the millisecond level, which can fully meet the needs. [page]

4.3 Application software design

Add the application and driver files to the file system, modify the relevant startup configuration files, so that the target program is automatically loaded when the system is started, so that the application program will be automatically entered every time the device is started. The main program flow is shown in Figure 3. The main functions of the main program are:

u System configuration: The system configuration table is stored in a S-EEPROM, and the configuration table can be configured online through the serial terminal or the network.

u Initialize the system: including downloading the kernel program and application program to the DSP, starting the DSP and LE58QL021, etc.

u Voice data reading and writing: Read DSP data through the DSP's HPI bus to realize voice acquisition, and write data to the DSP through HPI to realize voice playback.

u Data storage: Save the voice data to be recorded to the hard disk according to the recording plan.

u Command processing: including voice channel selection command, playback command, time calibration command, gain adjustment command, configuration table transmission command, recording data upload command, etc.



Figure 3. Main program flow chart

5. Conclusion

This recorder supports up to 32 channels of real-time voice processing, realizes long-term recording on the hard disk, and can realize data upload and management through 10/100Mbps Ethernet. After testing, this recorder can complete the collection, compression, storage, decompression and playback of voice data very well, and the kernel-level user process runs normally, ensuring the real-time performance of the entire system. This voice recorder has the characteristics of low cost, low power consumption, simple structure, and simple use, and has good practical value.

Reference address:Digital multi-channel voice recorder based on ARM9 processor S3C2410

Previous article:Home Gateway System Based on ARM and Clinux
Next article:Design of DC system ground fault detection application based on ARM

Recommended ReadingLatest update time:2024-11-16 22:40

SD storage and applications based on S3C2410
1 Introduction SD card (Secure Digital Memory Card) is a new generation of memory based on Flash. It focuses on the security, capacity and performance of data storage. It is an ideal external storage medium for many portable electronic products such as digital cameras, mobile phones, PDAs, etc. 2 Basic Con
[Analog Electronics]
SD storage and applications based on S3C2410
S3C2410 Clock & Power Management Unit
The clock & power management block consists of three parts: clock control, USB clk control, and power control. Clock control logic  The Clock control logic in S3C2410X can generate the required clock signals including FCLK for CPU, HCLK for the AHB bus peripherals, and PCLK for the APB bus peripherals.  The
[Microcontroller]
S3C2410 Clock & Power Management Unit
S3c2410 touch screen and analog-to-digital conversion
1. Several concepts of touch screen The so-called touch screen, from the market concept, is a computer input device that everyone can use, or a device that everyone can use to communicate with the computer. No need to learn, everyone can use it, which is the greatest magic of the touch screen, whether it is a keyboa
[Microcontroller]
S3c2410 touch screen and analog-to-digital conversion
Overall analysis of the running process of ucos on s3c2410--multitask scheduling and operation
Let's start by explaining the steps when ucos creates a task: 1. Initialize the task stack 2. Initialize the task control block 3. Set the newly created task to the ready state (i.e. set the ready table) We have already talked about the task stack, control block, and ready list mentioned above. Let's take a look at th
[Microcontroller]
Research and Application of Interrupt Programming Mechanism in ARM S3C2410X System
0Introduction ​ In embedded systems, the function of external devices is mainly realized by the interrupt mechanism, that is, the implementation of device function programs is organized in the form of interrupt service subroutines. The interrupt function can solve the waiting delay problem caused b
[Microcontroller]
Research and Application of Interrupt Programming Mechanism in ARM S3C2410X System
Overall analysis of the running process of ucos on s3c2410---two implementation methods of task switching
Take ucos as an example to explain in detail. Ucos is divided into task-level task switching and interrupt-level task switching. Ucos's entire user program and operating system program run in one mode (SVC mode), so task-level task switching can be done without switching the chip's operating mode. The reason for task-
[Microcontroller]
Data Acquisition System Based on S3C2410A and Multiple AD7656-1 Daisy Chain
Introduction    In substation automation systems, it is often necessary to collect and process multiple three-phase voltage and current signals (such as real-time monitoring of power quality). At this time, it is necessary to achieve simultaneous and rapid data collection of multiple signals. The AD7656-1 of Analog Dev
[Microcontroller]
Data Acquisition System Based on S3C2410A and Multiple AD7656-1 Daisy Chain
Design of touch screen driver based on S3C2410
introduction With the popularization of information appliances and communication equipment, touch screens are widely used in life as a terminal medium for interaction with users. How to integrate touch screen modules into the system and implement their drivers in embedded operating systems have become issues that em
[Microcontroller]
Design of touch screen driver based on S3C2410
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号