summaryrefslogtreecommitdiffstats
path: root/sound/core
Commit message (Collapse)AuthorAgeFilesLines
...
* | ALSA: pcm: Replace PCM hwptr tracking with tracepointsTakashi Iwai2014-11-043-122/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ALSA PCM core has a mechanism tracking the PCM hwptr updates for analyzing XRUNs. But its log is limited (up to 10) and its log output is a kernel message, which is hard to handle. In this patch, the hwptr logging is moved to the tracing infrastructure instead of its own. Not only the hwptr updates but also XRUN and hwptr errors are recorded on the trace log, so that user can see such events at the exact timing. The new "snd_pcm" entry will appear in the tracing events: # ls -F /sys/kernel/debug/tracing/events/snd_pcm enable filter hw_ptr_error/ hwptr/ xrun/ The hwptr is for the regular hwptr update events. An event trace looks like: aplay-26187 [004] d..3 4012.834761: hwptr: pcmC0D0p/sub0: POS: pos=488, old=0, base=0, period=1024, buf=16384 "POS" shows the hwptr update by the explicit position update call and "IRQ" means the hwptr update by the interrupt, i.e. snd_pcm_period_elapsed() call. The "pos" is the passed ring-buffer offset by the caller, "old" is the previous hwptr, "base" is the hwptr base position, "period" and "buf" are period- and buffer-size of the target PCM substream. (Note that the hwptr position displayed here isn't the ring-buffer offset. It increments up to the PCM position boundary.) The XRUN event appears similarly, but without "pos" field. The hwptr error events appear with the PCM identifier and its reason string, such as "Lost interrupt?". The XRUN and hwptr error reports on kernel message are still left, can be turned on/off via xrun_debug proc like before. But the bit 3, 4, 5 and 6 bits of xrun_debug proc are dropped by this patch. Also, along with the change, the message strings have been reformatted to be a bit more consistent. Last but not least, the hwptr reporting is enabled only when CONFIG_SND_PCM_XRUN_DEBUG is set. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: Correct PCM BUG error messageTakashi Iwai2014-11-041-1/+1
| | | | | | | | | | | | | | | | While converting to dev_*(), the message showing the invalid PCM position was wrongly tagged as if an XRUN although it's actually a BUG. This patch corrects the message again. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: Refactoring snd_pcm_action()Takashi Iwai2014-10-311-25/+10
| | | | | | | | | | | | Just a small code refactoring to reduce more lines. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: Simplify snd_pcm_action_lock_irq()Takashi Iwai2014-10-311-38/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function snd_pcm_action_lock_irq() can be much simplified by simply wrapping snd_pcm_action() with the stream lock. This was rather the original idea, but later it was open coded for optimization. However, looking at the optimization part closely, one notices that the probability of the optimized path is quite low; in normal situations, the linked stream action happens only for the triggered substream, thus the operation becomes identical. So the code simplification has a clear win, especially because we have now doubly codes for both atomic and non-atomic locks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: doc: More kerneldoc comments on core componentsTakashi Iwai2014-10-302-13/+29
| | | | | | | | | | | | Some functions missed the proper kerneldoc comments. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: More kerneldoc updatesTakashi Iwai2014-10-302-2/+66
| | | | | | | | | | | | Add proper kerneldoc comments to the exported functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: control: Add missing kerneldoc comments to exported functionsTakashi Iwai2014-10-301-15/+49
| | | | | | | | | | | | | | | | A few functions have no proper documentation yet, so let's add them. Along with it, remove superfluous blank line between the closing brace and EXPORT_SYMBOL() line. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'for-linus' into for-nextTakashi Iwai2014-10-271-7/+5
|\| | | | | | | | | | | | | | | Merged upstream branch to make further fireworks development easier (and avoid conflicts earlier). Conflicts: sound/firewire/bebob/bebob_focusrite.c
| * ALSA: pcm: Fix false lockdep warningsTakashi Iwai2014-10-211-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As PCM core handles the multiple linked streams in parallel, lockdep gets confused (partly because of weak annotations) and spews the false-positive warnings. This hasn't been a problem for long time but the latest PCM lock path update seems to have woken up a sleeping dog. Here is an attempt to paper over this issue: pass the lock subclass just calculated from the depth in snd_pcm_action_group(). Also, a (possibly) wrong lock subclass set in snd_pcm_action_lock_mutex() is dropped, too. Reported-and-tested-by: Arthur Marsh <arthur.marsh@internode.on.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: Avoid mmap warnings on x86Takashi Iwai2014-10-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | On x86, using dma_mmap_coherent() for the pages allocated via dma_alloc_coherent() results in a warning like: aplay:32536 map pfn RAM range req uncached-minus for [mem 0x21d500000-0x21d51ffff], got write-back Until the issue is addressed in the core side, take back to the old good way in PCM code only for x86. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'topic/pcm-mmap-cleanup' into for-nextTakashi Iwai2014-10-231-32/+21
|\ \ | | | | | | | | | | | | This drags a few post-3.18 mmap fixes, a cleanup of dma_mmap_coherent() usages and additional fixups for some architectures.
| * | ALSA: pcm: Disable mmap for known broken archsTakashi Iwai2014-10-221-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some architectures like PARISC is known not to support mmap properly with the DMA buffer, where dma_mmap_coherent() returns -EINVAL unconditionally. From the API POV, we should rather drop the mmap support there and expose it before the user-space tries to call mmap. The patch contains again ugly ifdef's, unfortunately, as there is no global flag indicating this. Once when such macro is defined, we can get rid of this instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: pcm: Remove arch-dependent mmap kludgesTakashi Iwai2014-10-221-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | Since we have consistently dma_mmap_coherent() for all architectures, the current ifdef and arch-specific codes in pcm core can be cleaned up gracefully. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | Merge branch 'topic/enum-info-cleanup' into for-nextTakashi Iwai2014-10-221-0/+5
|\ \ \ | |/ / |/| | | | | | | | | | | | | | this is a series of patches to just convert the plain info callback for enum ctl elements to snd_ctl_elem_info(). Also, it includes the extension of snd_ctl_elem_info(), for catching the unexpected string cut-off and handling the zero items.
| * | ALSA: control: Allow to pass items zero to snd_ctl_enum_info()Takashi Iwai2014-10-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Although this is weird, some drivers want to allow empty control elements intentionally, e.g. the number of items may change depending on the firmware status. Let the function simply returning in such a case. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: control: Warn if too long string is passed to snd_ctl_enum_info()Takashi Iwai2014-10-201-0/+3
| | | | | | | | | | | | | | | | | | This allows us to catch the bugs in drivers easily. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | Merge branch 'topic/seq-autoload' into for-nextTakashi Iwai2014-10-202-33/+75
|\ \ \ | |_|/ |/| |
| * | Subject: ALSA: seq: Remove autoload locks in driver registrationTakashi Iwai2014-10-182-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we're calling request_module() asynchronously now, we can get rid of the autoload lock in snd_seq_device_register_driver(), as well as in the snd-seq driver registration itself. This enables the automatic loading of dependent sequencer modules, such as snd-seq-virmidi from snd-emu10k1-synth. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: seq: bind seq driver automaticallyTakashi Iwai2014-10-182-23/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the sequencer module binding is performed independently from the card module itself. The reason behind it is to keep the sequencer stuff optional and allow the system running without it (e.g. for using PCM or rawmidi only). This works in most cases, but a remaining problem is that the binding isn't done automatically when a new driver module is probed. Typically this becomes visible when a hotplug driver like usb audio is used. This patch tries to address this and other potential issues. First, the seq-binder (seq_device.c) tries to load a missing driver module at creating a new device object. This is done asynchronously in a workq for avoiding the deadlock (modprobe call in module init path). This action, however, should be enabled only when the sequencer stuff was already initialized, i.e. snd-seq module was already loaded. For that, a new function, snd_seq_autoload_init() is introduced here; this clears the blocking of autoloading, and also tries to load all pending driver modules. Reported-by: Adam Goode <agoode@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: seq: Use atomic ops for autoload refcountTakashi Iwai2014-10-151-4/+4
| | | | | | | | | | | | | | | | | | ... just to robustify for races. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: pcm: use the same dma mmap codepath both for arm and arm64Anatol Pomozov2014-10-181-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids following kernel crash when try to playback on arm64 [ 107.497203] [<ffffffc00046b310>] snd_pcm_mmap_data_fault+0x90/0xd4 [ 107.503405] [<ffffffc0001541ac>] __do_fault+0xb0/0x498 [ 107.508565] [<ffffffc0001576a0>] handle_mm_fault+0x224/0x7b0 [ 107.514246] [<ffffffc000092640>] do_page_fault+0x11c/0x310 [ 107.519738] [<ffffffc000081100>] do_mem_abort+0x38/0x98 Tested: backported to 3.14 and tried to playback on arm64 machine Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: Fix referred substream in snd_pcm_action_group() unlock loopTakashi Iwai2014-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | In the unlock loop of snd_pcm_action_group(), the object "s" is used as the check of nonatomic PCM, but it should be rather "s1", which is the iterator of the loop. This supposedly causes a kernel panic when the substreams in operatino are linked. Fixes: 257f8cce5d40 ('ALSA: pcm: Allow nonatomic trigger operations') Reported-and-tested-by: Arthur Marsh <arthur.marsh@internode.on.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: Allow pass NULL dev for snd_pci_quirk_lookup()Takashi Iwai2014-10-081-0/+2
| | | | | | | | | | | | | | | | | | Add a NULL check in snd_pci_quirk_lookup() so that NULL can be passed as a pci_dev pointer. This fixes the possible NULL dereferences in HD-audio drivers. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge tag 'asoc-v3.18' of ↵Takashi Iwai2014-10-061-3/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.18 - More componentisation work from Lars-Peter, this time mainly cleaning up the suspend and bias level transition callbacks. - Real system support for the Intel drivers and a bunch of fixes and enhancements for the associated CODEC drivers, this is going to need a lot quirks over time due to the lack of any firmware description of the boards. - Jack detect support for simple card from Dylan Reid. - A bunch of small fixes and enhancements for the Freescale drivers. - New drivers for Analog Devices SSM4567, Cirrus Logic CS35L32, Everest Semiconductor ES8328 and Freescale cards using the ASRC in newer i.MX processors.
| * ALSA: pcm: fix fifo_size frame calculationClemens Ladisch2014-09-221-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The calculated frame size was wrong because snd_pcm_format_physical_width() actually returns the number of bits, not bytes. Use snd_pcm_format_size() instead, which not only returns bytes, but also simplifies the calculation. Fixes: 8bea869c5e56 ("ALSA: PCM midlevel: improve fifo_size handling") Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'for-linus' into for-nextTakashi Iwai2014-09-112-4/+4
|\| | | | | | | | | Merging for-linus branch for syncing the latest STAC/IDT codec changes to be affected by the upcoming hda-jack rewrites.
| * ALSA: pcm: Fix the silence data for DSD formatsTakashi Iwai2014-08-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | Right now we set 0 as the silence data for DSD_U8 and DSD_U16 formats, but this is actually wrong. 0 is rather the most negative value. Alternatively, we may take the repeating 0x69 pattern like ffmpeg deploys. Reference: https://ffmpeg.org/pipermail/ffmpeg-cvslog/2014-April/076427.html Suggested-by: Alexander E. Patrakov <patrakov@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: core: fix buffer overflow in snd_info_get_line()Clemens Ladisch2014-08-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | snd_info_get_line() documents that its last parameter must be one less than the buffer size, but this API design guarantees that (literally) every caller gets it wrong. Just change this parameter to have its obvious meaning. Reported-by: Tommi Rantala <tt.rantala@gmail.com> Cc: <stable@vger.kernel.org> # v2.2.26+ Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: add new DSD sampleformat for native DSD playback on XMOS based ↵Jurgen Kramer2014-09-082-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | devices XMOS based USB DACs with native DSD support expose this feature via a USB alternate setting. The audio format is either 32-bit raw or a 32-bit PCM format. To utilize this feature on linux this patch introduces a new 32-bit DSD sampleformat DSD_U32_LE. A follow up patch will add a quirk for XMOS based devices to utilize the new format. Further patches will add support to alsa-lib. Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'topic/pcm-nonatomic' into for-nextTakashi Iwai2014-09-082-9/+128
|\ \ | | | | | | | | | This is a merge for exending PCM ops to be non-atomic.
| * | ALSA: pcm: Uninline snd_pcm_stream_lock() and _unlock()Takashi Iwai2014-09-031-4/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous commit for the non-atomic PCM ops added more codes to snd_pcm_stream_lock() and its variants. Since they are inlined functions, it resulted in a significant code size bloat. For reducing the size bloat, this patch changes the inline functions to the normal function calls. The export of rwlock and rwsem are removed as well, since they are referred only in pcm_native.c now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: pcm: Allow nonatomic trigger operationsTakashi Iwai2014-09-032-7/+70
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, many PCM operations are performed in a critical section protected by spinlock, typically the trigger and pointer callbacks are assumed to be atomic. This is basically because some trigger action (e.g. PCM stop after drain or xrun) is done in the interrupt handler. If a driver runs in a threaded irq, however, this doesn't have to be atomic. And many devices want to handle trigger in a non-atomic context due to lengthy communications. This patch tries all PCM calls operational in non-atomic context. What it does is very simple: replaces the substream spinlock with the corresponding substream mutex when pcm->nonatomic flag is set. The driver that wants to use the non-atomic PCM ops just needs to set the flag and keep the rest as is. (Of course, it must not handle any PCM ops in irq context.) Note that the code doesn't check whether it's atomic-safe or not, but trust in 100% that the driver sets pcm->nonatomic correctly. One possible problem is the case where linked PCM substreams have inconsistent nonatomic states. For avoiding this, snd_pcm_link() returns an error if one tries to link an inconsistent PCM substream. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: snd_interval_step: fix changes of open intervalsClemens Ladisch2014-09-081-0/+2
| | | | | | | | | | | | | | | | Changing an interval boundary to a multiple of the step size makes that boundary exact. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: snd_interval_step: drop the min parameterClemens Ladisch2014-09-081-4/+4
|/ | | | | | | | The min parameter was not used by any caller. And if it were used, underflows in the calculations could lead to incorrect results. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge tag 'asoc-v3.17' of ↵Takashi Iwai2014-08-042-4/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v3.17 This has been a pretty exciting release in terms of the framework, we've finally got support for multiple CODECs attached to a single DAI link which has been something there's been interest in as long as I've been working on ASoC. A big thanks to Benoit and Misael for their work on this. Otherwise it's been a fairly standard release for development, including more componentisation work from Lars-Peter and a good selection of both CODEC and CPU drivers. - Support for multiple CODECs attached to a single DAI, enabling systems with for example multiple DAC/speaker drivers on a single link, contributed by Benoit Cousson based on work from Misael Lopez Cruz. - Support for byte controls larger than 256 bytes based on the use of TLVs contributed by Omair Mohammed Abdullah. - More componentisation work from Lars-Peter Clausen. - The remainder of the conversions of CODEC drivers to params_width() - Drivers for Cirrus Logic CS4265, Freescale i.MX ASRC blocks, Realtek RT286 and RT5670, Rockchip RK3xxx I2S controllers and Texas Instruments TAS2552. - Lots of updates and fixes, especially to the DaVinci, Intel, Freescale, Realtek, and rcar drivers.
| *-. Merge remote-tracking branches 'asoc/topic/tlv', 'asoc/topic/tlv320aic23', ↵Mark Brown2014-08-041-3/+3
| |\ \ | | | | | | | | | | | | 'asoc/topic/tlv320aic31xx' and 'asoc/topic/tlv320aic32x4' into asoc-next
| | * | ALSA: control: Define SNDRV_CTL_TLV_OP_* constantsTakashi Iwai2014-07-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of hard-coded magic numbers, define constants for op_flag to tlv callbacks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | Merge remote-tracking branch 'asoc/topic/dma' into asoc-nextMark Brown2014-08-041-1/+3
| |\ \ \ | | |/ / | |/| |
| | * | ALSA: pcm_dmaengine: Correct support for 24bits physical sample widthsPeter Ujfalusi2014-07-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of _3LE/_3BE formats the samples are stored in 3 consecutive bytes without padding it to 4 bytes. This means that the DMA needs to be able to support 3 bytes word length in order to read/write the samples from memory correctly. Originally the code treated 24 bits physical length samples as they were 32 bits which leads to corruption when playing or recording audio. The hw.formats field has already been prepared to exclude formats not supported by the DMA engine in use, which means that only on platforms where 3 bytes is supported by the DMA will be able to use this format. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * | ALSA: pcm_dmaengine: Use the available wrapper to get physical widthPeter Ujfalusi2014-07-041-1/+1
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | params_physical_width() is available via pcm_params.h Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | Merge branch 'topic/monotonic' into for-nextTakashi Iwai2014-07-222-4/+10
|\ \ \
| * | | ALSA: pcm: Add tstamp_type and proto to sw_params compat layerTakashi Iwai2014-07-211-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | I forgot to add the new fields in sw_params to 32bit compat layer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: pcm: Introduce protocol version field to sw_paramsTakashi Iwai2014-07-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For controlling the new fields more strictly, add sw_params.proto field indicating the protocol version of the user-space. User-space should fill the SNDRV_PCM_VERSION value it's built with, then kernel can know whether the new fields should be evaluated or not. And now tstamp_type field is evaluated only when the valid value is set there. This avoids the wrong override of tstamp_type to zero, which is SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | ALSA: compress: fix an integer overflow checkDan Carpenter2014-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I previously added an integer overflow check here but looking at it now, it's still buggy. The bug happens in snd_compr_allocate_buffer(). We multiply ".fragments" and ".fragment_size" and that doesn't overflow but then we save it in an unsigned int so it truncates the high bits away and we allocate a smaller than expected size. Fixes: b35cc8225845 ('ALSA: compress_core: integer overflow in snd_compr_allocate_buffer()') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | Merge branch 'topic/monotonic' into for-nextTakashi Iwai2014-07-141-3/+4
|\| | |
| * | | ALSA: pcm: Add timestamp type to sw_paramsTakashi Iwai2014-07-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For allowing adjusting the timestamp type on the fly, add it to sw_params. The existing ioctl is still kept for compatibility. Along with this, increment the PCM protocol version. The extension was suggested by Clemens Ladisch. Acked-by: Jaroslav Kysela <perex@perex.cz> Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: pcm: simplify snd_pcm_tstamp()Takashi Iwai2014-07-101-3/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | No functional change. Acked-by: Jaroslav Kysela <perex@perex.cz> Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* / / ALSA: seq: seq_memory.c: Fix closing brace followed by ifRasmus Villemoes2014-06-231-2/+2
|/ / | | | | | | | | | | | | Add a newline and, while at it, remove a space and redundant braces. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: control: Make sure that id->index does not overflowLars-Peter Clausen2014-06-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ALSA control code expects that the range of assigned indices to a control is continuous and does not overflow. Currently there are no checks to enforce this. If a control with a overflowing index range is created that control becomes effectively inaccessible and unremovable since snd_ctl_find_id() will not be able to find it. This patch adds a check that makes sure that controls with a overflowing index range can not be created. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jaroslav Kysela <perex@perex.cz> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: control: Handle numid overflowLars-Peter Clausen2014-06-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each control gets automatically assigned its numids when the control is created. The allocation is done by incrementing the numid by the amount of allocated numids per allocation. This means that excessive creation and destruction of controls (e.g. via SNDRV_CTL_IOCTL_ELEM_ADD/REMOVE) can cause the id to eventually overflow. Currently when this happens for the control that caused the overflow kctl->id.numid + kctl->count will also over flow causing it to be smaller than kctl->id.numid. Most of the code assumes that this is something that can not happen, so we need to make sure that it won't happen Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jaroslav Kysela <perex@perex.cz> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>