Commit graph

863 commits

Author SHA1 Message Date
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
Wim Taymans
293932d4ec v0: improve compatibility
Implement RequestClockUpdate event and ClockUpdate message for
old clients.
2020-02-11 11:23:28 +01:00
Wim Taymans
7edd3fb054 typemap: fill out more audio formats 2020-02-10 20:46:18 +01:00
Wim Taymans
eab6dda513 protocol-native: improve v0 compatibility 2020-02-10 18:15:24 +01:00
Wim Taymans
56c15ca9e8 connection: improve version check
do the version check on the v2 update_types request or the v3
hello request.
2020-02-10 16:26:24 +01:00
Wim Taymans
d2e7f75071 resource: destroy old core_resource
If there is already a core_resource when we are going to make a new
one, remove the old one. This can happen when there is a version
switch.
2020-02-10 16:22:49 +01:00
Wim Taymans
03844d6c72 rtkit: add parameters for prio and rlimits
Make it possible to configure the prio and rlimits on the
rtkit module.
Set the defaults to the max.
2020-02-10 10:43:31 +01:00
Wim Taymans
40db445f3d rtkit: actually wake up the thread to set rt priority
Wake up the eventfd in the data thread to actually request the
realtime priority.
2020-02-08 22:47:18 +01:00
Wim Taymans
ee67ab9c04 client-node: keep target links in list
Don't allocate the links in an array because they might be moved
when the array is resized. Instead just use calloc and add them
to a list.

Make sure we update the list used in the real-time thread from a
safe context.
2020-02-07 16:45:58 +01:00
Wim Taymans
a1bb1548e6 tests: msg is undefined when _get_next() return != 1 2020-02-07 15:40:28 +01:00
Wim Taymans
3aa8e301c5 protocol-native: implement v2 update_permissions
Convert the old permission update to new permission events.
2020-02-06 16:57:24 +01:00
Wim Taymans
7a395bccaf improve v2 compat mode
Always send the server types when we got the first client types and
don't rely on the message sequence number.
Add some more types in the typemap.
2020-02-06 16:56:19 +01:00
Wim Taymans
41b47e726e context: add some more defaults
Make a property to allow mlock and use it.
mlock in stream and filter when asked to mmap mem.
2020-02-04 17:09:41 +01:00
Wim Taymans
dcec3f12b5 remote-node: safely activate and deactivate a link
Make sure we execute the admin of the target links in the data
thread.
2020-02-04 16:29:48 +01:00
Wim Taymans
f79dfcd77f profiler: fix method prototype 2020-02-03 16:44:09 +01:00
Wim Taymans
a4a93a2a16 profiler: Improve profiler info
Split the profiler info into multiple properties.
Give feedback about time and logged samples while profiling.
2020-02-03 12:33:01 +01:00
Wim Taymans
3317af804b pw-profiler: add profiler tool
Add Profiler object and fields.
Add profiler extension API. It notifies Profiler objects with
real-time performance data.
Add module that implements the profiler extension.
Add pw-profiler tool that binds to the profiler API and dumps the
data into a log file, gnuplot files, a html page and a script to
generate svg graphs. This is almost the same as what JACK2
JackEngineProfiling does.
2020-01-31 15:13:47 +01:00
Wim Taymans
7450bfd88b Improve mlock failure warning message 2020-01-29 11:07:26 +01:00
Wim Taymans
1c46dc32f8 protocol-native: improve message debug 2020-01-17 11:00:09 +01:00
Wim Taymans
4169d9196d module-access: handle -EACCES as non-flatpak
If we can't access the root filesystem, grant access to the app.
This should not happen but for now it is a workaround for selinux
where we can't access the gnome-shell root when it connects for
screen sharing.
2020-01-15 17:17:56 +01:00
Wim Taymans
1cedfade3a protocol: improve old version check
Check if the pod size is > 4 because the unit test adds one fd
in the first message.
2020-01-15 12:24:11 +01:00
Wim Taymans
043e7f24fe add some more useful defines
Add define to match all ids for nodes and params.
Add define for invalid permissions
2020-01-15 11:15:51 +01:00
Wim Taymans
cf53ededd0 connection: improve old version check
Check the type of the pod in the message instead. Old versions
should not have 0 there, new versions keep the number of file
descriptors, which should be 0 for the first message.
2020-01-15 10:29:58 +01:00