Lines Matching refs:line6pcm
70 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
71 const int bytes_per_frame = line6pcm->properties->bytes_per_frame;
73 line6pcm->properties->snd_line6_rates.rats[0].num_min;
75 line6pcm->properties->snd_line6_rates.rats[0].den *
80 spin_lock_irqsave(&line6pcm->lock_audio_out, flags);
82 find_first_zero_bit(&line6pcm->active_urb_out, LINE6_ISO_BUFFERS);
85 spin_unlock_irqrestore(&line6pcm->lock_audio_out, flags);
90 urb_out = line6pcm->urb_audio_out[index];
98 line6pcm->count_out += frame_increment;
99 n = line6pcm->count_out / frame_factor;
100 line6pcm->count_out -= n * frame_factor;
109 if (test_bit(BIT_PAUSE_PLAYBACK, &line6pcm->flags)) {
110 urb_out->transfer_buffer = line6pcm->wrap_out;
111 memset(line6pcm->wrap_out, 0, urb_size);
113 if (line6pcm->pos_out + urb_frames > runtime->buffer_size) {
119 len = runtime->buffer_size - line6pcm->pos_out;
120 urb_out->transfer_buffer = line6pcm->wrap_out;
123 memcpy(line6pcm->wrap_out,
125 line6pcm->pos_out * bytes_per_frame,
127 memcpy(line6pcm->wrap_out +
139 line6pcm->pos_out * bytes_per_frame;
143 line6pcm->pos_out += urb_frames;
144 if (line6pcm->pos_out >= runtime->buffer_size)
145 line6pcm->pos_out -= runtime->buffer_size;
149 change_volume(urb_out, line6pcm->volume, bytes_per_frame);
155 line6_write_hexdump(line6pcm->line6, 'P',
162 set_bit(index, &line6pcm->active_urb_out);
167 spin_unlock_irqrestore(&line6pcm->lock_audio_out, flags);
190 static void unlink_audio_out_urbs(struct snd_line6_pcm *line6pcm)
195 if (test_bit(i, &line6pcm->active_urb_out)) {
196 if (!test_and_set_bit(i, &line6pcm->unlink_urb_out)) {
197 struct urb *u = line6pcm->urb_audio_out[i];
207 static void wait_clear_audio_out_urbs(struct snd_line6_pcm *line6pcm)
216 if (test_bit(i, &line6pcm->active_urb_out))
227 line6pcm->active_urb_out = 0;
228 line6pcm->unlink_urb_out = 0;
234 void unlink_wait_clear_audio_out_urbs(struct snd_line6_pcm *line6pcm)
236 unlink_audio_out_urbs(line6pcm);
237 wait_clear_audio_out_urbs(line6pcm);
250 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
255 if (urb == line6pcm->urb_audio_out[index])
264 spin_lock_irqsave(&line6pcm->lock_audio_out, flags);
265 line6pcm->pos_out_done +=
266 length / line6pcm->properties->bytes_per_frame;
268 if (line6pcm->pos_out_done >= runtime->buffer_size)
269 line6pcm->pos_out_done -= runtime->buffer_size;
271 clear_bit(index, &line6pcm->active_urb_out);
279 if (test_bit(index, &line6pcm->unlink_urb_out))
282 spin_unlock_irqrestore(&line6pcm->lock_audio_out, flags);
287 line6pcm->bytes_out += length;
288 if (line6pcm->bytes_out >= line6pcm->period_out) {
289 line6pcm->bytes_out -= line6pcm->period_out;
300 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
303 (&line6pcm->properties->
308 runtime->hw = line6pcm->properties->snd_line6_playback_hw;
323 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
327 if (line6pcm == NULL) {
333 line6pcm = snd_pcm_substream_chip(substream);
342 line6pcm->period_out = params_period_bytes(hw_params);
343 line6pcm->wrap_out = kmalloc(2 * LINE6_ISO_PACKET_SIZE_MAX, GFP_KERNEL);
345 if (!line6pcm->wrap_out) {
356 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
357 unlink_wait_clear_audio_out_urbs(line6pcm);
359 kfree(line6pcm->wrap_out);
360 line6pcm->wrap_out = NULL;
368 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
370 line6pcm->count_out = 0;
374 if (!test_and_set_bit(BIT_RUNNING_PLAYBACK, &line6pcm->flags)) {
379 &line6pcm->flags);
387 if (test_and_clear_bit(BIT_RUNNING_PLAYBACK, &line6pcm->flags))
388 unlink_audio_out_urbs(line6pcm);
393 set_bit(BIT_PAUSE_PLAYBACK, &line6pcm->flags);
397 clear_bit(BIT_PAUSE_PLAYBACK, &line6pcm->flags);
411 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
412 return line6pcm->pos_out_done;
427 int create_audio_out_urbs(struct snd_line6_pcm *line6pcm)
436 urb = line6pcm->urb_audio_out[i] =
440 dev_err(line6pcm->line6->ifcdev, "Out of memory\n");
444 urb->dev = line6pcm->line6->usbdev;
446 usb_sndisocpipe(line6pcm->line6->usbdev,
447 line6pcm->