aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
Commit message (Collapse)AuthorAge
* Merge branch 'topic/seq-midi-fix' into for-linusTakashi Iwai2009-06-22
|\ | | | | | | | | * topic/seq-midi-fix: sound: seq_midi_event: fix decoding of (N)RPN events
| * sound: seq_midi_event: fix decoding of (N)RPN eventsClemens Ladisch2009-06-22
| | | | | | | | | | | | | | | | | | | | When decoding (N)RPN sequencer events into raw MIDI commands, the extra_decode_xrpn() function had accidentally swapped the MSB and LSB controller values of both the parameter number and the data value. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'topic/pcm-jiffies-check' into for-linusTakashi Iwai2009-06-22
|\ \ | | | | | | | | | | | | * topic/pcm-jiffies-check: sound: fix check for return value in snd_pcm_hw_refine
| * | sound: fix check for return value in snd_pcm_hw_refineMariusz Kozlowski2009-06-22
| | | | | | | | | | | | | | | | | | | | | | | | 'params' is a pointer and looking at the code this probably should be a check for ioctl return value. Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | Merge branch 'topic/misc' into for-linusTakashi Iwai2009-06-12
|\ \ \ | | | | | | | | | | | | | | | | * topic/misc: ALSA: use card device as parent for jack input-devices
| * | | ALSA: use card device as parent for jack input-devicesKay Sievers2009-06-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the jack devices from the PCI device into the ALSA card device, which makes it easier for userspace to find all devices belonging to a specific card while granting access to logged-in users. Jack input devices from sound cards can now simply be matched with udev by doing: SUBSYSTEM="input", SUBSYSTEMS="sound", ... ls -l /sys/devices/pci0000:00/0000:00:1b.0/sound/card0 controlC0 device -> ../../../0000:00:1b.0 id input10 input11 input8 input9 number pcmC0D0c pcmC0D0p pcmC0D1p power subsystem -> ../../../../../class/sound uevent Cc: Lennart Poettering <lennart@0pointer.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | Merge branch 'topic/seq-kconfig-cleanup' into for-linusTakashi Iwai2009-06-10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * topic/seq-kconfig-cleanup: ALSA: clean up the logic for building sequencer modules
| * | | | ALSA: clean up the logic for building sequencer modulesMichal Marek2009-05-29
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of mangling the CONFIG_* variables in the makefiles over and over, set a few helper variables in Kconfig. Signed-off-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | Merge branch 'topic/pcm-jiffies-check' into for-linusTakashi Iwai2009-06-10
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * topic/pcm-jiffies-check: ALSA: pcm - A helper function to compose PCM stream name for debug prints ALSA: pcm - Fix update of runtime->hw_ptr_interrupt ALSA: pcm - Fix a typo in hw_ptr update check ALSA: PCM midlevel: lower jiffies check margin using runtime->delay value ALSA: PCM midlevel: Do not update hw_ptr_jiffies when hw_ptr is not changed ALSA: PCM midlevel: introduce mask for xrun_debug() macro ALSA: PCM midlevel: improve fifo_size handling
| * | | ALSA: pcm - A helper function to compose PCM stream name for debug printsTakashi Iwai2009-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a common helper function for the PCM stream name displayed in XRUN and buffer-pointer debug prints. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: pcm - Fix update of runtime->hw_ptr_interruptTakashi Iwai2009-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 13f040f9e55d41e92e485389123654971e03b819 made another regression, the missing update of runtime->hw_ptr_interrupt. Since this field is only checked in snd_pcmupdate__hw_ptr_interrupt(), not in snd_pcm_update_hw_ptr(), it must be updated before the hw_ptr change check. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: pcm - Fix a typo in hw_ptr update checkJaroslav Kysela2009-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a typo in the commit 13f040f9e55d41e92e485389123654971e03b819 ALSA: PCM midlevel: Do not update hw_ptr_jiffies when hw_ptr is not changed which causes obvious problems with PA. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: PCM midlevel: lower jiffies check margin using runtime->delay valueJaroslav Kysela2009-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When hardware has large FIFO, it is necessary to lower jiffies margin by count of queued samples. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: PCM midlevel: Do not update hw_ptr_jiffies when hw_ptr is not changedJaroslav Kysela2009-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some hardware might have bigger FIFOs and DMA pointer value will be updated in large chunks. Do not update hw_ptr_jiffies and position timestamp when hw_ptr value was not changed. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: PCM midlevel: introduce mask for xrun_debug() macroJaroslav Kysela2009-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For debugging purposes, it is better to separate actions. Bit-values: 1: show bad PCM ring buffer pointer 2: show also stack (to debug kernel latency issues) 4: check pointer against system jiffies Example: 5: show bad PCM ring buffer pointer and do jiffies check Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: PCM midlevel: improve fifo_size handlingJaroslav Kysela2009-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the fifo_size assignment to hw->ioctl callback to allow lowlevel drivers overwrite the default behaviour. fifo_size is in frames not bytes as specified in asound.h and alsa-lib's documentation, but most hardware have fixed byte based FIFOs. Introduce internal SNDRV_PCM_INFO_FIFO_IN_FRAMES. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | Merge branch 'fix/pcm-jiffies-check' into topic/pcm-jiffies-checkTakashi Iwai2009-05-29
| |\ \ \ | | | |/ | | |/|
* | | | Merge branch 'topic/pcm-delay' into for-linusTakashi Iwai2009-06-10
|\| | | | | | | | | | | | | | | | | | | | | | | * topic/pcm-delay: ALSA: usbaudio - Add delay account ALSA: Add extra delay count in PCM
| * | | ALSA: Add extra delay count in PCMTakashi Iwai2009-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added runtime->delay field to adjust the delayed samples for snd_pcm_delay(). Typically a hardware FIFO length is stored in this field, so that the extra delay between hwptr and applptr can be computed. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | Merge branch 'topic/div64-cleanup' into for-linusTakashi Iwai2009-06-10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * topic/div64-cleanup: ALSA: Clean up 64bit division functions
| * | | | ALSA: Clean up 64bit division functionsTakashi Iwai2009-06-05
| | |/ / | |/| | | | | | | | | | | | | | | | | | Replace the house-made div64_32() with the standard div_u64*() functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | ALSA: Core - clean up snd_card_set_id* calls and remove possible id collisionJaroslav Kysela2009-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move locking outside snd_card_set_id_internal() function and rename it to snd_card_set_id_no_lock() for better function description. User defined id is just copied to card structure at allocation time. The real unique id procedure is called in snd_card_register() to ensure real atomicity. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | ALSA: Fix double locking of card list in snd_card_register()Mark Brown2009-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The introduction of snd_card_set_id() added a lock on the card list to the old choose_default_id() function when using it to implement the new API call. This lock is needed to allow us to walk the list and check to see if our new name is a duplicate. Unfortunately this causes a lockup when called from snd_card_register() (in cases where no ID is supplied for the card) since the card list is already locked there. Fix this fairly hideously by factoring out the implementation and using a flag to indicate if the lock should be held. A better fix would probably be to refactor snd_card_register() to move the _set_id() outside the locking region but I can't immediately see anything I can convince myself is safe. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | ALSA: Core - add snd_card_set_id() functionJaroslav Kysela2009-06-02
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce snd_card_set_id() function to allow lowlevel drivers to set default identification name for card slot. The function checks also for identification name collisions and tries to create unique name. Also, the snd_card_create() function is simplified, because this new function is used. As bonus, proper name collision checks are evaluated at the card create time. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: Enable PCM hw_ptr_jiffies check only in xrun_debug modeTakashi Iwai2009-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PCM hw_ptr jiffies check results sometimes in problems when a hardware doesn't give smooth hw_ptr updates. So far, au88x0 and some other drivers appear not working due to this strict check. However, this check is a nice debug tool, and the capability should be still kept. Hence, we disable this check now as default unless the user enables it by setting the xrun_debug mode to the specific stream via a proc file. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: Fix invalid jiffies check after pauseTakashi Iwai2009-05-27
| |/ |/| | | | | | | | | | | | | | | | | | | The hw_ptr_jiffies has to be reset properly to avoid the invalid check of jiffies delta in snd_pcm_update_hw_ptr*() functions. Especailly this patch fixes the bogus jiffies check after the puase and resume. This patch is a modified version of the original patch by Jaroslav. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm core - Avoid jiffies check for devices with BATCH flagTakashi Iwai2009-04-28
|/ | | | | | | | | | | | The hardware devices with SNDRV_PCM_INFO_BATCH flag can't give the precise current position. And such hardwares have often big FIFO in addition to the ring buffer, and it screws up the jiffies check in pcm_lib.c. This patch adds a simple check of info flag so that the driver skips the jiffies check in snd_pcm_period_elapsed() when BATCH flag is set. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/memdup_user' into for-linusTakashi Iwai2009-04-15
|\ | | | | | | | | | | | | | | * topic/memdup_user: ALSA: sound/pci: use memdup_user() ALSA: sound/usb: use memdup_user() ALSA: sound/isa: use memdup_user() ALSA: sound/core: use memdup_user()
| * ALSA: sound/core: use memdup_user()Li Zefan2009-04-14
| | | | | | | | | | | | | | Remove open-coded memdup_user(). Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'topic/hda' into for-linusTakashi Iwai2009-04-15
|\ \ | | | | | | | | | | | | | | | | | | * topic/hda: ALSA: hda - Add quirk mask for Fujitsu Amilo laptops with ALC883 ALSA: hda - Avoid call of snd_jack_report at release ALSA: add private_data to struct snd_jack
| * | ALSA: add private_data to struct snd_jackTakashi Iwai2009-04-14
| |/ | | | | | | | | | | | | | | Added private_data and private_free fields to struct snd_jack so that the caller can assign the data. It'll be helpful for avoiding the double-free of the jack instance. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* / [ALSA] pcm-midlevel: Add more strict buffer position checks based on jiffiesJaroslav Kysela2009-04-10
|/ | | | | | | | | | | | Some drivers like Intel8x0 or Intel HDA are broken for some hardware variants. This patch adds more strict buffer position checks based on jiffies when internal hw_ptr is updated. Enable xrun_debug to see mangling of wrong positions. As a side effect, the hw_ptr interrupt update routine might do slightly better job when many interrupts are lost. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ALSA: oss - volume control for CSWITCH and CROUTEDeepika Makhija2009-04-06
| | | | | | | | | | | | | | Added an else part to check SNDRV_MIXER_OSS_PRESENT_CVOLUME for MIC (slot 7) in commit 36c7b833e5d2501142a371e4e75281d3a29fbd6b Similarly, checks and volume control is required for SNDRV_MIXER_OSS_PRESENT_CSWITCH and SNDRV_MIXER_OSS_PRESENT_CROUTE as well. Signed-off-by: Deepika Makhija <deepika.makhija@einfochips.com> Signed-off-by: Viral Mehta <viral.mehta@einfochips.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* proc 2/2: remove struct proc_dir_entry::ownerAlexey Dobriyan2009-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy as correctly noted at bug #12454. Someone can lookup entry with NULL ->owner, thus not pinning enything, and release it later resulting in module refcount underflow. We can keep ->owner and supply it at registration time like ->proc_fops and ->data. But this leaves ->owner as easy-manipulative field (just one C assignment) and somebody will forget to unpin previous/pin current module when switching ->owner. ->proc_fops is declared as "const" which should give some thoughts. ->read_proc/->write_proc were just fixed to not require ->owner for protection. rmmod'ed directories will be empty and return "." and ".." -- no harm. And directories with tricky enough readdir and lookup shouldn't be modular. We definitely don't want such modular code. Removing ->owner will also make PDE smaller. So, let's nuke it. Kudos to Jeff Layton for reminding about this, let's say, oversight. http://bugzilla.kernel.org/show_bug.cgi?id=12454 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
* Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6Linus Torvalds2009-03-26
|\ | | | | | | | | | | | | | | * 'bkl-removal' of git://git.lwn.net/linux-2.6: Rationalize fasync return values Move FASYNC bit handling to f_op->fasync() Use f_lock to protect f_flags Rename struct file->f_ep_lock
| * Rationalize fasync return valuesJonathan Corbet2009-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most fasync implementations do something like: return fasync_helper(...); But fasync_helper() will return a positive value at times - a feature used in at least one place. Thus, a number of other drivers do: err = fasync_helper(...); if (err < 0) return err; return 0; In the interests of consistency and more concise code, it makes sense to map positive return values onto zero where ->fasync() is called. Cc: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
| * Use f_lock to protect f_flagsJonathan Corbet2009-03-16
| | | | | | | | | | | | | | | | | | | | | | | | Traditionally, changes to struct file->f_flags have been done under BKL protection, or with no protection at all. This patch causes all f_flags changes after file open/creation time to be done under protection of f_lock. This allows the removal of some BKL usage and fixes a number of longstanding (if microscopic) races. Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
* | Merge branch 'topic/misc' into for-linusTakashi Iwai2009-03-23
|\ \
| * \ Merge branch 'topic/quirk-cleanup' into topic/miscTakashi Iwai2009-02-09
| |\ \
| * | | ALSA: Add missing KERN_* prefix to printk in sound/coreTakashi Iwai2009-02-05
| | | | | | | | | | | | | | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: snd_pcm_new api cleanupTim Blechmann2009-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: cleanup snd_pcm_new takes a char *id argument, although it is not modifying the string. it can therefore be declared as const char *id. Signed-off-by: Tim Blechmann <tim@klingt.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | Merge branch 'topic/pcm-cleanup' into for-linusTakashi Iwai2009-03-23
|\ \ \ \
| * | | | ALSA: pcm - Safer boundary checksTakashi Iwai2009-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the boundary checks a bit safer. These caese are rare or theoretically won't happen, but nothing bad to keep the checks safer... Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | | ALSA: pcm - Fix delta calculation at boundary overlapTakashi Iwai2009-03-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the hw_ptr_interrupt reaches the boundary, it must check whether the hw_base was already lapped and corret the delta value appropriately. Also, rebasing the hw_ptr needs a correction because buffer_size isn't always aligned to period_size. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | | ALSA: pcm - Reset invalid position even without debug optionTakashi Iwai2009-03-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always reset the invalind hw_ptr position returned by the pointer callback. The behavior should be consitent independently from the debug option. Also, add the printk_ratelimit() check to avoid flooding debug prints. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | | ALSA: pcm - avoid unnecessary inlineTakashi Iwai2009-03-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary explicit inlininig of internal functions. Let compiler optimize. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | | ALSA: pcm - Fix a typo in error messagesTakashi Iwai2009-03-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a typo in error messages; forgotten after a copy&paste error. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | | ALSA: Remove unneeded snd_pcm_substream.timer_lockTakashi Iwai2009-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The timer callbacks are called in the protected status by the lock of the timer instance, so there is no need for an extra lock in the PCM substream. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | | ALSA: Rewrite hw_ptr updatersTakashi Iwai2009-03-09
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up and improve snd_pcm_update_hw_ptr*() functions. snd_pcm_update_hw_ptr() tries to detect the unexpected hwptr jumps more strictly to avoid the position mess-up, which often results in the bad quality I/O with pulseaudio. The hw-ptr skip error messages are printed when xrun proc is set to non-zero. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | Merge branch 'topic/vmaster-update' into for-linusTakashi Iwai2009-03-23
|\ \ \ \