diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-29 11:47:53 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-29 11:47:53 -0400 |
| commit | 44ada1a147fa28ae15b83a031c48fc2b992cc3ef (patch) | |
| tree | 253d910ef02c8c864fffce7b70bcc7c68697df2b /sound/core | |
| parent | b8e7e40abeac49644fec4a4f52ffe74c7b05eca0 (diff) | |
| parent | 817682c11bb836cfe688b5601aa66f2b58a4848e (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: hda - Compaq Presario CQ60 patching for Conexant
sound: usb-audio: make the MotU Fastlane work again
ALSA: Enable PCM hw_ptr_jiffies check only in xrun_debug mode
ALSA: Fix invalid jiffies check after pause
Diffstat (limited to 'sound/core')
| -rw-r--r-- | sound/core/pcm_lib.c | 10 | ||||
| -rw-r--r-- | sound/core/pcm_native.c | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index a2a792c18c40..d659995ac3ac 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
| @@ -249,6 +249,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) | |||
| 249 | new_hw_ptr = hw_base + pos; | 249 | new_hw_ptr = hw_base + pos; |
| 250 | } | 250 | } |
| 251 | } | 251 | } |
| 252 | |||
| 253 | /* Do jiffies check only in xrun_debug mode */ | ||
| 254 | if (!xrun_debug(substream)) | ||
| 255 | goto no_jiffies_check; | ||
| 256 | |||
| 252 | /* Skip the jiffies check for hardwares with BATCH flag. | 257 | /* Skip the jiffies check for hardwares with BATCH flag. |
| 253 | * Such hardware usually just increases the position at each IRQ, | 258 | * Such hardware usually just increases the position at each IRQ, |
| 254 | * thus it can't give any strange position. | 259 | * thus it can't give any strange position. |
| @@ -336,7 +341,9 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream) | |||
| 336 | hw_base = 0; | 341 | hw_base = 0; |
| 337 | new_hw_ptr = hw_base + pos; | 342 | new_hw_ptr = hw_base + pos; |
| 338 | } | 343 | } |
| 339 | if (((delta * HZ) / runtime->rate) > jdelta + HZ/100) { | 344 | /* Do jiffies check only in xrun_debug mode */ |
| 345 | if (xrun_debug(substream) && | ||
| 346 | ((delta * HZ) / runtime->rate) > jdelta + HZ/100) { | ||
| 340 | hw_ptr_error(substream, | 347 | hw_ptr_error(substream, |
| 341 | "hw_ptr skipping! " | 348 | "hw_ptr skipping! " |
| 342 | "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n", | 349 | "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n", |
| @@ -1478,7 +1485,6 @@ static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream, | |||
| 1478 | runtime->status->hw_ptr %= runtime->buffer_size; | 1485 | runtime->status->hw_ptr %= runtime->buffer_size; |
| 1479 | else | 1486 | else |
| 1480 | runtime->status->hw_ptr = 0; | 1487 | runtime->status->hw_ptr = 0; |
| 1481 | runtime->hw_ptr_jiffies = jiffies; | ||
| 1482 | snd_pcm_stream_unlock_irqrestore(substream, flags); | 1488 | snd_pcm_stream_unlock_irqrestore(substream, flags); |
| 1483 | return 0; | 1489 | return 0; |
| 1484 | } | 1490 | } |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index fc6f98e257df..b5da656d1ece 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
| @@ -848,6 +848,7 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state) | |||
| 848 | { | 848 | { |
| 849 | struct snd_pcm_runtime *runtime = substream->runtime; | 849 | struct snd_pcm_runtime *runtime = substream->runtime; |
| 850 | snd_pcm_trigger_tstamp(substream); | 850 | snd_pcm_trigger_tstamp(substream); |
| 851 | runtime->hw_ptr_jiffies = jiffies; | ||
| 851 | runtime->status->state = state; | 852 | runtime->status->state = state; |
| 852 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && | 853 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && |
| 853 | runtime->silence_size > 0) | 854 | runtime->silence_size > 0) |
| @@ -961,6 +962,11 @@ static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push) | |||
| 961 | { | 962 | { |
| 962 | if (substream->runtime->trigger_master != substream) | 963 | if (substream->runtime->trigger_master != substream) |
| 963 | return 0; | 964 | return 0; |
| 965 | /* The jiffies check in snd_pcm_update_hw_ptr*() is done by | ||
| 966 | * a delta betwen the current jiffies, this gives a large enough | ||
| 967 | * delta, effectively to skip the check once. | ||
| 968 | */ | ||
| 969 | substream->runtime->hw_ptr_jiffies = jiffies - HZ * 1000; | ||
| 964 | return substream->ops->trigger(substream, | 970 | return substream->ops->trigger(substream, |
| 965 | push ? SNDRV_PCM_TRIGGER_PAUSE_PUSH : | 971 | push ? SNDRV_PCM_TRIGGER_PAUSE_PUSH : |
| 966 | SNDRV_PCM_TRIGGER_PAUSE_RELEASE); | 972 | SNDRV_PCM_TRIGGER_PAUSE_RELEASE); |
