Skip to content

Draft: Allow spa_node_enum_params_sync able to handle multiple results

P V requested to merge pvir/pipewire:fix-prop-enum-sync into master

The adapter changes in master, where multiple results are produced for SPA_PARAM_Props/PropInfo, doesn't seem to be compatible with spa_node_enum_params_sync which returns only the last value returned.

Fix this by adding spa_node_enum_params_sync_many that can obtain multiple results, and using it in some places where it seems necessary. The old function spa_node_enum_params_sync will return an error if there are multiple results, instead of ignoring all results except the last one.

What I'm not sure if it's a good thing / intended to allow multiple results in the API...

Currently on mater pw-dump output looks like this for bluez nodes (on 0ed7e537)

        "PropInfo": [
          {
            "id": "minLatency",
            "name": "The minimum latency",
            "type": { "default": 512, "min": 1, "max": 2147483647 }
          },
          {
            "id": "maxLatency",
            "name": "The maximum latency",
            "type": { "default": 1024, "min": 1, "max": 2147483647 }
          },
          {
            "id": "channelVolumes",
            "name": "Channel Volumes",
            "type": { "default": 1.000000, "min": 0.000000, "max": 10.000000 },
            "container": "Array"
          },
          {
            "id": "channelMap",
            "name": "Channel Map",
            "type": 0,
            "container": "Array"
          }
        ],
        "Props": [
          {
            "minLatency": 512,
            "maxLatency": 1024
          }
        ],

The channelmix props are missing, and propinfo is partially overwritten. I didn't check precisely, but the difference to alsa probably is because local and remote nodes are handled differently, or the nodes are created in a different way.

Edited by P V

Merge request reports