List Info

Thread: Ekiga runs but hangs




Ekiga runs but hangs
user name
2007-12-28 05:17:02
Hello All,

is anyone using ekiga? ekiga runs and connects to 500ekiga.net
( 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
_______________________________________________
freebsd-questionsfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribefreebsd.org"

Re: Ekiga runs but hangs
user name
2007-12-28 15:06:23
Em Sex, 2007-12-28 às 12:17 +0100, usleeplessgmail.com
escreveu:

> Hello All,
> 
> is anyone using ekiga? ekiga runs and connects to
500ekiga.net ( 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, "OSStSkipping setup for " <<
device << " as already
initialised");
-    resampleRate = entry.resampleRate;
 
   } else {
     PTRACE(6, "OSStInitialising " <<
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, "OSStRead failed");
-          return FALSE;
-        }
-        PTRACE(6, "OSStRead interrupted");
-      }
-      total += bytes;
-      if (total != len)
-        PTRACE(6, "OSStRead 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) 
-            return FALSE;
-        }
-      }
-
-      // use an average, not just a single sample
-      const BYTE * src = resampleBuffer;
-      while ( ((src - resampleBuffer) < bytes)
&& (dst < dstEnd)) {
-        int sample = 0;
-        unsigned j;
-        for (j = 0; j < resampleRate; ++j) {
-          sample += *(PUInt16l *)src;
-          src += 2;
-        }
-        *(PUInt16l *)dst = sample / resampleRate;
-        dst +=2 ;
-        lastReadCount += 2;
+  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, "OSStRead failed");
+        return FALSE;
       }
+      PTRACE(6, "OSStRead interrupted");
     }
+    total += bytes;
+    if (total != len)
+      PTRACE(6, "OSStRead completed short - "
<< total << " vs " <<
len << ". Reading more data");
   }
+  lastReadCount = total;
 
   if (lastReadCount != len)
     PTRACE(6, "OSStRead completed short - "
<< lastReadCount << " vs "
<< len);
   else
     PTRACE(6, "OSStRead completed");
-
   return TRUE;
 }
 
--- plugins/sound_oss/sound_oss.h.orig	2007-12-03
03:31:15.000000000
+0000
+++ plugins/sound_oss/sound_oss.h	2007-12-03
03:31:29.000000000 +0000
 -42,7
+42,6 
     unsigned bitsPerSample;
     unsigned fragmentValue;
     BOOL isInitialised;
-    unsigned resampleRate;
 };
 
 class PSoundChannelOSS: public PSoundChannel
 -99,5
+98,4 
     Directions direction;
     PString device;
     BOOL isInitialised;
-    unsigned resampleRate;
 };
============================================================
=
_______________________________________________
freebsd-questionsfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribefreebsd.org"

Re: Ekiga runs but hangs
user name
2007-12-30 05:17:33
Sergio,

On Dec 28, 2007 10:06 PM, Sergio Lenzi <lenzi.sergiogmail.com> wrote:
>
>
>  Em Sex, 2007-12-28 às 12:17 +0100, usleeplessgmail.com
escreveu:
>
>  Hello All,
>
> is anyone using ekiga? ekiga runs and connects to
500ekiga.net ( 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-questionsfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribefreebsd.org"

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )