All of lore.kernel.org
 help / color / mirror / Atom feed
* Merging alsa-kernel-1.0.7 into kernel 2.6.9
@ 2004-11-19  4:41 Stephen Warren
  2004-11-19  4:50 ` Lee Revell
  2004-11-19 18:33 ` Takashi Iwai
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Warren @ 2004-11-19  4:41 UTC (permalink / raw)
  To: alsa-devel

I'm working on a project where we don't use modules for the kernel at
all - for various reasons such as target environment simplicity - very
hard-coded boot scripts, no huge sysvinit based interactive 'desktop'
system etc.

We need ALSA support, and specifically, alsa-driver 1.0.7 release fixes
some problems for the target hardware we're using.

So, I'm attempting to merge the content of alsa-driver 1.0.7 into the
kernel source tree, and to build ALSA support as non-modules.

I found a few resources that *basically* say you just copy the
alsa-kernel directory into the kernel tree and that's it. So, here's
what I started doing:

# linux-kernel.org is a virgin kernel.org 2.6.9 tree
rm -rf linux-kernel.org-2
cp -rp linux-kernel.org linux-kernel.org-2
chmod -R +w linux-kernel.org-2
rm -rf alsa-driver-1.0.7
tar jxvf patches-src/alsa-driver-1.0.7.tar.bz2
cd alsa-driver-1.0.7/alsa-kernel/
rm -rf oss
cp -a * ../../linux-kernel.org-2/sound
rm -rf ../../linux-kernel.org-2/sound/include
rm -rf ../../linux-kernel.org-2/sound/Documentation
cd include
cp -a * ../../../linux-kernel.org-2/include/sound
cd ../Documentation
cp -a * ../../../linux-kernel.org-2/Documentation/sound/alsa
cd ../../..
diff -urN linux-kernel.org linux-kernel.org-2 >
patches-src/nvidia-2.6.9-alsa-1.0.7-1.diff

This gets me a pretty fair way. I found from that point, that all I
needed to do was apply acore/init.patch, then manually fix all the calls
to module_param_array() to take a dummy count argument to back-port the
code to the 2.6.9 API.

Having done this, the kernel does compile and I can get sound working.
However, I'm wondering if this is a totally 100% correct approach. For
example, if I watch the result of a regular "./configure;make" build of
alsa-driver, I notice a lot of patches being applied to the source
before the build, most to enable the code to compile on a wide range of
kernels. If I manually apply to my tree every *.patch that the regular
build process applies, then I'm left with a few sets of errors:

* memalloc failures, due to missing header files (config.h/adriver.h if
I recall)
* KERNEL_VERSION isn't define everywhere, due to missing
<linux/version.h> includes
* still have the module_param_array problems

So, should I just ignore all the patches except init.path, do the manual
fixup of the module_param_array stuff and be done?

Any pointers on the 'correct' way to do this would be greatly
appreciated. If there's an accurate doc somewhere, my googling hasn't
found it.

Thanks.

-- 
Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO
swarren@nvidia.com        http://www.nvidia.com/
swarren@wwwdotorg.org     http://www.wwwdotorg.org/pgp.html


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Merging alsa-kernel-1.0.7 into kernel 2.6.9
  2004-11-19  4:41 Merging alsa-kernel-1.0.7 into kernel 2.6.9 Stephen Warren
@ 2004-11-19  4:50 ` Lee Revell
  2004-11-19 18:33 ` Takashi Iwai
  1 sibling, 0 replies; 6+ messages in thread
From: Lee Revell @ 2004-11-19  4:50 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel

On Thu, 2004-11-18 at 20:41 -0800, Stephen Warren wrote:
> I'm working on a project where we don't use modules for the kernel at
> all - for various reasons such as target environment simplicity - very
> hard-coded boot scripts, no huge sysvinit based interactive 'desktop'
> system etc.
> 
> We need ALSA support, and specifically, alsa-driver 1.0.7 release fixes
> some problems for the target hardware we're using.
> 
> So, I'm attempting to merge the content of alsa-driver 1.0.7 into the
> kernel source tree, and to build ALSA support as non-modules.

If the range of hardware you need to support is cmall enough it might be
easier to start with the ALSA in your kernel tarball and forward port
any driver fixes you need.

HTH,

Lee 



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Merging alsa-kernel-1.0.7 into kernel 2.6.9
@ 2004-11-19 16:25 Stephen Warren
  2004-11-19 18:32 ` Lee Revell
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Warren @ 2004-11-19 16:25 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

> > So, I'm attempting to merge the content of alsa-driver 
> > 1.0.7 into the kernel source tree, and to build ALSA support
> > as non-modules.
> 
> If the range of hardware you need to support is cmall enough 
> it might be easier to start with the ALSA in your kernel
> tarball and forward port any driver fixes you need.

Unfortunately, this probably isn't an option for us. Whilst we're
targetting an embedded style userspace, we don't control the hardware,
and it can end up being basically any arbitrary PC right now. Thus, we
need good support for everything ALSA can give us!

-- 
Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO
swarren@nvidia.com        http://www.nvidia.com/
swarren@wwwdotorg.org     http://www.wwwdotorg.org/pgp.html


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Merging alsa-kernel-1.0.7 into kernel 2.6.9
  2004-11-19 16:25 Stephen Warren
@ 2004-11-19 18:32 ` Lee Revell
  0 siblings, 0 replies; 6+ messages in thread
From: Lee Revell @ 2004-11-19 18:32 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel

On Fri, 2004-11-19 at 08:25 -0800, Stephen Warren wrote:
> Unfortunately, this probably isn't an option for us. Whilst we're
> targetting an embedded style userspace, we don't control the hardware,
> and it can end up being basically any arbitrary PC right now. Thus, we
> need good support for everything ALSA can give us!
> 

OK that was just a suggestion for a quick fix.  It really should work
the way you said.  This is an area of frequent breakage because the
kernel changes so fast.  But 2.6.9 + 1.0.7 does works fine for me as
modules, so this should be easy to fix...

-- 
Lee Revell <rlrevell@joe-job.com>



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Merging alsa-kernel-1.0.7 into kernel 2.6.9
  2004-11-19  4:41 Merging alsa-kernel-1.0.7 into kernel 2.6.9 Stephen Warren
  2004-11-19  4:50 ` Lee Revell
@ 2004-11-19 18:33 ` Takashi Iwai
  1 sibling, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2004-11-19 18:33 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel

At Thu, 18 Nov 2004 20:41:13 -0800,
Stephen Warren wrote:
> 
> I'm working on a project where we don't use modules for the kernel at
> all - for various reasons such as target environment simplicity - very
> hard-coded boot scripts, no huge sysvinit based interactive 'desktop'
> system etc.
> 
> We need ALSA support, and specifically, alsa-driver 1.0.7 release fixes
> some problems for the target hardware we're using.
> 
> So, I'm attempting to merge the content of alsa-driver 1.0.7 into the
> kernel source tree, and to build ALSA support as non-modules.
> 
> I found a few resources that *basically* say you just copy the
> alsa-kernel directory into the kernel tree and that's it. So, here's
> what I started doing:
> 
> # linux-kernel.org is a virgin kernel.org 2.6.9 tree
> rm -rf linux-kernel.org-2
> cp -rp linux-kernel.org linux-kernel.org-2
> chmod -R +w linux-kernel.org-2
> rm -rf alsa-driver-1.0.7
> tar jxvf patches-src/alsa-driver-1.0.7.tar.bz2
> cd alsa-driver-1.0.7/alsa-kernel/
> rm -rf oss
> cp -a * ../../linux-kernel.org-2/sound
> rm -rf ../../linux-kernel.org-2/sound/include
> rm -rf ../../linux-kernel.org-2/sound/Documentation
> cd include
> cp -a * ../../../linux-kernel.org-2/include/sound
> cd ../Documentation
> cp -a * ../../../linux-kernel.org-2/Documentation/sound/alsa
> cd ../../..
> diff -urN linux-kernel.org linux-kernel.org-2 >
> patches-src/nvidia-2.6.9-alsa-1.0.7-1.diff
> 
> This gets me a pretty fair way. I found from that point, that all I
> needed to do was apply acore/init.patch, then manually fix all the calls
> to module_param_array() to take a dummy count argument to back-port the
> code to the 2.6.9 API.
> 
> Having done this, the kernel does compile and I can get sound working.
> However, I'm wondering if this is a totally 100% correct approach. For
> example, if I watch the result of a regular "./configure;make" build of
> alsa-driver, I notice a lot of patches being applied to the source
> before the build, most to enable the code to compile on a wide range of
> kernels. If I manually apply to my tree every *.patch that the regular
> build process applies, then I'm left with a few sets of errors:
> 
> * memalloc failures, due to missing header files (config.h/adriver.h if
> I recall)
> * KERNEL_VERSION isn't define everywhere, due to missing
> <linux/version.h> includes
> * still have the module_param_array problems
> 
> So, should I just ignore all the patches except init.path, do the manual
> fixup of the module_param_array stuff and be done?

