[linux-audio-dev] I need help! I can't handle the problem about full-duplex (playback & record) programming

leo zhu leozhuca at yahoo.com
Sun Dec 15 23:20:01 UTC 2002


Hi, Haakmat,

I'm so glad to see your reply. But I'm still wondering
how I can implement the full duplex operation on sound
card, i.e. playback and record audio on the same card
at same time. I don't think it's a good idea that
reopen the device when switch between reading and
writting, because I found it sometime took much time
to open the device and that means the quality wouldn't
be good. Do u have another solution to it? Anybody
have experience with it ? I really need suggestion
about it and I also believe there must be some tricks
which I havn't understood.

Thanks a lot anyway. This is my first question in this
group and it's my pleasure to get your help.

leo.

--- Pascal Haakmat <a.haakmat at chello.nl> wrote:
> 13/12/02 15:46, leo zhu wrote:
> 
> > Hi, guys,
> > 
> > I am working on a project in which I need to
> implement
> > palyback and recording on the same sound card and
> in
> > the same time. 
> > 
> > I open the soundcard with RDWR mode and used
> 'select'
> > to wait for sound data on card and read it. After
> > that, I receive audio data from socket and write
> this
> > data into buffer on card. for now. I tested it and
> i
> > found if just one way, ie. just read or write, it
> > works fine, the quality of sound is fine. but if
> two
> > way, ie. play&record, the sound is horrible and
> the
> > weird is that I always get better sound quality
> from
> > playback that what i got from recording. (I heard
> the
> > audio from two ends). by the way, I used
> > SNDCTL_DSP_TRIGGER to syncronyse them.
> > 
> > can this method implement full-duplex functions ?
> if
> > not, what should I do? thanks in advance
> 
> Yes, it's possible in principle, and it can work.
> Although some
> cards/drivers do it better than others... On Linux I
> believe the
> easiest way is to open the audio device twice: once
> for reading and
> once for writing. There might be other portability
> problems with that
> method as well. 
> I've never gotten SNDCTL_DSP_TRIGGER to work as
> expected, but that may just have been impatience.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the Linux-audio-dev mailing list