Commit graph

3131 commits

Author SHA1 Message Date
Wim Taymans
f8aabe69fe interfaces: don't define opaque types
Let the types be opaque so that we can make a private implementation
later.
2019-12-06 11:43:38 +01:00
Wim Taymans
1ba5a17236 core: add PW_KEY_CORE_PROFILE_MODULES
Let the core load a set of default modules.
Add a key to control what default set to load, falling back to a
reasonable set. Make the daemon not load any set and rely on the
config script to load modules.
2019-12-05 16:17:42 +01:00
Wim Taymans
6b1e1a82f1 alsa: improve debug 2019-12-05 13:17:43 +01:00
Wim Taymans
c67c73d64d remote: install core_proxy right after connect
Make the core proxy available right after we called connect. This
makes it possible to avoid waiting for the remote state change and
start using the core_proxy right away.
2019-12-05 12:18:17 +01:00
Wim Taymans
d5ea24ae2c proxy/resource: add method to remove 2019-12-05 12:04:45 +01:00
Wim Taymans
ed9d4e5e80 mem: add method to clear pool 2019-12-05 11:50:00 +01:00
Wim Taymans
0b2e4a18ff protocol-native: make the connection earlier
Make the connection as soon as we create the client. We create it
without file descriptor and then set it when we connect. This
makes it possible to use the connection to queue messages before
we connect.
2019-12-05 11:43:05 +01:00
Wim Taymans
8bb1ccf587 protocol-native: emit a core error on disconnect
Let the listeners on the core_proxy know about connection errors.
2019-12-05 11:32:51 +01:00
Wim Taymans
7594eabdc8 remote: pass core_proxy to export function
We want to remove the need for the pw_remote in most cases.
2019-12-05 11:15:04 +01:00
Wim Taymans
dd2fa2caee core: move export function to core.h 2019-12-05 10:54:47 +01:00
Wim Taymans
2474f9ae7d Add some more useful functions 2019-12-05 10:47:20 +01:00
Wim Taymans
b0932e687f pulse: avoid errors with const 2019-12-05 10:35:07 +01:00
Wim Taymans
4314fba7c4 alsa: close fd before destroying the loop 2019-12-04 15:30:30 +01:00
Wim Taymans
279e6706b2 stream: do not call process if the queue is not empty enough 2019-12-03 17:48:44 +02:00
Wim Taymans
125fcb5660 session-manager: remove obsolte _set_id
media-session: Wait for devices to appear and be bound before setting
the profile on the device. Then wait for all the nodes to appear
before attempting the create endpoints on the device.
2019-11-29 13:34:09 +01:00
Wim Taymans
e1ef01c860 alsa-endpoint: move to separate service
Let the session manager monitor device objects as well.

Make the alsa-endpoint monitor a separate service instead of letting
the alsa-monitor call it directly. This means that it listens for
device objects and then tries to configure the endpoints when the
device profile is set to active. This does not work yet because we
can't link the nodes to the device yet because there is no way to know
what the global id is of the device we created.

Make sure implementations of objects run in a separate remote connection
because the main remote connection might block while waiting for a
return value from the implementation.

Trigger an object update after all object info is collected. We do this
by triggering a roundtrip after receiving the info event. When we get
the reply, we can assume all info is flushed. This includes the
parameters that we received.
2019-11-29 13:34:09 +01:00
Wim Taymans
8c06760480 alsa-endpoint: monitor and update node params 2019-11-29 13:34:09 +01:00
Wim Taymans
4361e5f326 media-session: count params 2019-11-29 13:34:09 +01:00
Wim Taymans
87946ed2cf media-session: move all flags to the object 2019-11-29 13:34:09 +01:00
Wim Taymans
5b96e3a528 stream-monitor: improve stream monitor
Monitor the node Props and PropInfo and update the endpoint when
they change.
2019-11-29 13:34:09 +01:00
Wim Taymans
8e24e57db0 endpoint: handle NULL name and media_class 2019-11-29 13:34:09 +01:00
Wim Taymans
2fddfb02bd pulse: map stream index to endpoint 2019-11-29 13:34:09 +01:00
Wim Taymans
8335c50e1e session-manager: fix protocol 2019-11-29 13:34:09 +01:00
Wim Taymans
c46753bcae media-session: track nodes we create
Add a method to create a node and track the proxy. We can then
use this to track the params on a node.

Don't listen end enumerate the params in the monitors bbut let the
session do that. Use the collected params from the session to create
endpoints and streams.

