# Include "ALSA/asoundlib. H"
// 11 kHz support, longer audible time, slower sonic speed# Define sample_rate 48000// # Define sample_rate 11000
// It is indeed a two-channel Interaction# Define Channels 1// # Define channels 2
// If latency is too small, it will cause snd_pcm_writei () to lose voice data, resulting in the short write Phenomenon# Define latency (1000000) // 1sec
# Define nblocks 16# Define block_size 1024Unsigned char buffer [nblocks *
audio subsystem. This allows for automatic power up/downOf speaker/HP amplifiers, etc. Codec pins can be connected to the machines jackSockets in the machine init function. See soc/pxa/spitz. c and dapm.txtDetails.The machine driver can expand the decoder's power image to become an audio power image of the Audio Subsystem. This allows automatic disconnection of sources such as speakers/HP amplifiers. The decoder pin can be connected to the machine plug-in the machine initialization function. Fo
. The clock strictly works on the sampling rate.
Bit Clock can be generated as follows :-Bit Clock can be generated as follows:
Bclk = mclk/x
Or
Bclk = LRC * x
Or
Bclk = LRC * channels * Word Size
This relationship depends on the codec or soc cpu in particle. In generalIt is best to configure bclk to the lowest possible speed (depending on yourRate, number of channels and word size) to save on power.This relationship depends on the decoder, especially the on-board processor. In general, it is be
ASOC (ALSA system on Chip)//The Sound management architecture specifically developed for embedded systems [Luther.gliethttp].Digital Audio Interface (DAI) types/* SoC Machine * *struct Snd_soc_machine {//Snd_soc_machine set CPU internal audio control logic and CPU external audio decoder chip communication logic in one [Luther.gliethttp]....//audio machine driver represents the audio device structure, my ep9312 as a ARM-SOC chip,Is the machine here, a
1. Open the device
snd_pcm_t *handle;
/* Open PCM device for playback. *
rc = Snd_pcm_open (handle,
"Default",
snd_pcm_stream_playback, 0);
The IF (RC
2. Non-blocking writing (in general, the blocking way to write code is good, ALSA inside has been written, do not do it yourself retry operation)It means to try again after a while.
int rc = Snd_pcm_writei (handle, buf, N/4);
printf ("Done.") rc=%d\n ", RC);
while (RC
The third parame
Some experiences of installing the alsa sound card driver in Linux are expected to help those who fail to install the driver-Linux general technology-Linux technology and application information. The following is a detailed description. Which of the following is my personal information? Maybe you only have one thing missing, or more, double or totally different situations, however, I still hope that the following content will help you a little bit. (I
When using ALSA for audio playback, the following error is always reported when you exit the program:
Pcm_plug.c: 67: snd_pcm_close: assertion 'plug-> gen. Slave = plug-> req_slave 'failedaborted
After finding a circle on the Internet, there are two solutions:
1. Upgrade ALSA. It is said that this error is often reported in version 1.0.14. You can upgrade it. My account is 1.0.23, which is obviously no
one important concept in ASOC: Kcontrol, unfamiliar readers need to browse through my previous article: Linux ALSA sound card driver Four: control device creation. Typically, a kcontrol represents a mixer (mixer), or a MUX (multi-channel switch), or a volume controller, and so on. As we know from the above article, defining a kcontrol is primarily about defining a snd_kcontrol_new structure, which, for the sake of discussion, is again given its defin
for a DAI.
* *
struct Snd_soc_dai {
const char *name; /* DAI's name * *
struct device *dev; /* Device Pointers
/* Driver ops
/* struct snd_soc_dai_driver *driver; /* The pointer to the DAI drive structure
////* Dai Runtime Info *
/unsigned int capture_active:1; /* stream is in use
/unsigned int playback_active:1; /* stream is in use
//* DAI DMA data
/void *playback_dma_data; /* for managing Playback DMA
/void *capture_dma_data; /* Used to manage capture DMA
/* Parent PLAT
Environmental ubuntu12.04
Because the desktop version of the default installed, and the sound is also very convenient, here is the server version of the configuration, after all, do the development often or with the server version of
1. Installation
Apt-get Install Alsa-base It will also be a piece of alsa-utils, this is a toolkit, if not installed directly apt-get install
2. Configure
The sound defaul
After upgrading the Gentoo sound is gone, decided to reorganize the sound card driver (formerly used OSS).
After a few days of struggle is loaded, record some of these small details.
Gentoo official documentation on ALSA:
Www.gentoo.org/doc/en/alsa-guide.xml
Native information: kernel:2.6.30 arch:x86_64 sound card: Audio Device:ati Technologies INC SBx00 Azalia (Intel HDA)
So my driver is Intel HDA.
First
Linux ALSA Audio Driver Six: machine in ASOC architecture
As we mentioned in the previous section, ASOC is divided into machine, platform and codec, where the machine drive is responsible for coupling between platform and codec as well as parts and equipment or board-specific code, Again, refer to the previous section: The machine driver is responsible for handling some of the machine-specific controls and audio events (for example, when audio is pla
Statement: This Bo content by Http://blog.csdn.net/droidphone Original, reproduced please indicate the source, thank you. 1. struct Snd_card
What's 1.1 snd_card?
Snd_card can be said to be the entire ALSA audio-driven top-level of a structure, the entire sound card software logic structure began in the structure, almost all the sound-related logic devices are under the management of Snd_card, the sound card driver's first action is usually to c
The objective of ASoc design is to provide better ALSA support for the embedded system chip processor audio unit or external audio decoding chip.
ASoC has multiple components to form snd_soc_platform/snd_soc_codec/snd_soc_dai/snd_soc_card and ALSA snd_pcm
Snd_soc_platform and snd_soc_codec are indispensable for the relationship between the platform and the device. snd_soc_card is an object of their instanti
Article Title: Experience in installing the Alsa sound card driver in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I. Linux kernel source (the core source code of the system)
Enter ls-a/usr/src/linux on the terminal or console to check whether there are any such problems. The config file exists. If not, d
Alsa sound card configuration problems-general Linux technology-Linux technology and application information, the following is a detailed description. Hello everyone! I used debian4.0, but the sound card was not configured after the system was installed.
As a result, I used the alsaconf command to configure the sound card:
Debian:/home/thorne # alsaconf
Unloading ALSA sound driver modules: (none loaded )
header variables: codec_list, Dai_list, platform_list, all codec, Dai, and platform in the system are connected to these three global lists when registering. The Soc_bind_dai_link function scans each of these three lists, according to the names in card->dai_link[], and assigns the corresponding Codec,dai and platform instances to the card->rtd[ ] in (snd_soc_pcm_runtime). After this process, Snd_soc_pcm_runtime: (CARD->RTD) saves the Codec,dai and platform-driven information used in this mach
This paper is based on mstar801 platform Linux2.6.35.11 kernel.
First, ALSA drive to create a sound card process
1. Create sound card
Snd_card_create (Linux2.6.30 and later APIs), Snd_card_new (Linux2.6.30 previous API).
Description: First step to create a sound card2. Create a PCM device and add a sound card
int snd_pcm_new (struct snd_card *card,const char *id,int device,int playback_count,int capture_count,struct SND_PCM * RPCM);
Description: Param
;id.name)))continue;if (kctl->id.index > id->index)continue;if (kctl->id.index + kctl->count
When we continue to track the android audio system today, we find that no matter what the connection between Android and snd_kcontrol is found, whether it is the name or numid (numid printed by alsa_amixer controls, that is, the numid of the snd_kcontrol linked list element in the kernel layer. However, it can be used to adjust the volume. Later, I modified the codec driver of the kernel, changed the k
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.