Re: [PATCH] Updates to Maestro{1,2,2E} driver -- multiple open of dsp, persistent buffers.

2001-07-06 Thread Alan Cox

> The patch has the blessing of Zach Brown, the current maintainer, as far
> as that goes -- but it's my own work. :)

You need to keep the dsp_order option as people have stuff relying on it
(at least for 2.4). It doesnt need to be documented or the recommended way
(and I agree its a bit strange) but it needs to work

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] Updates to Maestro{1,2,2E} driver -- multiple open of dsp, persistent buffers.

2001-07-06 Thread Daniel Pittman

The attached patch modifies the kernel Maestro sound driver to add a
couple of features:

* open /dev/dsp many times, not /dev/dsp[0-3]
* persistent DMA buffers

This code has been well tested and has run for quite a long time with
stability and success on a number of Maestro-using computers.

The patch has the blessing of Zach Brown, the current maintainer, as far
as that goes -- but it's my own work. :)

It would be good if people could test this and let me know if they
encounter any problems. If not, I will submit it for inclusion in the
kernel proper soon.

The patch is against 2.4.7-pre3 but should apply successfully to version
2.4.6 or later.

Daniel



diff -ru linux/Documentation/Configure.help linux.maestro/Documentation/Configure.help
--- linux/Documentation/Configure.help	Fri Jul  6 17:15:55 2001
+++ linux.maestro/Documentation/Configure.help	Thu Jul  5 11:58:39 2001
@@ -15607,6 +15607,22 @@
   of PCI sound chips.  These include the Maestro 1, Maestro 2, and
   Maestro 2E.  See Documentation/sound/Maestro for more details.
 
+The number of DSP device to create.
+CONFIG_MAESTRO_CHANNELS
+  The number of DSP devices to allocate. Each device functions as
+  a fully independent sound system. The more devices allocated,
+  however, the larger the memory requirement for the driver.
+  You can allocate up to four DSP devices, but only in multiples
+  of two. This allows one, two or four devices.
+
+Allocate memory for DSP devices persistently
+CONFIG_MAESTRO_PERSIST
+  If you say Y to this, the memory for the DSP devices provided
+  by the Maestro device will be retained even when the sound
+  system is not in use.
+  This is beneficial if you find that sound cannot be used after
+  doing other things on the machine for a while.
+
 Are you using a crosscompiler
 CONFIG_CROSSCOMPILE
   Say Y here if you are compiling the kernel on a different
diff -ru linux/Documentation/sound/Maestro linux.maestro/Documentation/sound/Maestro
--- linux/Documentation/sound/Maestro	Sat Jul 29 05:50:52 2000
+++ linux.maestro/Documentation/sound/Maestro	Thu Jul  5 11:58:22 2001
@@ -80,16 +80,32 @@
 an IRQ.  This operation is incredibly system specific, so you're on your
 own.  Sometimes the magic lies in 'PNP Capable Operating System' settings.
 
-There are very few options to the driver.  One is 'debug' which will 
-tell the driver to print minimal debugging information as it runs.  This
-can be collected with 'dmesg' or through the klogd daemon.
-
-The other, more interesting option, is 'dsps_order'.  Typically at
-install time the driver will only register one available /dev/dsp device
-for its use.  The 'dsps_order' module parameter allows for more devices
-to be allocated, as a power of two.  Up to 4 devices can be registered
-( dsps_order=2 ).  These devices act as fully distinct units and use
-separate channels in the maestro.
+There are very few options to the driver. Options can be specified as either
+module options or on the kernel command line. Command line arguments are in
+the form 'maestro=:,:'.
+
+One is 'debug' which will tell the driver to print minimal debugging
+information as it runs. This can be collected with 'dmesg' or through the
+klogd daemon. Setting this to one will cause debug information to be dumped.
+
+The other, more interesting option, is 'channels'. At install time the driver
+will register /dev/dsp and makes a number of channels available through this
+device. Multiple programs can open /dev/dsp, until all channels are used.
+
+The 'channels' parameter specifies the number of channels to be specified. Up
+to 4 channels can be allocated, but only in powers of two. Thus, you can have
+one, two or four devices. The default value is to allocate one channel.
+
+When multiple channels are open, they act as distinct sound devices. This
+allows multiple applications to generate sound simultaneously without blocking
+each other.
+
+At compile time you may also select to use persistent dsp buffers. Because of
+some oddities of the hardware, a large number of channels requires a large
+slab of contiguous memory. The persistent buffers option allocates this memory
+when the cards are detected and holds it all the time, preventing memory
+fragmentation from preventing the sound device from working.
+
 
 Power Management
 
diff -ru linux/drivers/sound/Config.in linux.maestro/drivers/sound/Config.in
--- linux/drivers/sound/Config.in	Fri Jul  6 17:16:21 2001
+++ linux.maestro/drivers/sound/Config.in	Thu Jul  5 14:15:43 2001
@@ -36,6 +36,10 @@
 dep_tristate '  Creative Ensoniq AudioPCI 97 (ES1371)' CONFIG_SOUND_ES1371 $CONFIG_SOUND $CONFIG_PCI
 dep_tristate '  ESS Technology Solo1' CONFIG_SOUND_ESSSOLO1 $CONFIG_SOUND
 dep_tristate '  ESS Maestro, Maestro2, Maestro2E driver' CONFIG_SOUND_MAESTRO $CONFIG_SOUND
+if [ "$CONFIG_SOUND_MAESTRO" = "y" -o "$CONFIG_SOUND_MAESTRO" = "m" ]; then
+   int  'Number of channels (1,2,4)' CONFIG_MAESTRO_CHANNELS 1
+   bool 'Persistent 

[PATCH] Updates to Maestro{1,2,2E} driver -- multiple open of dsp, persistent buffers.

2001-07-06 Thread Daniel Pittman

The attached patch modifies the kernel Maestro sound driver to add a
couple of features:

* open /dev/dsp many times, not /dev/dsp[0-3]
* persistent DMA buffers

This code has been well tested and has run for quite a long time with
stability and success on a number of Maestro-using computers.

The patch has the blessing of Zach Brown, the current maintainer, as far
as that goes -- but it's my own work. :)

It would be good if people could test this and let me know if they
encounter any problems. If not, I will submit it for inclusion in the
kernel proper soon.

The patch is against 2.4.7-pre3 but should apply successfully to version
2.4.6 or later.

Daniel



diff -ru linux/Documentation/Configure.help linux.maestro/Documentation/Configure.help
--- linux/Documentation/Configure.help	Fri Jul  6 17:15:55 2001
+++ linux.maestro/Documentation/Configure.help	Thu Jul  5 11:58:39 2001
@@ -15607,6 +15607,22 @@
   of PCI sound chips.  These include the Maestro 1, Maestro 2, and
   Maestro 2E.  See Documentation/sound/Maestro for more details.
 
+The number of DSP device to create.
+CONFIG_MAESTRO_CHANNELS
+  The number of DSP devices to allocate. Each device functions as
+  a fully independent sound system. The more devices allocated,
+  however, the larger the memory requirement for the driver.
+  You can allocate up to four DSP devices, but only in multiples
+  of two. This allows one, two or four devices.
+
+Allocate memory for DSP devices persistently
+CONFIG_MAESTRO_PERSIST
+  If you say Y to this, the memory for the DSP devices provided
+  by the Maestro device will be retained even when the sound
+  system is not in use.
+  This is beneficial if you find that sound cannot be used after
+  doing other things on the machine for a while.
+
 Are you using a crosscompiler
 CONFIG_CROSSCOMPILE
   Say Y here if you are compiling the kernel on a different
diff -ru linux/Documentation/sound/Maestro linux.maestro/Documentation/sound/Maestro
--- linux/Documentation/sound/Maestro	Sat Jul 29 05:50:52 2000
+++ linux.maestro/Documentation/sound/Maestro	Thu Jul  5 11:58:22 2001
@@ -80,16 +80,32 @@
 an IRQ.  This operation is incredibly system specific, so you're on your
 own.  Sometimes the magic lies in 'PNP Capable Operating System' settings.
 
-There are very few options to the driver.  One is 'debug' which will 
-tell the driver to print minimal debugging information as it runs.  This
-can be collected with 'dmesg' or through the klogd daemon.
-
-The other, more interesting option, is 'dsps_order'.  Typically at
-install time the driver will only register one available /dev/dsp device
-for its use.  The 'dsps_order' module parameter allows for more devices
-to be allocated, as a power of two.  Up to 4 devices can be registered
-( dsps_order=2 ).  These devices act as fully distinct units and use
-separate channels in the maestro.
+There are very few options to the driver. Options can be specified as either
+module options or on the kernel command line. Command line arguments are in
+the form 'maestro=option:value,option:value'.
+
+One is 'debug' which will tell the driver to print minimal debugging
+information as it runs. This can be collected with 'dmesg' or through the
+klogd daemon. Setting this to one will cause debug information to be dumped.
+
+The other, more interesting option, is 'channels'. At install time the driver
+will register /dev/dsp and makes a number of channels available through this
+device. Multiple programs can open /dev/dsp, until all channels are used.
+
+The 'channels' parameter specifies the number of channels to be specified. Up
+to 4 channels can be allocated, but only in powers of two. Thus, you can have
+one, two or four devices. The default value is to allocate one channel.
+
+When multiple channels are open, they act as distinct sound devices. This
+allows multiple applications to generate sound simultaneously without blocking
+each other.
+
+At compile time you may also select to use persistent dsp buffers. Because of
+some oddities of the hardware, a large number of channels requires a large
+slab of contiguous memory. The persistent buffers option allocates this memory
+when the cards are detected and holds it all the time, preventing memory
+fragmentation from preventing the sound device from working.
+
 
 Power Management
 
diff -ru linux/drivers/sound/Config.in linux.maestro/drivers/sound/Config.in
--- linux/drivers/sound/Config.in	Fri Jul  6 17:16:21 2001
+++ linux.maestro/drivers/sound/Config.in	Thu Jul  5 14:15:43 2001
@@ -36,6 +36,10 @@
 dep_tristate '  Creative Ensoniq AudioPCI 97 (ES1371)' CONFIG_SOUND_ES1371 $CONFIG_SOUND $CONFIG_PCI
 dep_tristate '  ESS Technology Solo1' CONFIG_SOUND_ESSSOLO1 $CONFIG_SOUND
 dep_tristate '  ESS Maestro, Maestro2, Maestro2E driver' CONFIG_SOUND_MAESTRO $CONFIG_SOUND
+if [ $CONFIG_SOUND_MAESTRO = y -o $CONFIG_SOUND_MAESTRO = m ]; then
+   int  'Number of channels (1,2,4)' CONFIG_MAESTRO_CHANNELS 1
+   bool '

Re: [PATCH] Updates to Maestro{1,2,2E} driver -- multiple open of dsp, persistent buffers.

2001-07-06 Thread Alan Cox

 The patch has the blessing of Zach Brown, the current maintainer, as far
 as that goes -- but it's my own work. :)

You need to keep the dsp_order option as people have stuff relying on it
(at least for 2.4). It doesnt need to be documented or the recommended way
(and I agree its a bit strange) but it needs to work

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/