From alsa-user-owner@alsa.jcu.cz  Wed Sep  9 20:03:54 1998
Received: from gambit.kawo1.rwth-aachen.de (harryrat@gambit.kawo1.RWTH-Aachen.DE [134.130.50.8])
	by marvin.jcu.cz (8.8.8/8.8.8) with ESMTP id UAA24891
	for <alsa-user@jcu.cz>; Wed, 9 Sep 1998 20:00:21 +0200
From: harryrat@kawo1.rwth-aachen.de
Received: from localhost (harryrat@localhost)
	by gambit.kawo1.rwth-aachen.de (8.8.8/8.8.8) with SMTP id TAA00652
	for <alsa-user@jcu.cz>; Wed, 9 Sep 1998 19:58:08 +0200
Date: Wed, 9 Sep 1998 19:58:08 +0200 (CEST)
To: alsa-user@jcu.cz
Subject: coding question
Message-ID: <Pine.LNX.3.96.980909195243.649B-100000@gambit.kawo1.rwth-aachen.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-user@alsa.jcu.cz
Sender: alsa-user-owner@alsa.jcu.cz
Precedence: list

Hi there !

I'm new to ALSA sound programming ...ergh...actually new to sound
programming at all (:

question is :

As doc said, I can open the same device for every direction simultaniously
(Record & Playback)

What I now did was (after setting up devices) to record from PCM into a
buffer and play the buffer after that...


 snd_pcm_read(pcmRecordHandle, readbuffer, 80000);
 snd_pcm_write(pcmPlaybackHandle, readbuffer, 80000);
 snd_pcm_close(pcmPlaybackHandle);
 snd_pcm_close(pcmRecordHandle);
   

well...this way I get no output...but if I close the record direction
before playback it works fine...

 snd_pcm_read(pcmRecordHandle, readbuffer, 80000); 
 snd_pcm_close(pcmRecordHandle);  
 snd_pcm_write(pcmPlaybackHandle, readbuffer, 80000);
 snd_pcm_close(pcmPlaybackHandle);
 

Is this the only way ?
If yes, what's the advantage of being able to open one device in both
directions ?

I know these are newbies questions...sorry...


Harry



