2002-10-14 19:43:03

by Jaroslav Kysela

[permalink] [raw]
Subject: ALSA update

Linus, please do a

bk pull http://linux-sound.bkbits.net/linux-sound

This set of changes allows compilation without procfs and fixes next
problems reported on lkml. The major part of code is reducing stack usage
in several functions using kmalloc(). Also, USB audio/midi code has been
updated.

Jaroslav

This will update the following files:

include/sound/asound.h | 3
include/sound/core.h | 1
include/sound/info.h | 6
include/sound/version.h | 4
sound/core/control.c | 34 +-
sound/core/hwdep.c | 8
sound/core/info_oss.c | 2
sound/core/init.c | 2
sound/core/ioctl32/ioctl32.c | 76 +++---
sound/core/ioctl32/ioctl32.h | 38 +++
sound/core/ioctl32/pcm32.c | 52 ++--
sound/core/memory.c | 8
sound/core/oss/mixer_oss.c | 174 +++++++++-----
sound/core/oss/pcm_oss.c | 4
sound/core/pcm_lib.c | 66 ++---
sound/core/pcm_native.c | 140 ++++++-----
sound/core/rawmidi.c | 16 -
sound/core/seq/oss/seq_oss_readq.c | 7
sound/core/seq/oss/seq_oss_synth.c | 4
sound/core/seq/oss/seq_oss_writeq.c | 4
sound/core/seq/seq.c | 4
sound/core/seq/seq_clientmgr.c | 8
sound/core/seq/seq_fifo.c | 4
sound/core/seq/seq_lock.c | 2
sound/core/seq/seq_lock.h | 9
sound/core/seq/seq_memory.c | 12 -
sound/core/sound.c | 11
sound/core/sound_oss.c | 12 -
sound/core/timer.c | 4
sound/isa/es18xx.c | 24 +-
sound/isa/opl3sa2.c | 1
sound/isa/sb/emu8000.c | 2
sound/isa/wavefront/wavefront_synth.c | 2
sound/pci/Config.help | 2
sound/pci/Config.in | 21 -
sound/pci/emu10k1/emufx.c | 27 +-
sound/pci/ens1370.c | 6
sound/pci/ymfpci/ymfpci_main.c | 6
sound/usb/usbaudio.c | 28 +-
sound/usb/usbmixer.c | 405 ++++++++++++++++++++++------------
sound/usb/usbmixer_maps.c | 100 ++++++++
sound/usb/usbquirks.h | 66 ++---
42 files changed, 922 insertions(+), 483 deletions(-)

through these ChangeSets:

<[email protected]> (02/10/14 1.839)
ALSA update
- ES18xx - fixed detection and initialization of opl3 and mpu401
- ENS1370 - make inclusion of *_codec.h selective for each chipset
- usb audio
- unified get_min_max() function to retrieve the min and max values
- added the debug condition to ignore the error at get/put callbacks
- quirks - use USB_DEVICE without class interface

<[email protected]> (02/10/14 1.838)
ALSA update
- reduced stack usage for functions using >1024+ bytes
- fixed behaviour when OSS emulation is selected
- fix in kmod support for sequencer

<[email protected]> (02/10/13 1.837)
ALSA update
- compilation fixes without CONFIG_PROC_FS

<[email protected]> (02/10/13 1.836)
ALSA update
- USB driver update
- better extdigi support (mixer)
- cleanups in the audio code

<[email protected]> (02/10/13 1.835)
ALSA update
- added SNDRV_PCM_IOCTL_HWSYNC ioctl
- changed behaviour of read/write/poll functions
- prefer waiting than return an error code
- removed snd_seq_sleep_timeout_in_lock and snd_seq_sleep_in_lock helpers

<[email protected]> (02/10/13 1.834)
ALSA update
- fixes for compilation without CONFIG_PROC_FS

<[email protected]> (02/10/13 1.833)
ALSA update
- reduced stack usage (>1024 bytes) in ioctl32 routines and PCM routines
- PCM midlevel - fixed drop in release()
- OPL3SA2 - removed wrong inclusion of <linux/isapnp.h>
- EMU8000 - fixed compilation when sequencer is not selected
- Wavefront - fixed compilation for GCC3
- fixed gameport dependency in pci/Config.in
- EMU10K1 - fixed icode peek ioctl in emufx()
- YMFPCI - added FM legacy volume control

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com


2002-10-14 19:59:45

by David Miller

[permalink] [raw]
Subject: Re: ALSA update


This breaks the build on sparc64:

sound/core/ioctl32/ioctl32.h:95: parse error before `if'
sound/core/ioctl32/ioctl32.h:99: parse error before `sizeof'
sound/core/ioctl32/ioctl32.h:99: `data32' undeclared here (not in a function)
sound/core/ioctl32/ioctl32.h:99: warning: type defaults to `int' in declaration of `CVT_s\ndrv_type'
sound/core/ioctl32/ioctl32.h:99: warning: function declaration isn't a prototype
sound/core/ioctl32/ioctl32.h:99: warning: data definition has no type or storage class
sound/core/ioctl32/ioctl32.h:99: parse error before `}'
sound/core/ioctl32/ioctl32.h:99: warning: type defaults to `int' in declaration of `oldse\g'
sound/core/ioctl32/ioctl32.h:99: incompatible types in initialization
sound/core/ioctl32/ioctl32.h:99: initializer element is not constant
sound/core/ioctl32/ioctl32.h:99: warning: data definition has no type or storage class
sound/core/ioctl32/ioctl32.h:99: parse error before `do'
sound/core/ioctl32/ioctl32.h:99: warning: type defaults to `int' in declaration of `err'
sound/core/ioctl32/ioctl32.h:99: `file' undeclared here (not in a function)
sound/core/ioctl32/ioctl32.h:99: `file' undeclared here (not in a function)
sound/core/ioctl32/ioctl32.h:99: `file' undeclared here (not in a function)
sound/core/ioctl32/ioctl32.h:99: `native_ctl' undeclared here (not in a function)
sound/core/ioctl32/ioctl32.h:99: `data' undeclared here (not in a function)
sound/core/ioctl32/ioctl32.h:99: warning: data definition has no type or storage class
sound/core/ioctl32/ioctl32.h:99: parse error before `if'
sound/core/ioctl32/ioctl32.h:99: warning: type defaults to `int' in declaration of `err'
sound/core/ioctl32/ioctl32.h:99: redefinition of `err'
sound/core/ioctl32/ioctl32.h:99: `err' previously defined here
sound/core/ioctl32/ioctl32.h:99: warning: data definition has no type or storage class
sound/core/ioctl32/ioctl32.h:99: parse error before `if'
sound/core/ioctl32/ioctl32.h:99: `data32' undeclared here (not in a function)
sound/core/ioctl32/ioctl32.h:99: warning: type defaults to `int' in declaration of `CVT_s\ndrv_type'
sound/core/ioctl32/ioctl32.h:99: warning: function declaration isn't a prototype
sound/core/ioctl32/ioctl32.h:99: warning: data definition has no type or storage class
sound/core/ioctl32/ioctl32.h:99: parse error before `}'
sound/core/ioctl32/ioctl32.h:136: warning: This file contains more `}'s than `{'s.
sound/core/ioctl32/ioctl32.c: In function `_snd_ioctl32_ctl_elem_value':
sound/core/ioctl32/ioctl32.c:275: warning: implicit declaration of function `kmalloc_Rsmp\_6f6c1cf7'
sound/core/ioctl32/ioctl32.c:275: `GFP_KERNEL' undeclared (first use in this function)
sound/core/ioctl32/ioctl32.c:275: (Each undeclared identifier is reported only once
sound/core/ioctl32/ioctl32.c:275: for each function it appears in.)
sound/core/ioctl32/ioctl32.c:275: warning: assignment makes pointer from integer without \a cast
sound/core/ioctl32/ioctl32.c:276: warning: assignment makes pointer from integer without \a cast
sound/core/ioctl32/ioctl32.c:290: request for member `value' in something not a structure\ or union
sound/core/ioctl32/ioctl32.c:296: request for member `indirect' in something not a struct\ure or union
sound/core/ioctl32/ioctl32.c:331: request for member `indirect' in something not a struct\ure or union
sound/core/ioctl32/ioctl32.c:362: warning: implicit declaration of function `kfree_Rsmp_0\37a0cba'

2002-10-14 22:38:18

by Jaroslav Kysela

[permalink] [raw]
Subject: Re: ALSA update

On Mon, 14 Oct 2002, David S. Miller wrote:

> This breaks the build on sparc64:
>
> sound/core/ioctl32/ioctl32.h:95: parse error before `if'
> sound/core/ioctl32/ioctl32.h:99: parse error before `sizeof'

Oops. Missing two backslashes. It should be corrected with this patch
(already in linux-sound BK repository):

Index: ioctl32.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/ioctl32/ioctl32.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ioctl32.h 12 Oct 2002 14:18:09 -0000 1.9
+++ ioctl32.h 14 Oct 2002 22:28:27 -0000 1.10
@@ -91,11 +91,11 @@
if (data32 == NULL || data == NULL) { \
err = -ENOMEM; \
goto __end; \
- }
+ }\
if (copy_from_user(data32, (void*)arg, sizeof(*data32))) { \
err = -EFAULT; \
goto __end; \
- }
+ }\
memset(data, 0, sizeof(*data));\
convert_from_32(type, data, data32);\
oldseg = get_fs();\

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com



2002-10-15 09:50:33

by Jaroslav Kysela

[permalink] [raw]
Subject: Re: ALSA update

On Tue, 15 Oct 2002, Adrian Bunk wrote:

> On Mon, 14 Oct 2002, Jaroslav Kysela wrote:
>
> > Linus, please do a
> >
> > bk pull http://linux-sound.bkbits.net/linux-sound
> >...
>
> Hi Jaroslav,
>
> could you make it available as a GNU patch for non-BK users and post the
> URL?

Sure. The latest patch is at
ftp://ftp.alsa-project.org/pub/kernel-patches/alsa-bk-2002-10-15.patch.gz

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

2002-10-15 17:09:39

by David Miller

[permalink] [raw]
Subject: Re: ALSA update

From: Jaroslav Kysela <[email protected]>
Date: Tue, 15 Oct 2002 00:43:53 +0200 (CEST)

Oops. Missing two backslashes. It should be corrected with this patch
(already in linux-sound BK repository):

That's just the tip of the iceberg.

It fails again soon after that, none of the ioctl32.c/pcm32.c
changes were even _compile_ tested.

Try this instead:

--- ./sound/core/ioctl32/pcm32.c.~1~ Mon Oct 14 13:09:55 2002
+++ ./sound/core/ioctl32/pcm32.c Mon Oct 14 13:12:38 2002
@@ -20,6 +20,7 @@

#include <sound/driver.h>
#include <linux/time.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "ioctl32.h"
@@ -230,7 +231,7 @@ static int _snd_ioctl32_xfern(unsigned i
snd_pcm_file_t *pcm_file;
snd_pcm_substream_t *substream;
struct sndrv_xfern32 data32, *srcptr = (struct sndrv_xfern32*)arg;
- void *bufs = NULL;
+ void **bufs = NULL;
int err = 0, ch, i;
u32 *bufptr;
mm_segment_t oldseg;
@@ -260,7 +261,7 @@ static int _snd_ioctl32_xfern(unsigned i
return -EFAULT;
__get_user(data32.bufs, &srcptr->bufs);
bufptr = (u32*)TO_PTR(data32.bufs);
- bufs = kmalloc(sizeof(void *) * 128, GFP_KERNEL)
+ bufs = kmalloc(sizeof(void *) * 128, GFP_KERNEL);
if (bufs == NULL)
return -ENOMEM;
for (i = 0; i < ch; i++) {
@@ -352,8 +353,8 @@ static int _snd_ioctl32_pcm_hw_params_ol
mm_segment_t oldseg;
int err;

- data32 = kcalloc(sizeof(*data32), GFP_KERNEL);
- data = kcalloc(sizeof(*data), GFP_KERNEL);
+ data32 = snd_kcalloc(sizeof(*data32), GFP_KERNEL);
+ data = snd_kcalloc(sizeof(*data), GFP_KERNEL);
if (data32 == NULL || data == NULL) {
err = -ENOMEM;
goto __end;
--- ./sound/core/ioctl32/ioctl32.h.~1~ Mon Oct 14 13:01:25 2002
+++ ./sound/core/ioctl32/ioctl32.h Mon Oct 14 13:12:01 2002
@@ -86,16 +86,16 @@ static int _snd_ioctl32_##type(unsigned
struct sndrv_##type *data;\
mm_segment_t oldseg;\
int err;\
- data32 = kcalloc(sizeof(*data32), GFP_KERNEL); \
- data = kcalloc(sizeof(*data), GFP_KERNEL); \
+ data32 = snd_kcalloc(sizeof(*data32), GFP_KERNEL); \
+ data = snd_kcalloc(sizeof(*data), GFP_KERNEL); \
if (data32 == NULL || data == NULL) { \
err = -ENOMEM; \
goto __end; \
- }
+ } \
if (copy_from_user(data32, (void*)arg, sizeof(*data32))) { \
err = -EFAULT; \
goto __end; \
- }
+ } \
memset(data, 0, sizeof(*data));\
convert_from_32(type, data, data32);\
oldseg = get_fs();\
--- ./sound/core/ioctl32/ioctl32.c.~1~ Mon Oct 14 13:02:21 2002
+++ ./sound/core/ioctl32/ioctl32.c Mon Oct 14 13:03:35 2002
@@ -23,6 +23,7 @@
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/time.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <sound/core.h>
#include <sound/control.h>
@@ -287,13 +288,13 @@ static int _snd_ioctl32_ctl_elem_value(u
data->id = data32->id;
data->indirect = data32->indirect;
if (data->indirect) /* FIXME: this is not correct for long arrays */
- data.value.integer.value_ptr = (void*)TO_PTR(data32->value.integer.value_ptr);
+ data->value.integer.value_ptr = (void*)TO_PTR(data32->value.integer.value_ptr);
type = get_ctl_type(file, &data->id);
if (type < 0) {
err = type;
goto __end;
}
- if (! data.indirect) {
+ if (! data->indirect) {
switch (type) {
case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
case SNDRV_CTL_ELEM_TYPE_INTEGER:
@@ -328,7 +329,7 @@ static int _snd_ioctl32_ctl_elem_value(u
if (err < 0)
goto __end;
/* restore info to 32bit */
- if (! data.indirect) {
+ if (! data->indirect) {
switch (type) {
case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
case SNDRV_CTL_ELEM_TYPE_INTEGER:

2002-10-15 19:41:07

by Jaroslav Kysela

[permalink] [raw]
Subject: Re: ALSA update

On Tue, 15 Oct 2002, David S. Miller wrote:

> From: Jaroslav Kysela <[email protected]>
> Date: Tue, 15 Oct 2002 00:43:53 +0200 (CEST)
>
> Oops. Missing two backslashes. It should be corrected with this patch
> (already in linux-sound BK repository):
>
> That's just the tip of the iceberg.
>
> It fails again soon after that, none of the ioctl32.c/pcm32.c
> changes were even _compile_ tested.

Thanks. Applied to linux-sound repository.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

2002-10-15 19:47:02

by David Miller

[permalink] [raw]
Subject: Re: ALSA update

From: Jaroslav Kysela <[email protected]>
Date: Tue, 15 Oct 2002 21:45:56 +0200 (CEST)

On Tue, 15 Oct 2002, David S. Miller wrote:

> It fails again soon after that, none of the ioctl32.c/pcm32.c
> changes were even _compile_ tested.

Thanks. Applied to linux-sound repository.

And what are you going to do in the future to make sure
the sound/ioctl32/ changes you submit in the future even
compile?

2002-10-16 16:14:31

by Takashi Iwai

[permalink] [raw]
Subject: Re: ALSA update

At Tue, 15 Oct 2002 12:45:40 -0700 (PDT),
David S. Miller <[email protected]> wrote:
>
> From: Jaroslav Kysela <[email protected]>
> Date: Tue, 15 Oct 2002 21:45:56 +0200 (CEST)
>
> On Tue, 15 Oct 2002, David S. Miller wrote:
>
> > It fails again soon after that, none of the ioctl32.c/pcm32.c
> > changes were even _compile_ tested.
>
> Thanks. Applied to linux-sound repository.
>
> And what are you going to do in the future to make sure
> the sound/ioctl32/ changes you submit in the future even
> compile?

I'll test before submitting.
this time I had no chance, though...

--
Takashi Iwai <[email protected]> SuSE Linux AG - http://www.suse.de
ALSA Developer ALSA Project - http://www.alsa-project.org