[Wine] New Winecfg crash

Robert Reif reif at earthlink.net
Sat Dec 10 10:05:43 CST 2005


Evil wrote:

>Robert Reif wrote:
>
>  
>
>>...The latest winecfg now loads all sound drivers ...
>>    
>>
>
>
>Ah, knowing that made it pretty easy for me to find.  I know from
>playing with Amarok that many of us are seeing big problems with aRts
>support under KDE3.5.  In fact, most everything that tries to use aRts
>*except* KDE itself will crash.
>
>I renamed the winearts driver, and sure enough it now lets me modify the
>audio settings with no problem.  Thanks for the assistance, Robert!
>
>-Jesse
>
>  
>
Does this patch fix the problem?

With this patch (and tracing on) I get this but no crash.

trace:wave:ARTS_DriverProc (00000000, 0x403553d8, 00000001, 00000000, 
00000000)
trace:wave:ARTS_drvLoad ()
trace:wave:ARTS_WaveInit called
mcop warning: user defined signal handler found for SIG_PIPE, overriding
warn:wave:ARTS_WaveInit arts_init() failed (-1)


-------------- next part --------------
cvs diff: Diffing dlls/winmm/winearts
Index: dlls/winmm/winearts/arts.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winearts/arts.c,v
retrieving revision 1.7
diff -p -u -r1.7 arts.c
--- dlls/winmm/winearts/arts.c	6 Dec 2005 10:39:26 -0000	1.7
+++ dlls/winmm/winearts/arts.c	10 Dec 2005 15:49:51 -0000
@@ -31,14 +31,40 @@
 #include "winuser.h"
 #include "mmddk.h"
 #include "arts.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wave);
 
 #ifdef HAVE_ARTS
 
 /**************************************************************************
+ * 				ARTS_drvLoad			[internal]
+ */
+static LRESULT ARTS_drvLoad()
+{
+    TRACE("()\n");
+
+    if (ARTS_WaveInit()<0)
+        return 0;
+
+    return 1;
+}
+
+/**************************************************************************
+ * 				ARTS_drvFree			[internal]
+ */
+static LRESULT ARTS_drvFree()
+{
+    TRACE("()\n");
+    return ARTS_WaveClose();
+}
+
+/**************************************************************************
  * 				ARTS_drvOpen			[internal]
  */
 static LRESULT ARTS_drvOpen(LPSTR str)
 {
+    TRACE("(%s)\n", str);
     return 1;
 }
 
@@ -47,6 +73,7 @@ static LRESULT ARTS_drvOpen(LPSTR str)
  */
 static LRESULT ARTS_drvClose(DWORD_PTR dwDevID)
 {
+    TRACE("(%08lx)\n", dwDevID);
     return 1;
 }
 #endif /* #ifdef HAVE_ARTS */
@@ -58,14 +85,13 @@ static LRESULT ARTS_drvClose(DWORD_PTR d
 LRESULT CALLBACK ARTS_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
                                  LPARAM dwParam1, LPARAM dwParam2)
 {
-/* EPP     TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n",  */
-/* EPP 	  dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
+    TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n",
+          dwDevID, hDriv, wMsg, dwParam1, dwParam2);
 
     switch(wMsg) {
 #ifdef HAVE_ARTS
-    case DRV_LOAD:		if (ARTS_WaveInit()<0) return 0;
-				return 1;
-    case DRV_FREE:	        return ARTS_WaveClose();
+    case DRV_LOAD:		return ARTS_drvLoad();
+    case DRV_FREE:	        return ARTS_drvFree();
     case DRV_OPEN:		return ARTS_drvOpen((LPSTR)dwParam1);
     case DRV_CLOSE:		return ARTS_drvClose(dwDevID);
     case DRV_ENABLE:		return 1;
Index: dlls/winmm/winearts/arts.h
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winearts/arts.h,v
retrieving revision 1.2
diff -p -u -r1.2 arts.h
--- dlls/winmm/winearts/arts.h	25 Mar 2002 20:52:42 -0000	1.2
+++ dlls/winmm/winearts/arts.h	10 Dec 2005 15:49:51 -0000
@@ -28,7 +28,7 @@
 #include <sys/errno.h>
 #endif
 
-extern LONG ARTS_WaveInit(void);
-extern LONG ARTS_WaveClose(void);
+LRESULT ARTS_WaveInit(void);
+LRESULT ARTS_WaveClose(void);
 
 #endif  /* __WINE_ARTS_H */
Index: dlls/winmm/winearts/audio.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winearts/audio.c,v
retrieving revision 1.32
diff -p -u -r1.32 audio.c
--- dlls/winmm/winearts/audio.c	10 Nov 2005 12:14:56 -0000	1.32
+++ dlls/winmm/winearts/audio.c	10 Dec 2005 15:49:53 -0000
@@ -201,6 +201,7 @@ typedef struct {
     ARTS_MSG_RING		msgRing;
 } WINE_WAVEIN;
 
+static BOOL             ARTS_ok;
 static WINE_WAVEOUT	WOutDev   [MAX_WAVEOUTDRV];
 static WINE_WAVEIN	WInDev    [MAX_WAVEINDRV];
 
@@ -358,28 +359,32 @@ static int	ARTS_Init(void)
 /******************************************************************
  *		ARTS_WaveClose
  */
-LONG		ARTS_WaveClose(void)
+LRESULT		ARTS_WaveClose(void)
 {
     int iDevice;
 
-    /* close all open devices */
-    for(iDevice = 0; iDevice < MAX_WAVEOUTDRV; iDevice++)
+    if (ARTS_ok)
     {
-      if(WOutDev[iDevice].play_stream != (arts_stream_t*)-1)
-      {
-        ARTS_CloseWaveOutDevice(&WOutDev[iDevice]);
-      }
-    }
+        /* close all open devices */
+        for(iDevice = 0; iDevice < MAX_WAVEOUTDRV; iDevice++)
+        {
+            if(WOutDev[iDevice].play_stream != (arts_stream_t*)-1)
+            {
+                ARTS_CloseWaveOutDevice(&WOutDev[iDevice]);
+            }
+        }
 
-    for(iDevice = 0; iDevice < MAX_WAVEINDRV; iDevice++)
-    {
-      if(WInDev[iDevice].record_stream != (arts_stream_t*)-1)
-      {
-        ARTS_CloseWaveInDevice(&WInDev[iDevice]);
-      }
+        for(iDevice = 0; iDevice < MAX_WAVEINDRV; iDevice++)
+        {
+            if(WInDev[iDevice].record_stream != (arts_stream_t*)-1)
+            {
+                ARTS_CloseWaveInDevice(&WInDev[iDevice]);
+            }
+        }
+
+        arts_free();    /* free up arts */
     }
 
-    arts_free();    /* free up arts */
     return 1;
 }
 
@@ -388,7 +393,7 @@ LONG		ARTS_WaveClose(void)
  *
  * Initialize internal structures from ARTS server info
  */
-LONG ARTS_WaveInit(void)
+LRESULT ARTS_WaveInit(void)
 {
     int 	i;
     int		errorcode;
@@ -401,6 +406,8 @@ LONG ARTS_WaveInit(void)
 	return -1;
     }
 
+    ARTS_ok = TRUE;
+
     /* initialize all device handles to -1 */
     for (i = 0; i < MAX_WAVEOUTDRV; ++i)
     {


More information about the wine-users mailing list