linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] Fix for ALSA/dmix garbled output


From: Simon Morlat
Subject: Re: [Linphone-developers] Fix for ALSA/dmix garbled output
Date: Sun, 29 Jan 2006 19:36:16 +0100
User-agent: KMail/1.9.1

Thanks a lot for having found this problem.
It was not obvious !
It is now on cvs and will be in next 1.3.0 release.

Simon

Le Dimanche 29 Janvier 2006 01:49, Lilith Verlorenes a écrit :
> ok, i've tracked down the problem(s):
>
> here's a new version of alsa_card_write in mediastreamer*/alsacard.c:
>
> ===========================
> int alsa_card_write(AlsaCard *obj,char *buf,int size)
> {
>  int err;
>  gint bsize=SND_CARD(obj)->bsize;
>  g_return_val_if_fail(obj->write_handle!=NULL,-1);
>  if (size!=bsize || obj->writepos!=0){
>   gint canwrite;
>   gint totalwrite=0;
>
>   while(1){
>    canwrite=MIN(bsize-obj->writepos,size);
>    if (canwrite==0)
>     break;
>    memcpy(&obj->writebuf[obj->writepos],buf,canwrite);
>    obj->writepos+=canwrite;
>    if (obj->writepos>=bsize){
>     err=__alsa_card_write(obj,obj->writebuf,bsize);
>     obj->writepos=0;
>    }
>    size-=canwrite;
>    buf+=canwrite;
>    totalwrite+=canwrite;
>          }
>   return totalwrite;
>  }else{
>   return __alsa_card_write(obj,buf,bsize);
>  }
> }
> ===========================
>
> changes:
>
> 1) tighter checks on when it is possible to pass a complete buffer through
> without using obj->writebuf
>
> 2) call  __alsa_card_write as many times as needed rather than only once.
>
> linphone now works very well on my system, thank you!
>
> lilith
>
>
>
> _______________________________________________
> Linphone-developers mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/linphone-developers




reply via email to

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