Commit graph

409 commits

Author SHA1 Message Date
Gleb Popov
2720df0175 Do not call memfd_create on FreeBSD. 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
Wim Taymans
9f765897db add missing files 2019-11-07 16:39:13 +01:00
Wim Taymans
4ad7ce3aa2 session-manager: split policy and monitor
Separate the session manager in a monitor and policy part.

The monitor manages the devices and endpoints.

The policy watches the nodes/ports/clients and applies the policy
of linking them.

Because both now have a separate connection, we can remove some
hacks in the protocol. When a remote was both the implementer and
user of an object we could get in a deadlock when the user was
blocked waiting and the implementator was blocked sending a reply.
We used to un-busy a client when it was expecting a reply from a
ping or sync for this reason.

Add and use some more keys for the endpoints and streams.
2019-11-07 16:03:00 +01:00
Wim Taymans
60cd74fdb0 alsa: set MEDIA_CLASS in nodes 2019-11-05 16:34:12 +01:00
Wim Taymans
8409e8be49 endpoint: make endpoints of alsa devices
Make one endpoint for each device
Make a stream for each node
2019-11-04 17:30:33 +01:00
Wim Taymans
57299ec491 Add missing files 2019-11-03 11:25:23 +01:00
Wim Taymans
0a81a982f7 metadata: Add metadata API
Metadata allows apps to attach properties to objects that can be
read by other apps.
Not complete yet, properties should be removed when the object is
removed.
2019-11-03 10:31:14 +01:00
Wim Taymans
c842b5adf2 reserve: fix RequestRelease
Only fail when message is NULL
Actually send the message as well
2019-11-03 10:12:45 +01:00
Wim Taymans
b4b69473d3 filter: add filter API
The filter API is meant for making generic audio and video filters.
It's like a pw_stream but with many in/out ports and no conversion.
Eventually the pw_stream will be implemented with the filter.

Add some example audio and video filters.
2019-10-29 11:59:58 +01:00
Wim Taymans
858a5017ed small cleanups 2019-10-28 13:21:40 +01:00
Wim Taymans
ebb5ed94a2 add some docs 2019-10-25 15:01:27 +02:00
Wim Taymans
12fb58add1 core: explicitly calculate min and max quantum
Just clamp to default for now until we can implement power save mode.
2019-10-24 12:19:21 +02:00
Wim Taymans
b74080ea55 alsa: give capture stream highest priority
Make sure we always make the capture device a master. We would prefer
to only do resampling on the sinks when we need to.
2019-10-24 11:06:37 +02:00
Wim Taymans
320dc203cf export-spa: print node id 2019-10-23 17:37:10 +02:00
Wim Taymans
ff96165035 Improve debug 2019-10-22 13:06:20 +02:00
Wim Taymans
eb1d675cb0 node: add master priority
Change node.priority to priority.session to indicate that this
is the priority that the session manager uses to select the node.

Add another priority.master that the core uses to select a master
driver. Keep the driver nodes sorted by master priority.

Let jack always prefer to connect to the master driver nodes.
2019-10-22 12:25:25 +02:00
Wim Taymans
34a1a988ba session: make a jack device
Add a jack device and activate it when we release the device (for JACK
presumably). We need to work around some issues, jack does not allow
us to connect yet when it asks to release the device so we need to
wait a little and then connect.
2019-10-21 16:39:08 +02:00
Wim Taymans
1eca773145 media-session: only deal with state when it changed
Look at the change_mask and only deal with the state when it changed
or else we might start the idle timer again when something unrelated
changed.
2019-10-18 21:52:24 +02:00
Wim Taymans
102bd21d0e alsa: lower priority of cards with device not starting from 0 2019-10-17 13:03:28 +02:00
Wim Taymans
ecd8dbc7f0 node: add node.priority
Add a simple priority to nodes.
2019-10-17 12:43:23 +02:00
Wim Taymans
fb95e7660a media-session: start the midi bridge from the session 2019-10-02 21:12:42 +02:00
Wim Taymans
82ee139f65 spa: improve object properties 2019-10-01 10:04:22 +02:00
Wim Taymans
dc83c10c9a media-session: add device reservation for alsa
Implement the device reservation DBus API.

When we acquire the device name, set our device profile to 'On'. This
adds our sources and sinks to the graph.

When we lose the name, switch back to 'Off' and remove our nodes
again.

Move the session mamager stuff in a directory.

Fixes #191
2019-09-30 21:51:46 +02:00
Wim Taymans
c59af4debc examples: copy properties for pw_remote_export()
pw_remote_export() takes ownership of the properties so make a copy
of the ones we still want to hold on to.
2019-09-27 10:13:21 +02:00
George Kiagiadakis
5183e1d4b4 bluez-monitor: fix usage of pw_properties_setf without a format string
Otherwise compilation will fail with certain -Wformat-security flags
Add the flag to the warnings.
2019-09-26 17:26:23 +02:00
Wim Taymans
db341a6450 improve properties on node and port
Rename some alsa filenames.
2019-09-23 20:51:34 +02:00
Wim Taymans
6756a3c8fc monitor: remove monitor API and use device
Remove the monitor API, we can use the device API for it. Make sure
we support creating devices (like alsa) from another device (udev).