Always activate the default stream on alsa nodes to create the
ports and have something we can present to apps.
2019-11-29 13:34:09 +01:00
Wim Taymans
80ac755670 media-session: make the services more modular 2019-11-29 13:34:09 +01:00
Wim Taymans
b7aa8f5c85 media-session: subscribe to params when needed
Subscribe to params and collect them.
2019-11-29 13:34:08 +01:00
Wim Taymans
541f3a4cc6 media-session: keep globals in a list as well
Also keep a list of globals and use it to emit the globals in
add_listener.
2019-11-29 13:34:08 +01:00
Wim Taymans
b432bda109 pulse: use monitor endpoints as monitor 2019-11-29 13:34:08 +01:00
Wim Taymans
aef04961aa alsa-endpoint: make monitor endpoints as well 2019-11-29 13:34:08 +01:00
Wim Taymans
8d49964c4d session-manager: add monitor keys
Add keys to specify monitor endpoints
2019-11-29 13:34:08 +01:00
Wim Taymans
e24e383550 media-session: add callback based sync method
Call the callback when the sync completes. Implement roundtrip
with this.
2019-11-29 13:34:08 +01:00
Wim Taymans
f2ce69c4bd media-session: pass the client.id in the endpoint
Pass the client.id that we made this endpoint for in the endpoint
properties. This makes it possible to let pulse find the client
that belongs to the endpiont. The client.id is used to find the
client that actually made the object (the session manager)
2019-11-29 13:34:08 +01:00
Wim Taymans
b518496136 pulse: only find linked source or sink endpoints 2019-11-29 13:34:08 +01:00
Wim Taymans
8c43ebaf3e pulse: find linked endpoints
Set the stream node object-id as the node.id on the endpoint so that
the pulse api can find the linked endpoint.
2019-11-29 13:34:08 +01:00
Wim Taymans
709a52e286 media-session: also create EndpointLink objects
Create an endpoint link object when linking endpoints. Keep track
of the links in the endpoint_link and cleanup when they are all
gone.

Improve properties on session objects.
2019-11-29 13:34:08 +01:00
Wim Taymans
4ccbce9932 stream: handle endpoint-target for streams 2019-11-29 13:34:08 +01:00
Wim Taymans
7bce1762de alsa-endpoint: set param on node 2019-11-29 13:34:08 +01:00
Wim Taymans
ddd185e749 session-manager: pass param id as POD_Id 2019-11-29 13:34:07 +01:00
Wim Taymans
3cd7d90d88 media-session: link all stream ports
Create a helper in the session manager to link all ports between
2 nodes.

Make the output endpoint call the input endpoint create_link, passing
the node or ports to link to.

Make the input endpoint complete the link by calling the session
helper to link all ports.

Remove the node policy, we're only using a policy for the endpoints
now.
2019-11-29 13:34:07 +01:00
Wim Taymans
9bc5d23ffe media-session: add _roundtrip helper
Add a function to force a roundtrip
2019-11-29 13:34:07 +01:00
Wim Taymans
fcb0031f7c media-session: fix port direction 2019-11-29 13:34:07 +01:00
Wim Taymans
c5ee45044d fix unit test 2019-11-29 13:34:07 +01:00
Wim Taymans
161cf46898 media-session: add media session helpers
Move all the media-session object monitoring into one place and
provide an API to get to the session objects.

Make API to add module specific info to objects.

Add methods to export and create objects in the session. This should
make it possible to link proxy to implementation and avoid a server
roundtrip in some cases.
2019-11-29 13:34:07 +01:00
Wim Taymans
3f3dfbc67e More session manager work
pulseaudio card is mapped to device
pulseaudio sink/source is mapped to an endpoint
prepare to map streams to card profiles
Add Route param to implement the endpoint routing later (ports)
Create an alsa endpoint for each device
Create one stream for each endpoint (Playback/Capture)

Implement create_link on the endpoint. The idea is to call
create link on the peer endpoint to complete the link. Remove
create_link on the session.

Add stream-monitor to turn pw_stream nodes into endpoints

Add a policy manager that tries to link endpoints

Use enum pw_direction for the endpoint direction. We can use the
media_class to determine if this is a pw_stream or not but it should
not really matter, you can link any output to any input.

Add autoconnect property for endpoints to make the policy connect.
2019-11-29 13:34:07 +01:00
Wim Taymans
edd011605d use endpoint in pulse 2019-11-29 13:34:07 +01:00
Wim Taymans
c9a54112e4 client-node: use bound id from the proxy
Remove the obsolete node_id from the transport. We get this info
now from the proxy.
2019-11-29 13:34:06 +01:00
Wim Taymans
fcd4ae3334 remote: remove obsolete exported event
We can now do the same and more with the bound event on the proxy.
2019-11-29 13:34:06 +01:00
Wim Taymans
a1801b690f jack: use explicit variable to keep track of transport 2019-11-29 13:34:06 +01:00
Wim Taymans
e3a1c4151e emit bound_id event 2019-11-29 13:34:06 +01:00
Wim Taymans
f56e4dbc4d interfaces: add event to notify of global bound id
Make it possible to know when a proxy is bound to a global id before
the global shows up in the registry. This makes it possible to match
locally created objects to the one appearing in the registry and
possibly avoid a second bind.
2019-11-29 13:34:00 +01:00