Re: Ekiga runs but hangs

2007-12-30 Thread usleepless
Sergio,

On Dec 28, 2007 10:06 PM, Sergio Lenzi <[EMAIL PROTECTED]> wrote:
>
>
>  Em Sex, 2007-12-28 às 12:17 +0100, [EMAIL PROTECTED] escreveu:
>
>  Hello All,
>
> is anyone using ekiga? ekiga runs and connects to [EMAIL PROTECTED] ( test
> number ).
>
> but when i hang up, or change volume using the ekiga-controls, the UI
> freezes.
>
> #FreeBSD host 7.0-BETA2 FreeBSD 7.0-BETA2 #4
>
> i would love to hear succes or failures.
>
> regards,
>
> usleep
>
>  it happens with me too. the problem is in the
>  module sound-oss in the pwlib
>  the module that deals with oss (the freebsd sound system...)
>  tries to resample the stream and than loops... consuming all the cpu.
>
>  the folowing patch solves the problem for me
>  name this file to patch-oss and put it in /usr/ports/devel/pwlib/files
>  and than... cd /usr/ports/devel/pwlib
>  make clean deinstall package

that worked for me! thank you very much.

have you submitted a PR for this? ( if not, i probably will do )

thanks,

usleep
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Ekiga runs but hangs

2007-12-28 Thread Sergio Lenzi

Em Sex, 2007-12-28 às 12:17 +0100, [EMAIL PROTECTED] escreveu:

> Hello All,
> 
> is anyone using ekiga? ekiga runs and connects to [EMAIL PROTECTED] ( test 
> number ).
> 
> but when i hang up, or change volume using the ekiga-controls, the UI freezes.
> 
> #FreeBSD host 7.0-BETA2 FreeBSD 7.0-BETA2 #4
> 
> i would love to hear succes or failures.
> 
> regards,
> 
> usleep

it happens with me too. the problem is in the
module sound-oss in the pwlib 
the module that deals with oss (the freebsd sound system...) 
tries to resample the stream and than loops... consuming all the cpu.

the folowing patch solves the problem for me
name this file to patch-oss and put it in /usr/ports/devel/pwlib/files
and than... cd /usr/ports/devel/pwlib 
make clean deinstall package

=
--- plugins/sound_oss/sound_oss.cxx.orig
+++plugins/sound_oss/sound_oss.cxx  
@@ -565,7 +565,6 @@
 entry->bitsPerSample = mBitsPerSample   = _bitsPerSample;
 entry->isInitialised = FALSE;
 entry->fragmentValue = 0x7fff0008;
-entry->resampleRate  = 0;
   }

   // save the direction and device
@@ -602,7 +601,6 @@
   // do not re-initialise initialised devices
   if (entry.isInitialised) {
 PTRACE(6, "OSS\tSkipping setup for " << device << " as already
initialised");
-resampleRate = entry.resampleRate;
 
   } else {
 PTRACE(6, "OSS\tInitialising " << device << "(" << (void *)(&entry)
<< ")");
@@ -646,17 +644,6 @@
   arg = val = entry.sampleRate;
   if (ConvertOSError(::ioctl(os_handle, SNDCTL_DSP_SPEED,
&arg))) {
 stat = TRUE;
-
-// detect cases where the hardware can't do the actual rate
we need, but can do a simple multiple
-if (arg != (int)entry.sampleRate) {
-  if (((arg / entry.sampleRate) * entry.sampleRate) ==
(unsigned)arg) {
-PTRACE(3, "Resampling data at " << entry.sampleRate <<
" to match hardware rate of " << arg);
-resampleRate = entry.resampleRate = arg /
entry.sampleRate;
-  } else {
-PTRACE_IF(4, actualSampleRate != (unsigned)val, "Actual
sample rate selected is " << actualSampleRate << ", not " <<
entry.sampleRate);
-actualSampleRate = arg;
-  }
-}
   }
 }
   }
@@ -724,42 +711,10 @@
   if (!Setup() || os_handle < 0)
 return FALSE;
 
-  if (resampleRate == 0) {
-while (!ConvertOSError(::write(os_handle, (void *)buf, len))) 
-  if (GetErrorCode() != Interrupted)
-return FALSE;
-lastWriteCount += len;
-  }
-
-  else {
-// cut the data into 1K blocks and upsample it
-lastWriteCount = 0;
-BYTE resampleBuffer[1024];
-const BYTE * src= (const BYTE *)buf;
-const BYTE * srcEnd = src + len;
-while (src < srcEnd) {
-
-  // expand the data by the appropriate sample ratio
-  BYTE * dst = resampleBuffer;
-  const BYTE * srcStart = src;
-  unsigned j;
-   
-  while ((src < srcEnd) && (dst < (resampleBuffer +
sizeof(resampleBuffer) - resampleRate*2))) {
-for (j = 0; j < resampleRate; ++j) {
-  memcpy(dst, src, 2);
-  dst += 2 ;
-}
-src += 2;
-  }
-  lastWriteCount += src - srcStart;
-  while (!ConvertOSError(::write(os_handle, resampleBuffer, dst -
resampleBuffer))) {
-if (GetErrorCode() != Interrupted) 
-  return FALSE;
-  }
-}
-
-  }
-
+  while (!ConvertOSError(::write(os_handle, (void *)buf, len))) 
+if (GetErrorCode() != Interrupted)
+  return FALSE;
+  lastWriteCount += len;
   return TRUE;
 }
 
@@ -770,72 +725,26 @@
   if (!Setup() || os_handle < 0)
 return FALSE;
 
-  if (resampleRate == 0) {
-
-PINDEX total = 0;
-while (total < len) {
-  PINDEX bytes = 0;
-  while (!ConvertOSError(bytes = ::read(os_handle, (void
*)(((unsigned char *)buf) + total), len-total))) {
-if (GetErrorCode() != Interrupted) {
-  PTRACE(6, "OSS\tRead failed");
-  return FALSE;
-}
-PTRACE(6, "OSS\tRead interrupted");
-  }
-  total += bytes;
-  if (total != len)
-PTRACE(6, "OSS\tRead completed short - " << total << " vs " <<
len << ". Reading more data");
-}
-lastReadCount = total;
-  }
-
-  else {
-
-// downsample the data
-
-BYTE * dst= (BYTE *)buf;
-BYTE * dstEnd = dst + len;
-lastReadCount = 0;
-
-PBYTEArray resampleBuffer((1024 / resampleRate) * resampleRate);
-
-// downsample the data into 1K blocks 
-while (dst < dstEnd) {
-
-
-  // calculate number of source bytes needed to fill the buffer
-  PINDEX srcBytes = resampleRate * (dstEnd - dst);
-  PINDEX bytes;
-
-  {
-PINDEX bufLen = PMIN(resampleBuffer.GetSize(), srcBytes);
-while (!ConvertOSError(bytes = ::read(os_handle,
resampleBuffer.GetPointer(), bufLen))) {
-  if (GetErrorCode() != Interrupted) 
-ret