From alsa-devel-owner@alsa.jcu.cz  Fri Oct  9 20:06:52 1998
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id UAA19525;
	Fri, 9 Oct 1998 20:06:41 +0200
Date: Fri, 9 Oct 1998 20:06:41 +0200 (CEST)
From: Jaroslav Kysela <perex@jcu.cz>
To: Mike Lewis <mlewis@burly.com>
cc: alsa-devel@alsa.jcu.cz
Subject: Re: newbie questions about dsp api
In-Reply-To: <Pine.LNX.3.96.981009100658.8032N-100000@chili.burly.com>
Message-ID: <Pine.LNX.3.96.981009195819.20251G-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Fri, 9 Oct 1998, Mike Lewis wrote:

> Hi.  I've got a few questions about the dsp interface.  If anyone has
> answers, or source code that use these features, I'd be most appreciative.
> 
> For snd_pcm_block_mode(void *handle, int enable), does the enable
> arg take a 0 for disable and 1 for enable?  I tried both values and found
> no difference in blocking.

There is difference.

snd_pcm_block_mode( handle, 0 ) -> when snd_pcm_write() is called and
ring buffer for soundcards is full, driver simply returns to application
result code which means bytes written to ring buffer (this could be
zero for example)

snd_pcm_block_mode( handle, 1 ) - default settings, if ring buffer is full
then driver wait until new data can be written to ring buffer; driver
returns when all data from snd_pcm_write() call is written to soundcard or
some signal is arrived

> For snd_pcm_playback/record_info, what are fragments?  What is the
> relationship between min_fragment_size, max_fragment_size and
> fragment_align?  On my sb16, I get min=32, max=32768 and align=0.

Fragment means some small piece from ring buffer. You must setup minimum
two fragments (one fragment is played and one fragment is filled for
example).

> Related to prev question: what is the strategy for using
> snd_pcm_playback/record_params?  My guess it's for tuning the buffer, but
> don't know.  Could someone explain?

You can setup playback latency and wakeup control by this setup.

> snd_pcm_playback/record_status seems like more info for tuning
> buffer/playback/record and synchronization.  What is the strategy for
> using this?

Playback/record status gives info about current stream status (position
for example) to application.

You can look for more details to ALSA C library documentation.

							Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


