Hello,

Please find below diffs for a proposed fix for the
following problem encountered with JDS from the gnome-2-20
branch compiled on Solaris 10u4 with oss-solaris-v4.0-1008-i386.pkg:

Page 7/10 of the Ekiga 2.0.11 configuration druid:

Please choose the audio output device:

/dev/dsp

Please choose the audio input device:

/dev/dsp

Click on Test Settings

Cannot use the audio device

The selected audio device (/dev/dsp) was successfully opened but it is
impossible to read data from this device. Please check your audio setup.

Running truss indicates the problem (which there is lots of references
to in the documentation on opensound.com):

goanna% truss -l -f -o ekiga_oss_run_001.txt /usr/bin/pentium_pro+mmx/ekiga 
goanna% 

1103/24:        open("/dev/dsp", O_RDWR|O_NONBLOCK)             = 59          
<=== Open in non-blocking mode, supposedly to avoid hang on open call if its 
already open
1103/24:        ioctl(59, FIONBIO, 0xF5AFDE6C)                  = 22          
<=== Fails to set it to non-blocking mode
1103/24:        ioctl(59, (('P'<<8)|0), 0x00000000)             = 0
1103/24:        ioctl(59, (('P'<<8)|0), 0xF5AFDE3C)             = 0
1103/24:        ioctl(59, _ION('P', 10, 4), 0xF5AFDE3C)         = 0
1103/24:        ioctl(59, _ION('P', 5, 4), 0xF5AFDE3C)          = 0
1103/24:        ioctl(59, _ION('P', 3, 4), 0xF5AFDE3C)          = 0
1103/24:        ioctl(59, _ION('P', 2, 4), 0xF5AFDE3C)          = 0
1103/24:        read(59, 0x0879AC08, 640)                       Err#11 EAGAIN 
<=== not expecting EAGAIN, as assuming its in blocking mode now.
1103/24:        brk(0x0879CFB0)                                 = 0
1103/24:        brk(0x0879EFB0)                                 = 0
1103/24:        brk(0x0879EFB0)                                 = 0
1103/24:        brk(0x087A0FB0)                                 = 0
1103/24:        brk(0x087A0FB0)                                 = 0
1103/24:        brk(0x087A2FB0)                                 = 0
1103/24:        open64("/usr/share/themes/nimbus/gtk-2.0/dialog_error.png", 
O_RDONLY) = 60

My proposed fix is really just a first cut at making
Ekiga work with OSS on Solaris.  With this fix, Ekiga
at least works sometimes.  I am sorry that Ekiga still
seems to have some problems:

- hangs on startup sometimes, I just to pkill ekiga and try
again.

- crashes sometimes.  I will have to try to figure out
how to persuade it to core dump instead of just going
into the error reporting tool.  I built it with debug
symbols.

- on an early test call I made the audio quality seemed
really good.  After that though, I seemed to get static
on the next several test calls I tried.

And yes I see from the Open Sound documentation that the
code really should check the Open Sound version before
doing the open with O_NONBLOCK on other operating systems.
But I only run Solaris, so I can't test on other operating
systems.  So I will just note this when I try to upstream
the patch.

Thanks, Mark

goanna% svn diff gnome-2-20/base-specs/pwlib.spec 
gnome-2-20/patches/pwlib-06-oss-open-blocking-mode.diff
Index: gnome-2-20/base-specs/pwlib.spec
===================================================================
--- gnome-2-20/base-specs/pwlib.spec    (revision 12357)
+++ gnome-2-20/base-specs/pwlib.spec    (working copy)
@@ -35,6 +35,9 @@
 # owner:elaine date:2007-06-12 type:bug bugzilla:445066
 Patch5:       pwlib-05-rm-flush.diff
 
+# owner:mwright date:2007-11-2 type:bug
+Patch6:       pwlib-06-oss-open-blocking-mode.diff
+
 URL:          http://www.ekiga.org
 BuildRoot:    %{_tmppath}/%{name}-%{version}-build
 Docdir:       %{_defaultdocdir}/%{name}
@@ -61,6 +64,7 @@
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 # symlink the make dir to bin so that ptlib-config is found by ekiga
 ln -s make bin
@@ -98,6 +102,7 @@
         --enable-resolver \
         --enable-opal \
         --enable-sunaudio \
+        --enable-oss \
         --enable-v4l2
 make -j $CPUS
 
Index: gnome-2-20/patches/pwlib-06-oss-open-blocking-mode.diff
===================================================================
--- gnome-2-20/patches/pwlib-06-oss-open-blocking-mode.diff     (revision 0)
+++ gnome-2-20/patches/pwlib-06-oss-open-blocking-mode.diff     (revision 0)
@@ -0,0 +1,30 @@
+--- pwlib-1.10.10-orig/plugins/sound_oss/sound_oss.cxx 2006-04-23 
18:19:10.000000000 +0000
++++ pwlib-1.10.10/plugins/sound_oss/sound_oss.cxx      2007-11-02 
06:30:32.302030124 +0000
+@@ -541,17 +541,27 @@
+ 
+   } else {
+ 
++#ifndef P_SOLARIS
+     // this is the first time this device has been used
+     // open the device in read/write mode always
+     // open the device in non-blocking mode to avoid hang if already open
+     os_handle = ::open((const char *)_device, O_RDWR | O_NONBLOCK);
++#else    
++    // http://manuals.opensound.com/developer/open.html
++    // There is no need to use the O_NONBLOCK (or O_NDELAY) flag when opening
++    // OSS devices. The open call will return immediately with errno set to
++    // EBUSY if the device cannot be opened immediately.
++    os_handle = ::open((const char *)_device, O_RDWR);
++#endif
+ 
+     if ((os_handle < 0) && (errno != EWOULDBLOCK)) 
+       return ConvertOSError(os_handle);
+ 
++#ifndef P_SOLARIS
+     // switch to blocking mode
+     DWORD cmd = 0;
+     ::ioctl(os_handle, FIONBIO, &cmd);
++#endif
+ 
+     // add the device to the dictionary
+     SoundHandleEntry * entry = PNEW SoundHandleEntry;
goanna% 

Thanks, Mark
--
This message posted from opensolaris.org

Reply via email to