Make a function static
[openal-soft.git] / Alc / backends / coreaudio.c
blobb3583ffdea8aed212f86220237f7a88b3116485c
1 /**
2 * OpenAL cross platform audio library
3 * Copyright (C) 1999-2007 by authors.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
21 #include "config.h"
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
26 #include <alloca.h>
28 #include "alMain.h"
29 #include "alu.h"
31 #include <CoreServices/CoreServices.h>
32 #include <unistd.h>
33 #include <AudioUnit/AudioUnit.h>
34 #include <AudioToolbox/AudioToolbox.h>
37 typedef struct {
38 AudioUnit audioUnit;
40 ALuint frameSize;
41 ALdouble sampleRateRatio; // Ratio of hardware sample rate / requested sample rate
42 AudioStreamBasicDescription format; // This is the OpenAL format as a CoreAudio ASBD
44 AudioConverterRef audioConverter; // Sample rate converter if needed
45 AudioBufferList *bufferList; // Buffer for data coming from the input device
46 ALCvoid *resampleBuffer; // Buffer for returned RingBuffer data when resampling
48 RingBuffer *ring;
49 } ca_data;
51 static const ALCchar ca_device[] = "CoreAudio Default";
54 static void destroy_buffer_list(AudioBufferList* list)
56 if(list)
58 UInt32 i;
59 for(i = 0;i < list->mNumberBuffers;i++)
60 free(list->mBuffers[i].mData);
61 free(list);
65 static AudioBufferList* allocate_buffer_list(UInt32 channelCount, UInt32 byteSize)
67 AudioBufferList *list;
69 list = calloc(1, sizeof(AudioBufferList) + sizeof(AudioBuffer));
70 if(list)
72 list->mNumberBuffers = 1;
74 list->mBuffers[0].mNumberChannels = channelCount;
75 list->mBuffers[0].mDataByteSize = byteSize;
76 list->mBuffers[0].mData = malloc(byteSize);
77 if(list->mBuffers[0].mData == NULL)
79 free(list);
80 list = NULL;
83 return list;
86 static OSStatus ca_callback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp,
87 UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
89 ALCdevice *device = (ALCdevice*)inRefCon;
90 ca_data *data = (ca_data*)device->ExtraData;
92 aluMixData(device, ioData->mBuffers[0].mData,
93 ioData->mBuffers[0].mDataByteSize / data->frameSize);
95 return noErr;
98 static OSStatus ca_capture_conversion_callback(AudioConverterRef inAudioConverter, UInt32 *ioNumberDataPackets,
99 AudioBufferList *ioData, AudioStreamPacketDescription **outDataPacketDescription, void* inUserData)
101 ALCdevice *device = (ALCdevice*)inUserData;
102 ca_data *data = (ca_data*)device->ExtraData;
104 // Read from the ring buffer and store temporarily in a large buffer
105 ReadRingBuffer(data->ring, data->resampleBuffer, (ALsizei)(*ioNumberDataPackets));
107 // Set the input data
108 ioData->mNumberBuffers = 1;
109 ioData->mBuffers[0].mNumberChannels = data->format.mChannelsPerFrame;
110 ioData->mBuffers[0].mData = data->resampleBuffer;
111 ioData->mBuffers[0].mDataByteSize = (*ioNumberDataPackets) * data->format.mBytesPerFrame;
113 return noErr;
116 static OSStatus ca_capture_callback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags,
117 const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber,
118 UInt32 inNumberFrames, AudioBufferList *ioData)
120 ALCdevice *device = (ALCdevice*)inRefCon;
121 ca_data *data = (ca_data*)device->ExtraData;
122 AudioUnitRenderActionFlags flags = 0;
123 OSStatus err;
125 // fill the bufferList with data from the input device
126 err = AudioUnitRender(data->audioUnit, &flags, inTimeStamp, 1, inNumberFrames, data->bufferList);
127 if(err != noErr)
129 ERR("AudioUnitRender error: %d\n", err);
130 return err;
133 WriteRingBuffer(data->ring, data->bufferList->mBuffers[0].mData, inNumberFrames);
135 return noErr;
138 static ALCenum ca_open_playback(ALCdevice *device, const ALCchar *deviceName)
140 ComponentDescription desc;
141 Component comp;
142 ca_data *data;
143 OSStatus err;
145 if(!deviceName)
146 deviceName = ca_device;
147 else if(strcmp(deviceName, ca_device) != 0)
148 return ALC_INVALID_VALUE;
150 /* open the default output unit */
151 desc.componentType = kAudioUnitType_Output;
152 desc.componentSubType = kAudioUnitSubType_DefaultOutput;
153 desc.componentManufacturer = kAudioUnitManufacturer_Apple;
154 desc.componentFlags = 0;
155 desc.componentFlagsMask = 0;
157 comp = FindNextComponent(NULL, &desc);
158 if(comp == NULL)
160 ERR("FindNextComponent failed\n");
161 return ALC_INVALID_VALUE;
164 data = calloc(1, sizeof(*data));
166 err = OpenAComponent(comp, &data->audioUnit);
167 if(err != noErr)
169 ERR("OpenAComponent failed\n");
170 free(data);
171 return ALC_INVALID_VALUE;
174 /* init and start the default audio unit... */
175 err = AudioUnitInitialize(data->audioUnit);
176 if(err != noErr)
178 ERR("AudioUnitInitialize failed\n");
179 CloseComponent(data->audioUnit);
180 free(data);
181 return ALC_INVALID_VALUE;
184 al_string_copy_cstr(&device->DeviceName, deviceName);
185 device->ExtraData = data;
186 return ALC_NO_ERROR;
189 static void ca_close_playback(ALCdevice *device)
191 ca_data *data = (ca_data*)device->ExtraData;
193 AudioUnitUninitialize(data->audioUnit);
194 CloseComponent(data->audioUnit);
196 free(data);
197 device->ExtraData = NULL;
200 static ALCboolean ca_reset_playback(ALCdevice *device)
202 ca_data *data = (ca_data*)device->ExtraData;
203 AudioStreamBasicDescription streamFormat;
204 AURenderCallbackStruct input;
205 OSStatus err;
206 UInt32 size;
208 err = AudioUnitUninitialize(data->audioUnit);
209 if(err != noErr)
210 ERR("-- AudioUnitUninitialize failed.\n");
212 /* retrieve default output unit's properties (output side) */
213 size = sizeof(AudioStreamBasicDescription);
214 err = AudioUnitGetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &streamFormat, &size);
215 if(err != noErr || size != sizeof(AudioStreamBasicDescription))
217 ERR("AudioUnitGetProperty failed\n");
218 return ALC_FALSE;
221 #if 0
222 TRACE("Output streamFormat of default output unit -\n");
223 TRACE(" streamFormat.mFramesPerPacket = %d\n", streamFormat.mFramesPerPacket);
224 TRACE(" streamFormat.mChannelsPerFrame = %d\n", streamFormat.mChannelsPerFrame);
225 TRACE(" streamFormat.mBitsPerChannel = %d\n", streamFormat.mBitsPerChannel);
226 TRACE(" streamFormat.mBytesPerPacket = %d\n", streamFormat.mBytesPerPacket);
227 TRACE(" streamFormat.mBytesPerFrame = %d\n", streamFormat.mBytesPerFrame);
228 TRACE(" streamFormat.mSampleRate = %5.0f\n", streamFormat.mSampleRate);
229 #endif
231 /* set default output unit's input side to match output side */
232 err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &streamFormat, size);
233 if(err != noErr)
235 ERR("AudioUnitSetProperty failed\n");
236 return ALC_FALSE;
239 if(device->Frequency != streamFormat.mSampleRate)
241 device->UpdateSize = (ALuint)((ALuint64)device->UpdateSize *
242 streamFormat.mSampleRate /
243 device->Frequency);
244 device->Frequency = streamFormat.mSampleRate;
247 /* FIXME: How to tell what channels are what in the output device, and how
248 * to specify what we're giving? eg, 6.0 vs 5.1 */
249 switch(streamFormat.mChannelsPerFrame)
251 case 1:
252 device->FmtChans = DevFmtMono;
253 break;
254 case 2:
255 device->FmtChans = DevFmtStereo;
256 break;
257 case 4:
258 device->FmtChans = DevFmtQuad;
259 break;
260 case 6:
261 device->FmtChans = DevFmtX51;
262 break;
263 case 7:
264 device->FmtChans = DevFmtX61;
265 break;
266 case 8:
267 device->FmtChans = DevFmtX71;
268 break;
269 default:
270 ERR("Unhandled channel count (%d), using Stereo\n", streamFormat.mChannelsPerFrame);
271 device->FmtChans = DevFmtStereo;
272 streamFormat.mChannelsPerFrame = 2;
273 break;
275 SetDefaultWFXChannelOrder(device);
277 /* use channel count and sample rate from the default output unit's current
278 * parameters, but reset everything else */
279 streamFormat.mFramesPerPacket = 1;
280 streamFormat.mFormatFlags = 0;
281 switch(device->FmtType)
283 case DevFmtUByte:
284 device->FmtType = DevFmtByte;
285 /* fall-through */
286 case DevFmtByte:
287 streamFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
288 streamFormat.mBitsPerChannel = 8;
289 break;
290 case DevFmtUShort:
291 device->FmtType = DevFmtShort;
292 /* fall-through */
293 case DevFmtShort:
294 streamFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
295 streamFormat.mBitsPerChannel = 16;
296 break;
297 case DevFmtUInt:
298 device->FmtType = DevFmtInt;
299 /* fall-through */
300 case DevFmtInt:
301 streamFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
302 streamFormat.mBitsPerChannel = 32;
303 break;
304 case DevFmtFloat:
305 streamFormat.mFormatFlags = kLinearPCMFormatFlagIsFloat;
306 streamFormat.mBitsPerChannel = 32;
307 break;
309 streamFormat.mBytesPerFrame = streamFormat.mChannelsPerFrame *
310 streamFormat.mBitsPerChannel / 8;
311 streamFormat.mBytesPerPacket = streamFormat.mBytesPerFrame;
312 streamFormat.mFormatID = kAudioFormatLinearPCM;
313 streamFormat.mFormatFlags |= kAudioFormatFlagsNativeEndian |
314 kLinearPCMFormatFlagIsPacked;
316 err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &streamFormat, sizeof(AudioStreamBasicDescription));
317 if(err != noErr)
319 ERR("AudioUnitSetProperty failed\n");
320 return ALC_FALSE;
323 /* setup callback */
324 data->frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
325 input.inputProc = ca_callback;
326 input.inputProcRefCon = device;
328 err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &input, sizeof(AURenderCallbackStruct));
329 if(err != noErr)
331 ERR("AudioUnitSetProperty failed\n");
332 return ALC_FALSE;
335 /* init the default audio unit... */
336 err = AudioUnitInitialize(data->audioUnit);
337 if(err != noErr)
339 ERR("AudioUnitInitialize failed\n");
340 return ALC_FALSE;
343 return ALC_TRUE;
346 static ALCboolean ca_start_playback(ALCdevice *device)
348 ca_data *data = (ca_data*)device->ExtraData;
349 OSStatus err;
351 err = AudioOutputUnitStart(data->audioUnit);
352 if(err != noErr)
354 ERR("AudioOutputUnitStart failed\n");
355 return ALC_FALSE;
358 return ALC_TRUE;
361 static void ca_stop_playback(ALCdevice *device)
363 ca_data *data = (ca_data*)device->ExtraData;
364 OSStatus err;
366 err = AudioOutputUnitStop(data->audioUnit);
367 if(err != noErr)
368 ERR("AudioOutputUnitStop failed\n");
371 static ALCenum ca_open_capture(ALCdevice *device, const ALCchar *deviceName)
373 AudioStreamBasicDescription requestedFormat; // The application requested format
374 AudioStreamBasicDescription hardwareFormat; // The hardware format
375 AudioStreamBasicDescription outputFormat; // The AudioUnit output format
376 AURenderCallbackStruct input;
377 ComponentDescription desc;
378 AudioDeviceID inputDevice;
379 UInt32 outputFrameCount;
380 UInt32 propertySize;
381 UInt32 enableIO;
382 Component comp;
383 ca_data *data;
384 OSStatus err;
386 desc.componentType = kAudioUnitType_Output;
387 desc.componentSubType = kAudioUnitSubType_HALOutput;
388 desc.componentManufacturer = kAudioUnitManufacturer_Apple;
389 desc.componentFlags = 0;
390 desc.componentFlagsMask = 0;
392 // Search for component with given description
393 comp = FindNextComponent(NULL, &desc);
394 if(comp == NULL)
396 ERR("FindNextComponent failed\n");
397 return ALC_INVALID_VALUE;
400 data = calloc(1, sizeof(*data));
401 device->ExtraData = data;
403 // Open the component
404 err = OpenAComponent(comp, &data->audioUnit);
405 if(err != noErr)
407 ERR("OpenAComponent failed\n");
408 goto error;
411 // Turn off AudioUnit output
412 enableIO = 0;
413 err = AudioUnitSetProperty(data->audioUnit, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &enableIO, sizeof(ALuint));
414 if(err != noErr)
416 ERR("AudioUnitSetProperty failed\n");
417 goto error;
420 // Turn on AudioUnit input
421 enableIO = 1;
422 err = AudioUnitSetProperty(data->audioUnit, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &enableIO, sizeof(ALuint));
423 if(err != noErr)
425 ERR("AudioUnitSetProperty failed\n");
426 goto error;
429 // Get the default input device
430 propertySize = sizeof(AudioDeviceID);
431 err = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, &propertySize, &inputDevice);
432 if(err != noErr)
434 ERR("AudioHardwareGetProperty failed\n");
435 goto error;
438 if(inputDevice == kAudioDeviceUnknown)
440 ERR("No input device found\n");
441 goto error;
444 // Track the input device
445 err = AudioUnitSetProperty(data->audioUnit, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &inputDevice, sizeof(AudioDeviceID));
446 if(err != noErr)
448 ERR("AudioUnitSetProperty failed\n");
449 goto error;
452 // set capture callback
453 input.inputProc = ca_capture_callback;
454 input.inputProcRefCon = device;
456 err = AudioUnitSetProperty(data->audioUnit, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, 0, &input, sizeof(AURenderCallbackStruct));
457 if(err != noErr)
459 ERR("AudioUnitSetProperty failed\n");
460 goto error;
463 // Initialize the device
464 err = AudioUnitInitialize(data->audioUnit);
465 if(err != noErr)
467 ERR("AudioUnitInitialize failed\n");
468 goto error;
471 // Get the hardware format
472 propertySize = sizeof(AudioStreamBasicDescription);
473 err = AudioUnitGetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 1, &hardwareFormat, &propertySize);
474 if(err != noErr || propertySize != sizeof(AudioStreamBasicDescription))
476 ERR("AudioUnitGetProperty failed\n");
477 goto error;
480 // Set up the requested format description
481 switch(device->FmtType)
483 case DevFmtUByte:
484 requestedFormat.mBitsPerChannel = 8;
485 requestedFormat.mFormatFlags = kAudioFormatFlagIsPacked;
486 break;
487 case DevFmtShort:
488 requestedFormat.mBitsPerChannel = 16;
489 requestedFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked;
490 break;
491 case DevFmtInt:
492 requestedFormat.mBitsPerChannel = 32;
493 requestedFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked;
494 break;
495 case DevFmtFloat:
496 requestedFormat.mBitsPerChannel = 32;
497 requestedFormat.mFormatFlags = kAudioFormatFlagIsPacked;
498 break;
499 case DevFmtByte:
500 case DevFmtUShort:
501 case DevFmtUInt:
502 ERR("%s samples not supported\n", DevFmtTypeString(device->FmtType));
503 goto error;
506 switch(device->FmtChans)
508 case DevFmtMono:
509 requestedFormat.mChannelsPerFrame = 1;
510 break;
511 case DevFmtStereo:
512 requestedFormat.mChannelsPerFrame = 2;
513 break;
515 case DevFmtQuad:
516 case DevFmtX51:
517 case DevFmtX51Side:
518 case DevFmtX61:
519 case DevFmtX71:
520 ERR("%s not supported\n", DevFmtChannelsString(device->FmtChans));
521 goto error;
524 requestedFormat.mBytesPerFrame = requestedFormat.mChannelsPerFrame * requestedFormat.mBitsPerChannel / 8;
525 requestedFormat.mBytesPerPacket = requestedFormat.mBytesPerFrame;
526 requestedFormat.mSampleRate = device->Frequency;
527 requestedFormat.mFormatID = kAudioFormatLinearPCM;
528 requestedFormat.mReserved = 0;
529 requestedFormat.mFramesPerPacket = 1;
531 // save requested format description for later use
532 data->format = requestedFormat;
533 data->frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
535 // Use intermediate format for sample rate conversion (outputFormat)
536 // Set sample rate to the same as hardware for resampling later
537 outputFormat = requestedFormat;
538 outputFormat.mSampleRate = hardwareFormat.mSampleRate;
540 // Determine sample rate ratio for resampling
541 data->sampleRateRatio = outputFormat.mSampleRate / device->Frequency;
543 // The output format should be the requested format, but using the hardware sample rate
544 // This is because the AudioUnit will automatically scale other properties, except for sample rate
545 err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, (void *)&outputFormat, sizeof(outputFormat));
546 if(err != noErr)
548 ERR("AudioUnitSetProperty failed\n");
549 goto error;
552 // Set the AudioUnit output format frame count
553 outputFrameCount = device->UpdateSize * data->sampleRateRatio;
554 err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Output, 0, &outputFrameCount, sizeof(outputFrameCount));
555 if(err != noErr)
557 ERR("AudioUnitSetProperty failed: %d\n", err);
558 goto error;
561 // Set up sample converter
562 err = AudioConverterNew(&outputFormat, &requestedFormat, &data->audioConverter);
563 if(err != noErr)
565 ERR("AudioConverterNew failed: %d\n", err);
566 goto error;
569 // Create a buffer for use in the resample callback
570 data->resampleBuffer = malloc(device->UpdateSize * data->frameSize * data->sampleRateRatio);
572 // Allocate buffer for the AudioUnit output
573 data->bufferList = allocate_buffer_list(outputFormat.mChannelsPerFrame, device->UpdateSize * data->frameSize * data->sampleRateRatio);
574 if(data->bufferList == NULL)
575 goto error;
577 data->ring = CreateRingBuffer(data->frameSize, (device->UpdateSize * data->sampleRateRatio) * device->NumUpdates);
578 if(data->ring == NULL)
579 goto error;
581 al_string_copy_cstr(&device->DeviceName, deviceName);
583 return ALC_NO_ERROR;
585 error:
586 DestroyRingBuffer(data->ring);
587 free(data->resampleBuffer);
588 destroy_buffer_list(data->bufferList);
590 if(data->audioConverter)
591 AudioConverterDispose(data->audioConverter);
592 if(data->audioUnit)
593 CloseComponent(data->audioUnit);
595 free(data);
596 device->ExtraData = NULL;
598 return ALC_INVALID_VALUE;
601 static void ca_close_capture(ALCdevice *device)
603 ca_data *data = (ca_data*)device->ExtraData;
605 DestroyRingBuffer(data->ring);
606 free(data->resampleBuffer);
607 destroy_buffer_list(data->bufferList);
609 AudioConverterDispose(data->audioConverter);
610 CloseComponent(data->audioUnit);
612 free(data);
613 device->ExtraData = NULL;
616 static void ca_start_capture(ALCdevice *device)
618 ca_data *data = (ca_data*)device->ExtraData;
619 OSStatus err = AudioOutputUnitStart(data->audioUnit);
620 if(err != noErr)
621 ERR("AudioOutputUnitStart failed\n");
624 static void ca_stop_capture(ALCdevice *device)
626 ca_data *data = (ca_data*)device->ExtraData;
627 OSStatus err = AudioOutputUnitStop(data->audioUnit);
628 if(err != noErr)
629 ERR("AudioOutputUnitStop failed\n");
632 static ALCenum ca_capture_samples(ALCdevice *device, ALCvoid *buffer, ALCuint samples)
634 ca_data *data = (ca_data*)device->ExtraData;
635 AudioBufferList *list;
636 UInt32 frameCount;
637 OSStatus err;
639 // If no samples are requested, just return
640 if(samples == 0)
641 return ALC_NO_ERROR;
643 // Allocate a temporary AudioBufferList to use as the return resamples data
644 list = alloca(sizeof(AudioBufferList) + sizeof(AudioBuffer));
646 // Point the resampling buffer to the capture buffer
647 list->mNumberBuffers = 1;
648 list->mBuffers[0].mNumberChannels = data->format.mChannelsPerFrame;
649 list->mBuffers[0].mDataByteSize = samples * data->frameSize;
650 list->mBuffers[0].mData = buffer;
652 // Resample into another AudioBufferList
653 frameCount = samples;
654 err = AudioConverterFillComplexBuffer(data->audioConverter, ca_capture_conversion_callback,
655 device, &frameCount, list, NULL);
656 if(err != noErr)
658 ERR("AudioConverterFillComplexBuffer error: %d\n", err);
659 return ALC_INVALID_VALUE;
661 return ALC_NO_ERROR;
664 static ALCuint ca_available_samples(ALCdevice *device)
666 ca_data *data = device->ExtraData;
667 return RingBufferSize(data->ring) / data->sampleRateRatio;
671 static const BackendFuncs ca_funcs = {
672 ca_open_playback,
673 ca_close_playback,
674 ca_reset_playback,
675 ca_start_playback,
676 ca_stop_playback,
677 ca_open_capture,
678 ca_close_capture,
679 ca_start_capture,
680 ca_stop_capture,
681 ca_capture_samples,
682 ca_available_samples,
683 ALCdevice_GetLatencyDefault
686 ALCboolean alc_ca_init(BackendFuncs *func_list)
688 *func_list = ca_funcs;
689 return ALC_TRUE;
692 void alc_ca_deinit(void)
696 void alc_ca_probe(enum DevProbe type)
698 switch(type)
700 case ALL_DEVICE_PROBE:
701 AppendAllDevicesList(ca_device);
702 break;
703 case CAPTURE_DEVICE_PROBE:
704 AppendCaptureDeviceList(ca_device);
705 break;