Commit graph

985 commits

Author SHA1 Message Date
Wim Taymans
cfce048528 adapter: pass error to factory 2020-05-08 16:18:10 +02:00
Wim Taymans
2c13b3ecd2 client-node-v0: return -ENOENT when parameter not found 2020-05-07 10:42:19 +02:00
Wim Taymans
9049f1fdbb spa-node: don't warn on properties
When the node does not support enum_params or when the Props param
is not supported, suppress the warning.
2020-05-04 13:02:30 +02:00
Wim Taymans
940ff7f53b client-node: improve error reporting
Separate read failure and missed wakeup in 2 messages.
2020-05-01 11:23:54 +02:00
Wim Taymans
3324a15fe3 protocol: use bool for Bool pod 2020-04-30 17:12:20 +02:00
Wim Taymans
0fd46d057e remote: free io area after we set the new area
First set the new area, then destroy the old one. Otherwise the
data thread might still be using the old area and crash.
2020-04-30 16:13:50 +02:00
Wim Taymans
acd9991bfc remote-node: remove unused position area 2020-04-30 11:55:46 +02:00
Wim Taymans
856e1fe812 client-node: don't error in cleanup
It's possible the cleanup code might try to clean up ports we
already removed, don't show an error on that.
2020-04-28 13:56:23 +02:00
Wim Taymans
aafd1e7298 improve debug
Improve log so that debug level 3 gives a reasonably readable overview
of what is going on.
2020-04-22 12:47:18 +02:00
Wim Taymans
ee5c3349a0 client-node: don't try to clear port when destroyed
When the client destroyed a port, don't try to clear the
buffers because the client should have done that already.
2020-04-21 15:54:51 +02:00
Wim Taymans
48036f7d13 improve debug 2020-04-21 15:51:55 +02:00
Wim Taymans
0b68d65ebf metadata: trigger emission of properties
When the resource does add_listener, send a message to the proxy
to trigger an emission of properties.
Block the client until all properties have been notified, track
this with a ping event to the implementation.
2020-04-20 11:51:20 +02:00
Wim Taymans
ab3a6d3441 Fix some compiler warnings on arm 2020-04-03 13:18:02 +02:00
Wim Taymans
22e590c7cc stream: somewhat implement drain better
Abuse the xrun callback in the adapter to emit the drained signal until
almost all data left the resampler. This needs more work with a proper
signal and a buffer flag to signal the drain.
2020-04-02 17:46:50 +02:00
Wim Taymans
d1091462ab transport: init io_buffers with SPA_IO_BUFFERS_INIT 2020-04-02 15:36:56 +02:00
Wim Taymans
74ab04af26 client-node: use BUFFER_INIT to reset io_buffers 2020-04-02 15:31:58 +02:00
Wim Taymans
a86f70c13d protocol-native: avoid destroying NULL source
The source might have been destroyed before.
2020-04-02 15:25:13 +02:00
George Kiagiadakis
e918d60959 session-manager: implement factories for session, endpoint-stream & endpoint-link
Heavily based on the endpoint factory
2020-03-27 14:56:07 +00:00
George Kiagiadakis
444d180218 session-manager: endpoint: implement caching info & params
The info structure needs to be cached because there is no way to
request it from the implementation, unless we hack the add_listener
API to be used for making info requests or add a new method that
will be used just in the implementation (both are bad ideas).

The params are cached because
1) a client doing enum_params + sync will not work correctly, since
 the sync call syncs with the server and not the implementation...
 we could block the client to solve that, but then there is also #2
2) the implementation is not aware of the clients and therefore
 it cannot keep track of who is subscribed and who is not, this
 needs to happen in the server. Then if we only keep track of the
 subscriptions in the server and keep requesting params from the
 impl, there is no way to know if a param event coming from the
 impl matches a call to enum_params or to subscribe or if it's
 just an update that needs to be forwarded to subscribers.
2020-03-27 14:56:07 +00:00
George Kiagiadakis
df66edd9ab session-manager: implement 'endpoint' factory
This is modeled after the 'metadata' factory and provides
a way to use the pw_endpoint interface directly to implement
an endpoint object in a client.
2020-03-27 14:56:07 +00:00
George Kiagiadakis
0a8ec0380b session-manager: check error code when registering the marshallers 2020-03-27 14:56:07 +00:00
George Kiagiadakis
e971a79fce session-manager: implement export functions for session-manager objects 2020-03-27 14:56:07 +00:00
George Kiagiadakis
234c642746 session-manager: move files into client-endpoint / client-session subdirs
To clean up space for the new implementation.
The existing code is exclusively for use with the client-endpoint
and client-session factories.
2020-03-27 14:56:07 +00:00
George Kiagiadakis
bc3a92e950 session-manager: add impl marshallers for endpoint, -stream, -link and session 2020-03-27 14:56:07 +00:00
Wim Taymans
67eb89689d stream: only warn about mlock when in RT mode
Only warn about mlock failure when the stream is configured to
operate in REALTIME mode.
2020-03-20 11:21:44 +01:00
Wim Taymans
0d3aa1fd30 Fix export type prototype
Pass the type as provided by the export type. This way we can
look up the owner of the export type later.
2020-03-19 18:12:07 +01:00
Wim Taymans
8a2af908a7 small optimizations
Add some SPA_LIKELY
Enable FASTPATH by default
2020-03-18 15:43:29 +01:00
Wim Taymans
72d70b0f48 Add and fix some more warnings
Fixes #216
2020-03-17 11:37:56 +01:00
Rasmus Thomsen
fba9d8931d module-protocol-native: fix build on s390x 2020-03-09 08:52:16 +00:00
Rasmus Thomsen
cfd829913e meson: add rpath on the modules_install_dir for all modules
Otherwise the dynamic loader won't be able to find libraries in
modules_install_dir we link against

