diff options
Diffstat (limited to 'sound/usb/caiaq/caiaq-audio.c')
-rw-r--r-- | sound/usb/caiaq/caiaq-audio.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sound/usb/caiaq/caiaq-audio.c b/sound/usb/caiaq/caiaq-audio.c index b3a603325835..08d51e0c9fea 100644 --- a/sound/usb/caiaq/caiaq-audio.c +++ b/sound/usb/caiaq/caiaq-audio.c | |||
@@ -114,6 +114,7 @@ static int stream_start(struct snd_usb_caiaqdev *dev) | |||
114 | dev->output_panic = 0; | 114 | dev->output_panic = 0; |
115 | dev->first_packet = 1; | 115 | dev->first_packet = 1; |
116 | dev->streaming = 1; | 116 | dev->streaming = 1; |
117 | dev->warned = 0; | ||
117 | 118 | ||
118 | for (i = 0; i < N_URBS; i++) { | 119 | for (i = 0; i < N_URBS; i++) { |
119 | ret = usb_submit_urb(dev->data_urbs_in[i], GFP_ATOMIC); | 120 | ret = usb_submit_urb(dev->data_urbs_in[i], GFP_ATOMIC); |
@@ -376,6 +377,9 @@ static void read_in_urb_mode2(struct snd_usb_caiaqdev *dev, | |||
376 | 377 | ||
377 | for (stream = 0; stream < dev->n_streams; stream++, i++) { | 378 | for (stream = 0; stream < dev->n_streams; stream++, i++) { |
378 | sub = dev->sub_capture[stream]; | 379 | sub = dev->sub_capture[stream]; |
380 | if (dev->input_panic) | ||
381 | usb_buf[i] = 0; | ||
382 | |||
379 | if (sub) { | 383 | if (sub) { |
380 | struct snd_pcm_runtime *rt = sub->runtime; | 384 | struct snd_pcm_runtime *rt = sub->runtime; |
381 | char *audio_buf = rt->dma_area; | 385 | char *audio_buf = rt->dma_area; |
@@ -397,6 +401,9 @@ static void read_in_urb(struct snd_usb_caiaqdev *dev, | |||
397 | if (!dev->streaming) | 401 | if (!dev->streaming) |
398 | return; | 402 | return; |
399 | 403 | ||
404 | if (iso->actual_length < dev->bpp) | ||
405 | return; | ||
406 | |||
400 | switch (dev->spec.data_alignment) { | 407 | switch (dev->spec.data_alignment) { |
401 | case 0: | 408 | case 0: |
402 | read_in_urb_mode0(dev, urb, iso); | 409 | read_in_urb_mode0(dev, urb, iso); |
@@ -406,10 +413,11 @@ static void read_in_urb(struct snd_usb_caiaqdev *dev, | |||
406 | break; | 413 | break; |
407 | } | 414 | } |
408 | 415 | ||
409 | if (dev->input_panic || dev->output_panic) { | 416 | if ((dev->input_panic || dev->output_panic) && !dev->warned) { |
410 | debug("streaming error detected %s %s\n", | 417 | debug("streaming error detected %s %s\n", |
411 | dev->input_panic ? "(input)" : "", | 418 | dev->input_panic ? "(input)" : "", |
412 | dev->output_panic ? "(output)" : ""); | 419 | dev->output_panic ? "(output)" : ""); |
420 | dev->warned = 1; | ||
413 | } | 421 | } |
414 | } | 422 | } |
415 | 423 | ||
@@ -638,9 +646,10 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev) | |||
638 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1): | 646 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1): |
639 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3): | 647 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3): |
640 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_SESSIONIO): | 648 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_SESSIONIO): |
641 | dev->samplerates |= SNDRV_PCM_RATE_88200; | 649 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_GUITARRIGMOBILE): |
642 | dev->samplerates |= SNDRV_PCM_RATE_192000; | 650 | dev->samplerates |= SNDRV_PCM_RATE_192000; |
643 | break; | 651 | /* fall thru */ |
652 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): | ||
644 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): | 653 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): |
645 | dev->samplerates |= SNDRV_PCM_RATE_88200; | 654 | dev->samplerates |= SNDRV_PCM_RATE_88200; |
646 | break; | 655 | break; |