From alsa-devel-owner@alsa.jcu.cz  Sun Nov  8 00:22:45 1998
Received: from umr.edu (hermes.cc.umr.edu [131.151.1.68])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id AAA20972
	for <alsa-devel@alsa.jcu.cz>; Sun, 8 Nov 1998 00:22:41 +0100
Received: from AeroSpace.fries.net (dfries.student.umr.edu [131.151.188.49]) via ESMTP by hermes.cc.umr.edu (8.8.7/R.4.20) id RAA18250; Sat, 7 Nov 1998 17:22:37 -0600 (CST)
Received: (from david@localhost)
	by AeroSpace.fries.net (8.9.1a/8.9.1/Debian/GNU) id RAA00888;
	Sat, 7 Nov 1998 17:22:37 -0600
Message-ID: <19981107172236.A864@AeroSpace.miango.com>
Date: Sat, 7 Nov 1998 17:22:36 -0600
From: David Fries <dfries@umr.edu>
To: alsa-devel@alsa.jcu.cz
Cc: William Segura <xeraphin@earthlink.net>
Subject: compile problems patch(es)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list


I booted the kernel 2.1.127 with the alsa driver modifications and it is
playing pcm through the standard pcm device and the gus max gf1 device.


First problem,
I'm very confident this is the correct way, as SPIN_LOCK_UNLOCKED
includes (spinlock_t) so if this header file puts it there it ends up
(spinlock_t)(spinlock_t) something

Index: include/sndspinlock.h
===================================================================
RCS file: /home/alsa/cvsroot/alsa-driver/include/sndspinlock.h,v
retrieving revision 1.2
diff -u -r1.2 sndspinlock.h
--- sndspinlock.h       1998/11/04 21:30:46     1.2
+++ sndspinlock.h       1998/11/07 22:50:42
@@ -53,7 +53,7 @@
 #define snd_spin_prepare( object, name ) \
   (object) -> spin_lock_##name = (spinlock_t)SPIN_LOCK_UNLOCKED
 #define snd_spin_define_static( name ) \
-  static spinlock_t snd_static_spin_lock_##name = (spinlock_t)SPIN_LOCK_UNLOCKED
+  static spinlock_t snd_static_spin_lock_##name = SPIN_LOCK_UNLOCKED
 #else
 #define snd_spin_lock( object, name, flags ) snd_cli( flags )
 #define snd_spin_unlock( object, name, flags ) snd_sti( flags )


Second probem,

following the example it looks right to change interruptible_sleep_on
to interruptible_sleep_on_timeout, but I'm not sure about what all
is going on to know if just removing the '= current ->timeout'
second is the correct way to do things.

Index: include/schedule.h
===================================================================
RCS file: /home/alsa/cvsroot/alsa-driver/include/schedule.h,v
retrieving revision 1.3
diff -u -r1.3 schedule.h
--- schedule.h  1998/11/04 21:30:43     1.3
+++ schedule.h  1998/11/07 22:50:42
@@ -35,12 +35,12 @@
   do { (object) -> sleeper_##ident = NULL; } while ( 0 )
 #define snd_sleep( object, ident, time ) \
   do { \
-    (object) -> sleeper_end_jiffies_##ident = current -> timeout = jiffies + (time); \
-    interruptible_sleep_on( &(object) -> sleeper_##ident ); \
+    (object) -> sleeper_end_jiffies_##ident = jiffies + (time); \
+    interruptible_sleep_on_timeout( &(object) -> sleeper_##ident , (time)); \
   } while ( 0 )
 #define snd_sleep_u( object, ident, time ) \
   do { \
-    (object) -> sleeper_end_jiffies_##ident = current -> timeout = jiffies + (time); \
+    (object) -> sleeper_end_jiffies_##ident = jiffies + (time); \
     sleep_on( &(object) -> sleeper_##ident ); \
   } while ( 0 )
 #ifdef SND_POLL


as looking at the 2.1.127 patch shows,

-- v2.1.126/linux/drivers/cdrom/mcdx.c Thu Feb 12 20:56:05 1998
+++ linux/drivers/cdrom/mcdx.c  Wed Nov  4 14:52:21 1998
@@ -794,8 +794,7 @@
         * allowed! */
     if (current->pid == 0) {
                while (jiffies < tout) {
-            current->timeout = jiffies;
-            schedule();
+            schedule_timeout(0);
         }
     } else {
         current->timeout = tout;
@@ -1247,6 +1246,7 @@
 {
     int border;
     int done = 0;
+       long timeout;
 
        if (stuffp->audio) {
                        xwarn("Attempt to read from audio CD.\n");
@@ -1281,13 +1281,12 @@
 
        do {
 
-           current->timeout = jiffies + 5 * HZ;
            while (stuffp->busy) {
 
-                       interruptible_sleep_on(&stuffp->busyq);
+                       timeout = interruptible_sleep_on_timeout(&stuffp->busyq, 5*HZ);
 
                        if (!stuffp->introk) { xtrace(XFER, "error via interrupt\n"); }
-                       else if (current->timeout == 0) { xtrace(XFER, "timeout\n"); }
+                       else if (!timeout) { xtrace(XFER, "timeout\n"); }
                        else if (signal_pending(current)) {
                                xtrace(XFER, "signal\n");
                        } else continue;

+ cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 0.2.0-pre8.
Compiled in Nov  7 1998 for kernel 2.1.127 (SMP).
+ cat /proc/asound/cards
0 [card1          ]: GUS - Gravis UltraSound MAX
                     Gravis UltraSound MAX at 0x220, irq 5, dma 5&6
+ cat /proc/modules
snd-gusmax              3476   0
snd-gus                27412   0 [snd-gusmax]
snd-cs4231             10616   0 [snd-gusmax]
snd-synth               1108   0 [snd-gus]
snd-timer               2804   0 [snd-gus snd-cs4231]
snd-midi               14032   0 [snd-gusmax snd-gus]
snd-pcm1-oss           14624   0
snd-pcm1               16088   0 [snd-gus snd-cs4231 snd-pcm1-oss]
snd-pcm                 6888   0 [snd-gusmax snd-gus snd-cs4231 snd-pcm1-oss snd-pcm1]
snd-mixer              14296   0 [snd-gusmax snd-gus snd-cs4231 snd-pcm1-oss]
snd                    25868   0 [snd-gusmax snd-gus snd-cs4231 snd-synth snd-timer snd-midi snd-pcm1-oss snd-pcm1 snd-pcm snd-mixer]
serial                 17396   0 (autoclean)
nfsd                  146892   2
lockd                  28212   1 [nfsd]
sunrpc                 48508   1 [nfsd lockd]
bsd_comp                3428   2
ne                      5896   2
3c59x                  16428   1
8390                    5784   0 [ne]
+ uname -a
Linux AeroSpace 2.1.127 #259 SMP Sat Nov 7 14:34:14 CST 1998 i586 unknown
+ cat /home/david/hwinfo
Dual Pentium 200MHz MMX
Tyan 1653D, Tomcat III
Intel 82439HX, 82371SB chipset
128 megs memory,
NCR53C810 using BSD ported driver
Both IDE and SCSI harddrives
NE2000 compatible ISA
3Com 3c905B
gcc 2.7.2.3
gcc 2.7.2.3


-- 
		+---------------------------------+
		|      David Fries                |
		|      dfries@umr.edu             |
		+---------------------------------+