Yes.  The only changes are module_param_array() and
pci_save/restore_config() stuff, IIRC.
I don't remember whether usb has a change (which is one of the most
frequently changed thing).

> Any pointers on the 'correct' way to do this would be greatly
> appreciated. If there's an accurate doc somewhere, my googling hasn't
> found it.

The backporting is the only way, I think.
It's a generic problem of kernel drivers, continuously changing API :)


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Merging alsa-kernel-1.0.7 into kernel 2.6.9
@ 2004-11-19 20:52 Stephen Warren
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Warren @ 2004-11-19 20:52 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1901 bytes --]

> On Fri, 2004-11-19 at 08:25 -0800, Stephen Warren wrote:
> > Unfortunately, this probably isn't an option for us. Whilst
> > we're targetting an embedded style userspace, we don't
> > control the hardware, and it can end up being basically any
> > arbitrary PC right now. Thus, we need good support for
> > everything ALSA can give us!
> 
> OK that was just a suggestion for a quick fix.  It really should work
> the way you said.  This is an area of frequent breakage because the
> kernel changes so fast.  But 2.6.9 + 1.0.7 does works fine for me as
> modules, so this should be easy to fix...

OK. So I've done the merge and it seems to work. I've split this into
two patches.

The first patch is simply the copy of the relevant files into the kernel
tree. The second patch is the back-port to the 2.6.9 kernel API.

I was going to post both patches, but the first patch is 113K
compressed! So, I'll provide just the instructions to re-create the
first patch, plus the second patch...

rm -rf linux-kernel.org-2
cp -rp linux-kernel.org linux-kernel.org-2
chmod -R +w linux-kernel.org-2
rm -rf alsa-driver-1.0.7
tar jxvf patches-src/alsa-driver-1.0.7.tar.bz2
cd alsa-driver-1.0.7/alsa-kernel/
rm -rf oss
cp -a * ../../linux-kernel.org-2/sound
rm -rf ../../linux-kernel.org-2/sound/Documentation
rm -rf ../../linux-kernel.org-2/sound/include
rm -rf ../../linux-kernel.org-2/sound/kbuild
rm -rf ../../linux-kernel.org-2/sound/scripts
cd include
cp -a * ../../../linux-kernel.org-2/include/sound
cd ../Documentation
cp -a * ../../../linux-kernel.org-2/Documentation/sound/alsa
cd ../../..
diff -urN linux-kernel.org linux-kernel.org-2 >
patches-src/nvidia-2.6.9-alsa-1.0.7-1.diff

-- 
Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO
swarren@nvidia.com        http://www.nvidia.com/
swarren@wwwdotorg.org     http://www.wwwdotorg.org/pgp.html

[-- Attachment #2: nvidia-2.6.9-alsa-1.0.7-2.diff --]
[-- Type: application/octet-stream, Size: 5034 bytes --]

diff -urN linux-kernel.org-2/sound/core/init.c linux-kernel.org-3/sound/core/init.c
--- linux-kernel.org-2/sound/core/init.c	2004-10-27 01:52:59.000000000 -0600
+++ linux-kernel.org-3/sound/core/init.c	2004-11-19 13:39:11.677355112 -0700
@@ -798,7 +798,7 @@
 	if (card->power_state == SNDRV_CTL_POWER_D0)
 		return 0;
 	/* restore the PCI config space */
-	pci_restore_state(dev);
+	pci_restore_state(dev, dev->saved_config_space);
 	/* FIXME: correct state value? */
 	return card->pm_resume(card, 0);
 }
diff -urN linux-kernel.org-2/sound/core/memalloc.c linux-kernel.org-3/sound/core/memalloc.c
--- linux-kernel.org-2/sound/core/memalloc.c	2004-10-23 10:10:24.000000000 -0600
+++ linux-kernel.org-3/sound/core/memalloc.c	2004-11-19 13:23:03.442549176 -0700
@@ -36,6 +36,11 @@
 #include <asm/sbus.h>
 #endif
 
