softdsp-endpoint: workaround pipewire bug
spa audioconvert (the backend of audio-dsp) does not adevertise property changes, therefore subscribe_params() is useless. In order to get the real value from the node we need to call enum_params() manually. https://github.com/PipeWire/pipewire/issues/157
This commit is contained in:
@@ -232,7 +232,6 @@ emit_audio_dsp_node (WpPwAudioSoftdspEndpoint *self)
|
|||||||
uint8_t buf[1024];
|
uint8_t buf[1024];
|
||||||
struct spa_pod_builder pod_builder = { 0, };
|
struct spa_pod_builder pod_builder = { 0, };
|
||||||
struct spa_pod *param;
|
struct spa_pod *param;
|
||||||
uint32_t ids[1] = { SPA_PARAM_Props };
|
|
||||||
const struct pw_node_info *node_info;
|
const struct pw_node_info *node_info;
|
||||||
const struct spa_audio_info_raw *port_format;
|
const struct spa_audio_info_raw *port_format;
|
||||||
struct spa_audio_info_raw format;
|
struct spa_audio_info_raw format;
|
||||||
@@ -269,7 +268,7 @@ emit_audio_dsp_node (WpPwAudioSoftdspEndpoint *self)
|
|||||||
PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, &props->dict, 0);
|
PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, &props->dict, 0);
|
||||||
pw_node_proxy_add_listener(self->dsp_proxy, &self->dsp_listener,
|
pw_node_proxy_add_listener(self->dsp_proxy, &self->dsp_listener,
|
||||||
&dsp_node_events, self);
|
&dsp_node_events, self);
|
||||||
pw_node_proxy_subscribe_params (self->dsp_proxy, ids, SPA_N_ELEMENTS (ids));
|
pw_node_proxy_enum_params (self->dsp_proxy, 0, SPA_PARAM_Props, 0, -1, NULL);
|
||||||
|
|
||||||
/* Set DSP proxy params */
|
/* Set DSP proxy params */
|
||||||
spa_pod_builder_init(&pod_builder, buf, sizeof(buf));
|
spa_pod_builder_init(&pod_builder, buf, sizeof(buf));
|
||||||
@@ -448,6 +447,8 @@ endpoint_set_control_value (WpEndpoint * ep, guint32 control_id,
|
|||||||
SPA_TYPE_OBJECT_Props, SPA_PARAM_Props,
|
SPA_TYPE_OBJECT_Props, SPA_PARAM_Props,
|
||||||
SPA_PROP_volume, SPA_POD_Float(volume),
|
SPA_PROP_volume, SPA_POD_Float(volume),
|
||||||
NULL));
|
NULL));
|
||||||
|
pw_node_proxy_enum_params (self->dsp_proxy, 0, SPA_PARAM_Props, 0, -1,
|
||||||
|
NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CONTROL_MUTE:
|
case CONTROL_MUTE:
|
||||||
@@ -462,6 +463,8 @@ endpoint_set_control_value (WpEndpoint * ep, guint32 control_id,
|
|||||||
SPA_TYPE_OBJECT_Props, SPA_PARAM_Props,
|
SPA_TYPE_OBJECT_Props, SPA_PARAM_Props,
|
||||||
SPA_PROP_mute, SPA_POD_Bool(mute),
|
SPA_PROP_mute, SPA_POD_Bool(mute),
|
||||||
NULL));
|
NULL));
|
||||||
|
pw_node_proxy_enum_params (self->dsp_proxy, 0, SPA_PARAM_Props, 0, -1,
|
||||||
|
NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CONTROL_SELECTED:
|
case CONTROL_SELECTED:
|
||||||
|
Reference in New Issue
Block a user