From: Takashi Iwai Subject: Re: alsa-devel-basic Date: Mon, 14 Mar 2005 16:13:14 +0100 Message-ID: References: <20050314124054.54237.qmail@web21205.mail.yahoo.com> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII In-Reply-To: <20050314124054.54237.qmail@web21205.mail.yahoo.com> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: _R3D__5T4R_ Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Mon, 14 Mar 2005 04:40:53 -0800 (PST), _R3D__5T4R_ wrote: > > i'm a student of computer engineering and information, > and i planning to make an net application using an > audio, it's like VoIP, for my paperwork. > > The problem is, even if i'm not new in programming > but, for audio programming i don't have any idea. > There is some basic that i don't know. > > - what is rate, period time, period size, period, tick > time in *hw_params* means ? and what is used for ? hw_params are the essential settings for performing PCM transfer. At least, rate, format, channels, period_size (or time), buffer_size (time, or nperiods) must be defined. rate = sample frequency, usually in Hz. period = the period of interrupts DMA generates. Usually, a hardware buffer is set up as a certain number of (continuous) data chunks with equal sizes defined as period_size. (i.e., buffer_size = nperiods * period_size.) When the hardware processes period_size samples, it should generate an IRQ. ALSA introduces the term "frame" to indicate the unit size to determine buffer and period sizes. 1 frame is defined as sample_bytes * channels. For example, with 2-channel 16bit samples, 1 frame corresponds to 4 bytes. You don't need tick_time. Forget it :) > - what is xfer_align, start treshold, stop treshold, > silence treshold in *sw_params* mean ? > and what is used for ? sw_params are additional optional settings. Skip this at first. If you face a problem that needs special tuning (e.g. delaying the DMA start, ignoring XRUN, etc.), check this again. > - if i want to delay input (capture) and output > (playback) for a milisecond what function must i used > ? can both of delay (I/O) be different ? No special ALSA API for delay lines. You need to do it by yourself. If you mean to program a low-latency full-duplex audio, you'd better to check JACK rather than writing directly with ALSA API. Takashi ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click