diff options
Diffstat (limited to 'sound/core/pcm_lib.c')
-rw-r--r-- | sound/core/pcm_lib.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index c5bfd0918cf..0082914a7e3 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -1584,8 +1584,8 @@ int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | |||
1584 | return snd_pcm_hw_param_value(params, var, NULL); | 1584 | return snd_pcm_hw_param_value(params, var, NULL); |
1585 | } | 1585 | } |
1586 | 1586 | ||
1587 | int _snd_pcm_hw_param_mask(snd_pcm_hw_params_t *params, | 1587 | static int _snd_pcm_hw_param_mask(snd_pcm_hw_params_t *params, |
1588 | snd_pcm_hw_param_t var, const snd_mask_t *val) | 1588 | snd_pcm_hw_param_t var, const snd_mask_t *val) |
1589 | { | 1589 | { |
1590 | int changed; | 1590 | int changed; |
1591 | assert(hw_is_mask(var)); | 1591 | assert(hw_is_mask(var)); |
@@ -2063,7 +2063,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, | |||
2063 | if (((avail < runtime->control->avail_min && size > avail) || | 2063 | if (((avail < runtime->control->avail_min && size > avail) || |
2064 | (size >= runtime->xfer_align && avail < runtime->xfer_align))) { | 2064 | (size >= runtime->xfer_align && avail < runtime->xfer_align))) { |
2065 | wait_queue_t wait; | 2065 | wait_queue_t wait; |
2066 | enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED } state; | 2066 | enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED, DROPPED } state; |
2067 | long tout; | 2067 | long tout; |
2068 | 2068 | ||
2069 | if (nonblock) { | 2069 | if (nonblock) { |
@@ -2097,6 +2097,9 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, | |||
2097 | case SNDRV_PCM_STATE_SUSPENDED: | 2097 | case SNDRV_PCM_STATE_SUSPENDED: |
2098 | state = SUSPENDED; | 2098 | state = SUSPENDED; |
2099 | goto _end_loop; | 2099 | goto _end_loop; |
2100 | case SNDRV_PCM_STATE_SETUP: | ||
2101 | state = DROPPED; | ||
2102 | goto _end_loop; | ||
2100 | default: | 2103 | default: |
2101 | break; | 2104 | break; |
2102 | } | 2105 | } |
@@ -2123,6 +2126,9 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, | |||
2123 | snd_printd("playback write error (DMA or IRQ trouble?)\n"); | 2126 | snd_printd("playback write error (DMA or IRQ trouble?)\n"); |
2124 | err = -EIO; | 2127 | err = -EIO; |
2125 | goto _end_unlock; | 2128 | goto _end_unlock; |
2129 | case DROPPED: | ||
2130 | err = -EBADFD; | ||
2131 | goto _end_unlock; | ||
2126 | default: | 2132 | default: |
2127 | break; | 2133 | break; |
2128 | } | 2134 | } |
@@ -2359,7 +2365,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, | |||
2359 | } else if ((avail < runtime->control->avail_min && size > avail) || | 2365 | } else if ((avail < runtime->control->avail_min && size > avail) || |
2360 | (size >= runtime->xfer_align && avail < runtime->xfer_align)) { | 2366 | (size >= runtime->xfer_align && avail < runtime->xfer_align)) { |
2361 | wait_queue_t wait; | 2367 | wait_queue_t wait; |
2362 | enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED } state; | 2368 | enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED, DROPPED } state; |
2363 | long tout; | 2369 | long tout; |
2364 | 2370 | ||
2365 | if (nonblock) { | 2371 | if (nonblock) { |
@@ -2394,6 +2400,9 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, | |||
2394 | goto _end_loop; | 2400 | goto _end_loop; |
2395 | case SNDRV_PCM_STATE_DRAINING: | 2401 | case SNDRV_PCM_STATE_DRAINING: |
2396 | goto __draining; | 2402 | goto __draining; |
2403 | case SNDRV_PCM_STATE_SETUP: | ||
2404 | state = DROPPED; | ||
2405 | goto _end_loop; | ||
2397 | default: | 2406 | default: |
2398 | break; | 2407 | break; |
2399 | } | 2408 | } |
@@ -2420,6 +2429,9 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, | |||
2420 | snd_printd("capture read error (DMA or IRQ trouble?)\n"); | 2429 | snd_printd("capture read error (DMA or IRQ trouble?)\n"); |
2421 | err = -EIO; | 2430 | err = -EIO; |
2422 | goto _end_unlock; | 2431 | goto _end_unlock; |
2432 | case DROPPED: | ||
2433 | err = -EBADFD; | ||
2434 | goto _end_unlock; | ||
2423 | default: | 2435 | default: |
2424 | break; | 2436 | break; |
2425 | } | 2437 | } |