fixes #214
2020-03-09 08:51:49 +00:00
Wim Taymans
c4b2be2aad use true and false for boolean properties
So that it's easier to convert them to booleans in introspection
code later.
2020-03-03 18:17:46 +01:00
Wim Taymans
fd262aa0f2 adapter: add some debug 2020-03-03 13:04:13 +01:00
Wim Taymans
c8633767e7 remote-node: map buffer metadata readwrite
Map the buffer metadata in read/write mode. Some metadata might
need to be writable even for input buffers (like ref-count metadata)
2020-03-02 16:51:32 +01:00
Wim Taymans
0ed86941ce client-node: only return -ENOENT for unknown param
Always iterate all params because we are only supposed to
return -ENOENT for unknown params and if we start iterating at some
random start position we might be past the paran and report -ENOENT
wrongly.
2020-03-02 12:26:10 +01:00
Wim Taymans
847ee8f064 metadata: fix cleanup
When the global is destroyed, free the resource.
When the resource is freed, destroy the global.
Make sure any bound resources are freed when the global is destroyed
by calling pw_global_add_resource().
2020-03-02 10:49:04 +01:00
Wim Taymans
77cc58ba71 protocol-native: improve bool in set_active 2020-03-02 10:48:31 +01:00
Wim Taymans
65d72bb87c improve error messages
Send create_object error messages to the new resource id so that
the client can better know what proxy is failing.
Use resource_remove when create_object fails because the core will
already send a remove_id on failure.
Try to send other errors to the proxy that made the request if
possible.
2020-02-25 16:38:13 +01:00
Wim Taymans
b96daabb2f link-factory: send errors to the proxy of the new link
Sending the errors to the proxy id allows the client to know something
is wrong with the proxy and deal with it better.
Use the port global id in the error message.
2020-02-25 15:07:49 +01:00
Wim Taymans
41989f4889 client-node: don't overwrite the chunk memory pointer
When the client uploads a buffer, copy all data fields except for
the chunk memory that we configured before.
If we overwrite the chunk memory, the users of the buffer would not
be able to find the chunk memory anymore and crash or fail.
2020-02-24 15:08:27 +01:00
Wim Taymans
8ecef35e80 client-node: update n_buffers after we can process them
Make sure we don't configure the buffers before we manage to
completely process them or else we are left with an invalid list
of buffers.

See #209
2020-02-24 10:20:33 +01:00
Wim Taymans
f9dccccf91 spa-node: fix properties while loading.
Update the example in the config file to load a spa node
2020-02-21 16:27:00 +01:00
Wim Taymans
5074ca37ff protocol-native: Improve errors
A missing XDG_RUNTIME_DIR results in ENOENT, like on the server
side.
A too long name results in ENAMETOOLONG, like on the server side.
When we can't find the socket, return EHOSTDOWN to make it more
obvious what is going.
2020-02-21 15:05:43 +01:00
Wim Taymans
b33bd68bac improve error messages
Log an error when we send an error to the client so that we don't need
to log and error anymore.
Improve the error messages when we can
Move some warnings and errors to debug
2020-02-21 15:02:55 +01:00
Pantelis Antoniou
e58d33e8d8 Terminate PW_KEY_SEC_LABEL key with '\0'
The socket call does not terminate the string with '\0' so
we have to use the length explicitly.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
2020-02-21 11:30:49 +01:00
Wim Taymans
d8bac82e72 improve logging
Remove some harmless warnings from the log
Remove some excessive info logging
2020-02-21 11:09:34 +01:00
Wim Taymans
a528189d26 slave -> follower
We use master/follower terminology everywhere.
2020-02-21 10:47:32 +01:00
Wim Taymans
463b9e4e29 buffers: handle -ENOENT
enum_param should return -ENOENT when the param is not known.
When negotiating buffers handle -ENOENT. This means the port does
not know about the property and we should assume anything is fine
so just use the filter from the first port.
2020-02-18 17:34:41 +01:00
Wim Taymans
495dc7c3af device: implement subscribe_params
Also add subscribe params for the device, like for Node and Port.
2020-02-12 16:07:10 +01:00
Wim Taymans
1a6848801f fix compiler warnings 2020-02-11 15:25:53 +01:00
Wim Taymans
9ce2c6157f client-node: fix v0 data offset
Set the right data offset for v0 clients.
2020-02-11 15:15:20 +01:00