+#undef module_param_array
+#define module_param_array(name, type, nump, perm) \
+        static int boot_devs_##name; \
+        module_param_array_named(name, name, type, boot_devs_##name, perm)
+
 
 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Memory allocator for ALSA system.");
diff -urN linux-kernel.org-2/sound/core/oss/pcm_oss.c linux-kernel.org-3/sound/core/oss/pcm_oss.c
--- linux-kernel.org-2/sound/core/oss/pcm_oss.c	2004-11-10 23:41:05.000000000 -0700
+++ linux-kernel.org-3/sound/core/oss/pcm_oss.c	2004-11-19 13:23:21.934737936 -0700
@@ -42,6 +42,11 @@
 #include <linux/soundcard.h>
 #include <sound/initval.h>
 
+#undef module_param_array
+#define module_param_array(name, type, nump, perm) \
+        static int boot_devs_##name; \
+        module_param_array_named(name, name, type, boot_devs_##name, perm)
+
 #define OSS_ALSAEMULVER		_SIOR ('M', 249, int)
 
 static int dsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};
diff -urN linux-kernel.org-2/sound/core/rawmidi.c linux-kernel.org-3/sound/core/rawmidi.c
--- linux-kernel.org-2/sound/core/rawmidi.c	2004-10-23 10:10:24.000000000 -0600
+++ linux-kernel.org-3/sound/core/rawmidi.c	2004-11-19 13:23:12.463177832 -0700
@@ -35,6 +35,11 @@
 #include <sound/minors.h>
 #include <sound/initval.h>
 
+#undef module_param_array
+#define module_param_array(name, type, nump, perm) \
+        static int boot_devs_##name; \
+        module_param_array_named(name, name, type, boot_devs_##name, perm)
+
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Midlevel RawMidi code for ALSA.");
 MODULE_LICENSE("GPL");
diff -urN linux-kernel.org-2/sound/pci/cmipci.c linux-kernel.org-3/sound/pci/cmipci.c
--- linux-kernel.org-2/sound/pci/cmipci.c	2004-10-23 10:10:26.000000000 -0600
+++ linux-kernel.org-3/sound/pci/cmipci.c	2004-11-19 13:23:31.338308376 -0700
@@ -40,6 +40,11 @@
 #include <sound/asoundef.h>
 #include <sound/initval.h>
 
+#undef module_param_array
+#define module_param_array(name, type, nump, perm) \
+        static int boot_devs_##name; \
+        module_param_array_named(name, name, type, boot_devs_##name, perm)
+
 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
 MODULE_DESCRIPTION("C-Media CMI8x38 PCI");
 MODULE_LICENSE("GPL");
diff -urN linux-kernel.org-2/sound/pci/ens1370.c linux-kernel.org-3/sound/pci/ens1370.c
--- linux-kernel.org-2/sound/pci/ens1370.c	2004-10-23 10:10:27.000000000 -0600
+++ linux-kernel.org-3/sound/pci/ens1370.c	2004-11-19 13:23:41.139818320 -0700
@@ -51,6 +51,11 @@
 #define DRIVER_NAME "ENS1371"
 #endif
 
+#undef module_param_array
+#define module_param_array(name, type, nump, perm) \
+        static int boot_devs_##name; \
+        module_param_array_named(name, name, type, boot_devs_##name, perm)
+
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Thomas Sailer <sailer@ife.ee.ethz.ch>");
 MODULE_LICENSE("GPL");
diff -urN linux-kernel.org-2/sound/pci/intel8x0.c linux-kernel.org-3/sound/pci/intel8x0.c
--- linux-kernel.org-2/sound/pci/intel8x0.c	2004-10-26 00:20:13.000000000 -0600
+++ linux-kernel.org-3/sound/pci/intel8x0.c	2004-11-19 13:23:49.010621776 -0700
@@ -43,6 +43,11 @@
 #include <asm/pgtable.h>
 #include <asm/cacheflush.h>
 
+#undef module_param_array
+#define module_param_array(name, type, nump, perm) \
+        static int boot_devs_##name; \
+        module_param_array_named(name, name, type, boot_devs_##name, perm)
+
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7012; Ali 5455");
 MODULE_LICENSE("GPL");
diff -urN linux-kernel.org-2/sound/pci/via82xx.c linux-kernel.org-3/sound/pci/via82xx.c
--- linux-kernel.org-2/sound/pci/via82xx.c	2004-11-09 10:43:36.000000000 -0700
+++ linux-kernel.org-3/sound/pci/via82xx.c	2004-11-19 13:23:57.613313968 -0700
@@ -64,6 +64,11 @@
 #define POINTER_DEBUG
 #endif
 
+#undef module_param_array
+#define module_param_array(name, type, nump, perm) \
+        static int boot_devs_##name; \
+        module_param_array_named(name, name, type, boot_devs_##name, perm)
+
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("VIA VT82xx audio");
 MODULE_LICENSE("GPL");

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-11-19 20:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-19  4:41 Merging alsa-kernel-1.0.7 into kernel 2.6.9 Stephen Warren
2004-11-19  4:50 ` Lee Revell
2004-11-19 18:33 ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2004-11-19 16:25 Stephen Warren
2004-11-19 18:32 ` Lee Revell
2004-11-19 20:52 Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.