3 #include "qemu/osdep.h"
4 #include "qemu/module.h"
5 #include "qemu-common.h"
7 #include "qapi/opts-visitor.h"
9 #include <pulse/pulseaudio.h>
11 #define AUDIO_CAP "pulseaudio"
12 #include "audio_int.h"
14 typedef struct PAConnection
{
17 QTAILQ_ENTRY(PAConnection
) list
;
19 pa_threaded_mainloop
*mainloop
;
23 static QTAILQ_HEAD(PAConnectionHead
, PAConnection
) pa_conns
=
24 QTAILQ_HEAD_INITIALIZER(pa_conns
);
40 const void *read_data
;
45 static void qpa_conn_fini(PAConnection
*c
);
47 static void GCC_FMT_ATTR (2, 3) qpa_logerr (int err
, const char *fmt
, ...)
52 AUD_vlog (AUDIO_CAP
, fmt
, ap
);
55 AUD_log (AUDIO_CAP
, "Reason: %s\n", pa_strerror (err
));
58 #ifndef PA_CONTEXT_IS_GOOD
59 static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x
)
62 x
== PA_CONTEXT_CONNECTING
||
63 x
== PA_CONTEXT_AUTHORIZING
||
64 x
== PA_CONTEXT_SETTING_NAME
||
65 x
== PA_CONTEXT_READY
;
69 #ifndef PA_STREAM_IS_GOOD
70 static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x
)
73 x
== PA_STREAM_CREATING
||
78 #define CHECK_SUCCESS_GOTO(c, expression, label, msg) \
80 if (!(expression)) { \
81 qpa_logerr(pa_context_errno((c)->context), msg); \
86 #define CHECK_DEAD_GOTO(c, stream, label, msg) \
88 if (!(c)->context || !PA_CONTEXT_IS_GOOD (pa_context_get_state((c)->context)) || \
89 !(stream) || !PA_STREAM_IS_GOOD (pa_stream_get_state ((stream)))) { \
90 if (((c)->context && pa_context_get_state ((c)->context) == PA_CONTEXT_FAILED) || \
91 ((stream) && pa_stream_get_state ((stream)) == PA_STREAM_FAILED)) { \
92 qpa_logerr(pa_context_errno((c)->context), msg); \
94 qpa_logerr(PA_ERR_BADSTATE, msg); \
100 static void *qpa_get_buffer_in(HWVoiceIn
*hw
, size_t *size
)
102 PAVoiceIn
*p
= (PAVoiceIn
*) hw
;
103 PAConnection
*c
= p
->g
->conn
;
106 pa_threaded_mainloop_lock(c
->mainloop
);
108 CHECK_DEAD_GOTO(c
, p
->stream
, unlock_and_fail
,
109 "pa_threaded_mainloop_lock failed\n");
111 if (!p
->read_length
) {
112 r
= pa_stream_peek(p
->stream
, &p
->read_data
, &p
->read_length
);
113 CHECK_SUCCESS_GOTO(c
, r
== 0, unlock_and_fail
,
114 "pa_stream_peek failed\n");
117 *size
= MIN(p
->read_length
, *size
);
119 pa_threaded_mainloop_unlock(c
->mainloop
);
120 return (void *) p
->read_data
;
123 pa_threaded_mainloop_unlock(c
->mainloop
);
128 static void qpa_put_buffer_in(HWVoiceIn
*hw
, void *buf
, size_t size
)
130 PAVoiceIn
*p
= (PAVoiceIn
*) hw
;
131 PAConnection
*c
= p
->g
->conn
;
134 pa_threaded_mainloop_lock(c
->mainloop
);
136 CHECK_DEAD_GOTO(c
, p
->stream
, unlock
,
137 "pa_threaded_mainloop_lock failed\n");
139 assert(buf
== p
->read_data
&& size
<= p
->read_length
);
141 p
->read_data
+= size
;
142 p
->read_length
-= size
;
144 if (size
&& !p
->read_length
) {
145 r
= pa_stream_drop(p
->stream
);
146 CHECK_SUCCESS_GOTO(c
, r
== 0, unlock
, "pa_stream_drop failed\n");
150 pa_threaded_mainloop_unlock(c
->mainloop
);
153 static size_t qpa_read(HWVoiceIn
*hw
, void *data
, size_t length
)
155 PAVoiceIn
*p
= (PAVoiceIn
*) hw
;
156 PAConnection
*c
= p
->g
->conn
;
159 pa_threaded_mainloop_lock(c
->mainloop
);
161 CHECK_DEAD_GOTO(c
, p
->stream
, unlock_and_fail
,
162 "pa_threaded_mainloop_lock failed\n");
163 if (pa_stream_get_state(p
->stream
) != PA_STREAM_READY
) {
164 /* wait for stream to become ready */
168 while (total
< length
) {
172 if (!p
->read_length
) {
173 r
= pa_stream_peek(p
->stream
, &p
->read_data
, &p
->read_length
);
174 CHECK_SUCCESS_GOTO(c
, r
== 0, unlock_and_fail
,
175 "pa_stream_peek failed\n");
176 if (!p
->read_length
) {
177 /* buffer is empty */
182 l
= MIN(p
->read_length
, length
- total
);
183 memcpy((char *)data
+ total
, p
->read_data
, l
);
189 if (!p
->read_length
) {
190 r
= pa_stream_drop(p
->stream
);
191 CHECK_SUCCESS_GOTO(c
, r
== 0, unlock_and_fail
,
192 "pa_stream_drop failed\n");
197 pa_threaded_mainloop_unlock(c
->mainloop
);
201 pa_threaded_mainloop_unlock(c
->mainloop
);
205 static void *qpa_get_buffer_out(HWVoiceOut
*hw
, size_t *size
)
207 PAVoiceOut
*p
= (PAVoiceOut
*) hw
;
208 PAConnection
*c
= p
->g
->conn
;
212 pa_threaded_mainloop_lock(c
->mainloop
);
214 CHECK_DEAD_GOTO(c
, p
->stream
, unlock_and_fail
,
215 "pa_threaded_mainloop_lock failed\n");
218 r
= pa_stream_begin_write(p
->stream
, &ret
, size
);
219 CHECK_SUCCESS_GOTO(c
, r
>= 0, unlock_and_fail
,
220 "pa_stream_begin_write failed\n");
222 pa_threaded_mainloop_unlock(c
->mainloop
);
226 pa_threaded_mainloop_unlock(c
->mainloop
);
231 static size_t qpa_write(HWVoiceOut
*hw
, void *data
, size_t length
)
233 PAVoiceOut
*p
= (PAVoiceOut
*) hw
;
234 PAConnection
*c
= p
->g
->conn
;
238 pa_threaded_mainloop_lock(c
->mainloop
);
240 CHECK_DEAD_GOTO(c
, p
->stream
, unlock_and_fail
,
241 "pa_threaded_mainloop_lock failed\n");
243 l
= pa_stream_writable_size(p
->stream
);
245 CHECK_SUCCESS_GOTO(c
, l
!= (size_t) -1, unlock_and_fail
,
246 "pa_stream_writable_size failed\n");
252 r
= pa_stream_write(p
->stream
, data
, l
, NULL
, 0LL, PA_SEEK_RELATIVE
);
253 CHECK_SUCCESS_GOTO(c
, r
>= 0, unlock_and_fail
, "pa_stream_write failed\n");
255 pa_threaded_mainloop_unlock(c
->mainloop
);
259 pa_threaded_mainloop_unlock(c
->mainloop
);
263 static pa_sample_format_t
audfmt_to_pa (AudioFormat afmt
, int endianness
)
268 case AUDIO_FORMAT_S8
:
269 case AUDIO_FORMAT_U8
:
270 format
= PA_SAMPLE_U8
;
272 case AUDIO_FORMAT_S16
:
273 case AUDIO_FORMAT_U16
:
274 format
= endianness
? PA_SAMPLE_S16BE
: PA_SAMPLE_S16LE
;
276 case AUDIO_FORMAT_S32
:
277 case AUDIO_FORMAT_U32
:
278 format
= endianness
? PA_SAMPLE_S32BE
: PA_SAMPLE_S32LE
;
280 case AUDIO_FORMAT_F32
:
281 format
= endianness
? PA_SAMPLE_FLOAT32BE
: PA_SAMPLE_FLOAT32LE
;
284 dolog ("Internal logic error: Bad audio format %d\n", afmt
);
285 format
= PA_SAMPLE_U8
;
291 static AudioFormat
pa_to_audfmt (pa_sample_format_t fmt
, int *endianness
)
295 return AUDIO_FORMAT_U8
;
296 case PA_SAMPLE_S16BE
:
298 return AUDIO_FORMAT_S16
;
299 case PA_SAMPLE_S16LE
:
301 return AUDIO_FORMAT_S16
;
302 case PA_SAMPLE_S32BE
:
304 return AUDIO_FORMAT_S32
;
305 case PA_SAMPLE_S32LE
:
307 return AUDIO_FORMAT_S32
;
308 case PA_SAMPLE_FLOAT32BE
:
310 return AUDIO_FORMAT_F32
;
311 case PA_SAMPLE_FLOAT32LE
:
313 return AUDIO_FORMAT_F32
;
315 dolog ("Internal logic error: Bad pa_sample_format %d\n", fmt
);
316 return AUDIO_FORMAT_U8
;
320 static void context_state_cb (pa_context
*c
, void *userdata
)
322 PAConnection
*conn
= userdata
;
324 switch (pa_context_get_state(c
)) {
325 case PA_CONTEXT_READY
:
326 case PA_CONTEXT_TERMINATED
:
327 case PA_CONTEXT_FAILED
:
328 pa_threaded_mainloop_signal(conn
->mainloop
, 0);
331 case PA_CONTEXT_UNCONNECTED
:
332 case PA_CONTEXT_CONNECTING
:
333 case PA_CONTEXT_AUTHORIZING
:
334 case PA_CONTEXT_SETTING_NAME
:
339 static void stream_state_cb (pa_stream
*s
, void * userdata
)
341 PAConnection
*c
= userdata
;
343 switch (pa_stream_get_state (s
)) {
345 case PA_STREAM_READY
:
346 case PA_STREAM_FAILED
:
347 case PA_STREAM_TERMINATED
:
348 pa_threaded_mainloop_signal(c
->mainloop
, 0);
351 case PA_STREAM_UNCONNECTED
:
352 case PA_STREAM_CREATING
:
357 static pa_stream
*qpa_simple_new (
360 pa_stream_direction_t dir
,
362 const pa_sample_spec
*ss
,
363 const pa_buffer_attr
*attr
,
367 pa_stream
*stream
= NULL
;
368 pa_stream_flags_t flags
;
371 pa_threaded_mainloop_lock(c
->mainloop
);
373 pa_channel_map_init(&map
);
374 map
.channels
= ss
->channels
;
377 * TODO: This currently expects the only frontend supporting more than 2
378 * channels is the usb-audio. We will need some means to set channel
379 * order when a new frontend gains multi-channel support.
381 switch (ss
->channels
) {
383 map
.map
[0] = PA_CHANNEL_POSITION_MONO
;
387 map
.map
[0] = PA_CHANNEL_POSITION_LEFT
;
388 map
.map
[1] = PA_CHANNEL_POSITION_RIGHT
;
392 map
.map
[0] = PA_CHANNEL_POSITION_FRONT_LEFT
;
393 map
.map
[1] = PA_CHANNEL_POSITION_FRONT_RIGHT
;
394 map
.map
[2] = PA_CHANNEL_POSITION_CENTER
;
395 map
.map
[3] = PA_CHANNEL_POSITION_LFE
;
396 map
.map
[4] = PA_CHANNEL_POSITION_REAR_LEFT
;
397 map
.map
[5] = PA_CHANNEL_POSITION_REAR_RIGHT
;
401 map
.map
[0] = PA_CHANNEL_POSITION_FRONT_LEFT
;
402 map
.map
[1] = PA_CHANNEL_POSITION_FRONT_RIGHT
;
403 map
.map
[2] = PA_CHANNEL_POSITION_CENTER
;
404 map
.map
[3] = PA_CHANNEL_POSITION_LFE
;
405 map
.map
[4] = PA_CHANNEL_POSITION_REAR_LEFT
;
406 map
.map
[5] = PA_CHANNEL_POSITION_REAR_RIGHT
;
407 map
.map
[6] = PA_CHANNEL_POSITION_SIDE_LEFT
;
408 map
.map
[7] = PA_CHANNEL_POSITION_SIDE_RIGHT
;
412 dolog("Internal error: unsupported channel count %d\n", ss
->channels
);
416 stream
= pa_stream_new(c
->context
, name
, ss
, &map
);
421 pa_stream_set_state_callback(stream
, stream_state_cb
, c
);
424 PA_STREAM_INTERPOLATE_TIMING
425 | PA_STREAM_AUTO_TIMING_UPDATE
426 | PA_STREAM_EARLY_REQUESTS
;
429 /* don't move the stream if the user specified a sink/source */
430 flags
|= PA_STREAM_DONT_MOVE
;
433 if (dir
== PA_STREAM_PLAYBACK
) {
434 r
= pa_stream_connect_playback(stream
, dev
, attr
, flags
, NULL
, NULL
);
436 r
= pa_stream_connect_record(stream
, dev
, attr
, flags
);
443 pa_threaded_mainloop_unlock(c
->mainloop
);
448 pa_threaded_mainloop_unlock(c
->mainloop
);
451 pa_stream_unref (stream
);
454 *rerror
= pa_context_errno(c
->context
);
459 static int qpa_init_out(HWVoiceOut
*hw
, struct audsettings
*as
,
465 struct audsettings obt_as
= *as
;
466 PAVoiceOut
*pa
= (PAVoiceOut
*) hw
;
467 paaudio
*g
= pa
->g
= drv_opaque
;
468 AudiodevPaOptions
*popts
= &g
->dev
->u
.pa
;
469 AudiodevPaPerDirectionOptions
*ppdo
= popts
->out
;
470 PAConnection
*c
= g
->conn
;
472 ss
.format
= audfmt_to_pa (as
->fmt
, as
->endianness
);
473 ss
.channels
= as
->nchannels
;
476 ba
.tlength
= pa_usec_to_bytes(ppdo
->latency
, &ss
);
481 obt_as
.fmt
= pa_to_audfmt (ss
.format
, &obt_as
.endianness
);
483 pa
->stream
= qpa_simple_new (
485 ppdo
->has_stream_name
? ppdo
->stream_name
: g
->dev
->id
,
487 ppdo
->has_name
? ppdo
->name
: NULL
,
489 &ba
, /* buffering attributes */
493 qpa_logerr (error
, "pa_simple_new for playback failed\n");
497 audio_pcm_init_info (&hw
->info
, &obt_as
);
498 hw
->samples
= audio_buffer_samples(
499 qapi_AudiodevPaPerDirectionOptions_base(ppdo
),
500 &obt_as
, ppdo
->buffer_length
);
508 static int qpa_init_in(HWVoiceIn
*hw
, struct audsettings
*as
, void *drv_opaque
)
513 struct audsettings obt_as
= *as
;
514 PAVoiceIn
*pa
= (PAVoiceIn
*) hw
;
515 paaudio
*g
= pa
->g
= drv_opaque
;
516 AudiodevPaOptions
*popts
= &g
->dev
->u
.pa
;
517 AudiodevPaPerDirectionOptions
*ppdo
= popts
->in
;
518 PAConnection
*c
= g
->conn
;
520 ss
.format
= audfmt_to_pa (as
->fmt
, as
->endianness
);
521 ss
.channels
= as
->nchannels
;
524 ba
.fragsize
= pa_usec_to_bytes(ppdo
->latency
, &ss
);
525 ba
.maxlength
= pa_usec_to_bytes(ppdo
->latency
* 2, &ss
);
529 obt_as
.fmt
= pa_to_audfmt (ss
.format
, &obt_as
.endianness
);
531 pa
->stream
= qpa_simple_new (
533 ppdo
->has_stream_name
? ppdo
->stream_name
: g
->dev
->id
,
535 ppdo
->has_name
? ppdo
->name
: NULL
,
537 &ba
, /* buffering attributes */
541 qpa_logerr (error
, "pa_simple_new for capture failed\n");
545 audio_pcm_init_info (&hw
->info
, &obt_as
);
546 hw
->samples
= audio_buffer_samples(
547 qapi_AudiodevPaPerDirectionOptions_base(ppdo
),
548 &obt_as
, ppdo
->buffer_length
);
556 static void qpa_simple_disconnect(PAConnection
*c
, pa_stream
*stream
)
561 * wait until actually connects. workaround pa bug #247
562 * https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/247
564 while (pa_stream_get_state(stream
) == PA_STREAM_CREATING
) {
565 pa_threaded_mainloop_wait(c
->mainloop
);
568 err
= pa_stream_disconnect(stream
);
570 dolog("Failed to disconnect! err=%d\n", err
);
572 pa_stream_unref(stream
);
575 static void qpa_fini_out (HWVoiceOut
*hw
)
577 PAVoiceOut
*pa
= (PAVoiceOut
*) hw
;
580 PAConnection
*c
= pa
->g
->conn
;
582 pa_threaded_mainloop_lock(c
->mainloop
);
583 qpa_simple_disconnect(c
, pa
->stream
);
585 pa_threaded_mainloop_unlock(c
->mainloop
);
589 static void qpa_fini_in (HWVoiceIn
*hw
)
591 PAVoiceIn
*pa
= (PAVoiceIn
*) hw
;
594 PAConnection
*c
= pa
->g
->conn
;
596 pa_threaded_mainloop_lock(c
->mainloop
);
597 if (pa
->read_length
) {
598 int r
= pa_stream_drop(pa
->stream
);
600 qpa_logerr(pa_context_errno(c
->context
),
601 "pa_stream_drop failed\n");
605 qpa_simple_disconnect(c
, pa
->stream
);
607 pa_threaded_mainloop_unlock(c
->mainloop
);
611 static void qpa_volume_out(HWVoiceOut
*hw
, Volume
*vol
)
613 PAVoiceOut
*pa
= (PAVoiceOut
*) hw
;
616 PAConnection
*c
= pa
->g
->conn
;
619 #ifdef PA_CHECK_VERSION /* macro is present in 0.9.16+ */
620 pa_cvolume_init (&v
); /* function is present in 0.9.13+ */
623 v
.channels
= vol
->channels
;
624 for (i
= 0; i
< vol
->channels
; ++i
) {
625 v
.values
[i
] = ((PA_VOLUME_NORM
- PA_VOLUME_MUTED
) * vol
->vol
[i
]) / 255;
628 pa_threaded_mainloop_lock(c
->mainloop
);
630 op
= pa_context_set_sink_input_volume(c
->context
,
631 pa_stream_get_index(pa
->stream
),
634 qpa_logerr(pa_context_errno(c
->context
),
635 "set_sink_input_volume() failed\n");
637 pa_operation_unref(op
);
640 op
= pa_context_set_sink_input_mute(c
->context
,
641 pa_stream_get_index(pa
->stream
),
642 vol
->mute
, NULL
, NULL
);
644 qpa_logerr(pa_context_errno(c
->context
),
645 "set_sink_input_mute() failed\n");
647 pa_operation_unref(op
);
650 pa_threaded_mainloop_unlock(c
->mainloop
);
653 static void qpa_volume_in(HWVoiceIn
*hw
, Volume
*vol
)
655 PAVoiceIn
*pa
= (PAVoiceIn
*) hw
;
658 PAConnection
*c
= pa
->g
->conn
;
661 #ifdef PA_CHECK_VERSION
662 pa_cvolume_init (&v
);
665 v
.channels
= vol
->channels
;
666 for (i
= 0; i
< vol
->channels
; ++i
) {
667 v
.values
[i
] = ((PA_VOLUME_NORM
- PA_VOLUME_MUTED
) * vol
->vol
[i
]) / 255;
670 pa_threaded_mainloop_lock(c
->mainloop
);
672 op
= pa_context_set_source_output_volume(c
->context
,
673 pa_stream_get_index(pa
->stream
),
676 qpa_logerr(pa_context_errno(c
->context
),
677 "set_source_output_volume() failed\n");
679 pa_operation_unref(op
);
682 op
= pa_context_set_source_output_mute(c
->context
,
683 pa_stream_get_index(pa
->stream
),
684 vol
->mute
, NULL
, NULL
);
686 qpa_logerr(pa_context_errno(c
->context
),
687 "set_source_output_mute() failed\n");
689 pa_operation_unref(op
);
692 pa_threaded_mainloop_unlock(c
->mainloop
);
695 static int qpa_validate_per_direction_opts(Audiodev
*dev
,
696 AudiodevPaPerDirectionOptions
*pdo
)
698 if (!pdo
->has_buffer_length
) {
699 pdo
->has_buffer_length
= true;
700 pdo
->buffer_length
= 46440;
702 if (!pdo
->has_latency
) {
703 pdo
->has_latency
= true;
704 pdo
->latency
= 15000;
710 static void *qpa_conn_init(const char *server
)
713 PAConnection
*c
= g_malloc0(sizeof(PAConnection
));
714 QTAILQ_INSERT_TAIL(&pa_conns
, c
, list
);
716 c
->mainloop
= pa_threaded_mainloop_new();
721 vm_name
= qemu_get_vm_name();
722 c
->context
= pa_context_new(pa_threaded_mainloop_get_api(c
->mainloop
),
723 vm_name
? vm_name
: "qemu");
728 pa_context_set_state_callback(c
->context
, context_state_cb
, c
);
730 if (pa_context_connect(c
->context
, server
, 0, NULL
) < 0) {
731 qpa_logerr(pa_context_errno(c
->context
),
732 "pa_context_connect() failed\n");
736 pa_threaded_mainloop_lock(c
->mainloop
);
738 if (pa_threaded_mainloop_start(c
->mainloop
) < 0) {
739 goto unlock_and_fail
;
743 pa_context_state_t state
;
745 state
= pa_context_get_state(c
->context
);
747 if (state
== PA_CONTEXT_READY
) {
751 if (!PA_CONTEXT_IS_GOOD(state
)) {
752 qpa_logerr(pa_context_errno(c
->context
),
753 "Wrong context state\n");
754 goto unlock_and_fail
;
757 /* Wait until the context is ready */
758 pa_threaded_mainloop_wait(c
->mainloop
);
761 pa_threaded_mainloop_unlock(c
->mainloop
);
765 pa_threaded_mainloop_unlock(c
->mainloop
);
767 AUD_log (AUDIO_CAP
, "Failed to initialize PA context");
772 static void *qpa_audio_init(Audiodev
*dev
)
775 AudiodevPaOptions
*popts
= &dev
->u
.pa
;
779 assert(dev
->driver
== AUDIODEV_DRIVER_PA
);
781 if (!popts
->has_server
) {
786 runtime
= getenv("XDG_RUNTIME_DIR");
790 snprintf(pidfile
, sizeof(pidfile
), "%s/pulse/pid", runtime
);
791 if (stat(pidfile
, &st
) != 0) {
796 if (!qpa_validate_per_direction_opts(dev
, popts
->in
)) {
799 if (!qpa_validate_per_direction_opts(dev
, popts
->out
)) {
803 g
= g_malloc0(sizeof(paaudio
));
804 server
= popts
->has_server
? popts
->server
: NULL
;
808 QTAILQ_FOREACH(c
, &pa_conns
, list
) {
809 if (server
== NULL
|| c
->server
== NULL
?
810 server
== c
->server
:
811 strcmp(server
, c
->server
) == 0) {
817 g
->conn
= qpa_conn_init(server
);
828 static void qpa_conn_fini(PAConnection
*c
)
831 pa_threaded_mainloop_stop(c
->mainloop
);
835 pa_context_disconnect(c
->context
);
836 pa_context_unref(c
->context
);
840 pa_threaded_mainloop_free(c
->mainloop
);
843 QTAILQ_REMOVE(&pa_conns
, c
, list
);
847 static void qpa_audio_fini (void *opaque
)
850 PAConnection
*c
= g
->conn
;
852 if (--c
->refcount
== 0) {
859 static struct audio_pcm_ops qpa_pcm_ops
= {
860 .init_out
= qpa_init_out
,
861 .fini_out
= qpa_fini_out
,
863 .get_buffer_out
= qpa_get_buffer_out
,
864 .put_buffer_out
= qpa_write
, /* pa handles it */
865 .volume_out
= qpa_volume_out
,
867 .init_in
= qpa_init_in
,
868 .fini_in
= qpa_fini_in
,
870 .get_buffer_in
= qpa_get_buffer_in
,
871 .put_buffer_in
= qpa_put_buffer_in
,
872 .volume_in
= qpa_volume_in
875 static struct audio_driver pa_audio_driver
= {
877 .descr
= "http://www.pulseaudio.org/",
878 .init
= qpa_audio_init
,
879 .fini
= qpa_audio_fini
,
880 .pcm_ops
= &qpa_pcm_ops
,
882 .max_voices_out
= INT_MAX
,
883 .max_voices_in
= INT_MAX
,
884 .voice_size_out
= sizeof (PAVoiceOut
),
885 .voice_size_in
= sizeof (PAVoiceIn
),
888 static void register_audio_pa(void)
890 audio_driver_register(&pa_audio_driver
);
892 type_init(register_audio_pa
);