aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorKarsten Wiese <annabellesgarden@yahoo.de>2006-10-04 11:17:32 -0400
committerJaroslav Kysela <perex@suse.cz>2006-10-06 14:23:02 -0400
commit635bbb355ebb735647ca49fb649a6a7edea9b3ed (patch)
treea6bee5a4d355feb684c4996e00308e07bec4a4fc /sound/usb
parent9b08c2aa54948361da0e2d26b47e3bcb8f8911e8 (diff)
[ALSA] Repair snd-usb-usx2y for usb 2.6.18
urb->start_frame rolls over beyond MAX_INT now. This is for stable kernel and stable alsa. Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/usx2y/usbusx2yaudio.c18
-rw-r--r--sound/usb/usx2y/usx2yhwdeppcm.c15
2 files changed, 11 insertions, 22 deletions
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index e662281a751a..367f8a32a665 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -322,7 +322,7 @@ static void i_usX2Y_urb_complete(struct urb *urb)
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)
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 }
@@ -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);
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c
index 20708d2ffb6a..8f3e35e24e72 100644
--- a/sound/usb/usx2y/usx2yhwdeppcm.c
+++ b/sound/usb/usx2y/usx2yhwdeppcm.c
@@ -243,7 +243,7 @@ static void i_usX2Y_usbpcm_urb_complete(struct urb *urb)
243 usX2Y_error_urb_status(usX2Y, subs, urb); 243 usX2Y_error_urb_status(usX2Y, subs, urb);
244 return; 244 return;
245 } 245 }
246 if (likely((0xFFFF & urb->start_frame) == usX2Y->wait_iso_frame)) 246 if (likely(urb->start_frame == usX2Y->wait_iso_frame))
247 subs->completed_urb = urb; 247 subs->completed_urb = urb;
248 else { 248 else {
249 usX2Y_error_sequence(usX2Y, subs, urb); 249 usX2Y_error_sequence(usX2Y, subs, urb);
@@ -256,13 +256,9 @@ static void i_usX2Y_usbpcm_urb_complete(struct urb *urb)
256 if (capsubs->completed_urb && atomic_read(&capsubs->state) >= state_PREPARED && 256 if (capsubs->completed_urb && atomic_read(&capsubs->state) >= state_PREPARED &&
257 (NULL == capsubs2 || capsubs2->completed_urb) && 257 (NULL == capsubs2 || capsubs2->completed_urb) &&
258 (playbacksubs->completed_urb || atomic_read(&playbacksubs->state) < state_PREPARED)) { 258 (playbacksubs->completed_urb || atomic_read(&playbacksubs->state) < state_PREPARED)) {
259 if (!usX2Y_usbpcm_usbframe_complete(capsubs, capsubs2, playbacksubs, urb->start_frame)) { 259 if (!usX2Y_usbpcm_usbframe_complete(capsubs, capsubs2, playbacksubs, urb->start_frame))
260 if (nr_of_packs() <= urb->start_frame && 260 usX2Y->wait_iso_frame += nr_of_packs();
261 urb->start_frame <= (2 * nr_of_packs() - 1)) // uhci and ohci 261 else {
262 usX2Y->wait_iso_frame = urb->start_frame - nr_of_packs();
263 else
264 usX2Y->wait_iso_frame += nr_of_packs();
265 } else {
266 snd_printdd("\n"); 262 snd_printdd("\n");
267 usX2Y_clients_stop(usX2Y); 263 usX2Y_clients_stop(usX2Y);
268 } 264 }
@@ -433,7 +429,6 @@ static int usX2Y_usbpcm_urbs_start(struct snd_usX2Y_substream *subs)
433 if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED) 429 if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED)
434 goto start; 430 goto start;
435 } 431 }
436 usX2Y->wait_iso_frame = -1;
437 432
438 start: 433 start:
439 usX2Y_usbpcm_subs_startup(subs); 434 usX2Y_usbpcm_subs_startup(subs);
@@ -459,7 +454,7 @@ static int usX2Y_usbpcm_urbs_start(struct snd_usX2Y_substream *subs)
459 goto cleanup; 454 goto cleanup;
460 } else { 455 } else {
461 snd_printdd("%i\n", urb->start_frame); 456 snd_printdd("%i\n", urb->start_frame);
462 if (0 > usX2Y->wait_iso_frame) 457 if (u == 0)
463 usX2Y->wait_iso_frame = urb->start_frame; 458 usX2Y->wait_iso_frame = urb->start_frame;
464 } 459 }
465 urb->transfer_flags = 0; 460 urb->transfer_flags = 0;