I am trying to record sound from a Delta 1010LT.
To avoid preemptive problems, I am using the approach of running two
pthreads to acquire the data. Each thread should perform a read() (In the
regular syscall read interface) on the data. The file descriptor is opened
before the pthread call (In order to be shared by both threads). I was
expecting the driver to queue the requests so that each one would be
awaken when data was ready (and the other thread would have a huge amount
of time to queue another data request)...
Unfortunatelly what is happening is that I am receiving a mix of samples
between the two read syscalls...
Is there some flag, some update, something I should add to my procedures
to be able to use this approach?! In order to clear things, here is a
model of how I am doing it :
void* routine (void* arg){
while(1) {
read(dsp_fd, buffer, nbtyes);
}
}
int main (void){
pthread_create(th1, (SCHED_FIFO 99 ),routine, NULL);
pthread_create(th2, (SCHED_FIFO 99 ),routine, NULL);
sleep(10);
}
Thanks a lot for any suggestions,
Denis Damazio
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Alsa-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-user