aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_lib.c
Commit message (Collapse)AuthorAgeFilesLines
* remove compat from include, get new scripts workingWolfgang Wiedmeyer2015-10-231-12/+43
| | | | | further update code, especially sound remove initramfs files for galaxys2 and d710 and a busybox binary
* d710: initial support for the Epic 4G Touch (SPH-D710)Dorian Snyder2013-06-201-1/+4
| | | | Change-Id: Iafbd9fb45253b02d539ac0ba114f57b3bf9eeed4
* ALSA: pcm - fix race condition in wait_for_avail()Arjan van de Ven2011-10-031-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 763437a9e7737535b2fc72175ad4974048769be6 upstream. wait_for_avail() in pcm_lib.c has a race in it (observed in practice by an Intel validation group). The function is supposed to return once space in the buffer has become available, or if some timeout happens. The entity that creates space (irq handler of sound driver and some such) will do a wake up on a waitqueue that this function registers for. However there are two races in the existing code 1) If space became available between the caller noticing there was no space and this function actually sleeping, the wakeup is missed and the timeout condition will happen instead 2) If a wakeup happened but not sufficient space became available, the code will loop again and wait for more space. However, if the second wake comes in prior to hitting the schedule_timeout_interruptible(), it will be missed, and potentially you'll wait out until the timeout happens. The fix consists of using more careful setting of the current state (so that if a wakeup happens in the main loop window, the schedule_timeout() falls through) and by checking for available space prior to going into the schedule_timeout() loop, but after being on the waitqueue and having the state set to interruptible. [tiwai: the following changes have been added to Arjan's original patch: - merged akpm's fix for waitqueue adding order into a single patch - reduction of duplicated code of avail check ] Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: PCM - Don't check DMA time-out too shortlyTakashi Iwai2011-05-261-4/+13
| | | | | | | | | | | | | When the PCM period size is set larger than 10 seconds, currently the PCM core may abort the operation with DMA-error due to the fixed timeout for 10 seconds. A similar problem is seen in the drain operation that has a fixed timeout of 10 seconds, too. This patch fixes the timeout length depending on the period size and rate, also including the consideration of no_period_wakeup flag. Reported-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: sound, core, pcm_lib: fix xrun_logBen Gardiner2011-05-191-1/+1
| | | | | | | | | | | The xrun_log function was augmented with the in_interrupt parameter whereas the empty macro definition used when xrun logging is disabled was not. Add a third parameter to the empty macro definition so as to not cause compiler errors when xrun logging (CONFIG_SND_PCM_XRUN_DEBUG) is disabled. Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: sound, core, pcm_lib: xrun_log: log also in_interruptBen Gardiner2011-05-181-4/+8
| | | | | | | | | | | | | | | | | | When debugging pcm drivers I found the "period" or "hw" prefix printed by either XRUN_DEBUG_PERIODUPDATE or XRUN_DEBUG_PERIODUPDATE events, respectively to be very useful is observing the interplay between interrupt-context updates and syscall-context updates. Similarly, when debugging overruns with XRUN_DEBUG_LOG it is useful to see the context of the last 10 positions. Add an in_interrupt member to hwptr_log_entry which stores the value of the in_interrupt parameter of snd_pcm_update_hw_ptr0 when the log entry is created. Print a "[Q]" prefix when dumping the log entries if in_interrupt was true. Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pcm: fix infinite loop in snd_pcm_update_hw_ptr0()Kelly Anderson2011-04-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | When period interrupts are disabled, snd_pcm_update_hw_ptr0() compares the current time against the time estimated for the current hardware pointer to detect xruns. The somewhat fuzzy threshold in the while loop makes it possible that hdelta becomes negative; the comparison being done with unsigned types then makes the loop go through the entire 263 negative range, and, depending on the value, never reach an unsigned value that is small enough to stop the loop. Doing this with interrupts disabled results in the machine locking up. To prevent this, ensure that the loop condition uses signed types for both operands so that the comparison is correctly done. Many thanks to Kelly Anderson for debugging this. Reported-by: Nix <nix@esperi.org.uk> Reported-by: "Christopher K." <c.krooss@googlemail.com> Reported-and-tested-by: Kelly Anderson <kelly@silka.with-linux.com> Signed-off-by: Kelly Anderson <kelly@silka.with-linux.com> [cl: remove unneeded casts; use a temp variable] Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: 2.6.38 <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/misc' into for-linusTakashi Iwai2011-01-131-0/+22
|\
| * ALSA: pcm: optimize xrun detection in no-period-wakeup modeClemens Ladisch2010-11-221-0/+2
| | | | | | | | | | | | | | | | | | | | Add a lightweight condition on top of the xrun checking so that we can avoid the division when the application is calling the update function often enough. Suggested-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: pcm: detect xruns in no-period-wakeup modeClemens Ladisch2010-11-221-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When period wakeups are disabled, successive calls to the pointer update function do not have a maximum allowed distance, so xruns cannot be detected with the pointer value only. To detect xruns, compare the actually elapsed time with the time that should have theoretically elapsed since the last update. When the hardware pointer has wrapped around due to an xrun, the actually elapsed time will be too big by about hw_ptr_buffer_jiffies. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: pcm: support for period wakeup disablingClemens Ladisch2010-11-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows to disable period interrupts which are not needed when the application relies on a system timer to wake-up and refill the ring buffer. The behavior of the driver is left unchanged, and interrupts are only disabled if the application requests this configuration. The behavior in case of underruns is slightly different, instead of being detected during the period interrupts the underruns are detected when the application calls snd_pcm_update_avail, which in turns forces a refresh of the hw pointer and shows the buffer is empty. More specifically this patch makes a lot of sense when PulseAudio relies on timer-based scheduling to access audio devices such as HDAudio or Intel SST. Disabling interrupts removes two unwanted wake-ups due to period elapsed events in low-power playback modes. It also simplifies PulseAudio voice modules used for speech calls. To quote Lennart "This patch looks very interesting and desirable. This is something have long been waiting for." Support for this in hardware drivers is optional. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: remember to always call va_end() on stuff that we va_start()Jesper Juhl2010-12-211-3/+7
|/ | | | | | | | | | | The Coverity checker spotted that we do not always remember to call va_end() on 'args' in failure paths in snd_pcm_hw_rule_add(). Here's a patch to fix that up (compile tested only) - it also removes some annoying trailing whitespace that caught my eye while I was in the area.. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: sound/core/pcm_lib.c: Remove unnecessary semicolonsJoe Perches2010-11-221-1/+1
| | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pcm midlevel code - add time check for double interrupt acknowledgeJaroslav Kysela2010-08-181-5/+9
| | | | | | | | | | | | | | The current code in pcm_lib.c do all checks using only the position in the ring buffer. Unfortunately, where the interrupts gets delayed or merged into one, we need another timing source to check when the buffer size boundary overlaps to avoid the wrong updating of the ring buffer pointers. This code uses jiffies to check the right time window without any performance impact. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pcm core - add a safe check to the silence filling functionJaroslav Kysela2010-07-191-0/+2
| | | | | | | In situation when appl_ptr is far greater then hw_ptr, the hw_avail value can be greater than buffer_size. Check for this. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ALSA: pcm_lib: avoid timing jitter in snd_pcm_read/write()David Dillow2010-06-281-8/+15
| | | | | | | | | | | | | | | | | | | | | | When using poll() to wait for the next period -- or avail_min samples -- one gets a consistent delay for each system call that is usually just a little short of the selected period time. However, When using snd_pcm_read/write(), one gets a jittery delay that alternates between less than a millisecond and approximately two period times. This is caused by snd_pcm_lib_{read,write}1() transferring any available samples to the user's buffer and adjusting the application pointer prior to sleeping to the end of the current period. When the next period interrupt occurs, there is then less than avail_min samples remaining to be transferred in the period, so we end up sleeping until a second period occurs. This is solved by using runtime->twake as the number of samples needed for a wakeup in addition to selecting the proper wait queue to wake in snd_pcm_update_state(). This requires twake to be non-zero when used by snd_pcm_lib_{read,write}1() even if avail_min is zero. Signed-off-by: Dave Dillow <dave@thedillows.org> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ALSA: pcm: fix delta calculation at boundary wraparoundClemens Ladisch2010-05-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | In the cleanup of the hw_ptr update functions in 2.6.33, the calculation of the delta value was changed to use the modulo operator to protect against a negative difference due to the pointer wrapping around at the boundary. However, the ptr variables are unsigned, so a negative difference would result in the two complement's value which has no relation to the actual difference relative to the boundary; the result is typically some value near LONG_MAX-boundary. Furthermore, even if the modulo operation would be done with signed types, the result of a negative dividend could be negative. The invalid delta value is then caught by the following checks, but this means that the pointer update is ignored. To fix this, use a range check as in the other pointer calculations. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pcm: fix the fix of the runtime->boundary calculationClemens Ladisch2010-05-211-2/+7
| | | | | | | | | | | | | | | | | | | | | | | Commit 7910b4a1db63fefc3d291853d33c34c5b6352e8e in 2.6.34 changed the runtime->boundary calculation to make this value a multiple of both the buffer_size and the period_size, because the latter is assumed by the runtime->hw_ptr_interrupt calculation. However, due to the lack of a ioctl that could read the software parameters before they are set, the kernel requires that alsa-lib calculates the boundary value, too. The changed algorithm leads to a different boundary value used by alsa-lib, which makes, e.g., mplayer fail to play a 44.1 kHz file because the silence_size parameter is now invalid; bug report: <https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5015>. This patch reverts the change to the boundary calculation, and instead fixes the hw_ptr_interrupt calculation to be period-aligned regardless of the boundary value. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pcm_lib - fix xrun functionalityJarkko Nikula2010-03-261-2/+4
| | | | | | | | | | | | | The commit 4d96eb255c53ab5e39b37fd4d484ea3dc39ab456 broke the interrupt time xrun functionality (stream stop etc.) if the CONFIG_SND_PCM_XRUN_DEBUG is not set. This is because the xrun() is null defined without it. Fix this by letting the function xrun() to be always defined as it was before. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge remote branch 'alsa/devel' into topic/miscTakashi Iwai2010-01-261-2/+5
|\
| * ALSA: pcm_lib - return back hw_ptr_interruptJaroslav Kysela2010-01-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clemens Ladisch noted for hw_ptr_removal in "cleanup & merge hw_ptr update functions" commit: "It is possible for the status/delay ioctls to be called when the sound card's pointer register alreay shows a position at the beginning of the new period, but immediately before the interrupt is actually executed. (This happens regularly on a SMP machine with mplayer.) When that happens, the code thinks that the position must be at least one period ahead of the current position and drops an entire buffer of data." Return back the hw_ptr_interrupt variable. The last interrupt pointer is always computed from the latest hw_ptr instead of tracking it separately (in this case all hw_ptr checks and modifications might influence also hw_ptr_interrupt and it is difficult to keep it consistent). Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* | Merge remote branch 'alsa/devel' into topic/miscTakashi Iwai2010-01-211-10/+10
|\ \ | |/
| * ALSA: pcm_core: Fix wake_up() optimizationJaroslav Kysela2010-01-211-10/+10
| | | | | | | | | | | | | | | | This change fixes the "ALSA: pcm_lib - optimize wake_up() calls for PCM I/O" commit. New sleeping queue is introduced to separate user space and kernel space wake_ups. runtime->nowake is renamed to twake (transfer wake). Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* | Merge branch 'devel' of git.alsa-project.org:alsa-kernel into topic/miscTakashi Iwai2010-01-131-3/+5
|\ \ | |/
| * ALSA: pcm_lib - fix wrong delta print for jiffies checkJaroslav Kysela2010-01-131-3/+5
| | | | | | | | | | | | | | The previous jiffies delta was 0 in all cases. Use hw_ptr variable to store and print original value. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
| * Merge branch 'topic/hda' of ↵Jaroslav Kysela2010-01-081-2/+2
| |\ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into devel
* | \ Merge commit alsa/devel into topic/miscTakashi Iwai2010-01-121-196/+222
|\ \ \ | |/ / | | | | | | | | | Conflicts: include/sound/version.h
| * | ALSA: pcm_lib: fix "something must be really wrong" conditionJaroslav Kysela2010-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | When runtime->periods == 1 or when pointer crosses end of ring buffer, the delta might be greater than buffer_size. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
| * | ALSA: pcm_lib - optimize wake_up() calls for PCM I/OJaroslav Kysela2010-01-071-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | As noted by pl bossart <bossart.nospam@gmail.com>, the PCM I/O routines (snd_pcm_lib_write1, snd_pcm_lib_read1) should block wake_up() calls until all samples are not processed. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
| * | ALSA: pcm_lib - cleanup & merge hw_ptr update functionsJaroslav Kysela2010-01-071-182/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do general cleanup in snd_pcm_update_hw_ptr*() routines and merge them. The main change is hw_ptr_interrupt variable removal to simplify code logic. This variable can be computed directly from hw_ptr. Ensure that updated hw_ptr is not lower than previous one (it was possible with old code in some obscure situations when interrupt was delayed or the lowlevel driver returns wrong ring buffer position value). Signed-off-by: Jaroslav Kysela <perex@perex.cz>
| * | ALSA: pcm_lib - add possibility to log last 10 DMA ring buffer positionsJaroslav Kysela2010-01-071-23/+117
| | | | | | | | | | | | | | | | | | | | | In some debug cases, it might be usefull to see previous ring buffer positions to determine position problems from the lowlevel drivers. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
| * | ALSA: pcm_lib.c - convert second xrun_debug() parameter to use definesJaroslav Kysela2010-01-071-10/+17
| | | | | | | | | | | | | | | | | | | | | To increase code readability, convert send xrun_debug() argument to use defines. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* | | ALSA: refine rate selection in snd_interval_ratnum()Krzysztof Helt2009-12-221-3/+17
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | Refine the rate selection by choosing the rate closer to the requested one in case of selecting single frequency. Previously, the higher rate was always selected. Also, fix problem with the best_diff unsigned int value wrapping (turning negative). Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fix incorrect rounding direction in snd_interval_ratnum()Krzysztof Helt2009-12-211-2/+2
|/ | | | | | | | | | | | | | | | | | The direction of rounding is incorrect in the snd_interval_ratnum() It was detected with following parameters (sb8 driver playing 8kHz stereo file): - num is always 1000000 - requested frequency rate is from 7999 to 7999 (single frequency) The first loop calculates div_down(num, freq->min) which is 125. Thus, a frequency range's minimum value is 1000000 / 125 = 8000 Hz. The second loop calculates div_up(num, freq->max) which is 126 The frequency range's maximum value is 1000000 / 126 = 7936 Hz. The range maximum is lower than the range minimum so the function fails due to empty result range. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/pcm-drain-nonblock' into for-linusTakashi Iwai2009-09-101-4/+8
|\ | | | | | | | | | | * topic/pcm-drain-nonblock: ALSA: pcm - Increase protocol version ALSA: pcm - Fix drain behavior in non-blocking mode
| * ALSA: pcm - Fix drain behavior in non-blocking modeTakashi Iwai2009-08-201-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current PCM core has the following problems regarding PCM draining in non-blocking mode: - the current f_flags isn't checked in snd_pcm_drain(), thus changing the mode dynamically via snd_pcm_nonblock() after open doesn't work. - calling drain in non-blocking mode just return -EAGAIN error, but doesn't provide any way to sync with draining. This patch fixes these issues. - check file->f_flags in snd_pcm_drain() properly - when O_NONBLOCK is set, PCM core sets the stream(s) to DRAIN state but quits ioctl immediately without waiting the whole drain; the caller can sync the drain manually via poll() Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'fix/misc' of ↵Linus Torvalds2009-08-251-31/+8
|\ \ | |/ |/| | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 * 'fix/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: sound: pcm_lib: fix unsorted list constraint handling sound: vx222: fix input level control range check ALSA: ali5451: fix timeout handling in snd_ali_{codecs,timer}_ready()
| * sound: pcm_lib: fix unsorted list constraint handlingClemens Ladisch2009-08-251-31/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_interval_list() expected a sorted list but did not document this, so there are drivers that give it an unsorted list. To fix this, change the algorithm to work with any list. This fixes the "Slave PCM not usable" error with USB devices that have multiple alternate settings with sample rates in decreasing order, such as the Philips Askey VC010 WebCam. http://bugzilla.kernel.org/show_bug.cgi?id=14028 Reported-and-tested-by: Andrzej <adkadk@gmail.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm - Fix hwptr buffer-size overlap bugTakashi Iwai2009-07-231-1/+1
| | | | | | | | | | | | | | | | | | The fix 79452f0a28aa5a40522c487b42a5fc423647ad98 introduced another bug due to the missing offset for the overlapped hwptr. When the hwptr goes back to zero, the delta value has to be corrected with the buffer size. Otherwise this causes looping sounds. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm - Fix warnings in debug loggingsTakashi Iwai2009-07-231-12/+12
| | | | | | | | | | | | Add proper cast. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm - Add logging of hwptr updates and interrupt updatesTakashi Iwai2009-07-231-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | Added the logging functionality to xrun_debug to record the hwptr updates via snd_pcm_update_hw_ptr() and snd_pcm_update_hwptr_interrupt(), corresponding to 16 and 8, respectively. For example, # echo 9 > /proc/asound/card0/pcm0p/xrun_debug will record the position and other parameters at each period interrupt together with the normal XRUN debugging. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm - Fix regressions with VMwareTakashi Iwai2009-07-221-1/+10
|/ | | | | | | | | | | | VMware tends to report PCM positions and period updates at utterly wrong timing. This screws up the recent PCM core code that tries to correct the position based on the irq timing. Now, when a backward irq position is detected, skip the update instead of rebasing. (This is almost the old behavior before 2.6.30.) Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/pcm-jiffies-check' into for-linusTakashi Iwai2009-06-101-19/+70
|\ | | | | | | | | | | | | | | | | | | | | * 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-081-6/+17
| | | | | | | | | | | | | | 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-071-1/+2
| | | | | | | | | | | | | | | | | | | | 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-061-1/+1
| | | | | | | | | | | | | | | | 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-291-2/+10
| | | | | | | | | | | | | | | | 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-291-2/+14
| | | | | | | | | | | | | | | | | | 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-291-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-291-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | 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>