2 This file is part of PulseAudio.
4 Copyright 2009 Lennart Poettering
6 PulseAudio is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 2.1 of the License,
9 or (at your option) any later version.
11 PulseAudio is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with PulseAudio; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 #include <pulse/xmalloc.h>
28 #include <pulsecore/core-util.h>
29 #include <pulsecore/i18n.h>
30 #include <pulsecore/modargs.h>
31 #include <pulsecore/queue.h>
33 #include <modules/reserve-wrap.h>
36 #include <modules/udev-util.h>
39 #include "alsa-util.h"
41 #include "alsa-sink.h"
42 #include "alsa-source.h"
43 #include "module-alsa-card-symdef.h"
45 PA_MODULE_AUTHOR("Lennart Poettering");
46 PA_MODULE_DESCRIPTION("ALSA Card");
47 PA_MODULE_VERSION(PACKAGE_VERSION
);
48 PA_MODULE_LOAD_ONCE(FALSE
);
50 "name=<name for the card/sink/source, to be prefixed> "
51 "card_name=<name for the card> "
52 "card_properties=<properties for the card> "
53 "sink_name=<name for the sink> "
54 "sink_properties=<properties for the sink> "
55 "source_name=<name for the source> "
56 "source_properties=<properties for the source> "
57 "namereg_fail=<when false attempt to synthesise new names if they are already taken> "
58 "device_id=<ALSA card index> "
59 "format=<sample format> "
61 "fragments=<number of fragments> "
62 "fragment_size=<fragment size> "
63 "mmap=<enable memory mapping?> "
64 "tsched=<enable system timer based scheduling mode?> "
65 "tsched_buffer_size=<buffer size when using timer based scheduling> "
66 "tsched_buffer_watermark=<lower fill watermark> "
67 "profile=<profile name> "
68 "fixed_latency_range=<disable latency range changes on underrun?> "
69 "ignore_dB=<ignore dB information from the device?> "
70 "deferred_volume=<Synchronize software and hardware volume changes to avoid momentary jumps?> "
71 "profile_set=<profile set configuration file> "
72 "paths_dir=<directory containing the path configuration files> "
73 "use_ucm=<load use case manager> "
76 static const char* const valid_modargs
[] = {
93 "tsched_buffer_watermark",
94 "fixed_latency_range",
104 #define DEFAULT_DEVICE_ID "0"
113 snd_mixer_t
*mixer_handle
;
114 snd_hctl_t
*hctl_handle
;
116 pa_alsa_fdlist
*mixer_fdl
;
122 pa_alsa_profile_set
*profile_set
;
126 pa_alsa_ucm_config ucm
;
128 /* hooks for modifier action */
130 *sink_input_put_hook_slot
,
131 *source_output_put_hook_slot
,
132 *sink_input_unlink_hook_slot
,
133 *source_output_unlink_hook_slot
;
136 struct profile_data
{
137 pa_alsa_profile
*profile
;
140 static void add_profiles(struct userdata
*u
, pa_hashmap
*h
, pa_hashmap
*ports
) {
147 PA_HASHMAP_FOREACH(ap
, u
->profile_set
->profiles
, state
) {
148 struct profile_data
*d
;
153 cp
= pa_card_profile_new(ap
->name
, ap
->description
, sizeof(struct profile_data
));
154 cp
->priority
= ap
->priority
;
156 if (ap
->output_mappings
) {
157 cp
->n_sinks
= pa_idxset_size(ap
->output_mappings
);
159 PA_IDXSET_FOREACH(m
, ap
->output_mappings
, idx
) {
161 pa_alsa_ucm_add_ports_combination(NULL
, &m
->ucm_context
, TRUE
, ports
, cp
, u
->core
);
163 pa_alsa_path_set_add_ports(m
->output_path_set
, cp
, ports
, NULL
, u
->core
);
164 if (m
->channel_map
.channels
> cp
->max_sink_channels
)
165 cp
->max_sink_channels
= m
->channel_map
.channels
;
169 if (ap
->input_mappings
) {
170 cp
->n_sources
= pa_idxset_size(ap
->input_mappings
);
172 PA_IDXSET_FOREACH(m
, ap
->input_mappings
, idx
) {
174 pa_alsa_ucm_add_ports_combination(NULL
, &m
->ucm_context
, FALSE
, ports
, cp
, u
->core
);
176 pa_alsa_path_set_add_ports(m
->input_path_set
, cp
, ports
, NULL
, u
->core
);
177 if (m
->channel_map
.channels
> cp
->max_source_channels
)
178 cp
->max_source_channels
= m
->channel_map
.channels
;
182 d
= PA_CARD_PROFILE_DATA(cp
);
185 pa_hashmap_put(h
, cp
->name
, cp
);
189 static void add_disabled_profile(pa_hashmap
*profiles
) {
191 struct profile_data
*d
;
193 p
= pa_card_profile_new("off", _("Off"), sizeof(struct profile_data
));
195 d
= PA_CARD_PROFILE_DATA(p
);
198 pa_hashmap_put(profiles
, p
->name
, p
);
201 static int card_set_profile(pa_card
*c
, pa_card_profile
*new_profile
) {
203 struct profile_data
*nd
, *od
;
206 pa_queue
*sink_inputs
= NULL
, *source_outputs
= NULL
;
209 pa_assert(new_profile
);
210 pa_assert_se(u
= c
->userdata
);
212 nd
= PA_CARD_PROFILE_DATA(new_profile
);
213 od
= PA_CARD_PROFILE_DATA(c
->active_profile
);
215 if (od
->profile
&& od
->profile
->output_mappings
)
216 PA_IDXSET_FOREACH(am
, od
->profile
->output_mappings
, idx
) {
221 nd
->profile
->output_mappings
&&
222 pa_idxset_get_by_data(nd
->profile
->output_mappings
, am
, NULL
))
225 sink_inputs
= pa_sink_move_all_start(am
->sink
, sink_inputs
);
226 pa_alsa_sink_free(am
->sink
);
230 if (od
->profile
&& od
->profile
->input_mappings
)
231 PA_IDXSET_FOREACH(am
, od
->profile
->input_mappings
, idx
) {
236 nd
->profile
->input_mappings
&&
237 pa_idxset_get_by_data(nd
->profile
->input_mappings
, am
, NULL
))
240 source_outputs
= pa_source_move_all_start(am
->source
, source_outputs
);
241 pa_alsa_source_free(am
->source
);
245 /* if UCM is available for this card then update the verb */
247 if (pa_alsa_ucm_set_profile(&u
->ucm
, nd
->profile
? nd
->profile
->name
: NULL
,
248 od
->profile
? od
->profile
->name
: NULL
) < 0)
252 if (nd
->profile
&& nd
->profile
->output_mappings
)
253 PA_IDXSET_FOREACH(am
, nd
->profile
->output_mappings
, idx
) {
256 am
->sink
= pa_alsa_sink_new(c
->module
, u
->modargs
, __FILE__
, c
, am
);
258 if (sink_inputs
&& am
->sink
) {
259 pa_sink_move_all_finish(am
->sink
, sink_inputs
, FALSE
);
264 if (nd
->profile
&& nd
->profile
->input_mappings
)
265 PA_IDXSET_FOREACH(am
, nd
->profile
->input_mappings
, idx
) {
268 am
->source
= pa_alsa_source_new(c
->module
, u
->modargs
, __FILE__
, c
, am
);
270 if (source_outputs
&& am
->source
) {
271 pa_source_move_all_finish(am
->source
, source_outputs
, FALSE
);
272 source_outputs
= NULL
;
277 pa_sink_move_all_fail(sink_inputs
);
280 pa_source_move_all_fail(source_outputs
);
285 static void init_profile(struct userdata
*u
) {
288 struct profile_data
*d
;
289 pa_alsa_ucm_config
*ucm
= &u
->ucm
;
293 d
= PA_CARD_PROFILE_DATA(u
->card
->active_profile
);
295 if (d
->profile
&& u
->use_ucm
) {
296 /* Set initial verb */
297 if (pa_alsa_ucm_set_profile(ucm
, d
->profile
->name
, NULL
) < 0) {
298 pa_log("Failed to set ucm profile %s", d
->profile
->name
);
303 if (d
->profile
&& d
->profile
->output_mappings
)
304 PA_IDXSET_FOREACH(am
, d
->profile
->output_mappings
, idx
)
305 am
->sink
= pa_alsa_sink_new(u
->module
, u
->modargs
, __FILE__
, u
->card
, am
);
307 if (d
->profile
&& d
->profile
->input_mappings
)
308 PA_IDXSET_FOREACH(am
, d
->profile
->input_mappings
, idx
)
309 am
->source
= pa_alsa_source_new(u
->module
, u
->modargs
, __FILE__
, u
->card
, am
);
312 static void report_port_state(pa_device_port
*p
, struct userdata
*u
)
316 pa_port_available_t pa
= PA_PORT_AVAILABLE_UNKNOWN
;
317 pa_device_port
*port
;
319 PA_HASHMAP_FOREACH(jack
, u
->jacks
, state
) {
320 pa_port_available_t cpa
;
323 port
= pa_hashmap_get(u
->card
->ports
, jack
->name
);
326 port
= jack
->path
->port
;
334 cpa
= jack
->plugged_in
? jack
->state_plugged
: jack
->state_unplugged
;
336 /* "Yes" and "no" trumphs "unknown" if we have more than one jack */
337 if (cpa
== PA_PORT_AVAILABLE_UNKNOWN
)
340 if ((cpa
== PA_PORT_AVAILABLE_NO
&& pa
== PA_PORT_AVAILABLE_YES
) ||
341 (pa
== PA_PORT_AVAILABLE_NO
&& cpa
== PA_PORT_AVAILABLE_YES
))
342 pa_log_warn("Availability of port '%s' is inconsistent!", p
->name
);
347 pa_device_port_set_available(p
, pa
);
350 static int report_jack_state(snd_hctl_elem_t
*elem
, unsigned int mask
)
352 struct userdata
*u
= snd_hctl_elem_get_callback_private(elem
);
353 snd_ctl_elem_value_t
*elem_value
;
354 pa_bool_t plugged_in
;
357 pa_device_port
*port
;
361 if (mask
== SND_CTL_EVENT_MASK_REMOVE
)
364 snd_ctl_elem_value_alloca(&elem_value
);
365 if (snd_hctl_elem_read(elem
, elem_value
) < 0) {
366 pa_log_warn("Failed to read jack detection from '%s'", pa_strnull(snd_hctl_elem_get_name(elem
)));
370 plugged_in
= !!snd_ctl_elem_value_get_boolean(elem_value
, 0);
372 pa_log_debug("Jack '%s' is now %s", pa_strnull(snd_hctl_elem_get_name(elem
)), plugged_in
? "plugged in" : "unplugged");
374 PA_HASHMAP_FOREACH(jack
, u
->jacks
, state
)
375 if (jack
->hctl_elem
== elem
) {
376 jack
->plugged_in
= plugged_in
;
378 pa_assert(u
->card
->ports
);
379 port
= pa_hashmap_get(u
->card
->ports
, jack
->name
);
383 pa_assert(jack
->path
&& jack
->path
->port
);
384 port
= jack
->path
->port
;
386 report_port_state(port
, u
);
391 static void init_jacks(struct userdata
*u
) {
396 u
->jacks
= pa_hashmap_new(pa_idxset_trivial_hash_func
, pa_idxset_trivial_compare_func
);
399 PA_LLIST_FOREACH(jack
, u
->ucm
.jacks
)
400 if (jack
->has_control
)
401 pa_hashmap_put(u
->jacks
, jack
, jack
);
403 /* See if we have any jacks */
404 if (u
->profile_set
->output_paths
)
405 PA_HASHMAP_FOREACH(path
, u
->profile_set
->output_paths
, state
)
406 PA_LLIST_FOREACH(jack
, path
->jacks
)
407 if (jack
->has_control
)
408 pa_hashmap_put(u
->jacks
, jack
, jack
);
410 if (u
->profile_set
->input_paths
)
411 PA_HASHMAP_FOREACH(path
, u
->profile_set
->input_paths
, state
)
412 PA_LLIST_FOREACH(jack
, path
->jacks
)
413 if (jack
->has_control
)
414 pa_hashmap_put(u
->jacks
, jack
, jack
);
417 pa_log_debug("Found %d jacks.", pa_hashmap_size(u
->jacks
));
419 if (pa_hashmap_size(u
->jacks
) == 0)
422 u
->mixer_fdl
= pa_alsa_fdlist_new();
424 u
->mixer_handle
= pa_alsa_open_mixer(u
->alsa_card_index
, NULL
, &u
->hctl_handle
);
425 if (u
->mixer_handle
&& pa_alsa_fdlist_set_handle(u
->mixer_fdl
, NULL
, u
->hctl_handle
, u
->core
->mainloop
) >= 0) {
426 PA_HASHMAP_FOREACH(jack
, u
->jacks
, state
) {
427 jack
->hctl_elem
= pa_alsa_find_jack(u
->hctl_handle
, jack
->alsa_name
);
428 if (!jack
->hctl_elem
) {
429 pa_log_warn("Jack '%s' seems to have disappeared.", jack
->alsa_name
);
430 jack
->has_control
= FALSE
;
433 snd_hctl_elem_set_callback_private(jack
->hctl_elem
, u
);
434 snd_hctl_elem_set_callback(jack
->hctl_elem
, report_jack_state
);
435 report_jack_state(jack
->hctl_elem
, 0);
439 pa_log("Failed to open hctl/mixer for jack detection");
443 static void set_card_name(pa_card_new_data
*data
, pa_modargs
*ma
, const char *device_id
) {
449 pa_assert(device_id
);
451 if ((n
= pa_modargs_get_value(ma
, "card_name", NULL
))) {
452 pa_card_new_data_set_name(data
, n
);
453 data
->namereg_fail
= TRUE
;
457 if ((n
= pa_modargs_get_value(ma
, "name", NULL
)))
458 data
->namereg_fail
= TRUE
;
461 data
->namereg_fail
= FALSE
;
464 t
= pa_sprintf_malloc("alsa_card.%s", n
);
465 pa_card_new_data_set_name(data
, t
);
469 static pa_hook_result_t
sink_input_put_hook_callback(pa_core
*c
, pa_sink_input
*sink_input
, struct userdata
*u
) {
471 pa_sink
*sink
= sink_input
->sink
;
475 role
= pa_proplist_gets(sink_input
->proplist
, PA_PROP_MEDIA_ROLE
);
477 /* new sink input linked to sink of this card */
478 if (role
&& sink
->card
== u
->card
)
479 pa_alsa_ucm_roled_stream_begin(&u
->ucm
, role
, PA_DIRECTION_OUTPUT
);
484 static pa_hook_result_t
source_output_put_hook_callback(pa_core
*c
, pa_source_output
*source_output
, struct userdata
*u
) {
486 pa_source
*source
= source_output
->source
;
490 role
= pa_proplist_gets(source_output
->proplist
, PA_PROP_MEDIA_ROLE
);
492 /* new source output linked to source of this card */
493 if (role
&& source
->card
== u
->card
)
494 pa_alsa_ucm_roled_stream_begin(&u
->ucm
, role
, PA_DIRECTION_INPUT
);
499 static pa_hook_result_t
sink_input_unlink_hook_callback(pa_core
*c
, pa_sink_input
*sink_input
, struct userdata
*u
) {
501 pa_sink
*sink
= sink_input
->sink
;
505 role
= pa_proplist_gets(sink_input
->proplist
, PA_PROP_MEDIA_ROLE
);
507 /* new sink input unlinked from sink of this card */
508 if (role
&& sink
->card
== u
->card
)
509 pa_alsa_ucm_roled_stream_end(&u
->ucm
, role
, PA_DIRECTION_OUTPUT
);
514 static pa_hook_result_t
source_output_unlink_hook_callback(pa_core
*c
, pa_source_output
*source_output
, struct userdata
*u
) {
516 pa_source
*source
= source_output
->source
;
520 role
= pa_proplist_gets(source_output
->proplist
, PA_PROP_MEDIA_ROLE
);
522 /* new source output unlinked from source of this card */
523 if (role
&& source
->card
== u
->card
)
524 pa_alsa_ucm_roled_stream_end(&u
->ucm
, role
, PA_DIRECTION_INPUT
);
529 int pa__init(pa_module
*m
) {
530 pa_card_new_data data
;
532 pa_bool_t ignore_dB
= FALSE
;
534 pa_reserve_wrapper
*reserve
= NULL
;
535 const char *description
;
536 const char *profile
= NULL
;
538 pa_bool_t namereg_fail
= FALSE
;
540 pa_alsa_refcnt_inc();
544 if (!(ma
= pa_modargs_new(m
->argument
, valid_modargs
))) {
545 pa_log("Failed to parse module arguments");
549 if (pa_modargs_get_value_boolean(ma
, "ignore_dB", &ignore_dB
) < 0) {
550 pa_log("Failed to parse ignore_dB argument.");
554 m
->userdata
= u
= pa_xnew0(struct userdata
, 1);
557 u
->device_id
= pa_xstrdup(pa_modargs_get_value(ma
, "device_id", DEFAULT_DEVICE_ID
));
561 u
->ucm
.core
= m
->core
;
563 if ((u
->alsa_card_index
= snd_card_get_index(u
->device_id
)) < 0) {
564 pa_log("Card '%s' doesn't exist: %s", u
->device_id
, pa_alsa_strerror(u
->alsa_card_index
));
568 if (!pa_in_system_mode()) {
571 if ((rname
= pa_alsa_get_reserve_name(u
->device_id
))) {
572 reserve
= pa_reserve_wrapper_get(m
->core
, rname
);
580 pa_modargs_get_value_boolean(ma
, "use_ucm", &u
->use_ucm
);
581 if (u
->use_ucm
&& !pa_alsa_ucm_query_profiles(&u
->ucm
, u
->alsa_card_index
)) {
582 pa_log_info("Found UCM profiles");
584 u
->profile_set
= pa_alsa_ucm_add_profile_set(&u
->ucm
, &u
->core
->default_channel_map
);
586 /* hook start of sink input/source output to enable modifiers */
587 /* A little bit later than module-role-cork */
588 u
->sink_input_put_hook_slot
= pa_hook_connect(&m
->core
->hooks
[PA_CORE_HOOK_SINK_INPUT_PUT
], PA_HOOK_LATE
+10,
589 (pa_hook_cb_t
) sink_input_put_hook_callback
, u
);
590 u
->source_output_put_hook_slot
= pa_hook_connect(&m
->core
->hooks
[PA_CORE_HOOK_SOURCE_OUTPUT_PUT
], PA_HOOK_LATE
+10,
591 (pa_hook_cb_t
) source_output_put_hook_callback
, u
);
593 /* hook end of sink input/source output to disable modifiers */
594 /* A little bit later than module-role-cork */
595 u
->sink_input_unlink_hook_slot
= pa_hook_connect(&m
->core
->hooks
[PA_CORE_HOOK_SINK_INPUT_UNLINK
], PA_HOOK_LATE
+10,
596 (pa_hook_cb_t
) sink_input_unlink_hook_callback
, u
);
597 u
->source_output_unlink_hook_slot
= pa_hook_connect(&m
->core
->hooks
[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK
], PA_HOOK_LATE
+10,
598 (pa_hook_cb_t
) source_output_unlink_hook_callback
, u
);
603 fn
= pa_udev_get_property(u
->alsa_card_index
, "PULSE_PROFILE_SET");
606 if (pa_modargs_get_value(ma
, "profile_set", NULL
)) {
608 fn
= pa_xstrdup(pa_modargs_get_value(ma
, "profile_set", NULL
));
611 u
->profile_set
= pa_alsa_profile_set_new(fn
, &u
->core
->default_channel_map
);
615 u
->profile_set
->ignore_dB
= ignore_dB
;
620 pa_alsa_profile_set_probe(u
->profile_set
, u
->device_id
, &m
->core
->default_sample_spec
, m
->core
->default_n_fragments
, m
->core
->default_fragment_size_msec
);
621 pa_alsa_profile_set_dump(u
->profile_set
);
623 pa_card_new_data_init(&data
);
624 data
.driver
= __FILE__
;
627 pa_alsa_init_proplist_card(m
->core
, data
.proplist
, u
->alsa_card_index
);
629 pa_proplist_sets(data
.proplist
, PA_PROP_DEVICE_STRING
, u
->device_id
);
630 pa_alsa_init_description(data
.proplist
);
631 set_card_name(&data
, ma
, u
->device_id
);
633 /* We need to give pa_modargs_get_value_boolean() a pointer to a local
634 * variable instead of using &data.namereg_fail directly, because
635 * data.namereg_fail is a bitfield and taking the address of a bitfield
636 * variable is impossible. */
637 namereg_fail
= data
.namereg_fail
;
638 if (pa_modargs_get_value_boolean(ma
, "namereg_fail", &namereg_fail
) < 0) {
639 pa_log("Failed to parse namereg_fail argument.");
640 pa_card_new_data_done(&data
);
643 data
.namereg_fail
= namereg_fail
;
646 if ((description
= pa_proplist_gets(data
.proplist
, PA_PROP_DEVICE_DESCRIPTION
)))
647 pa_reserve_wrapper_set_application_device_name(reserve
, description
);
649 add_profiles(u
, data
.profiles
, data
.ports
);
651 if (pa_hashmap_isempty(data
.profiles
)) {
652 pa_log("Failed to find a working profile.");
653 pa_card_new_data_done(&data
);
657 add_disabled_profile(data
.profiles
);
659 if (pa_modargs_get_proplist(ma
, "card_properties", data
.proplist
, PA_UPDATE_REPLACE
) < 0) {
660 pa_log("Invalid properties");
661 pa_card_new_data_done(&data
);
665 if ((profile
= pa_modargs_get_value(ma
, "profile", NULL
)))
666 pa_card_new_data_set_profile(&data
, profile
);
668 u
->card
= pa_card_new(m
->core
, &data
);
669 pa_card_new_data_done(&data
);
674 u
->card
->userdata
= u
;
675 u
->card
->set_profile
= card_set_profile
;
681 pa_reserve_wrapper_unref(reserve
);
683 if (!pa_hashmap_isempty(u
->profile_set
->decibel_fixes
))
684 pa_log_warn("Card %s uses decibel fixes (i.e. overrides the decibel information for some alsa volume elements). "
685 "Please note that this feature is meant just as a help for figuring out the correct decibel values. "
686 "PulseAudio is not the correct place to maintain the decibel mappings! The fixed decibel values "
687 "should be sent to ALSA developers so that they can fix the driver. If it turns out that this feature "
688 "is abused (i.e. fixes are not pushed to ALSA), the decibel fix feature may be removed in some future "
689 "PulseAudio version.", u
->card
->name
);
695 pa_reserve_wrapper_unref(reserve
);
702 int pa__get_n_used(pa_module
*m
) {
710 pa_assert_se(u
= m
->userdata
);
713 PA_IDXSET_FOREACH(sink
, u
->card
->sinks
, idx
)
714 n
+= pa_sink_linked_by(sink
);
716 PA_IDXSET_FOREACH(source
, u
->card
->sources
, idx
)
717 n
+= pa_source_linked_by(source
);
722 void pa__done(pa_module
*m
) {
727 if (!(u
= m
->userdata
))
730 if (u
->sink_input_put_hook_slot
)
731 pa_hook_slot_free(u
->sink_input_put_hook_slot
);
733 if (u
->sink_input_unlink_hook_slot
)
734 pa_hook_slot_free(u
->sink_input_unlink_hook_slot
);
736 if (u
->source_output_put_hook_slot
)
737 pa_hook_slot_free(u
->source_output_put_hook_slot
);
739 if (u
->source_output_unlink_hook_slot
)
740 pa_hook_slot_free(u
->source_output_unlink_hook_slot
);
743 pa_alsa_fdlist_free(u
->mixer_fdl
);
745 snd_mixer_close(u
->mixer_handle
);
747 pa_hashmap_free(u
->jacks
, NULL
);
749 if (u
->card
&& u
->card
->sinks
)
750 pa_idxset_remove_all(u
->card
->sinks
, (pa_free_cb_t
) pa_alsa_sink_free
);
752 if (u
->card
&& u
->card
->sources
)
753 pa_idxset_remove_all(u
->card
->sources
, (pa_free_cb_t
) pa_alsa_source_free
);
756 pa_card_free(u
->card
);
759 pa_modargs_free(u
->modargs
);
762 pa_alsa_profile_set_free(u
->profile_set
);
764 pa_alsa_ucm_free(&u
->ucm
);
766 pa_xfree(u
->device_id
);
770 pa_alsa_refcnt_dec();