mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
volume: Rename 'sync volume' to 'deferred volume'.
This just covers Lennart's concern over the terminology used. The majority of this change is simply the following command: grep -rli sync[-_]volume . | xargs sed -i 's/sync_volume/deferred_volume/g;s/PA_SINK_SYNC_VOLUME/PA_SINK_DEFERRED_VOLUME/g;s/PA_SOURCE_SYNC_VOLUME/PA_SOURCE_DEFERRED_VOLUME/g;s/sync-volume/deferred-volume/g' Some minor tweaks were added on top to tidy up formatting and a couple of phrases were clarified too.
This commit is contained in:
parent
83577aa373
commit
aa3142ab20
20 changed files with 143 additions and 141 deletions
|
|
@ -899,7 +899,7 @@ static int element_get_nearest_alsa_dB(snd_mixer_elem_t *me, snd_mixer_selem_cha
|
|||
return r;
|
||||
}
|
||||
|
||||
static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, pa_bool_t sync_volume, pa_bool_t write_to_hw) {
|
||||
static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, pa_bool_t deferred_volume, pa_bool_t write_to_hw) {
|
||||
|
||||
snd_mixer_selem_id_t *sid;
|
||||
pa_cvolume rv;
|
||||
|
|
@ -964,7 +964,7 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
|
|||
|
||||
} else {
|
||||
if (write_to_hw) {
|
||||
if (sync_volume) {
|
||||
if (deferred_volume) {
|
||||
if ((r = element_get_nearest_alsa_dB(me, c, PA_ALSA_DIRECTION_OUTPUT, &value)) >= 0)
|
||||
r = snd_mixer_selem_set_playback_dB(me, c, value, 0);
|
||||
} else {
|
||||
|
|
@ -992,7 +992,7 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
|
|||
|
||||
} else {
|
||||
if (write_to_hw) {
|
||||
if (sync_volume) {
|
||||
if (deferred_volume) {
|
||||
if ((r = element_get_nearest_alsa_dB(me, c, PA_ALSA_DIRECTION_INPUT, &value)) >= 0)
|
||||
r = snd_mixer_selem_set_capture_dB(me, c, value, 0);
|
||||
} else {
|
||||
|
|
@ -1059,7 +1059,7 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pa_alsa_path_set_volume(pa_alsa_path *p, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, pa_bool_t sync_volume, pa_bool_t write_to_hw) {
|
||||
int pa_alsa_path_set_volume(pa_alsa_path *p, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, pa_bool_t deferred_volume, pa_bool_t write_to_hw) {
|
||||
|
||||
pa_alsa_element *e;
|
||||
pa_cvolume rv;
|
||||
|
|
@ -1085,7 +1085,7 @@ int pa_alsa_path_set_volume(pa_alsa_path *p, snd_mixer_t *m, const pa_channel_ma
|
|||
pa_assert(!p->has_dB || e->has_dB);
|
||||
|
||||
ev = rv;
|
||||
if (element_set_volume(e, m, cm, &ev, sync_volume, write_to_hw) < 0)
|
||||
if (element_set_volume(e, m, cm, &ev, deferred_volume, write_to_hw) < 0)
|
||||
return -1;
|
||||
|
||||
if (!p->has_dB) {
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, pa_bool_t ignore_dB);
|
|||
void pa_alsa_path_dump(pa_alsa_path *p);
|
||||
int pa_alsa_path_get_volume(pa_alsa_path *p, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v);
|
||||
int pa_alsa_path_get_mute(pa_alsa_path *path, snd_mixer_t *m, pa_bool_t *muted);
|
||||
int pa_alsa_path_set_volume(pa_alsa_path *path, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, pa_bool_t sync_volume, pa_bool_t write_to_hw);
|
||||
int pa_alsa_path_set_volume(pa_alsa_path *path, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, pa_bool_t deferred_volume, pa_bool_t write_to_hw);
|
||||
int pa_alsa_path_set_mute(pa_alsa_path *path, snd_mixer_t *m, pa_bool_t muted);
|
||||
int pa_alsa_path_select(pa_alsa_path *p, snd_mixer_t *m);
|
||||
void pa_alsa_path_set_callback(pa_alsa_path *p, snd_mixer_t *m, snd_mixer_elem_callback_t cb, void *userdata);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ struct userdata {
|
|||
char *device_name; /* name of the PCM device */
|
||||
char *control_device; /* name of the control device */
|
||||
|
||||
pa_bool_t use_mmap:1, use_tsched:1, sync_volume:1;
|
||||
pa_bool_t use_mmap:1, use_tsched:1, deferred_volume:1;
|
||||
|
||||
pa_bool_t first, after_rewind;
|
||||
|
||||
|
|
@ -1278,7 +1278,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
struct userdata *u = s->userdata;
|
||||
pa_cvolume r;
|
||||
char vol_str_pcnt[PA_CVOLUME_SNPRINT_MAX];
|
||||
pa_bool_t sync_volume = !!(s->flags & PA_SINK_SYNC_VOLUME);
|
||||
pa_bool_t deferred_volume = !!(s->flags & PA_SINK_DEFERRED_VOLUME);
|
||||
|
||||
pa_assert(u);
|
||||
pa_assert(u->mixer_path);
|
||||
|
|
@ -1287,7 +1287,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
/* Shift up by the base volume */
|
||||
pa_sw_cvolume_divide_scalar(&r, &s->real_volume, s->base_volume);
|
||||
|
||||
if (pa_alsa_path_set_volume(u->mixer_path, u->mixer_handle, &s->channel_map, &r, sync_volume, !sync_volume) < 0)
|
||||
if (pa_alsa_path_set_volume(u->mixer_path, u->mixer_handle, &s->channel_map, &r, deferred_volume, !deferred_volume) < 0)
|
||||
return;
|
||||
|
||||
/* Shift down by the base volume, so that 0dB becomes maximum volume */
|
||||
|
|
@ -1339,7 +1339,7 @@ static void sink_write_volume_cb(pa_sink *s) {
|
|||
pa_assert(u);
|
||||
pa_assert(u->mixer_path);
|
||||
pa_assert(u->mixer_handle);
|
||||
pa_assert(s->flags & PA_SINK_SYNC_VOLUME);
|
||||
pa_assert(s->flags & PA_SINK_DEFERRED_VOLUME);
|
||||
|
||||
/* Shift up by the base volume */
|
||||
pa_sw_cvolume_divide_scalar(&hw_vol, &hw_vol, s->base_volume);
|
||||
|
|
@ -1411,7 +1411,7 @@ static void mixer_volume_init(struct userdata *u) {
|
|||
pa_sink_set_get_volume_callback(u->sink, sink_get_volume_cb);
|
||||
pa_sink_set_set_volume_callback(u->sink, sink_set_volume_cb);
|
||||
|
||||
if (u->mixer_path->has_dB && u->sync_volume) {
|
||||
if (u->mixer_path->has_dB && u->deferred_volume) {
|
||||
pa_sink_set_write_volume_callback(u->sink, sink_write_volume_cb);
|
||||
pa_log_info("Successfully enabled synchronous volume.");
|
||||
} else
|
||||
|
|
@ -1692,7 +1692,7 @@ static void thread_func(void *userdata) {
|
|||
|
||||
}
|
||||
|
||||
if (u->sink->flags & PA_SINK_SYNC_VOLUME) {
|
||||
if (u->sink->flags & PA_SINK_DEFERRED_VOLUME) {
|
||||
pa_usec_t volume_sleep;
|
||||
pa_sink_volume_change_apply(u->sink, &volume_sleep);
|
||||
if (volume_sleep > 0)
|
||||
|
|
@ -1708,7 +1708,7 @@ static void thread_func(void *userdata) {
|
|||
if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
|
||||
goto fail;
|
||||
|
||||
if (u->sink->flags & PA_SINK_SYNC_VOLUME)
|
||||
if (u->sink->flags & PA_SINK_DEFERRED_VOLUME)
|
||||
pa_sink_volume_change_apply(u->sink, NULL);
|
||||
|
||||
if (ret == 0)
|
||||
|
|
@ -1882,7 +1882,7 @@ static int setup_mixer(struct userdata *u, pa_bool_t ignore_dB) {
|
|||
|
||||
if (need_mixer_callback) {
|
||||
int (*mixer_callback)(snd_mixer_elem_t *, unsigned int);
|
||||
if (u->sink->flags & PA_SINK_SYNC_VOLUME) {
|
||||
if (u->sink->flags & PA_SINK_DEFERRED_VOLUME) {
|
||||
u->mixer_pd = pa_alsa_mixer_pdata_new();
|
||||
mixer_callback = io_mixer_callback;
|
||||
|
||||
|
|
@ -1918,7 +1918,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
|||
uint32_t nfrags, frag_size, buffer_size, tsched_size, tsched_watermark, rewind_safeguard;
|
||||
snd_pcm_uframes_t period_frames, buffer_frames, tsched_frames;
|
||||
size_t frame_size;
|
||||
pa_bool_t use_mmap = TRUE, b, use_tsched = TRUE, d, ignore_dB = FALSE, namereg_fail = FALSE, sync_volume = FALSE, set_formats = FALSE;
|
||||
pa_bool_t use_mmap = TRUE, b, use_tsched = TRUE, d, ignore_dB = FALSE, namereg_fail = FALSE, deferred_volume = FALSE, set_formats = FALSE;
|
||||
pa_sink_new_data data;
|
||||
pa_alsa_profile_set *profile_set = NULL;
|
||||
|
||||
|
|
@ -1977,9 +1977,9 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
|||
goto fail;
|
||||
}
|
||||
|
||||
sync_volume = m->core->sync_volume;
|
||||
if (pa_modargs_get_value_boolean(ma, "sync_volume", &sync_volume) < 0) {
|
||||
pa_log("Failed to parse sync_volume argument.");
|
||||
deferred_volume = m->core->deferred_volume;
|
||||
if (pa_modargs_get_value_boolean(ma, "deferred_volume", &deferred_volume) < 0) {
|
||||
pa_log("Failed to parse deferred_volume argument.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
@ -1990,7 +1990,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
|||
u->module = m;
|
||||
u->use_mmap = use_mmap;
|
||||
u->use_tsched = use_tsched;
|
||||
u->sync_volume = sync_volume;
|
||||
u->deferred_volume = deferred_volume;
|
||||
u->first = TRUE;
|
||||
u->rewind_safeguard = rewind_safeguard;
|
||||
u->rtpoll = pa_rtpoll_new();
|
||||
|
|
@ -2151,15 +2151,15 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_modargs_get_value_u32(ma, "sync_volume_safety_margin",
|
||||
if (pa_modargs_get_value_u32(ma, "deferred_volume_safety_margin",
|
||||
&u->sink->thread_info.volume_change_safety_margin) < 0) {
|
||||
pa_log("Failed to parse sync_volume_safety_margin parameter");
|
||||
pa_log("Failed to parse deferred_volume_safety_margin parameter");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_modargs_get_value_s32(ma, "sync_volume_extra_delay",
|
||||
if (pa_modargs_get_value_s32(ma, "deferred_volume_extra_delay",
|
||||
&u->sink->thread_info.volume_change_extra_delay) < 0) {
|
||||
pa_log("Failed to parse sync_volume_extra_delay parameter");
|
||||
pa_log("Failed to parse deferred_volume_extra_delay parameter");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ struct userdata {
|
|||
char *device_name; /* name of the PCM device */
|
||||
char *control_device; /* name of the control device */
|
||||
|
||||
pa_bool_t use_mmap:1, use_tsched:1, sync_volume:1;
|
||||
pa_bool_t use_mmap:1, use_tsched:1, deferred_volume:1;
|
||||
|
||||
pa_bool_t first;
|
||||
|
||||
|
|
@ -1129,7 +1129,7 @@ static void source_set_volume_cb(pa_source *s) {
|
|||
struct userdata *u = s->userdata;
|
||||
pa_cvolume r;
|
||||
char vol_str_pcnt[PA_CVOLUME_SNPRINT_MAX];
|
||||
pa_bool_t sync_volume = !!(s->flags & PA_SOURCE_SYNC_VOLUME);
|
||||
pa_bool_t deferred_volume = !!(s->flags & PA_SOURCE_DEFERRED_VOLUME);
|
||||
|
||||
pa_assert(u);
|
||||
pa_assert(u->mixer_path);
|
||||
|
|
@ -1138,7 +1138,7 @@ static void source_set_volume_cb(pa_source *s) {
|
|||
/* Shift up by the base volume */
|
||||
pa_sw_cvolume_divide_scalar(&r, &s->real_volume, s->base_volume);
|
||||
|
||||
if (pa_alsa_path_set_volume(u->mixer_path, u->mixer_handle, &s->channel_map, &r, sync_volume, !sync_volume) < 0)
|
||||
if (pa_alsa_path_set_volume(u->mixer_path, u->mixer_handle, &s->channel_map, &r, deferred_volume, !deferred_volume) < 0)
|
||||
return;
|
||||
|
||||
/* Shift down by the base volume, so that 0dB becomes maximum volume */
|
||||
|
|
@ -1190,7 +1190,7 @@ static void source_write_volume_cb(pa_source *s) {
|
|||
pa_assert(u);
|
||||
pa_assert(u->mixer_path);
|
||||
pa_assert(u->mixer_handle);
|
||||
pa_assert(s->flags & PA_SOURCE_SYNC_VOLUME);
|
||||
pa_assert(s->flags & PA_SOURCE_DEFERRED_VOLUME);
|
||||
|
||||
/* Shift up by the base volume */
|
||||
pa_sw_cvolume_divide_scalar(&hw_vol, &hw_vol, s->base_volume);
|
||||
|
|
@ -1262,7 +1262,7 @@ static void mixer_volume_init(struct userdata *u) {
|
|||
pa_source_set_get_volume_callback(u->source, source_get_volume_cb);
|
||||
pa_source_set_set_volume_callback(u->source, source_set_volume_cb);
|
||||
|
||||
if (u->mixer_path->has_dB && u->sync_volume) {
|
||||
if (u->mixer_path->has_dB && u->deferred_volume) {
|
||||
pa_source_set_write_volume_callback(u->source, source_write_volume_cb);
|
||||
pa_log_info("Successfully enabled synchronous volume.");
|
||||
} else
|
||||
|
|
@ -1405,7 +1405,7 @@ static void thread_func(void *userdata) {
|
|||
}
|
||||
}
|
||||
|
||||
if (u->source->flags & PA_SOURCE_SYNC_VOLUME) {
|
||||
if (u->source->flags & PA_SOURCE_DEFERRED_VOLUME) {
|
||||
pa_usec_t volume_sleep;
|
||||
pa_source_volume_change_apply(u->source, &volume_sleep);
|
||||
if (volume_sleep > 0)
|
||||
|
|
@ -1421,7 +1421,7 @@ static void thread_func(void *userdata) {
|
|||
if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
|
||||
goto fail;
|
||||
|
||||
if (u->source->flags & PA_SOURCE_SYNC_VOLUME)
|
||||
if (u->source->flags & PA_SOURCE_DEFERRED_VOLUME)
|
||||
pa_source_volume_change_apply(u->source, NULL);
|
||||
|
||||
if (ret == 0)
|
||||
|
|
@ -1593,7 +1593,7 @@ static int setup_mixer(struct userdata *u, pa_bool_t ignore_dB) {
|
|||
|
||||
if (need_mixer_callback) {
|
||||
int (*mixer_callback)(snd_mixer_elem_t *, unsigned int);
|
||||
if (u->source->flags & PA_SOURCE_SYNC_VOLUME) {
|
||||
if (u->source->flags & PA_SOURCE_DEFERRED_VOLUME) {
|
||||
u->mixer_pd = pa_alsa_mixer_pdata_new();
|
||||
mixer_callback = io_mixer_callback;
|
||||
|
||||
|
|
@ -1629,7 +1629,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
uint32_t nfrags, frag_size, buffer_size, tsched_size, tsched_watermark;
|
||||
snd_pcm_uframes_t period_frames, buffer_frames, tsched_frames;
|
||||
size_t frame_size;
|
||||
pa_bool_t use_mmap = TRUE, b, use_tsched = TRUE, d, ignore_dB = FALSE, namereg_fail = FALSE, sync_volume = FALSE;
|
||||
pa_bool_t use_mmap = TRUE, b, use_tsched = TRUE, d, ignore_dB = FALSE, namereg_fail = FALSE, deferred_volume = FALSE;
|
||||
pa_source_new_data data;
|
||||
pa_alsa_profile_set *profile_set = NULL;
|
||||
|
||||
|
|
@ -1682,9 +1682,9 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
goto fail;
|
||||
}
|
||||
|
||||
sync_volume = m->core->sync_volume;
|
||||
if (pa_modargs_get_value_boolean(ma, "sync_volume", &sync_volume) < 0) {
|
||||
pa_log("Failed to parse sync_volume argument.");
|
||||
deferred_volume = m->core->deferred_volume;
|
||||
if (pa_modargs_get_value_boolean(ma, "deferred_volume", &deferred_volume) < 0) {
|
||||
pa_log("Failed to parse deferred_volume argument.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
@ -1695,7 +1695,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
u->module = m;
|
||||
u->use_mmap = use_mmap;
|
||||
u->use_tsched = use_tsched;
|
||||
u->sync_volume = sync_volume;
|
||||
u->deferred_volume = deferred_volume;
|
||||
u->first = TRUE;
|
||||
u->rtpoll = pa_rtpoll_new();
|
||||
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
|
||||
|
|
@ -1851,15 +1851,15 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_modargs_get_value_u32(ma, "sync_volume_safety_margin",
|
||||
if (pa_modargs_get_value_u32(ma, "deferred_volume_safety_margin",
|
||||
&u->source->thread_info.volume_change_safety_margin) < 0) {
|
||||
pa_log("Failed to parse sync_volume_safety_margin parameter");
|
||||
pa_log("Failed to parse deferred_volume_safety_margin parameter");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_modargs_get_value_s32(ma, "sync_volume_extra_delay",
|
||||
if (pa_modargs_get_value_s32(ma, "deferred_volume_extra_delay",
|
||||
&u->source->thread_info.volume_change_extra_delay) < 0) {
|
||||
pa_log("Failed to parse sync_volume_extra_delay parameter");
|
||||
pa_log("Failed to parse deferred_volume_extra_delay parameter");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ PA_MODULE_USAGE(
|
|||
"tsched_buffer_watermark=<lower fill watermark> "
|
||||
"profile=<profile name> "
|
||||
"ignore_dB=<ignore dB information from the device?> "
|
||||
"sync_volume=<syncronize sw and hw voluchanges in IO-thread?> "
|
||||
"deferred_volume=<Synchronize software and hardware volume changes to avoid momentary jumps?> "
|
||||
"profile_set=<profile set configuration file> ");
|
||||
|
||||
static const char* const valid_modargs[] = {
|
||||
|
|
@ -88,7 +88,7 @@ static const char* const valid_modargs[] = {
|
|||
"tsched_buffer_watermark",
|
||||
"profile",
|
||||
"ignore_dB",
|
||||
"sync_volume",
|
||||
"deferred_volume",
|
||||
"profile_set",
|
||||
NULL
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ PA_MODULE_USAGE(
|
|||
"ignore_dB=<ignore dB information from the device?> "
|
||||
"control=<name of mixer control> "
|
||||
"rewind_safeguard=<number of bytes that cannot be rewound> "
|
||||
"sync_volume=<syncronize sw and hw voluchanges in IO-thread?> "
|
||||
"sync_volume_safety_margin=<usec adjustment depending on volume direction> "
|
||||
"sync_volume_extra_delay=<usec adjustment to HW volume changes>");
|
||||
"deferred_volume=<Synchronize software and hardware volume changes to avoid momentary jumps?> "
|
||||
"deferred_volume_safety_margin=<usec adjustment depending on volume direction> "
|
||||
"deferred_volume_extra_delay=<usec adjustment to HW volume changes>");
|
||||
|
||||
static const char* const valid_modargs[] = {
|
||||
"name",
|
||||
|
|
@ -80,9 +80,9 @@ static const char* const valid_modargs[] = {
|
|||
"ignore_dB",
|
||||
"control",
|
||||
"rewind_safeguard",
|
||||
"sync_volume",
|
||||
"sync_volume_safety_margin",
|
||||
"sync_volume_extra_delay",
|
||||
"deferred_volume",
|
||||
"deferred_volume_safety_margin",
|
||||
"deferred_volume_extra_delay",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -64,9 +64,9 @@ PA_MODULE_USAGE(
|
|||
"tsched_buffer_watermark=<upper fill watermark> "
|
||||
"ignore_dB=<ignore dB information from the device?> "
|
||||
"control=<name of mixer control>"
|
||||
"sync_volume=<syncronize sw and hw voluchanges in IO-thread?> "
|
||||
"sync_volume_safety_margin=<usec adjustment depending on volume direction> "
|
||||
"sync_volume_extra_delay=<usec adjustment to HW volume changes>");
|
||||
"deferred_volume=<Synchronize software and hardware volume changes to avoid momentary jumps?> "
|
||||
"deferred_volume_safety_margin=<usec adjustment depending on volume direction> "
|
||||
"deferred_volume_extra_delay=<usec adjustment to HW volume changes>");
|
||||
|
||||
static const char* const valid_modargs[] = {
|
||||
"name",
|
||||
|
|
@ -87,9 +87,9 @@ static const char* const valid_modargs[] = {
|
|||
"tsched_buffer_watermark",
|
||||
"ignore_dB",
|
||||
"control",
|
||||
"sync_volume",
|
||||
"sync_volume_safety_margin",
|
||||
"sync_volume_extra_delay",
|
||||
"deferred_volume",
|
||||
"deferred_volume_safety_margin",
|
||||
"deferred_volume_extra_delay",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ PA_MODULE_LOAD_ONCE(TRUE);
|
|||
PA_MODULE_USAGE(
|
||||
"tsched=<enable system timer based scheduling mode?> "
|
||||
"ignore_dB=<ignore dB information from the device?> "
|
||||
"sync_volume=<syncronize sw and hw volume changes in IO-thread?>");
|
||||
"deferred_volume=<syncronize sw and hw volume changes in IO-thread?>");
|
||||
|
||||
struct device {
|
||||
char *path;
|
||||
|
|
@ -63,7 +63,7 @@ struct userdata {
|
|||
|
||||
pa_bool_t use_tsched:1;
|
||||
pa_bool_t ignore_dB:1;
|
||||
pa_bool_t sync_volume:1;
|
||||
pa_bool_t deferred_volume:1;
|
||||
|
||||
struct udev* udev;
|
||||
struct udev_monitor *monitor;
|
||||
|
|
@ -76,7 +76,7 @@ struct userdata {
|
|||
static const char* const valid_modargs[] = {
|
||||
"tsched",
|
||||
"ignore_dB",
|
||||
"sync_volume",
|
||||
"deferred_volume",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -389,14 +389,14 @@ static void card_changed(struct userdata *u, struct udev_device *dev) {
|
|||
"namereg_fail=false "
|
||||
"tsched=%s "
|
||||
"ignore_dB=%s "
|
||||
"sync_volume=%s "
|
||||
"deferred_volume=%s "
|
||||
"card_properties=\"module-udev-detect.discovered=1\"",
|
||||
path_get_card_id(path),
|
||||
n,
|
||||
d->card_name,
|
||||
pa_yes_no(u->use_tsched),
|
||||
pa_yes_no(u->ignore_dB),
|
||||
pa_yes_no(u->sync_volume));
|
||||
pa_yes_no(u->deferred_volume));
|
||||
pa_xfree(n);
|
||||
|
||||
pa_hashmap_put(u->devices, d->path, d);
|
||||
|
|
@ -665,7 +665,7 @@ int pa__init(pa_module *m) {
|
|||
struct udev_enumerate *enumerate = NULL;
|
||||
struct udev_list_entry *item = NULL, *first = NULL;
|
||||
int fd;
|
||||
pa_bool_t use_tsched = TRUE, ignore_dB = FALSE, sync_volume = m->core->sync_volume;
|
||||
pa_bool_t use_tsched = TRUE, ignore_dB = FALSE, deferred_volume = m->core->deferred_volume;
|
||||
|
||||
|
||||
pa_assert(m);
|
||||
|
|
@ -692,11 +692,11 @@ int pa__init(pa_module *m) {
|
|||
}
|
||||
u->ignore_dB = ignore_dB;
|
||||
|
||||
if (pa_modargs_get_value_boolean(ma, "sync_volume", &sync_volume) < 0) {
|
||||
pa_log("Failed to parse sync_volume= argument.");
|
||||
if (pa_modargs_get_value_boolean(ma, "deferred_volume", &deferred_volume) < 0) {
|
||||
pa_log("Failed to parse deferred_volume= argument.");
|
||||
goto fail;
|
||||
}
|
||||
u->sync_volume = sync_volume;
|
||||
u->deferred_volume = deferred_volume;
|
||||
|
||||
if (!(u->udev = udev_new())) {
|
||||
pa_log("Failed to initialize udev library.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue