diff options
-rw-r--r-- | include/sound/asound.h | 3 | ||||
-rw-r--r-- | include/sound/pcm.h | 1 | ||||
-rw-r--r-- | sound/core/pcm_lib.c | 6 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 3 |
4 files changed, 13 insertions, 0 deletions
diff --git a/include/sound/asound.h b/include/sound/asound.h index a1803ecea34d..5d6074faa279 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -259,6 +259,7 @@ typedef int __bitwise snd_pcm_subformat_t; | |||
259 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ | 259 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ |
260 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ | 260 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ |
261 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ | 261 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ |
262 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ | ||
262 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ | 263 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ |
263 | 264 | ||
264 | typedef int __bitwise snd_pcm_state_t; | 265 | typedef int __bitwise snd_pcm_state_t; |
@@ -334,6 +335,8 @@ typedef int snd_pcm_hw_param_t; | |||
334 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME | 335 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME |
335 | 336 | ||
336 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ | 337 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ |
338 | #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */ | ||
339 | #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */ | ||
337 | 340 | ||
338 | struct snd_interval { | 341 | struct snd_interval { |
339 | unsigned int min, max; | 342 | unsigned int min, max; |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index dfd9b76b1853..e731f8d71934 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -297,6 +297,7 @@ struct snd_pcm_runtime { | |||
297 | unsigned int info; | 297 | unsigned int info; |
298 | unsigned int rate_num; | 298 | unsigned int rate_num; |
299 | unsigned int rate_den; | 299 | unsigned int rate_den; |
300 | unsigned int no_period_wakeup: 1; | ||
300 | 301 | ||
301 | /* -- SW params -- */ | 302 | /* -- SW params -- */ |
302 | int tstamp_mode; /* mmap timestamp is updated */ | 303 | int tstamp_mode; /* mmap timestamp is updated */ |
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index b75db8e9cc0f..bc57501c584a 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -373,6 +373,11 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, | |||
373 | (unsigned long)new_hw_ptr, | 373 | (unsigned long)new_hw_ptr, |
374 | (unsigned long)runtime->hw_ptr_base); | 374 | (unsigned long)runtime->hw_ptr_base); |
375 | } | 375 | } |
376 | |||
377 | /* without period interrupts, there are no regular pointer updates */ | ||
378 | if (runtime->no_period_wakeup) | ||
379 | goto no_delta_check; | ||
380 | |||
376 | /* something must be really wrong */ | 381 | /* something must be really wrong */ |
377 | if (delta >= runtime->buffer_size + runtime->period_size) { | 382 | if (delta >= runtime->buffer_size + runtime->period_size) { |
378 | hw_ptr_error(substream, | 383 | hw_ptr_error(substream, |
@@ -442,6 +447,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, | |||
442 | (long)old_hw_ptr); | 447 | (long)old_hw_ptr); |
443 | } | 448 | } |
444 | 449 | ||
450 | no_delta_check: | ||
445 | if (runtime->status->hw_ptr == new_hw_ptr) | 451 | if (runtime->status->hw_ptr == new_hw_ptr) |
446 | return 0; | 452 | return 0; |
447 | 453 | ||
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 8bc7cb3db330..f91a439f675c 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -423,6 +423,9 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, | |||
423 | runtime->info = params->info; | 423 | runtime->info = params->info; |
424 | runtime->rate_num = params->rate_num; | 424 | runtime->rate_num = params->rate_num; |
425 | runtime->rate_den = params->rate_den; | 425 | runtime->rate_den = params->rate_den; |
426 | runtime->no_period_wakeup = | ||
427 | (params->info & SNDRV_PCM_INFO_NO_PERIOD_WAKEUP) && | ||
428 | (params->flags & SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP); | ||
426 | 429 | ||
427 | bits = snd_pcm_format_physical_width(runtime->format); | 430 | bits = snd_pcm_format_physical_width(runtime->format); |
428 | runtime->sample_bits = bits; | 431 | runtime->sample_bits = bits; |