Use new object.id to store the object id in the object properties. Use
the port.id/node.id etc to make relations to other objects.
2019-09-20 13:04:14 +02:00
Wim Taymans
4381e79632 control: clean up some control includes
Remove control from channelmix, it's not used
Add control metadata
Add OSC control type
Improve some docs
2019-09-16 15:49:46 +02:00
Wim Taymans
8b85cc225e rename HAVE/NEED_BUFFER -> HAVE/NEED_DATA
It is more generic and works with control-only ports as well
2019-09-16 12:55:23 +02:00
Wim Taymans
edbd9eb077 video: add support for RGBA with 16 and 32 bit float 2019-08-19 16:22:12 +02:00
Wim Taymans
8db4a797aa core: remove parent_id from the global event
Remove the parent_id from the global event. Remove the parent
and owner from the global object.

Use properties instead to mark parents and owners of objects.

Properties are easier to control for client exported objects and
usually a simple parent/child is not enough. For example, a client
exported node has the client as a parent but also the factory that
created the node.
2019-08-16 22:11:42 +02:00
Wim Taymans
774e11bc10 keys: rename device.id to device.bus-id 2019-08-16 21:52:32 +02:00
Wim Taymans
c879b85884 export-sink: add more buffer space 2019-08-14 11:44:37 +02:00
Wim Taymans
b90c5b925a examples: add example of memfd upload
Add an example of a client that allocates the buffer memory and
uploads the fds to the server.
2019-08-12 16:54:05 +02:00
Wim Taymans
c6a7b3eedb channelmix: implement per channel volume
Implement per channel volume on channelmix. Extend control on stream to
take an array of values when possible.

Remove name argument from pw_node_new and pw_device_new. We can pass
this as a property instead.

Improve properties on nodes to more closely match what pulseaudio does.
Don't let the monitor do too much with the udev properties but let the
session manager set the description and icon-names.

Remove some change_mask flags for things that don't change in
introspect. Use the flags to mark changes in -cli and -monitor.
2019-08-12 15:14:39 +02:00
Wim Taymans
f41720e7db Add PortConfig parameter
Add a new PortConfig parameter to configure ports of elements that
are marked with the SPA_NODE_FLAG_*_PORT_CONFIG. This is used to
configure the operation of the audioconver/audioadapter nodes and
how it should convert the internal format. We want to use the
Profile parameter only for cases where there is an enumeration of
values, like with device configuration.

Add unit tests for audioconvert and adapter to check if they handle
PortConfig correctly.

Make the media session use the PortConfig to dynamically configure
the device nodes.

Remove audio-dsp, it is not used anymore and can/should be implemented
with a simple audioconvert spa node now and some PortConfig.
2019-08-06 12:45:20 +02:00
Wim Taymans
acdfed0d04 session: keep format with max number of channels 2019-08-06 12:35:42 +02:00
Wim Taymans
d6289639f1 media-session: keep track of peer
When we don't link to a session but directly to a peer, remember
this so that we don't try to link over and over again.
2019-08-06 12:19:24 +02:00
Wim Taymans
2772c9f554 bluez: clean up nodes 2019-07-31 18:30:19 +02:00
Wim Taymans
9869734250 monitor: unload spa handle instead of free() 2019-07-31 10:08:29 +02:00
Wim Taymans
40e3ba8bb4 session: only set profile on audio for now 2019-07-29 16:52:24 +02:00
Wim Taymans
e76a7abceb Add support for client fd memory
Remove the node buffers reply again. We don't need it. Instead add a
new method to the client-node to upload an array of buffer datas.
This method is called after the client has allocated buffer mem. It
will update the buffers on the server side with the client allocated
memory.

Wait for the async reply of use_buffers when doing alloc_buffers so
that we can get the updated buffer mem before we continue.

Let the link follow the states of the ports.

Add some error code to the port error states.

Add PW_STREAM_FLAG_ALLOC_BUFFERS flag to make the client alloc buffer
memory.
2019-07-26 16:17:39 +02:00
Wim Taymans
8590ac158b node: add flags to port_use_buffer
Remove the CAN_USE_BUFFERS flag, it is redundant. We can know this
because of the IO params and buffer params.

Add flags to the port_use_buffer call. We also want this call to
replace port_alloc_buffer. Together with a new result event we can
ask the node to (a)synchronously fill up the buffer data for us. This
is part of a plan to let remote nodes provide buffer data.
2019-07-25 13:19:39 +02:00
Wim Taymans
cf6fcb65c9 adapter: decide monitor ports in the session-manager 2019-07-16 18:53:04 +02:00
Wim Taymans
3d302ffd4d media-session: remove DSP node type
Remove unused profile-format
2019-07-16 11:15:30 +02:00
Wim Taymans
3745f79fc5 media-session: create a local adaper+a2dp sink/source
Run the a2dp sink and sources with the adapter in the session manager
and export it to PipeWire. The idea is that the codecs should not
preferably not run inside the daemon.
2019-07-12 10:04:26 +02:00
Wim Taymans
d7098d6a4c session: handle monitor in the session
Load the monitor in the session manager.
Export devices to pipewire.
Create nodes or a device in an adapter.
2019-07-10 20:24:11 +02:00