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

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] I need help! I can't handle the problem about full-duplex (playback & record) programming
From: Pascal Haakmat (a.haakmat_AT_chello.nl)
Date: Sun Dec 15 2002 - 04:15:31 EET


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.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sun Dec 15 2002 - 04:17:59 EET