aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Wiese <fzu@wemgehoertderstaat.de>2007-03-29 11:02:45 -0400
committerJaroslav Kysela <perex@suse.cz>2007-05-11 10:55:55 -0400
commita971c3d42524afc5619fa271d59d29be3c1661e3 (patch)
tree396bb4570775d50c4d7080339813f092f6c7cb3f
parentc052f046240b094b2ec12e0004e47756302e2b55 (diff)
[ALSA] snd-usb-caiaq: Make playback work
some typo fixes. Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/usb/caiaq/caiaq-audio.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/usb/caiaq/caiaq-audio.c b/sound/usb/caiaq/caiaq-audio.c
index e80c8db237d3..0414d766ba07 100644
--- a/sound/usb/caiaq/caiaq-audio.c
+++ b/sound/usb/caiaq/caiaq-audio.c
@@ -388,8 +388,8 @@ static void read_in_urb_mode2(struct snd_usb_caiaqdev *dev,
388 struct snd_pcm_runtime *rt = sub->runtime; 388 struct snd_pcm_runtime *rt = sub->runtime;
389 char *audio_buf = rt->dma_area; 389 char *audio_buf = rt->dma_area;
390 int sz = frames_to_bytes(rt, rt->buffer_size); 390 int sz = frames_to_bytes(rt, rt->buffer_size);
391 audio_buf[dev->audio_in_buf_pos[stream]++] 391 audio_buf[dev->audio_in_buf_pos[stream]++] =
392 = usb_buf[i]; 392 usb_buf[i];
393 dev->period_in_count[stream]++; 393 dev->period_in_count[stream]++;
394 if (dev->audio_in_buf_pos[stream] == sz) 394 if (dev->audio_in_buf_pos[stream] == sz)
395 dev->audio_in_buf_pos[stream] = 0; 395 dev->audio_in_buf_pos[stream] = 0;
@@ -436,19 +436,21 @@ static void fill_out_urb(struct snd_usb_caiaqdev *dev,
436 spin_lock(&dev->spinlock); 436 spin_lock(&dev->spinlock);
437 437
438 for (i = 0; i < iso->length;) { 438 for (i = 0; i < iso->length;) {
439 for (stream = 0; stream < dev->n_streams; stream++) { 439 for (stream = 0; stream < dev->n_streams; stream++, i++) {
440 sub = dev->sub_playback[stream]; 440 sub = dev->sub_playback[stream];
441 if (sub) { 441 if (sub) {
442 struct snd_pcm_runtime *rt = sub->runtime; 442 struct snd_pcm_runtime *rt = sub->runtime;
443 char *audio_buf = rt->dma_area; 443 char *audio_buf = rt->dma_area;
444 int sz = frames_to_bytes(rt, rt->buffer_size); 444 int sz = frames_to_bytes(rt, rt->buffer_size);
445 usb_buf[i++] 445 usb_buf[i] =
446 = audio_buf[dev->audio_out_buf_pos[stream]++]; 446 audio_buf[dev->audio_out_buf_pos[stream]];
447 dev->period_out_count[stream]++;
447 dev->audio_out_buf_pos[stream]++; 448 dev->audio_out_buf_pos[stream]++;
448 if (dev->audio_out_buf_pos[stream] == sz) 449 if (dev->audio_out_buf_pos[stream] == sz)
449 dev->audio_out_buf_pos[stream] = 0; 450 dev->audio_out_buf_pos[stream] = 0;
450 } else 451 } else
451 usb_buf[i++] = 0; 452 usb_buf[i] = 0;
453 }
452 454
453 /* fill in the check bytes */ 455 /* fill in the check bytes */
454 if (dev->spec.data_alignment == 2 && 456 if (dev->spec.data_alignment == 2 &&
@@ -456,7 +458,6 @@ static void fill_out_urb(struct snd_usb_caiaqdev *dev,
456 (dev->n_streams * CHANNELS_PER_STREAM)) 458 (dev->n_streams * CHANNELS_PER_STREAM))
457 for (stream = 0; stream < dev->n_streams; stream++, i++) 459 for (stream = 0; stream < dev->n_streams; stream++, i++)
458 usb_buf[i] = MAKE_CHECKBYTE(dev, stream, i); 460 usb_buf[i] = MAKE_CHECKBYTE(dev, stream, i);
459 }
460 } 461 }
461 462
462 spin_unlock(&dev->spinlock); 463 spin_unlock(&dev->spinlock);