alsa-sink, alsa-source: Use a more appropriate function for enabling UCM devices

pa_alsa_ucm_set_port() disables devices in addition to enabling them,
which is unnecessary during initialization.
This commit is contained in:
Tanu Kaskinen 2020-06-10 11:36:01 +03:00
parent 45cf9d61e7
commit b3edd127a6
2 changed files with 4 additions and 8 deletions

View file

@ -2155,10 +2155,8 @@ static int setup_mixer(struct userdata *u, bool ignore_dB) {
* configuration doesn't specify volume or mute controls, u->mixer_handle * configuration doesn't specify volume or mute controls, u->mixer_handle
* will be NULL, but the UCM device enable sequence will still need to be * will be NULL, but the UCM device enable sequence will still need to be
* executed. */ * executed. */
if (u->sink->active_port && u->ucm_context) { if (u->sink->active_port && u->ucm_context)
if (pa_alsa_ucm_set_port(u->ucm_context, u->sink->active_port, true) < 0) pa_alsa_ucm_port_enable_devices(PA_DEVICE_PORT_DATA(u->sink->active_port), true);
return -1;
}
if (!u->mixer_handle) if (!u->mixer_handle)
return 0; return 0;

View file

@ -1861,10 +1861,8 @@ static int setup_mixer(struct userdata *u, bool ignore_dB) {
* configuration doesn't specify volume or mute controls, u->mixer_handle * configuration doesn't specify volume or mute controls, u->mixer_handle
* will be NULL, but the UCM device enable sequence will still need to be * will be NULL, but the UCM device enable sequence will still need to be
* executed. */ * executed. */
if (u->source->active_port && u->ucm_context) { if (u->source->active_port && u->ucm_context)
if (pa_alsa_ucm_set_port(u->ucm_context, u->source->active_port, false) < 0) pa_alsa_ucm_port_enable_devices(PA_DEVICE_PORT_DATA(u->source->active_port), true);
return -1;
}
if (!u->mixer_handle) if (!u->mixer_handle)
return 0; return 0;