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]
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.
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
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MSP430G2 LaunchPad, how to play music with buzzer
- Disassemble a WSN node device and see how to select materials?
- Allwinner V853 heterogeneous multi-core AI intelligent vision development board review - V853 YOLO V3 test
- TMS320F28335 Study Notes——DMA
- RISC-V MCU Development (Part 2): Project Creation and Management
- What is this DC to AC circuit called a power supply circuit?
- MSP430 analog-to-digital conversion module--ADC12
- TPA3245 series amplifier problem
- EEWORLD University Hall----Live Replay: Application of TI Sitara? Products in Smart Grid
- [LDO common terms 1] line regulation and load regulation