Lines Matching +full:sub +full:- +full:frame

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (c) 2006-2008 Daniel Mack, Karsten Wiese
31 (stream << 1) | (~(i / (cdev->n_streams * BYTES_PER_SAMPLE_USB)) & 1)
52 struct snd_pcm_substream *sub) in activate_substream() argument
54 spin_lock(&cdev->spinlock); in activate_substream()
56 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) in activate_substream()
57 cdev->sub_playback[sub->number] = sub; in activate_substream()
59 cdev->sub_capture[sub->number] = sub; in activate_substream()
61 spin_unlock(&cdev->spinlock); in activate_substream()
66 struct snd_pcm_substream *sub) in deactivate_substream() argument
69 spin_lock_irqsave(&cdev->spinlock, flags); in deactivate_substream()
71 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) in deactivate_substream()
72 cdev->sub_playback[sub->number] = NULL; in deactivate_substream()
74 cdev->sub_capture[sub->number] = NULL; in deactivate_substream()
76 spin_unlock_irqrestore(&cdev->spinlock, flags); in deactivate_substream()
96 if (cdev->streaming) in stream_start()
97 return -EINVAL; in stream_start()
99 memset(cdev->sub_playback, 0, sizeof(cdev->sub_playback)); in stream_start()
100 memset(cdev->sub_capture, 0, sizeof(cdev->sub_capture)); in stream_start()
101 cdev->input_panic = 0; in stream_start()
102 cdev->output_panic = 0; in stream_start()
103 cdev->first_packet = 4; in stream_start()
104 cdev->streaming = 1; in stream_start()
105 cdev->warned = 0; in stream_start()
108 ret = usb_submit_urb(cdev->data_urbs_in[i], GFP_ATOMIC); in stream_start()
112 cdev->streaming = 0; in stream_start()
113 return -EPIPE; in stream_start()
126 if (!cdev->streaming) in stream_stop()
129 cdev->streaming = 0; in stream_stop()
132 usb_kill_urb(cdev->data_urbs_in[i]); in stream_stop()
134 if (test_bit(i, &cdev->outurb_active_mask)) in stream_stop()
135 usb_kill_urb(cdev->data_urbs_out[i]); in stream_stop()
138 cdev->outurb_active_mask = 0; in stream_stop()
147 substream->runtime->hw = cdev->pcm_info; in snd_usb_caiaq_substream_open()
148 snd_pcm_limit_hw_rates(substream->runtime); in snd_usb_caiaq_substream_open()
159 if (all_substreams_zero(cdev->sub_playback) && in snd_usb_caiaq_substream_close()
160 all_substreams_zero(cdev->sub_capture)) { in snd_usb_caiaq_substream_close()
164 cdev->pcm_info.rates = cdev->samplerates; in snd_usb_caiaq_substream_close()
170 static int snd_usb_caiaq_pcm_hw_free(struct snd_pcm_substream *sub) in snd_usb_caiaq_pcm_hw_free() argument
172 struct snd_usb_caiaqdev *cdev = snd_pcm_substream_chip(sub); in snd_usb_caiaq_pcm_hw_free()
173 deactivate_substream(cdev, sub); in snd_usb_caiaq_pcm_hw_free()
180 int index = substream->number; in snd_usb_caiaq_pcm_prepare()
182 struct snd_pcm_runtime *runtime = substream->runtime; in snd_usb_caiaq_pcm_prepare()
187 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in snd_usb_caiaq_pcm_prepare()
190 switch (cdev->spec.data_alignment) { in snd_usb_caiaq_pcm_prepare()
201 cdev->period_out_count[index] = out_pos; in snd_usb_caiaq_pcm_prepare()
202 cdev->audio_out_buf_pos[index] = out_pos; in snd_usb_caiaq_pcm_prepare()
206 switch (cdev->spec.data_alignment) { in snd_usb_caiaq_pcm_prepare()
219 cdev->period_in_count[index] = in_pos; in snd_usb_caiaq_pcm_prepare()
220 cdev->audio_in_buf_pos[index] = in_pos; in snd_usb_caiaq_pcm_prepare()
223 if (cdev->streaming) in snd_usb_caiaq_pcm_prepare()
228 cdev->pcm_info.rates = snd_pcm_rate_to_rate_bit(runtime->rate); in snd_usb_caiaq_pcm_prepare()
232 if (cdev->spec.data_alignment >= 2) in snd_usb_caiaq_pcm_prepare()
235 bpp = ((runtime->rate / 8000) + CLOCK_DRIFT_TOLERANCE) in snd_usb_caiaq_pcm_prepare()
236 * bytes_per_sample * CHANNELS_PER_STREAM * cdev->n_streams; in snd_usb_caiaq_pcm_prepare()
241 ret = snd_usb_caiaq_set_audio_params(cdev, runtime->rate, in snd_usb_caiaq_pcm_prepare()
242 runtime->sample_bits, bpp); in snd_usb_caiaq_pcm_prepare()
250 cdev->output_running = 0; in snd_usb_caiaq_pcm_prepare()
251 wait_event_timeout(cdev->prepare_wait_queue, cdev->output_running, HZ); in snd_usb_caiaq_pcm_prepare()
252 if (!cdev->output_running) { in snd_usb_caiaq_pcm_prepare()
254 return -EPIPE; in snd_usb_caiaq_pcm_prepare()
260 static int snd_usb_caiaq_pcm_trigger(struct snd_pcm_substream *sub, int cmd) in snd_usb_caiaq_pcm_trigger() argument
262 struct snd_usb_caiaqdev *cdev = snd_pcm_substream_chip(sub); in snd_usb_caiaq_pcm_trigger()
265 dev_dbg(dev, "%s(%p) cmd %d\n", __func__, sub, cmd); in snd_usb_caiaq_pcm_trigger()
270 activate_substream(cdev, sub); in snd_usb_caiaq_pcm_trigger()
274 deactivate_substream(cdev, sub); in snd_usb_caiaq_pcm_trigger()
277 return -EINVAL; in snd_usb_caiaq_pcm_trigger()
284 snd_usb_caiaq_pcm_pointer(struct snd_pcm_substream *sub) in snd_usb_caiaq_pcm_pointer() argument
286 int index = sub->number; in snd_usb_caiaq_pcm_pointer()
287 struct snd_usb_caiaqdev *cdev = snd_pcm_substream_chip(sub); in snd_usb_caiaq_pcm_pointer()
290 spin_lock(&cdev->spinlock); in snd_usb_caiaq_pcm_pointer()
292 if (cdev->input_panic || cdev->output_panic) { in snd_usb_caiaq_pcm_pointer()
297 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) in snd_usb_caiaq_pcm_pointer()
298 ptr = bytes_to_frames(sub->runtime, in snd_usb_caiaq_pcm_pointer()
299 cdev->audio_out_buf_pos[index]); in snd_usb_caiaq_pcm_pointer()
301 ptr = bytes_to_frames(sub->runtime, in snd_usb_caiaq_pcm_pointer()
302 cdev->audio_in_buf_pos[index]); in snd_usb_caiaq_pcm_pointer()
305 spin_unlock(&cdev->spinlock); in snd_usb_caiaq_pcm_pointer()
323 struct snd_pcm_substream *sub; in check_for_elapsed_periods() local
325 for (stream = 0; stream < cdev->n_streams; stream++) { in check_for_elapsed_periods()
326 sub = subs[stream]; in check_for_elapsed_periods()
327 if (!sub) in check_for_elapsed_periods()
330 pb = snd_pcm_lib_period_bytes(sub); in check_for_elapsed_periods()
331 cnt = (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) ? in check_for_elapsed_periods()
332 &cdev->period_out_count[stream] : in check_for_elapsed_periods()
333 &cdev->period_in_count[stream]; in check_for_elapsed_periods()
336 snd_pcm_period_elapsed(sub); in check_for_elapsed_periods()
346 unsigned char *usb_buf = urb->transfer_buffer + iso->offset; in read_in_urb_mode0()
347 struct snd_pcm_substream *sub; in read_in_urb_mode0() local
350 if (all_substreams_zero(cdev->sub_capture)) in read_in_urb_mode0()
353 for (i = 0; i < iso->actual_length;) { in read_in_urb_mode0()
354 for (stream = 0; stream < cdev->n_streams; stream++, i++) { in read_in_urb_mode0()
355 sub = cdev->sub_capture[stream]; in read_in_urb_mode0()
356 if (sub) { in read_in_urb_mode0()
357 struct snd_pcm_runtime *rt = sub->runtime; in read_in_urb_mode0()
358 char *audio_buf = rt->dma_area; in read_in_urb_mode0()
359 int sz = frames_to_bytes(rt, rt->buffer_size); in read_in_urb_mode0()
360 audio_buf[cdev->audio_in_buf_pos[stream]++] in read_in_urb_mode0()
362 cdev->period_in_count[stream]++; in read_in_urb_mode0()
363 if (cdev->audio_in_buf_pos[stream] == sz) in read_in_urb_mode0()
364 cdev->audio_in_buf_pos[stream] = 0; in read_in_urb_mode0()
374 unsigned char *usb_buf = urb->transfer_buffer + iso->offset; in read_in_urb_mode2()
376 struct snd_pcm_substream *sub; in read_in_urb_mode2() local
379 for (i = 0; i < iso->actual_length;) { in read_in_urb_mode2()
380 if (i % (cdev->n_streams * BYTES_PER_SAMPLE_USB) == 0) { in read_in_urb_mode2()
382 stream < cdev->n_streams; in read_in_urb_mode2()
384 if (cdev->first_packet) in read_in_urb_mode2()
390 cdev->input_panic = 1; in read_in_urb_mode2()
393 cdev->output_panic = 1; in read_in_urb_mode2()
396 cdev->first_packet = 0; in read_in_urb_mode2()
398 for (stream = 0; stream < cdev->n_streams; stream++, i++) { in read_in_urb_mode2()
399 sub = cdev->sub_capture[stream]; in read_in_urb_mode2()
400 if (cdev->input_panic) in read_in_urb_mode2()
403 if (sub) { in read_in_urb_mode2()
404 struct snd_pcm_runtime *rt = sub->runtime; in read_in_urb_mode2()
405 char *audio_buf = rt->dma_area; in read_in_urb_mode2()
406 int sz = frames_to_bytes(rt, rt->buffer_size); in read_in_urb_mode2()
407 audio_buf[cdev->audio_in_buf_pos[stream]++] = in read_in_urb_mode2()
409 cdev->period_in_count[stream]++; in read_in_urb_mode2()
410 if (cdev->audio_in_buf_pos[stream] == sz) in read_in_urb_mode2()
411 cdev->audio_in_buf_pos[stream] = 0; in read_in_urb_mode2()
421 unsigned char *usb_buf = urb->transfer_buffer + iso->offset; in read_in_urb_mode3()
426 if (iso->actual_length % (BYTES_PER_SAMPLE_USB * CHANNELS_PER_STREAM)) in read_in_urb_mode3()
429 for (i = 0; i < iso->actual_length;) { in read_in_urb_mode3()
430 for (stream = 0; stream < cdev->n_streams; stream++) { in read_in_urb_mode3()
431 struct snd_pcm_substream *sub = cdev->sub_capture[stream]; in read_in_urb_mode3() local
435 if (sub && !cdev->input_panic) { in read_in_urb_mode3()
436 struct snd_pcm_runtime *rt = sub->runtime; in read_in_urb_mode3()
437 audio_buf = rt->dma_area; in read_in_urb_mode3()
438 sz = frames_to_bytes(rt, rt->buffer_size); in read_in_urb_mode3()
445 audio_buf[cdev->audio_in_buf_pos[stream]++] = usb_buf[i+n]; in read_in_urb_mode3()
447 if (cdev->audio_in_buf_pos[stream] == sz) in read_in_urb_mode3()
448 cdev->audio_in_buf_pos[stream] = 0; in read_in_urb_mode3()
451 cdev->period_in_count[stream] += BYTES_PER_SAMPLE; in read_in_urb_mode3()
457 !cdev->first_packet) { in read_in_urb_mode3()
458 if (!cdev->input_panic) in read_in_urb_mode3()
461 cdev->input_panic = 1; in read_in_urb_mode3()
469 if (cdev->first_packet > 0) in read_in_urb_mode3()
470 cdev->first_packet--; in read_in_urb_mode3()
479 if (!cdev->streaming) in read_in_urb()
482 if (iso->actual_length < cdev->bpp) in read_in_urb()
485 switch (cdev->spec.data_alignment) { in read_in_urb()
497 if ((cdev->input_panic || cdev->output_panic) && !cdev->warned) { in read_in_urb()
499 cdev->input_panic ? "(input)" : "", in read_in_urb()
500 cdev->output_panic ? "(output)" : ""); in read_in_urb()
501 cdev->warned = 1; in read_in_urb()
509 unsigned char *usb_buf = urb->transfer_buffer + iso->offset; in fill_out_urb_mode_0()
510 struct snd_pcm_substream *sub; in fill_out_urb_mode_0() local
513 for (i = 0; i < iso->length;) { in fill_out_urb_mode_0()
514 for (stream = 0; stream < cdev->n_streams; stream++, i++) { in fill_out_urb_mode_0()
515 sub = cdev->sub_playback[stream]; in fill_out_urb_mode_0()
516 if (sub) { in fill_out_urb_mode_0()
517 struct snd_pcm_runtime *rt = sub->runtime; in fill_out_urb_mode_0()
518 char *audio_buf = rt->dma_area; in fill_out_urb_mode_0()
519 int sz = frames_to_bytes(rt, rt->buffer_size); in fill_out_urb_mode_0()
521 audio_buf[cdev->audio_out_buf_pos[stream]]; in fill_out_urb_mode_0()
522 cdev->period_out_count[stream]++; in fill_out_urb_mode_0()
523 cdev->audio_out_buf_pos[stream]++; in fill_out_urb_mode_0()
524 if (cdev->audio_out_buf_pos[stream] == sz) in fill_out_urb_mode_0()
525 cdev->audio_out_buf_pos[stream] = 0; in fill_out_urb_mode_0()
531 if (cdev->spec.data_alignment == 2 && in fill_out_urb_mode_0()
532 i % (cdev->n_streams * BYTES_PER_SAMPLE_USB) == in fill_out_urb_mode_0()
533 (cdev->n_streams * CHANNELS_PER_STREAM)) in fill_out_urb_mode_0()
534 for (stream = 0; stream < cdev->n_streams; stream++, i++) in fill_out_urb_mode_0()
543 unsigned char *usb_buf = urb->transfer_buffer + iso->offset; in fill_out_urb_mode_3()
546 for (i = 0; i < iso->length;) { in fill_out_urb_mode_3()
547 for (stream = 0; stream < cdev->n_streams; stream++) { in fill_out_urb_mode_3()
548 struct snd_pcm_substream *sub = cdev->sub_playback[stream]; in fill_out_urb_mode_3() local
552 if (sub) { in fill_out_urb_mode_3()
553 struct snd_pcm_runtime *rt = sub->runtime; in fill_out_urb_mode_3()
554 audio_buf = rt->dma_area; in fill_out_urb_mode_3()
555 sz = frames_to_bytes(rt, rt->buffer_size); in fill_out_urb_mode_3()
561 usb_buf[i+n] = audio_buf[cdev->audio_out_buf_pos[stream]++]; in fill_out_urb_mode_3()
563 if (cdev->audio_out_buf_pos[stream] == sz) in fill_out_urb_mode_3()
564 cdev->audio_out_buf_pos[stream] = 0; in fill_out_urb_mode_3()
571 cdev->period_out_count[stream] += BYTES_PER_SAMPLE; in fill_out_urb_mode_3()
586 switch (cdev->spec.data_alignment) { in fill_out_urb()
599 struct snd_usb_caiaq_cb_info *info = urb->context; in read_completed()
603 int i, frame, len, send_it = 0, outframe = 0; in read_completed() local
607 if (urb->status || !info) in read_completed()
610 cdev = info->cdev; in read_completed()
613 if (!cdev->streaming) in read_completed()
618 if (test_and_set_bit(i, &cdev->outurb_active_mask) == 0) { in read_completed()
619 out = cdev->data_urbs_out[i]; in read_completed()
630 for (frame = 0; frame < FRAMES_PER_URB; frame++) { in read_completed()
631 if (urb->iso_frame_desc[frame].status) in read_completed()
634 len = urb->iso_frame_desc[outframe].actual_length; in read_completed()
635 out->iso_frame_desc[outframe].length = len; in read_completed()
636 out->iso_frame_desc[outframe].actual_length = 0; in read_completed()
637 out->iso_frame_desc[outframe].offset = offset; in read_completed()
641 spin_lock_irqsave(&cdev->spinlock, flags); in read_completed()
642 fill_out_urb(cdev, out, &out->iso_frame_desc[outframe]); in read_completed()
643 read_in_urb(cdev, urb, &urb->iso_frame_desc[frame]); in read_completed()
644 spin_unlock_irqrestore(&cdev->spinlock, flags); in read_completed()
645 check_for_elapsed_periods(cdev, cdev->sub_playback); in read_completed()
646 check_for_elapsed_periods(cdev, cdev->sub_capture); in read_completed()
654 out->number_of_packets = outframe; in read_completed()
657 struct snd_usb_caiaq_cb_info *oinfo = out->context; in read_completed()
658 clear_bit(oinfo->index, &cdev->outurb_active_mask); in read_completed()
662 /* re-submit inbound urb */ in read_completed()
663 for (frame = 0; frame < FRAMES_PER_URB; frame++) { in read_completed()
664 urb->iso_frame_desc[frame].offset = BYTES_PER_FRAME * frame; in read_completed()
665 urb->iso_frame_desc[frame].length = BYTES_PER_FRAME; in read_completed()
666 urb->iso_frame_desc[frame].actual_length = 0; in read_completed()
669 urb->number_of_packets = FRAMES_PER_URB; in read_completed()
675 struct snd_usb_caiaq_cb_info *info = urb->context; in write_completed()
676 struct snd_usb_caiaqdev *cdev = info->cdev; in write_completed()
678 if (!cdev->output_running) { in write_completed()
679 cdev->output_running = 1; in write_completed()
680 wake_up(&cdev->prepare_wait_queue); in write_completed()
683 clear_bit(info->index, &cdev->outurb_active_mask); in write_completed()
688 int i, frame; in alloc_urbs() local
690 struct usb_device *usb_dev = cdev->chip.dev; in alloc_urbs()
699 *ret = -ENOMEM; in alloc_urbs()
706 *ret = -ENOMEM; in alloc_urbs()
710 urbs[i]->transfer_buffer = in alloc_urbs()
713 if (!urbs[i]->transfer_buffer) { in alloc_urbs()
714 *ret = -ENOMEM; in alloc_urbs()
718 for (frame = 0; frame < FRAMES_PER_URB; frame++) { in alloc_urbs()
720 &urbs[i]->iso_frame_desc[frame]; in alloc_urbs()
722 iso->offset = BYTES_PER_FRAME * frame; in alloc_urbs()
723 iso->length = BYTES_PER_FRAME; in alloc_urbs()
726 urbs[i]->dev = usb_dev; in alloc_urbs()
727 urbs[i]->pipe = pipe; in alloc_urbs()
728 urbs[i]->transfer_buffer_length = FRAMES_PER_URB in alloc_urbs()
730 urbs[i]->context = &cdev->data_cb_info[i]; in alloc_urbs()
731 urbs[i]->interval = 1; in alloc_urbs()
732 urbs[i]->number_of_packets = FRAMES_PER_URB; in alloc_urbs()
733 urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ? in alloc_urbs()
753 kfree(urbs[i]->transfer_buffer); in free_urbs()
765 cdev->n_audio_in = max(cdev->spec.num_analog_audio_in, in snd_usb_caiaq_audio_init()
766 cdev->spec.num_digital_audio_in) / in snd_usb_caiaq_audio_init()
768 cdev->n_audio_out = max(cdev->spec.num_analog_audio_out, in snd_usb_caiaq_audio_init()
769 cdev->spec.num_digital_audio_out) / in snd_usb_caiaq_audio_init()
771 cdev->n_streams = max(cdev->n_audio_in, cdev->n_audio_out); in snd_usb_caiaq_audio_init()
773 dev_dbg(dev, "cdev->n_audio_in = %d\n", cdev->n_audio_in); in snd_usb_caiaq_audio_init()
774 dev_dbg(dev, "cdev->n_audio_out = %d\n", cdev->n_audio_out); in snd_usb_caiaq_audio_init()
775 dev_dbg(dev, "cdev->n_streams = %d\n", cdev->n_streams); in snd_usb_caiaq_audio_init()
777 if (cdev->n_streams > MAX_STREAMS) { in snd_usb_caiaq_audio_init()
779 return -EINVAL; in snd_usb_caiaq_audio_init()
782 if (cdev->n_streams < 1) { in snd_usb_caiaq_audio_init()
783 dev_err(dev, "bogus number of streams: %d\n", cdev->n_streams); in snd_usb_caiaq_audio_init()
784 return -EINVAL; in snd_usb_caiaq_audio_init()
787 ret = snd_pcm_new(cdev->chip.card, cdev->product_name, 0, in snd_usb_caiaq_audio_init()
788 cdev->n_audio_out, cdev->n_audio_in, &cdev->pcm); in snd_usb_caiaq_audio_init()
795 cdev->pcm->private_data = cdev; in snd_usb_caiaq_audio_init()
796 strscpy(cdev->pcm->name, cdev->product_name, sizeof(cdev->pcm->name)); in snd_usb_caiaq_audio_init()
798 memset(cdev->sub_playback, 0, sizeof(cdev->sub_playback)); in snd_usb_caiaq_audio_init()
799 memset(cdev->sub_capture, 0, sizeof(cdev->sub_capture)); in snd_usb_caiaq_audio_init()
801 memcpy(&cdev->pcm_info, &snd_usb_caiaq_pcm_hardware, in snd_usb_caiaq_audio_init()
805 cdev->samplerates = cdev->pcm_info.rates; in snd_usb_caiaq_audio_init()
806 switch (cdev->chip.usb_id) { in snd_usb_caiaq_audio_init()
811 cdev->samplerates |= SNDRV_PCM_RATE_192000; in snd_usb_caiaq_audio_init()
817 cdev->samplerates |= SNDRV_PCM_RATE_88200; in snd_usb_caiaq_audio_init()
821 snd_pcm_set_ops(cdev->pcm, SNDRV_PCM_STREAM_PLAYBACK, in snd_usb_caiaq_audio_init()
823 snd_pcm_set_ops(cdev->pcm, SNDRV_PCM_STREAM_CAPTURE, in snd_usb_caiaq_audio_init()
825 snd_pcm_set_managed_buffer_all(cdev->pcm, SNDRV_DMA_TYPE_VMALLOC, in snd_usb_caiaq_audio_init()
828 cdev->data_cb_info = in snd_usb_caiaq_audio_init()
832 if (!cdev->data_cb_info) in snd_usb_caiaq_audio_init()
833 return -ENOMEM; in snd_usb_caiaq_audio_init()
835 cdev->outurb_active_mask = 0; in snd_usb_caiaq_audio_init()
836 BUILD_BUG_ON(N_URBS > (sizeof(cdev->outurb_active_mask) * 8)); in snd_usb_caiaq_audio_init()
839 cdev->data_cb_info[i].cdev = cdev; in snd_usb_caiaq_audio_init()
840 cdev->data_cb_info[i].index = i; in snd_usb_caiaq_audio_init()
843 cdev->data_urbs_in = alloc_urbs(cdev, SNDRV_PCM_STREAM_CAPTURE, &ret); in snd_usb_caiaq_audio_init()
845 kfree(cdev->data_cb_info); in snd_usb_caiaq_audio_init()
846 free_urbs(cdev->data_urbs_in); in snd_usb_caiaq_audio_init()
850 cdev->data_urbs_out = alloc_urbs(cdev, SNDRV_PCM_STREAM_PLAYBACK, &ret); in snd_usb_caiaq_audio_init()
852 kfree(cdev->data_cb_info); in snd_usb_caiaq_audio_init()
853 free_urbs(cdev->data_urbs_in); in snd_usb_caiaq_audio_init()
854 free_urbs(cdev->data_urbs_out); in snd_usb_caiaq_audio_init()
867 free_urbs(cdev->data_urbs_in); in snd_usb_caiaq_audio_free()
868 free_urbs(cdev->data_urbs_out); in snd_usb_caiaq_audio_free()
869 kfree(cdev->data_cb_info); in snd_usb_caiaq_audio_free()