From alsa-user-owner@alsa.jcu.cz  Tue Sep 15 02:53:33 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 CAA29927
	for <alsa-user@jcu.cz>; Tue, 15 Sep 1998 02:52:06 +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 CAA00217
	for <alsa-user@jcu.cz>; Tue, 15 Sep 1998 02:49:43 +0200
Date: Tue, 15 Sep 1998 02:49:43 +0200 (CEST)
To: alsa-user@jcu.cz
Subject: Re: coding question
In-Reply-To: <Pine.LNX.3.96.980914201619.3911D-100000@entry.jcu.cz>
Message-ID: <Pine.LNX.3.96.980915024219.215A-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


On Mon, 14 Sep 1998, Jaroslav Kysela wrote:

> On Wed, 9 Sep 1998 harryrat@kawo1.rwth-aachen.de wrote:
> 
> > 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)
> 
> If hardware supports this. If you have some simple chip (ESS1688 for
> example) full duplex doesn't work, of course.

Card is GUS PNP...btw, is there a difference between 
opening device in duplex mode and opening it in both direction via two
handles ?
I mean, I don't want to have full duplex (recording & playback at the same
time) but ONLY using one device for both direction step by step...
(maybe I misunderstood "full duplex"...)

> 
> > 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);
> 
> Are you sure, that handles are valid? Soundcard?
They seem to be...
actually it records....and I can play back after closing the recording
direction before playback..
> 
> > 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 ?
> 
> No, both ways are correct.
> 
> > If yes, what's the advantage of being able to open one device in both
> > directions ?
> 
> Two indenpended application can share same hardware (Speak Freely for
> example).

I mean this is what I want...I want to be able to record stuff and
playback on demand...there is no need for any full duplex stuff, so it is
ok to have only one direction being active at a time...
I only want to avoid those overhead for opening a device, using it,
closing device each time for each direction...
(sorry if I'm confusing u...it's a little hard to explain for me in
English and without too much knowledge about sound programming...)
 
Greez,
	Harry


