linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] About on voice on S3C2410


From: Simon Morlat
Subject: Re: [Linphone-developers] About on voice on S3C2410
Date: Tue, 18 Aug 2009 11:00:07 +0200
User-agent: KMail/1.11.4 (Linux/2.6.30-1-amd64; KDE/4.2.4; x86_64; ; )

Hi Chen,

Many OSS drivers don't support non-blocking mode for read/write. That's why 
the design I choosed is to start a thread (oss_thread) doing blocking 
read/write on the soundcard's file descriptor, pass the read buffers to the 
MSFilter using a queue, and grabs buffers to write from the MSFilter using 
another queue.

Simon

Le dimanche 16 août 2009 17:11:38, cheng zhu a écrit :
> Hello,
>
> I find oss_thread may block in read(), in oss_oepn():
>
>        ... ...
>         fd=open(devname,O_RDWR|O_NONBLOCK);
>         if (fd<0) return -EWOULDBLOCK;
>         /* unset nonblocking mode */
>         /* We wanted non blocking open but now put it back to normal ;
> thanks Xine !*/
>         fcntl(fd, F_SETFL, fcntl(fd,
> F_GETFL)&~O_NONBLOCK);                                      // I don't know
> why to set block mode???
>        ... ...
>         /* start recording !!! Alex */
>         {
>                 int fl,res;
>
>                 fl=PCM_ENABLE_OUTPUT|PCM_ENABLE_INPUT;
>                 res=ioctl(fd, SNDCTL_DSP_SETTRIGGER,
> &fl);                                          // I don't know why to start
> recording???
>                 if (res<0) ms_warning("OSS_TRIGGER: %s",strerror(errno));
>         }
>        ... ...
> I don't know why to set block mode and why to start recording.
>
> Because s3c2410-uda1341 driver don't support SNDCTL_DSP_SETTRIGGER, so
> oss_thread will block in read():
>
>         ... ...
>         while(d->read_started || d->write_started){
>                 if (d->pcmfd>=0){
>                         if (d->read_started){
>                                   ... ...
>                         } else {
>                                 int sz = read(d->pcmfd,rtmpbuff,bsize);
>                                 if( sz!=bsize) ms_warning("sound device
> read returned %i !",sz);
>                         }
>        ... ...
>
> I think audio driver can't support SNDCTL_DSP_SETTRIGGER isn't serious, If
> we have some method to support this audio device?
>
> Thank you for your suggestion.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]