diff options
Diffstat (limited to 'sound/usb/usx2y/usbusx2yaudio.c')
-rw-r--r-- | sound/usb/usx2y/usbusx2yaudio.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index f6bd0dee563c..367f8a32a665 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c | |||
@@ -306,7 +306,7 @@ static void usX2Y_error_sequence(struct usX2Ydev *usX2Y, | |||
306 | usX2Y_clients_stop(usX2Y); | 306 | usX2Y_clients_stop(usX2Y); |
307 | } | 307 | } |
308 | 308 | ||
309 | static void i_usX2Y_urb_complete(struct urb *urb, struct pt_regs *regs) | 309 | static void i_usX2Y_urb_complete(struct urb *urb) |
310 | { | 310 | { |
311 | struct snd_usX2Y_substream *subs = urb->context; | 311 | struct snd_usX2Y_substream *subs = urb->context; |
312 | struct usX2Ydev *usX2Y = subs->usX2Y; | 312 | struct usX2Ydev *usX2Y = subs->usX2Y; |
@@ -322,7 +322,7 @@ static void i_usX2Y_urb_complete(struct urb *urb, struct pt_regs *regs) | |||
322 | usX2Y_error_urb_status(usX2Y, subs, urb); | 322 | usX2Y_error_urb_status(usX2Y, subs, urb); |
323 | return; | 323 | return; |
324 | } | 324 | } |
325 | if (likely((0xFFFF & urb->start_frame) == usX2Y->wait_iso_frame)) | 325 | if (likely(urb->start_frame == usX2Y->wait_iso_frame)) |
326 | subs->completed_urb = urb; | 326 | subs->completed_urb = urb; |
327 | else { | 327 | else { |
328 | usX2Y_error_sequence(usX2Y, subs, urb); | 328 | usX2Y_error_sequence(usX2Y, subs, urb); |
@@ -335,13 +335,9 @@ static void i_usX2Y_urb_complete(struct urb *urb, struct pt_regs *regs) | |||
335 | atomic_read(&capsubs->state) >= state_PREPARED && | 335 | atomic_read(&capsubs->state) >= state_PREPARED && |
336 | (playbacksubs->completed_urb || | 336 | (playbacksubs->completed_urb || |
337 | atomic_read(&playbacksubs->state) < state_PREPARED)) { | 337 | atomic_read(&playbacksubs->state) < state_PREPARED)) { |
338 | if (!usX2Y_usbframe_complete(capsubs, playbacksubs, urb->start_frame)) { | 338 | if (!usX2Y_usbframe_complete(capsubs, playbacksubs, urb->start_frame)) |
339 | if (nr_of_packs() <= urb->start_frame && | 339 | usX2Y->wait_iso_frame += nr_of_packs(); |
340 | urb->start_frame <= (2 * nr_of_packs() - 1)) // uhci and ohci | 340 | else { |
341 | usX2Y->wait_iso_frame = urb->start_frame - nr_of_packs(); | ||
342 | else | ||
343 | usX2Y->wait_iso_frame += nr_of_packs(); | ||
344 | } else { | ||
345 | snd_printdd("\n"); | 341 | snd_printdd("\n"); |
346 | usX2Y_clients_stop(usX2Y); | 342 | usX2Y_clients_stop(usX2Y); |
347 | } | 343 | } |
@@ -350,7 +346,7 @@ static void i_usX2Y_urb_complete(struct urb *urb, struct pt_regs *regs) | |||
350 | } | 346 | } |
351 | 347 | ||
352 | static void usX2Y_urbs_set_complete(struct usX2Ydev * usX2Y, | 348 | static void usX2Y_urbs_set_complete(struct usX2Ydev * usX2Y, |
353 | void (*complete)(struct urb *, struct pt_regs *)) | 349 | void (*complete)(struct urb *)) |
354 | { | 350 | { |
355 | int s, u; | 351 | int s, u; |
356 | for (s = 0; s < 4; s++) { | 352 | for (s = 0; s < 4; s++) { |
@@ -370,7 +366,7 @@ static void usX2Y_subs_startup_finish(struct usX2Ydev * usX2Y) | |||
370 | usX2Y->prepare_subs = NULL; | 366 | usX2Y->prepare_subs = NULL; |
371 | } | 367 | } |
372 | 368 | ||
373 | static void i_usX2Y_subs_startup(struct urb *urb, struct pt_regs *regs) | 369 | static void i_usX2Y_subs_startup(struct urb *urb) |
374 | { | 370 | { |
375 | struct snd_usX2Y_substream *subs = urb->context; | 371 | struct snd_usX2Y_substream *subs = urb->context; |
376 | struct usX2Ydev *usX2Y = subs->usX2Y; | 372 | struct usX2Ydev *usX2Y = subs->usX2Y; |
@@ -382,7 +378,7 @@ static void i_usX2Y_subs_startup(struct urb *urb, struct pt_regs *regs) | |||
382 | wake_up(&usX2Y->prepare_wait_queue); | 378 | wake_up(&usX2Y->prepare_wait_queue); |
383 | } | 379 | } |
384 | 380 | ||
385 | i_usX2Y_urb_complete(urb, regs); | 381 | i_usX2Y_urb_complete(urb); |
386 | } | 382 | } |
387 | 383 | ||
388 | static void usX2Y_subs_prepare(struct snd_usX2Y_substream *subs) | 384 | static void usX2Y_subs_prepare(struct snd_usX2Y_substream *subs) |
@@ -495,7 +491,6 @@ static int usX2Y_urbs_start(struct snd_usX2Y_substream *subs) | |||
495 | if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED) | 491 | if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED) |
496 | goto start; | 492 | goto start; |
497 | } | 493 | } |
498 | usX2Y->wait_iso_frame = -1; | ||
499 | 494 | ||
500 | start: | 495 | start: |
501 | usX2Y_subs_startup(subs); | 496 | usX2Y_subs_startup(subs); |
@@ -516,10 +511,9 @@ static int usX2Y_urbs_start(struct snd_usX2Y_substream *subs) | |||
516 | snd_printk (KERN_ERR "cannot submit datapipe for urb %d, err = %d\n", i, err); | 511 | snd_printk (KERN_ERR "cannot submit datapipe for urb %d, err = %d\n", i, err); |
517 | err = -EPIPE; | 512 | err = -EPIPE; |
518 | goto cleanup; | 513 | goto cleanup; |
519 | } else { | 514 | } else |
520 | if (0 > usX2Y->wait_iso_frame) | 515 | if (i == 0) |
521 | usX2Y->wait_iso_frame = urb->start_frame; | 516 | usX2Y->wait_iso_frame = urb->start_frame; |
522 | } | ||
523 | urb->transfer_flags = 0; | 517 | urb->transfer_flags = 0; |
524 | } else { | 518 | } else { |
525 | atomic_set(&subs->state, state_STARTING1); | 519 | atomic_set(&subs->state, state_STARTING1); |
@@ -663,7 +657,7 @@ static struct s_c2 SetRate48000[] = | |||
663 | }; | 657 | }; |
664 | #define NOOF_SETRATE_URBS ARRAY_SIZE(SetRate48000) | 658 | #define NOOF_SETRATE_URBS ARRAY_SIZE(SetRate48000) |
665 | 659 | ||
666 | static void i_usX2Y_04Int(struct urb *urb, struct pt_regs *regs) | 660 | static void i_usX2Y_04Int(struct urb *urb) |
667 | { | 661 | { |
668 | struct usX2Ydev *usX2Y = urb->context; | 662 | struct usX2Ydev *usX2Y = urb->context; |
669 | 663 | ||