Skip to contentSkip to conversation

Compilation problems in adriver.h

DISCUSSION Mikael Magnusson 2 participants 4 messages Sep 8, 2005 – Sep 9, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

I'm using a customized kernel based on kernel-source-2.6.11 from Debian, and I needed to modify adriver.h to be able to compile the alsa modules from current CVS. I moved the definition of __nocast, since the declaration of snd_compat_kstrdup causes a compilation error if __nocast is undefined.

I also commented out the definition of CONFIG_ISA_DMA_API, because it led to a loop in snd.ko:

WARNING: Loop detected: /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko which needs snd.ko again!

It looks like a problem with snd_dma_pointer, snd_dma_disable and snd_dma_program:

/lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko needs "snd_dma_pointer": /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko needs "snd_dma_disable": /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko needs "snd_dma_program": /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko

I'm using a customized kernel based on kernel-source-2.6.11 (version 2.6.11-5) from Debian.

Regards,
Mikael Magnusson

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

#1 lore raw

At Thu, 8 Sep 2005 22:07:29 +0200,

Quoted 24 lines · Mikael Magnusson

Hi,

I'm using a customized kernel based on kernel-source-2.6.11 from Debian, and I needed to modify adriver.h to be able to compile the alsa modules from current CVS. I moved the definition of __nocast, since the declaration of snd_compat_kstrdup causes a compilation error if __nocast is undefined.

I also commented out the definition of CONFIG_ISA_DMA_API, because it led to a loop in snd.ko:

WARNING: Loop detected: /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko which needs snd.ko again!

It looks like a problem with snd_dma_pointer, snd_dma_disable and snd_dma_program:

/lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko needs "snd_dma_pointer": /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko needs "snd_dma_disable": /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko needs "snd_dma_program": /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko

Quoted 2 lines

I'm using a customized kernel based on kernel-source-2.6.11 (version 2.6.11-5) from Debian.

Try the patch below.

Takashi

Index: alsa-driver/include/adriver.h
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-driver/include/adriver.h,v retrieving revision 1.126

include/adriver.h +10 -7
diff -u -r1.126 adriver.h
@@ -51,7 +51,7 @@
 #define request_module(name, args...) snd_compat_request_module(name, ##args)
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
 #include <linux/compiler.h>
 #ifndef __iomem
 #define __iomem
@@ -59,12 +59,18 @@
 #ifndef __user
 #define __user
 #endif
+#ifndef __kernel
+#define __kernel
+#endif
 #ifndef __nocast
 #define __nocast
 #endif
 #ifndef __force
 #define __force
 #endif
+#ifndef __safe
+#define __safe
+#endif
 #endif /* < 2.6.9 */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
@@ -183,7 +189,9 @@
 #endif /* < 2.6.0 */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 13)
-#define CONFIG_ISA_DMA_API 1
+#ifdef CONFIG_SND_ISA
+#define CONFIG_ISA_DMA_API
+#endif
 #endif
 
 #include <linux/types.h>
@@ -879,11 +887,6 @@
 #endif
 #endif
 
-/* __nocast prefix (defined in compiler.h in the recent 2.6.x) */
-#ifndef __nocast
-#define __nocast
-#endif
-
 /* pci_get_device() and pci_dev_put() wrappers */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
 #define pci_get_device	pci_find_device

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

#2 lore raw
Quoted 26 lines · Takashi Iwai

At Thu, 8 Sep 2005 22:07:29 +0200,

Quoted 24 lines · Mikael Magnusson

Hi,

I'm using a customized kernel based on kernel-source-2.6.11 from Debian, and I needed to modify adriver.h to be able to compile the alsa modules from current CVS. I moved the definition of __nocast, since the declaration of snd_compat_kstrdup causes a compilation error if __nocast is undefined.

I also commented out the definition of CONFIG_ISA_DMA_API, because it led to a loop in snd.ko:

WARNING: Loop detected: /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko which needs snd.ko again!

It looks like a problem with snd_dma_pointer, snd_dma_disable and snd_dma_program:

/lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko needs "snd_dma_pointer": /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko needs "snd_dma_disable": /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko needs "snd_dma_program": /lib/modules/2.6.11-vserver-k7/alsa/acore/snd.ko

Quoted 5 lines
Quoted 2 lines

I'm using a customized kernel based on kernel-source-2.6.11 (version 2.6.11-5) from Debian.

Try the patch below.

I have tried the patch and it solves the problems.

/Mikael Magnusson

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

#3 lore raw

At Fri, 9 Sep 2005 14:10:07 +0200,

Quoted 2 lines · Mikael Magnusson

I have tried the patch and it solves the problems.

Thanks, it's on CVS now.

Takashi

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf