Commit Graph

142 Commits

Author SHA1 Message Date
Takashi Iwai
c6077b3000 [ALSA] Fix memory leaks in error path of control.c
Modules: Control Midlevel

Fix memory leaks in error path of control.c (only with CONFIG_SND_DEBUG=y).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:43:56 +01:00
Eugene Teo
e64d2e3623 [ALSA] Fix seq_clientmgr dereferences before NULL check
Modules: ALSA sequencer

cptr->pool must be non-NULL there, so just the if (cptr->pool) is
superfluous. Thanks Takashi.

Signed-off-by: Eugene Teo <eugene.teo@eugeneteo.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:39:23 +01:00
Adrian Bunk
3a63e44420 [ALSA] sound/core/: fix 3 off-by-one errors
Modules: ALSA Core

This patch fixes three off-by-one errors found by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:37:31 +01:00
Giuliano Pochini
646494007b [ALSA] make control.c suspend aware
Modules: Control Midlevel

This patch prevents user-space apps from accessing the hardware via
control interface while the soundcard is suspended.

Signed-off-by: Giuliano Pochini <pochini@shiny.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:37:23 +01:00
Clemens Ladisch
b3b0abe11d [ALSA] return ENODEV for disconnected devices
Modules: ALSA Core

Add dummy functions that return -ENODEV for the struct file_operations
of a disconnected device.  Without such functions, userspace would get
ENOTTY.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-03-22 10:34:24 +01:00
Takashi Iwai
62c5549ee2 [ALSA] Fix sleep in atomic in virmidi driver
Modules: ALSA sequencer

 Debug: sleeping function called from invalid context at /usr/src/linux/include/linux/rwsem.h:43
 in_atomic():1, irqs_disabled():0
  [<f999d15e>] snd_seq_deliver_event+0xb4/0x1a8 [snd_seq]
  [<f999d2be>] snd_seq_kernel_client_dispatch+0x6c/0x7c [snd_seq]
  [<f93321fc>] snd_virmidi_output_trigger+0xca/0xe5 [snd_seq_virmidi]

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:30:58 +01:00
Takashi Iwai
e661d0ddc5 [ALSA] pcm - Move PAUSE ioctl to common ioctl handler
Modules: PCM Midlevel

Moved PAUSE ioctl to the common ioctl handler.
A capture stream may issue PAUSE, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:30:48 +01:00
Takashi Iwai
2ba8c15c73 [ALSA] Removed unneeded page-reserve
Modules: Memalloc module

Removed unneeded page-reservation.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:28:12 +01:00
Takashi Iwai
ea50888d83 [ALSA] Use dma_alloc_coherent() hack on i386 only
Modules: Memalloc module

Use dma_alloc_coherent() hack on i386 only (as a valid arch).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:28:06 +01:00
Takashi Iwai
c82590d2b2 [ALSA] Fix mulaw -> linear conversion in OSS PCM emulation
Modules: ALSA<-OSS emulation

Fixed the missing mulaw -> linear conversion in OSS PCM emulation code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:28:02 +01:00
Jaroslav Kysela
3f72a30ccf [ALSA] snd_pcm_format_name() is no longer exported
Modules: PCM Midlevel,USB generic driver

Because snd_pcm_format_name() function is used only for informational
purposes, it is no longer exported from the PCM midlevel to reduce
space and dependency. usbaudio module shows only numeric value for format.

Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-03-22 10:27:05 +01:00
Ingo Molnar
1a60d4c5a0 [ALSA] semaphore -> mutex (core part)
Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:24:50 +01:00
Takashi Iwai
0534ab4279 [ALSA] Clean up pcm-oss plugins
Modules: ALSA<-OSS emulation

Clean up pcm-oss plugin codes.
Removed dead codes, and simplified route/rate plugins.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:23:20 +01:00
Takashi Iwai
9d83911ac0 [ALSA] Fix a typo
Modules: ALSA<-OSS emulation

Fixed a typo.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22 10:23:16 +01:00
Jaroslav Kysela
21a3479a0b [ALSA] PCM midlevel & PCM OSS - make procfs & OSS plugin code optional
Modules: ALSA Core,PCM Midlevel,ALSA<-OSS emulation,USB generic driver

1) The verbose procfs code for the PCM midlevel and usb audio
   can be removed now (more patches will follow).
   CONFIG_SND_VERBOSE_PROCFS
2) The PCM OSS plugin system can be also compiled optionaly.
   CONFIG_SND_PCM_OSS_PLUGINS

Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-03-22 10:23:12 +01:00
Takashi Iwai
2fbf182ed0 [PATCH] alsa: fix error paths in snd_ctl_elem_add()
Fix bugs in error paths of snd_ctl_elem_add()
 - NULL reference
 - double free (already freed in snd_ctl_add())

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-06 18:40:44 -08:00
Juergen Kreileder
aa657ca924 [PATCH] Fix snd-usb-audio in 32-bit compat environment
I'm getting oopses with snd-usb-audio in 32-bit compat environments:
control_compat.c:get_ctl_type() doesn't initialize 'info', so
'itemlist[uinfo->value.enumerated.item]' in
usbmixer.c:mixer_ctl_selector_info() might access random memory (The 'if
((int)uinfo->value.enumerated.item >= cval->max)' doesn't fix all problems
because of the unsigned -> signed conversion.)

