aboutsummaryrefslogtreecommitdiff
path: root/sound/core
AgeCommit message (Collapse)Author
2008-01-31[ALSA] Remove PCM xfer_align sw paramsTakashi Iwai
The xfer_align sw_params parameter has never been used in a sane manner, and no one understands what this does exactly. The current implementation looks also buggy because it allows write of shorter size than xfer_align. So, if you do partial writes, the write isn't actually aligned at all. Removing this parameter will make some pcm_lib_* code more readable (and less buggy). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Fix PCM write blockingTakashi Iwai
The snd_pcm_lib_write1() may block in some weird condition: - the stream isn't started - avail_min is big (e.g. period size) - partial write up to buffer_size - avail_min The patch fixes this invalid blocking problem. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Remove indirect control accessTakashi Iwai
This patch removes the indirect control access to the control elements. The indirect access has never been used and is even broken on 32bit ioctl wrapper. Let's clean it up. The pointers still remain in snd_ctl_elem_* structs just to make sure that the struct size won't change. Once after checking the size consistency, we can get rid of them, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] PCM core - remove SNDRV_PCM_TSTAMP_MMAP condition in snd_pcm_status()Jaroslav Kysela
The condition caused that the returned ring buffer position does not match with timestamp when SNDRV_PCM_TSTAMP_MMAP mode was enabled. Removing condition makes unified behaviour and interrupt based timestamp can be accessed via PCM_IOCTL_SYNC_PTR or mmaped status area. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Add SNDRV_PCM_IOCTL_TSTAMP back to compat ioctlTakashi Iwai
The replaced one should be re-added for older alsa-lib. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] PCM - added back TSTAMP ioctl for PCM (for old alsa-lib binaries)Jaroslav Kysela
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] sound/core/seq: move declarations of globally visible variables to ↵Marcin Ślusarz
proper headers sound/core/seq: move declarations of globally visible variables to proper headers Signed-off-by: Marcin Ślusarz <marcin.slusarz@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] info_oss: move prototype of snd_card_info_read_oss to info.hMarcin Ślusarz
info_oss: move prototype of snd_card_info_read_oss to info.h Signed-off-by: Marcin Ślusarz <marcin.slusarz@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] pcm_lib: fix sparse warning about different signednessMarcin Ślusarz
pcm_lib: fix sparse warning about different signedness Signed-off-by: Marcin Ślusarz <marcin.slusarz@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] pcm_lib: fix sparse warning about shadowing 'n' symbolMarcin Ślusarz
pcm_lib: fix sparse warning about shadowing 'n' symbol Signed-off-by: Marcin Ślusarz <marcin.slusarz@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] pcm_native: fix sparse warning about shadowing 'state' symbolMarcin Ślusarz
pcm_native: fix sparse warning about shadowing 'state' symbol Signed-off-by: Marcin Ślusarz <marcin.slusarz@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] copy_ctl_value_from_user() warning fixAndrew Morton
sound/core/control_compat.c: In function 'copy_ctl_value_from_user': sound/core/control_compat.c:222: warning: 'count' may be used uninitialized in this function Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Fix old tstamp ioctl for compat_ioctlTakashi Iwai
Replaced the old SNDRV_PCM_IOCTL_TSTAMP with the new one in PCM compat_ioctl. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] alsa: nopageNick Piggin
Convert ALSA from nopage to fault. Switch from OOM to SIGBUS if the resource is not available. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] PCM - fixed SNDRV_PCM_FORMAT_U24_BE silence constantJaroslav Kysela
Reported by Timur Tabi <timur@freescale.com> . Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Use posix clock monotonic for PCM and timer timestampsJaroslav Kysela
We need an accurate and continuous (monotonic) time sources to do accurate synchronization among more timing sources. This patch allows to enable monotonic timestamps for ALSA PCM devices and enables monotonic timestamps for ALSA timer devices. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] sound/core/memalloc.c: Add missing pci_dev_putJulia Lawall
There should be a pci_dev_put when breaking out of a loop that iterates over calls to pci_get_device and similar functions. In this case, the return under the initial if needs a pci_dev_put in the same way that the return under the subsequent for loop has a pci_dev_put. This was fixed using the following semantic patch. // <smpl> @@ type T; identifier d; expression e; @@ T *d; ... while ((d = \(pci_get_device\|pci_get_device_reverse\|pci_get_subsys\|pci_get_class\)(..., d)) != NULL) {... when != pci_dev_put(d) when != e = d ( return d; | + pci_dev_put(d); ? return ...; ) ...} // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Fix PCM MMAP time-stamp modeTakashi Iwai
When MMAP time-stamp mode is given, it's supposed to update the time-stamp only at period boundary. However, it currently updates at each status call so this is just useless. The patch fixes this misbehavior. Also it fixes the wrong check of tstamp_mode (don't use bit-and for enum). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Remove sequencer instrument layerTakashi Iwai
Remove sequencer instrument layer from the tree. This mechanism hasn't been used much with the actual devices. The only reasonable user was OPL3 loader, and now it was rewritten to use hwdep instead. So, let's remove the rest of rotten codes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Introduce slots option to snd moduleTakashi Iwai
Introduced the global 'slots' option to snd module. This option provides an alternative way to handle the order of multiple sound card instances. It's an easier approach to avoid conflict with hotplug devices, and can be used together with the existing 'order' option of each card driver. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-08snd_mixer_oss_build_input(): fix for __you_cannot_kmalloc_that_much failure ↵Jean Delvare
with gcc-3.2 Rework this functions so that gcc-3.2 can successfully perform constant-folding. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-23[ALSA] sound/core/control.c: hard-irq-safe -> hard-irq-unsafe lock warningBorislav Petkov
The lock grabbed in snd_ctl_empty_read_queue() is hardirq-unsafe but we hold an hardirq-safe one already, so make the &ctl->read_lock also hard-irq-safe. Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-10-19Fix misspellings of "system", "controller", "interrupt" and "necessary".Robert P. J. Day
Fix the various misspellings of "system", controller", "interrupt" and "[un]necessary". Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-16[ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.czJaroslav Kysela
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-10-16[ALSA] sound: snd_register_device_for_dev fixMariusz Kozlowski
snd_register_device_for_dev() can oops when device_create() returns ERR_PTR(err). Scenario: preg->dev = device_create(...); /* fails */ if (preg->dev) /* contains ERR_PTR(err) */ dev_set_drvdata(preg->dev, private_data); and dev_set_drvdata() looks like this: static inline void dev_set_drvdata (struct device *dev, void *data) { dev->driver_data = data; <--- boom } This patch should prevent that. Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] schedule_timeout() fix for core/seq/seq_instr.cRene Herman
Replace schedule_timeout() with schedule_timeout_uninterruptible() to avoid signals in loop. Signed-off-by: Rene Herman <rene.herman@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] unexport snd_ctl_elem_{read,write}Adrian Bunk
snd_ctl_elem_{read,write} no longer have any modular users Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] pcm: add snd_pcm_rate_to_rate_bit() helperClemens Ladisch
Add a snd_pcm_rate_to_rate_bit() function to factor out common code used by several drivers. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] pcm: merge rates[] from pcm_misc.c and pcm_native.cClemens Ladisch
Merge the rates[] arrays from pcm_misc.c and pcm_native.c because they are both the same. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] seq_midi_event: fix parsing of F9/FD bytesClemens Ladisch
Check for a valid event type when encoding a system real-time message to prevent the bytes F9 or FD resulting in an empty sequencer message. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] seq_midi_event: fix parsing of missing data bytesClemens Ladisch
Reorganize the encoder logic to prevent status bytes that appear where data bytes are expected from being interpreted as data bytes. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] seq_midi_event: prevent running status after system messagesClemens Ladisch
Reset the event type after encoding a system message to prevent any following data bytes from being interpreted as data for a running status system message, which is not allowed in MIDI. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] seq_midi_event: fix encoding of data bytes after end of sysexClemens Ladisch
Create a new state ST_INVALID for the encoder to prevent data bytes at the beginning of a stream or after a sysex message being interpreted as note-off parameters. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] Add new AFMT_* formats for OSS emulationTakashi Iwai
The recent OSS includes the support for 32bit and other formats, which we already have, too. Let's define and map them. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] Support 3-bytes 24bit format in PCM OSS emulationTakashi Iwai
Add the support of 3-bytes 24bit formats in PCM OSS emulation. Also removed snd_pcm_build_linear_format() function. It's exported just for OSS emulation, and now the code was changed without calling this function. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] Simplify the format conversion in PCM OSS emulationTakashi Iwai
Simplify the format conversion code in PCM OSS emulation. This patch also adds the support of 3bytes 24bit formats with linear and mulaw, but they are not enabled in pcm_plugin.c yet. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] Remove ifdefs from OSS PCM emulation codesTakashi Iwai
Fix Makefile to compile files conditionally to CONFIG_SND_PCM_OSS_PLUGINS, and remove unneeded ifdefs in these files. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] seq: resource leak fix and various code cleanupsEugene Teo
This patch fixes: 1) a resource leak (CID: 1817) 2) various code cleanups Signed-off-by: Eugene Teo <eugeneteo@kernel.sg> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] Clean up MakefileTakashi Iwai
Clean up Makefile using xxx- style instead of ifeq(CONFIG_XXX,y). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] Fix build error without CONFIG_HAS_DMATakashi Iwai
The recent change of include/asm-generic/dma-mapping-broken.h breaks the build without CONFIG_HAS_DMA. This patch is an ad hoc fix. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] Add helper functions for frequently used callbacksTakashi Iwai
Added helper functions for frequenty used callbacks: snd_ctl_boolean_mono_info() and snd_ctl_boolean_stereo_info() Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] Clean up duplicate includes in sound/core/Jesper Juhl
This patch cleans up duplicate includes in sound/core/ Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-09-24Convert snd-page-alloc proc file to use seq_fileTakashi Iwai
Use seq_file for the proc file read/write of snd-page-alloc module. This automatically fixes bugs in the old proc code. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-20[ALSA] timer: check for incorrect device state in non-debug compiles, tooClemens Ladisch
Convert the snd_assert()s to simple if()s to prevent crashes when one of the timer instance ioctls is called before the file is bound to a timer device. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-07-20[ALSA] Fix substream to check in PCM drainTakashi Iwai
The check of a substream in snd_pcm_drain() might not be always correct since runtime can point a different substream (although the PCM state of each linked substream should be same, in theory). This patch fixes it. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-07-20[ALSA] Fix invalid schedule_timeout_interruptible()Takashi Iwai
Fixed the invalid use of schedule_timeout_interruptible() without checking pending signals. Simply replaced with schedule_timeout(). Suggestions thanks to Jeff Garzik. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-07-19some kmalloc/memset ->kzalloc (tree wide)Yoann Padioleau
Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc). Here is a short excerpt of the semantic patch performing this transformation: @@ type T2; expression x; identifier f,fld; expression E; expression E1,E2; expression e1,e2,e3,y; statement S; @@ x = - kmalloc + kzalloc (E1,E2) ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\) - memset((T2)x,0,E1); @@ expression E1,E2,E3; @@ - kzalloc(E1 * E2,E3) + kcalloc(E1,E2,E3) [akpm@linux-foundation.org: get kcalloc args the right way around] Signed-off-by: Yoann Padioleau <padator@wanadoo.fr> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Acked-by: Russell King <rmk@arm.linux.org.uk> Cc: Bryan Wu <bryan.wu@analog.com> Acked-by: Jiri Slaby <jirislaby@gmail.com> Cc: Dave Airlie <airlied@linux.ie> Acked-by: Roland Dreier <rolandd@cisco.com> Cc: Jiri Kosina <jkosina@suse.cz> Acked-by: Dmitry Torokhov <dtor@mail.ru> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Acked-by: Pierre Ossman <drzeus-list@drzeus.cx> Cc: Jeff Garzik <jeff@garzik.org> Cc: "David S. Miller" <davem@davemloft.net> Acked-by: Greg KH <greg@kroah.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-19unregister_chrdev(): ignore the return valueAkinobu Mita
unregister_chrdev() always returns 0. There is no need to check the return value. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-11[ALSA] pcm_native: lockdep warning when launching jackFrederik Deweerdt
When launching 'jackd -d alsa', lockdep issues the following warning: [39701.405086] ============================================= [39701.405093] [ INFO: possible recursive locking detected ] [39701.405107] 2.6.21-rc5-mm4 #2 [39701.405109] --------------------------------------------- [39701.405112] jackd/17366 is trying to acquire lock: [39701.405114] (&substream->self_group.lock){....}, at: [<c034d3c0>] snd_pcm_action_group+0x90/0x240 [39701.405131] [39701.405131] but task is already holding lock: [39701.405134] (&substream->self_group.lock){....}, at: [<c034d63f>] snd_pcm_action_lock_irq+0x3f/0xb0 [39701.405141] [39701.405142] other info that might help us debug this: [39701.405145] 3 locks held by jackd/17366: [39701.405147] #0: (snd_pcm_link_rwlock){....}, at: [<c034d627>] snd_pcm_action_lock_irq+0x27/0xb0 [39701.405155] #1: (&substream->group->lock){....}, at: [<c034d638>] snd_pcm_action_lock_irq+0x38/0xb0 [39701.405163] #2: (&substream->self_group.lock){....}, at: [<c034d63f>] snd_pcm_action_lock_irq+0x3f/0xb0 [39701.405171] [39701.405171] stack backtrace: [39701.405174] [<c0103b8a>] show_trace_log_lvl+0x1a/0x30 [39701.405179] [<c0104912>] show_trace+0x12/0x20 [39701.405183] [<c01049c6>] dump_stack+0x16/0x20 [39701.405187] [<c013b980>] __lock_acquire+0xbd0/0x1040 [39701.405193] [<c013be60>] lock_acquire+0x70/0x90 [39701.405197] [<c0407846>] _spin_lock+0x36/0x50 [39701.405203] [<c034d3c0>] snd_pcm_action_group+0x90/0x240 [39701.405207] [<c034d653>] snd_pcm_action_lock_irq+0x53/0xb0 [39701.405211] [<c035046f>] snd_pcm_common_ioctl1+0x35f/0xfb0 [39701.405215] [<c0351544>] snd_pcm_playback_ioctl1+0x34/0x420 [39701.405219] [<c03519f3>] snd_pcm_playback_ioctl+0x43/0x50 [39701.405223] [<c017ecc8>] do_ioctl+0x28/0x80 [39701.405229] [<c017ed77>] vfs_ioctl+0x57/0x290 [39701.405233] [<c017efe9>] sys_ioctl+0x39/0x60 [39701.405237] [<c0102bf4>] sysenter_past_esp+0x5d/0x99 [39701.405240] ======================= The attached lockdep annotation silences the warning. Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-05-11[ALSA] is_power_of_2 in rtctimer.cvignesh babu
Replacing (n & (n-1)) in the context of power of 2 checks with is_power_of_2 Signed-off-by: vignesh babu <vignesh.babu@wipro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>