Commit graph

3628 commits

Author SHA1 Message Date
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
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
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
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
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
Wim Taymans
b264ef0772 proxy: add _get_type()
Also return the optional version in resource_get_type()
2019-11-29 13:30:51 +01:00
Wim Taymans
988144dda4 test: fix test 2019-11-29 13:29:40 +01:00
Wim Taymans
8acae9db7d Make sure we bind before registering the global
Bind to the resource in create_object before we register the global.
This ensure a client gets to see the resource global id associated
with the resource before it appears in the registry, which makes it
easier to patch the local proxy to the global object.
2019-11-25 16:33:53 +01:00
Wim Taymans
b7c5e00697 add some missing events
Add initialized events for completeness
2019-11-25 15:58:19 +01:00
Wim Taymans
772bf2dce2 filter: Use method implementation directly 2019-11-21 17:53:28 +01:00
Wim Taymans
738603fd04 stream: Align with pw_filter
Remove some of the unused states in pw_stream. The app can know the
state by following the format and buffer events.

Make it possible to be notified of io are updates. This should make it
possible to follow the transport etc.

Make it possible to be notified of any param changes.

Rename finish_format to update_params because that is what it does.
Make this work in the same was as the filter: updating the params
removes all old params of the types and installs the new ones.

Don't get the Props and PropInfo from the node proxy, instead get them
directly from the adapter that we have locally. Update the controls
directly on the adapter instead of going to the server first.
2019-11-21 16:14:50 +01:00
Wim Taymans
be53554def filter: add new method to set error state
Add a new set_error function that can also take a message instead
of abusing the update_params method.
2019-11-21 16:12:53 +01:00
Wim Taymans
e40fbf8cc4 Add printf checks for proxy_error and resource_error
Add an error variant without checks.
2019-11-21 16:09:05 +01:00
Wim Taymans
f2b7f2dc6d filter: improve param handling
Improve update_params so that it can be used in set_param.

Remove the node proxy listener, we don't need it.
2019-11-21 13:14:09 +01:00
Wim Taymans
6bd553f89b node: add _set_param() 2019-11-21 13:09:28 +01:00
Wim Taymans
02d0802004 remote-node: don't enum invalid param ids 2019-11-21 13:05:58 +01:00
Wim Taymans
d9b34dc4e3 filter: remove unused pending_seq 2019-11-21 13:04:58 +01:00
Wim Taymans
d8c86d977a remote: destroy mempool after proxies
Some proxies might want to free the memory from the pool.
2019-11-21 13:04:58 +01:00
Wim Taymans
3f89911f1d device: expose DEVICE_API in global properties 2019-11-21 09:34:34 +01:00
Wim Taymans
feb8dd3a34 Add include of keys.h 2019-11-21 09:34:08 +01:00
Wim Taymans
81bf9cd488 improve some debug 2019-11-21 09:32:48 +01:00
Wim Taymans
e18a24493a client: don't register in client_new()
Don't register in client_new() to make it possible to do other things
on the client before registering. Register the client in protocol-native
after we set up the events etc.
2019-11-19 15:59:45 +01:00
George Kiagiadakis
5f65f1cbbe client: register the global early, in pw_client_new()
otherwise, if the access module blocks the client, the on_start
callback in the protocol is not called and there is no global,
which means the session manager cannot do anything to grant
permissions on this client and the client is blocked forever
2019-11-19 14:50:04 +00:00
Julian Bouzas
ef94b5c345 tools: add new pipewire-dot tool to generate a global objects dot graph 2019-11-19 15:41:50 +01:00
Wim Taymans
f92775719a log: make timestamps configurable 2019-11-19 15:38:09 +01:00
Wim Taymans
ac24743b2e the epoll shim should only be used by the system library.
All other places should use the system library to get the right
fds.
2019-11-19 15:16:18 +01:00
Gleb Popov
2720df0175 Do not call memfd_create on FreeBSD. 2019-11-19 13:41:40 +01:00
Gleb Popov
999fa525f5 Implement _gettid() for FreeBSD and do not call pthread_setschedparam() with SCHED_RESET_ON_FORK argument. 2019-11-19 13:41:40 +01:00
Gleb Popov
6ea24a7db5 Don't call getsockopt with SO_PEERCRED and SO_PEERSEC parameters on FreeBSD. 2019-11-19 13:41:40 +01:00
Gleb Popov
33df224254 Use pthread_set_name_np() instead of pthread_setname_np() on FreeBSD. 2019-11-19 13:41:40 +01:00
Gleb Popov
feb9a4b9e1 Don't call prctl() on FreeBSD. 2019-11-19 13:41:40 +01:00
Gleb Popov
0a21c61ed0 Don't define memfd_create() and USE_MEMFD on FreeBSD. 2019-11-19 13:41:40 +01:00
Gleb Popov
ef3ebbed46 Define empty struct ucred on FreeBSD. 2019-11-19 13:41:40 +01:00
Gleb Popov
fd937fa378 On FreeBSD, add dependency on epoll-shim library.
FreeBSD doesn't provide timerfd and eventfd functions. These are implemented in
3rd party library called epoll-shim. Link targets requiring these functions to
this library.
2019-11-19 13:41:40 +01:00
Wim Taymans
68e94a2e7e system: use spa_system functions for fds 2019-11-19 13:41:40 +01:00
Wim Taymans
b14bb1f496 media-session: don't include use-case.h
We only use the use-case manager in alsa-endpoint
2019-11-19 11:29:50 +01:00
Arun Raghavan
f61498b863 session-manager: Fix use-case.h include ordering
Seems like the ALSA requires the general headers to be included before
use-case.h.
2019-11-19 07:45:43 +05:30
Wim Taymans
3c51f559ef elsa-endpoint: include asoundlib first 2019-11-18 10:40:50 +01:00