diff --git a/src/modules/module-protocol-pulse/module.c b/src/modules/module-protocol-pulse/module.c index b2fd4f6ca..2627db29d 100644 --- a/src/modules/module-protocol-pulse/module.c +++ b/src/modules/module-protocol-pulse/module.c @@ -174,6 +174,7 @@ int module_args_to_audioinfo(struct impl *impl, struct pw_properties *props, str /* We don't use any incoming format setting and use our native format */ spa_zero(*info); + info->flags = SPA_AUDIO_FLAG_UNPOSITIONED; info->format = SPA_AUDIO_FORMAT_F32P; if ((str = pw_properties_get(props, "channels")) != NULL) { @@ -199,6 +200,7 @@ int module_args_to_audioinfo(struct impl *impl, struct pw_properties *props, str return -EINVAL; } channel_map_to_positions(&map, info->position); + info->flags &= ~SPA_AUDIO_FLAG_UNPOSITIONED; pw_properties_set(props, "channel_map", NULL); } else { if (info->channels == 0) @@ -216,6 +218,8 @@ int module_args_to_audioinfo(struct impl *impl, struct pw_properties *props, str for (i = 0; i < info->channels; i++) info->position[i] = SPA_AUDIO_CHANNEL_UNKNOWN; } + if (info->position[0] != SPA_AUDIO_CHANNEL_UNKNOWN) + info->flags &= ~SPA_AUDIO_FLAG_UNPOSITIONED; } if ((str = pw_properties_get(props, "rate")) != NULL) { diff --git a/src/modules/module-protocol-pulse/modules/module-loopback.c b/src/modules/module-protocol-pulse/modules/module-loopback.c index 11cb88ec0..64c6fd106 100644 --- a/src/modules/module-protocol-pulse/modules/module-loopback.c +++ b/src/modules/module-protocol-pulse/modules/module-loopback.c @@ -63,15 +63,23 @@ static int module_loopback_load(struct client *client, struct module *module) struct module_loopback_data *data = module->user_data; FILE *f; char *args; - size_t size; + size_t size, i; pw_properties_setf(data->capture_props, PW_KEY_NODE_GROUP, "loopback-%u", module->idx); pw_properties_setf(data->playback_props, PW_KEY_NODE_GROUP, "loopback-%u", module->idx); f = open_memstream(&args, &size); fprintf(f, "{"); - if (data->info.channels != 0) + if (data->info.channels != 0) { fprintf(f, " audio.channels = %u", data->info.channels); + if (!(data->info.flags & SPA_AUDIO_FLAG_UNPOSITIONED)) { + fprintf(f, " audio.position = [ "); + for (i = 0; i < data->info.channels; i++) + fprintf(f, "%s%s", i == 0 ? "" : ",", + channel_id2name(data->info.position[i])); + fprintf(f, " ]"); + } + } fprintf(f, " capture.props = {"); pw_properties_serialize_dict(f, &data->capture_props->dict, 0); fprintf(f, " } playback.props = {");