update upstream-2021-08-15

This commit is contained in:
Chengyi Zhao 2021-08-15 02:35:23 +08:00
parent c8653c13fa
commit 1703683def
297 changed files with 91782 additions and 54869 deletions

View file

@ -1365,6 +1365,7 @@ static void source_set_volume_cb(pa_source *s) {
pa_cvolume r;
char volume_buf[PA_CVOLUME_SNPRINT_VERBOSE_MAX];
bool deferred_volume = !!(s->flags & PA_SOURCE_DEFERRED_VOLUME);
bool write_to_hw = !deferred_volume;
pa_assert(u);
pa_assert(u->mixer_path);
@ -1373,7 +1374,14 @@ 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, deferred_volume, !deferred_volume) < 0)
/* If the set_volume() is called because of ucm active_port changing, the
* volume should be written to hw immediately, otherwise this volume will be
* overridden by calling get_volume_cb() which is called by
* _disdev/_enadev() -> io_mixer_callback() */
if (u->ucm_context && s->port_changing)
write_to_hw = true;
if (pa_alsa_path_set_volume(u->mixer_path, u->mixer_handle, &s->channel_map, &r, deferred_volume, write_to_hw) < 0)
return;
/* Shift down by the base volume, so that 0dB becomes maximum volume */
@ -1813,7 +1821,7 @@ static void find_mixer(struct userdata *u, pa_alsa_mapping *mapping, const char
u->mixers = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func,
NULL, (pa_free_cb_t) pa_alsa_mixer_free);
mdev = pa_proplist_gets(mapping->proplist, "alsa.mixer_device");
mdev = mapping ? pa_proplist_gets(mapping->proplist, "alsa.mixer_device") : NULL;
if (mdev) {
u->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, mdev, false);
} else {
@ -1972,7 +1980,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
bool volume_is_set;
bool mute_is_set;
pa_alsa_profile_set *profile_set = NULL;
void *state = NULL;
void *state;
pa_assert(m);
pa_assert(ma);
@ -2250,6 +2258,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_PROFILE_NAME, mapping->name);
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_PROFILE_DESCRIPTION, mapping->description);
state = NULL;
while ((key = pa_proplist_iterate(mapping->proplist, &state)))
pa_proplist_sets(data.proplist, key, pa_proplist_gets(mapping->proplist, key));
}
@ -2286,7 +2295,6 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
if (u->ucm_context) {
pa_device_port *port;
void *state;
unsigned h_prio = 0;
PA_HASHMAP_FOREACH(port, u->source->ports, state) {
if (!h_prio || port->priority > h_prio)