[pulseaudio-discuss] [PATCH v2 00/21] Routing: allow router modules to set stream initial routing

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Thu Dec 5 06:19:00 PST 2013


Changes in v2:
    - Fixed the bug that I mentioned here: [1]
    - Dropped pa_router, replaced it with a new hook:
      PA_CORE_HOOK_NODE_SET_INITIAL_ROUTING

>From the v1 cover letter (slightly edited):

As suggested by David, I removed the create_node flags from port,
sink, source, sink input and source output new data. The result is
that now all devices and streams, also virtual ones, expose a node.

Monitor sources require some special handling. Logically there should
be a separate monitor node for each output port node, not just one
monitor corresponding to the monitor source that covers multiple
ports.

The stream initialization is modified to allow nodes and router
modules to access the sink input and source output objects already in
the initial routing phase. I didn't want to somehow expose the new
data structure to nodes and router modules. Consider pa_node.owner,
for example: it's much cleaner to have it always point to
pa_sink_input instead of having it first pointing to
pa_sink_input_new_data and then changing it later to point to
pa_sink_input.

Finally, an "experimental router module" is introduced, which I intend
to evolve into a Murphy module.

[1] http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/18875/focus=18923

Tanu Kaskinen (21):
  Remove pa_device_port_new_data.create_node
  Remove create_node from sink input and source output new data
  Remove create_node from sink and source new data
  source: Initialize pa_source.monitor_of already in pa_source_new()
  sink: Create the sink node before creating the monitor source
  Don't create nodes for monitor sources if the sink has ports
  node: Generate a nice name for monitor nodes
  device-port: Generate monitor nodes for output ports
  sink-input, source-output: Use "goto fail" for error handling in new()
  sink-input, source-output: Allocate the object early in new()
  match: Do proplist updating already in the NEW hook
  sink-input, source-output: Create the node early
  Fix some error reporting style issues
  sink, source: Add a TODO comment about removing get_formats()
  idxset: Allow deep copying with pa_idxset_copy()
  core-format: Add pa_format_info_negotiate()
  sink-input, source-output: Add req_formats to
    pa_sink_input/pa_source_output
  sink-input, source-output: Add set_initial_sink/source()
  sink-input, source-output: Allow pa_node_put() to do routing
  Add PA_CORE_HOOK_NODE_SET_INITIAL_ROUTING
  New module: module-experimental-router

 src/Makefile.am                                 |   9 +
 src/modules/alsa/alsa-mixer.c                   |   3 +-
 src/modules/alsa/alsa-sink.c                    |  14 +-
 src/modules/alsa/alsa-source.c                  |   5 +-
 src/modules/alsa/alsa-ucm.c                     |   1 -
 src/modules/bluetooth/module-bluetooth-device.c |   2 -
 src/modules/jack/module-jack-sink.c             |   1 -
 src/modules/jack/module-jack-source.c           |   1 -
 src/modules/module-device-manager.c             |   4 +-
 src/modules/module-experimental-router.c        | 122 +++++++++
 src/modules/module-intended-roles.c             |   4 +-
 src/modules/module-match.c                      |  37 ++-
 src/modules/module-stream-restore.c             |   2 +-
 src/pulsecore/core-format.c                     |  51 ++++
 src/pulsecore/core-format.h                     |  44 +++
 src/pulsecore/core.h                            |   5 +
 src/pulsecore/device-port.c                     |  49 +++-
 src/pulsecore/device-port.h                     |   3 +-
 src/pulsecore/idxset.c                          |   4 +-
 src/pulsecore/idxset.h                          |   7 +-
 src/pulsecore/node.c                            |  19 +-
 src/pulsecore/node.h                            |   5 +-
 src/pulsecore/protocol-native.c                 |   4 +-
 src/pulsecore/sink-input.c                      | 342 +++++++++++++++---------
 src/pulsecore/sink-input.h                      |  11 +-
 src/pulsecore/sink.c                            |  33 +--
 src/pulsecore/sink.h                            |   7 +-
 src/pulsecore/source-output.c                   | 341 ++++++++++++++---------
 src/pulsecore/source-output.h                   |  11 +-
 src/pulsecore/source.c                          |  19 +-
 src/pulsecore/source.h                          |   9 +-
 31 files changed, 829 insertions(+), 340 deletions(-)
 create mode 100644 src/modules/module-experimental-router.c
 create mode 100644 src/pulsecore/core-format.c
 create mode 100644 src/pulsecore/core-format.h

-- 
1.8.3.1



More information about the pulseaudio-discuss mailing list