Commit graph

27 commits

Author SHA1 Message Date
Wim Taymans
2b44f42845 pass the complete buffer size to snprintf
There is no reason to pass size-1, snprintf will always put a \0
at the end.
2021-02-02 12:09:29 +01:00
Pauli Virtanen
59452a0904 pulse-server: send server change events when default nodes change
Send server change events to subscribers, when default nodes change due
to some nodes being added/removed/changed, also if there is no metadata
change.  Make sure the event is consistent with the result from
find_device at the time.

Previously, these were not necessarily sent, or information from
find_device immediately after the event might not reflect the change
yet.
2021-01-23 07:17:19 +01:00
Pauli Virtanen
d46c58e958 pulse-server: behave like PA when moving streams to default
Pulseaudio unsets the preferred sink/source when stream is moved to a
default target. Emulate this behavior by setting + unsetting
target.node, which informs policy-node to move it accordingly.
2021-01-18 22:40:27 +02:00
Wim Taymans
38fcc64e1f pulse-server: check if route param changed
Only mark the sink/source changed when the card route param
changed. Avoids triggering sink/source updates when nothing
changed.

See #298
2020-11-24 20:02:46 +01:00
Wim Taymans
3d6e87832d pulse-server: after new event, clear changes
Remove any pending changes after we emited the new event.
2020-11-24 19:29:49 +01:00
Wim Taymans
a65d4d04c3 pulse-server: collect updates and apply after sync
Collect all object updates in a separate list. When we collected
all updates in sync, apply them and then signal notifications.
This ensure we have a consistent object model.
2020-11-24 15:31:20 +01:00
Wim Taymans
d0d64de1a0 pulse-server: emit metadata immeditately
Don't wait for sync but immediately emit the added event for metadata.
This way the server can get the name and handle the metadata events
immediately.
2020-11-24 11:55:51 +01:00
Wim Taymans
cc7f91db19 pulse-server: actually wait for sync to complete
Wait for sync to complete before we start emiting new objects.
Add some more debug
2020-11-24 11:28:29 +01:00
Wim Taymans
4f0f5fccc9 pulse-server: keep metadata for the routes
Pass all metadata objects to the pulse-server and keep track of
some. Keep route restore info in properties.
2020-11-23 10:44:12 +01:00
Wim Taymans
77b8959df5 pulse-server: clear info in destroy to avoid segfault
Fixes #400
2020-11-23 09:43:40 +01:00
Wim Taymans
1908c88cfc manager: notify of changed sink/source
When the Route param changes on the card, find the associated
device and mark it as modified. Fixes volume changes in gnome-shell
and pavucontrol.

See #377
See #298
2020-11-18 17:07:03 +01:00
Wim Taymans
22cec7823e pulse-server: skip objects being created
Skip iterating over objects that still have pending updates.
Make sure we have all info and properties before we process
objects.

Fixes #376
2020-11-13 09:52:02 +01:00
Wim Taymans
218689ff9a manager: also make a Core global
So that we can checke the permissions for the metadata
2020-11-11 17:19:04 +01:00
Wim Taymans
cd3610367b pulse-server: free object info
Don't remove the listeners before destroying the proxy because
we clean up the info in the destroy event.
2020-11-09 16:52:25 +01:00
Wim Taymans
18c57efb39 pulse-server: take type from info 2020-11-09 09:42:53 +01:00
Wim Taymans
1570e62635 remove hooks from objects
Remove the hooks we installed on objects in the destroy/free event
or before calling _destroy. This is not really needed but it is
a nice thing to do because it calls the hook removed callbacks.
2020-11-06 15:53:32 +01:00
Wim Taymans
42319e32be pulse-server: handle NULL registry 2020-11-06 15:35:44 +01:00
Wim Taymans
b472abe65b pulse-server: improve GET_SERVER_INFO
We don't need to bind to the core object again, we can just use the
events on the manager core.
We don't actually have info when the Core is added so don't try to
use it to get defaults for the client.
Use the manager core info in server info.
2020-11-05 10:36:13 +01:00
Wim Taymans
c619d7851f pulse-server: add move and default sink/source
Clean up error handling, use errno everywhere and convert when needed.
2020-10-29 11:59:16 +01:00
Wim Taymans
66cf4e68d5 pulse-server: use EnumFormat as fallback
Use a fixated format and position from EnumFormat as a fallback.
2020-10-27 15:42:48 +01:00
Wim Taymans
124b1221a6 pulse-server: add more introspection
Emit new/change/remove events
Handle suspended state of peer
Handle direct_on_input record streams.
Place the tag in error messages
2020-10-27 14:57:15 +01:00
Wim Taymans
51328af0e1 pulse-server: collect node params 2020-10-27 08:59:28 +01:00
Wim Taymans
4f63f37f00 pulse-server: collect device params 2020-10-26 20:53:34 +01:00
Wim Taymans
a372e4e90e pulse-server: add more introspection
Add default nodes support and subscription events when it changes.
Fix stream id.
Fix node lookup.
Fix node volume.
2020-10-26 13:28:45 +01:00
Wim Taymans
fdf3485902 pulse-server: add sink/source sink_input/source_output introspect 2020-10-25 19:51:42 +01:00
Wim Taymans
02d04c63ea pulse-server: introspect cards 2020-10-25 16:24:11 +01:00
Wim Taymans
1cbad89862 pulse-server: add introspection of clients and modules
Add manager object to collect object info
Wait for object info until completing client connect
Implement clients and modules list and info.
2020-10-25 15:28:42 +01:00