Linux sound card driver porting and testing

Source: Internet
Author: User

I. Analyze the driver and change the code according to the Development Board

Code is too long, it is not affixed, a few points to note:

1, view the Development Board schematic diagram and s3c2410 datasheet,uda1341 l3mode, L3data, L3clock respectively and s3c2410 GPB2, GPB3, GPB4 connected. IISLRCK=GPE0, Iissclk=gpe1, Cdclk=gpe2,iissdi=gpe3, Iissdo=gpe4, part of the code such as the following:


2, two important structures: audio_buf_t and audio_stream_t, in which audio_stream_t composed a ring buffer for audio stream data;


3, file_operations structure. The underlying implementation of functions such as open (), write (), read (), IOCTL (), release ().



4, the principle of DMA;

5, driving loading and unloading, etc.;

Second, add a sound card driver to the kernel

1. Configure the sound card options in the kernel;

Note: The driver for UDA1341 is S3C2410-OSS.C under the linux/sound/oss/folder (Kernel version number: Linux-2.6.8.1).

Enter make menuconfig under the kernel tree folder to jump out of the kernel configuration interface:


Then press the down navigation key of the keyboard and pull down to the sound option:


Press ENTER to enter the Sound Options screen:


Select the "Open Sound System" option and enter the OSS options interface:


Select Open sound System (DEPRECATED) and s3c2410 audio support, respectively, by space. Save the configuration information until the option is changed to * in front <>, then press TAB to exit:


PS : * indicates that the driver is compiled into the kernel, and Null indicates that the driver is not compiled. M means that the driver is compiled into a module.

2, compile kernel, generate kernel image zimage;

Under the Kernel Tree folder, enter the command make Zimage, which will generate the Zimage file under the linux/arch/arm/boot/folder after successful compilation.

3, open the Sambaserver, the kernel image zimage share to the Windows platform, and then through the DNW software will zimage download to the Development Board;

After the above steps, the sound card driver is successfully added to the kernel.

Third, test sound card

1, start the Development Board, check the sound card equipment;


From the display results can be seen. The driver has successfully registered a two-character device in the kernel: the main device number for the DSP and MIXER,DSP is 14. The secondary device number is 3;mixer's main device number is also 14. The secondary device number is 0.

2. Check if the sound card can be recorded and played normally;


Create a temporary directory audio. Use the command to implement recording, generate audio file audio.wav. Use the command to achieve playback, through testing, found that the sound card is working properly.


Problems encountered:

When testing the sound card, there was an error "Cat:read Error:illegal seek".

The workaround:

Modify the sound card driver to stare at some of the code in the driver's Smdk2410_audio_read function, such as circled in red.


Note: Change driver after the need to compile the kernel again. Generate the Zimage file and download it to the Development Board.

June 13, 2014 Friday 16:23

Linux sound card driver porting and testing

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.