Signed-off-by: Juergen Kreileder <jk@blackdown.de>
Cc: Jaroslav Kysela <perex@suse.cz>
Acked-by: Takashi Iwai <tiwai@suse.de>
Cc: Greg KH <greg@kroah.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-20 20:00:10 -08:00
Ingo Molnar
d99e98891c [ALSA] Remove BKL from sound/core/info.c
Modules: ALSA Core

Remove BKL from sound/core/info.c

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-22 16:23:57 +01:00
Jes Sorensen
1b1dcc1b57 [PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
This patch converts the inode semaphore to a mutex. I have tested it on
XFS and compiled as much as one can consider on an ia64. Anyway your
luck with it might be different.

Modified-by: Ingo Molnar <mingo@elte.hu>

(finished the conversion)

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2006-01-09 15:59:24 -08:00
Takashi Iwai
3e23c65883 [ALSA] Revert the nested-device patch
Modules: ALSA Core

Revert the nested-device patch to keep the compatibility with the
current HAL configuration.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-04 10:13:48 +01:00
Clemens Ladisch
aa1e77e691 [ALSA] seq: reorganize sequencer client numbers
Modules: ALSA sequencer

Reduce the maximum possible number of global clients to 16 to make
more numbers available for card clients, and allow dynamically allocated
card client numbers to share the same range as application client
numbers to make sure that all 32 cards can be used at the same time.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:30:50 +01:00
Clemens Ladisch
7b6d92451a [ALSA] seq: set client name in snd_seq_create_kernel_client()
All users of snd_seq_create_kernel_client() have to set the client name
anyway, so we can just pass the name as parameter.  This relieves us
from having to muck around with a struct snd_seq_client_info in these
cases.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:30:49 +01:00
Clemens Ladisch
83e8ad6984 [ALSA] seq: remove struct snd_seq_client_callback
The fields of struct snd_seq_client_callback either aren't used or are
always set to the same value, so we can get rid of it altogether.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:30:47 +01:00
Clemens Ladisch
255bd169ab [ALSA] seq: remove superfluous fields
Modules: ALSA sequencer

None of the fields of struct snd_seq_kernel_client was actually used, so
remove them.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:30:45 +01:00
Takashi Iwai
235475cb77 [ALSA] pcm - Fix wrong asserts
Modules: PCM Midlevel

Fixed wrong or supreflous snd_assert()'s.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:30:41 +01:00
Clemens Ladisch
416c1079d3 [ALSA] Nest sound devices
Modules: ALSA Core

Make the control device parent of all other ALSA devices of a card.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:30:36 +01:00
Takashi Iwai
59d4858250 [ALSA] pcm - Make the support of old API selectable
Modules: ALSA Core,PCM Midlevel

Make the support of old API selectable via config option.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:30:10 +01:00
Takashi Iwai
04f141a880 [ALSA] Optimize for config without PROC_FS (seq and oss parts)
Modules: ALSA<-OSS emulation,ALSA sequencer,ALSA<-OSS sequencer

Optimize the code when compiled without CONFIG_PROC_FS (in seq and oss
emulation parts).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:30:05 +01:00
Takashi Iwai
e28563cceb [ALSA] Optimize for config without PROC_FS
Modules: HWDEP Midlevel,ALSA Core,PCM Midlevel,Timer Midlevel

Optimize the code when compiled without CONFIG_PROC_FS.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:30:02 +01:00
Adrian Bunk
18612048b3 [ALSA] sound/: possible cleanups
Modules: RawMidi Midlevel,HDA generic driver

This patch contains the following possible cleanups:
- pci/hda/hda_proc.c should #include 'hda_local.h' for including the
  prototype of it's global function snd_hda_codec_proc_new()
- core/rawmidi.c: make the needlessly global and EXPORT_SYMBOL'ed
  function snd_rawmidi_info() static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:29:40 +01:00
Takashi Iwai
9a1a2a1d4e [ALSA] Fix a missing include
Modules: ALSA Core

Fix missing include <linux/device.h>

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:29:38 +01:00
Clemens Ladisch
1b98ea4791 [ALSA] rawmidi: adjust runtime->avail when changing output buffer size
Modules: RawMidi Midlevel

When the output buffer size is changed, runtime->avail must be
adjusted to the new size; otherwise, draining of a bigger buffer would
appear to fail because avail does not reach buffer_size.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:29:25 +01:00
Clemens Ladisch
d001544ded [ALSA] dynamic minors (6/6): increase maximum number of sound cards
Modules: ALSA Core,Memalloc module,ALSA sequencer

With dynamic minor numbers, we can increase the number of sound cards.

This requires that the sequencer client numbers of some kernel drivers
are allocated dynamically, too.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:29:21 +01:00
Clemens Ladisch
204bdb1b50 [ALSA] dynamic minors (5/6): reduce maximum number of MIDI devices per card
Modules: ALSA sequencer,Generic drivers

To allow increasing the maximum number of sound cards, we have to limit
the number of sequencer clients per card because client numbers are
still allocated statically.

Reducing the number of clients to four limits the number of sequencer
MIDI ports to 1024 per card.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:29:20 +01:00
Clemens Ladisch
332682b1cd [ALSA] dynamic minors (4/6): dynamic minor number allocation
Modules: ALSA Core,ALSA Minor Numbers

Add an option to allocate device file minor numbers dynamically.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:29:19 +01:00
Clemens Ladisch
f87135f56c [ALSA] dynamic minors (3/6): store device-specific object pointers dynamically
Instead of storing the pointers to the device-specific structures in an
array, put them into the struct snd_minor, and look them up dynamically.

This makes the device type modules independent of the minor number
encoding.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:29:17 +01:00
Clemens Ladisch
6983b7240c [ALSA] dynamic minors (2/6): simplify storage of snd_minor structures
Modules: ALSA Core

Store the snd_minor structure pointers in one array instead of using a
separate list for each card.  This simplifies the mapping from device
files to minor struct by removing the need to know about the encoding
of the card number in the minor number.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:29:15 +01:00
Clemens Ladisch
2af677fc88 [ALSA] dynamic minors (1/6): store device type in struct snd_minor
Instead of a comment string, store the device type in the snd_minor
structure.  This makes snd_minor more flexible, and has the nice side
effect that we don't need anymore to create a separate snd_minor
template for registering a device but can pass the file_operations
directly to snd_register_device().

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:29:14 +01:00
Clemens Ladisch
a106cd3d9e [ALSA] rawmidi: protect against invalid device number in snd_rawmidi_info_select()
Modules: RawMidi Midlevel

In snd_rawmidi_info_select(), check that the device identified by the
passed device number actually exists.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03 12:29:12 +01:00
Takashi Iwai
b32425ac93 [ALSA] Fix possible races in timer callbacks
Fix possible races in timer callbacks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:29:08 +01:00
Takashi Iwai
73e77ba023 [ALSA] Add error messages
Add error messages in the critial error path to be more verbose.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:28:58 +01:00
Takashi Iwai
603bf524aa [ALSA] pcm - NULL check in snd_pcm_suspend*()
Modules: PCM Midlevel

Add NULL check in snd_pcm_suspend*() so that the caller doesn't have to do it
by itself.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:20:20 +01:00
Takashi Iwai
a381a7a664 [ALSA] Decentralize PM control
Modules: ALSA Core,Control Midlevel,/oss/Makefile

Remove the centralized PM control in the sound core.
Each driver is responsible to get callbacks from bus/driver now.

SND_GENERIC_DRIVER is removed together with this action.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:20:19 +01:00
Takashi Iwai
080dece346 [ALSA] Remove xxx_t typedefs: Sequencer OSS-emulation
Modules: ALSA<-OSS sequencer,ALSA sequencer

Remove xxx_t typedefs from the core sequencer OSS-emulation codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:17:57 +01:00
Takashi Iwai
19ac31e82c [ALSA] Remove xxx_t typedefs: Instrument layer
Modules: Instrument layer

Remove xxx_t typedefs from the core instrument layer codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:17:54 +01:00
Takashi Iwai
c7e0b5bf9f [ALSA] Remove xxx_t typedefs: Sequencer
Modules: ALSA sequencer

Remove xxx_t typedefs from the core sequencer codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:17:52 +01:00
Takashi Iwai
6ac77bc180 [ALSA] Remove xxx_t typedefs: PCM OSS-emulation
Modules: ALSA<-OSS emulation

Remove xxx_t typedefs from the core PCM OSS-emulation codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:17:48 +01:00
Takashi Iwai
f956b4a3ae [ALSA] Remove xxx_t typedefs: Mixer OSS-emulation
Modules: ALSA<-OSS emulation

Remove xxx_t typedefs from the core mixer OSS-emulation codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:17:47 +01:00
Takashi Iwai
174c1f65e5 [ALSA] Remove xxx_t typedefs: OSS-emulation
Modules: ALSA Core

Remove xxx_t typedefs from the core OSS-emulation codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:17:44 +01:00
Takashi Iwai
877211f5e1 [ALSA] Remove xxx_t typedefs: PCM
Modules: PCM Midlevel

Remove xxx_t typedefs from the core PCM codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:17:43 +01:00