Commit graph

3269 commits

Author SHA1 Message Date
Wim Taymans
5f70a2713e a2dp: fix audio
Don't just remove the buffer from the queue when it was only
partially written. To do this, return the error code from add_buffer
and only remove the buffer when there is a real error.
2020-01-10 09:55:02 +01:00
Wim Taymans
f026e95585 audioconvert: use position rate as default rate 2020-01-09 16:50:02 +01:00
Wim Taymans
c14881fbe2 Respect the rate from the position as the default 2020-01-09 16:43:08 +01:00
Wim Taymans
9b41e4dfd9 jack: use sample rate from position
Use the sample rate from the position io area as soon as we get it.
2020-01-09 16:06:28 +01:00
Wim Taymans
b99074879f policy-node: use the daemon samplerate
Use the samplerate of the daemon to configure the nodes.
2020-01-09 15:52:53 +01:00
Wim Taymans
852ac043d3 Use the DSP format for dsp formats
Use the DSP media subtype to describe DSP formats. DSP formats
don't include the rate, channels and channel position in the
format and must use the rate and duration from the position io. This
makes it possible to later change the samplerate dynamically without
having to renegotiate the graph.

The same goes for the video DSP format, which uses the io_video_size
from the io_position to get the size/stride. Set this up in the node
based on the defaults from the context.

Make it possible to define defaults in the daemon config file, such
as samplerate, quantum, video size and framerate. This is stored in
the context and used for the DSP formats.
2020-01-09 15:18:59 +01:00
Wim Taymans
5a6da7d5e1 video: add and parse modifier as well 2020-01-09 13:36:52 +01:00
Wim Taymans
f42ca8b52e stream: emit io_changed event 2020-01-09 13:27:43 +01:00
Wim Taymans
96d4ec3207 use defined key for factory.name 2020-01-09 09:46:04 +01:00
Wim Taymans
2bca786fff policy-node: use priority of the nodes 2020-01-08 17:29:11 +01:00
Wim Taymans
817f8fef07 Makefile.in: fix path to pipewire daemon 2020-01-08 17:02:52 +01:00
Wim Taymans
e29969f937 Use build_root to generate Makefile
Don't hardcode the buildroot but use the value from meson.

Based on patch by Jan Koester <jan.koester@gmx.net>

Fixes #202
2020-01-08 15:41:01 +01:00
Jan Koester
dfdd664160 mainloop: add SPA_EXPORT to pa_mainloop_api_once
Fixes #200
2020-01-08 15:29:37 +01:00
Wim Taymans
7c615f4e64 stream: only set media.class when not set before 2020-01-08 15:16:32 +01:00
Wim Taymans
92c26fa124 suspend-node: only suspend devices 2020-01-08 15:16:17 +01:00
Wim Taymans
a3ddc6b744 media-session: add module to suspend nodes 2020-01-08 13:24:06 +01:00
Wim Taymans
9ffa9c0b08 v4l2: handle suspend 2020-01-08 13:23:35 +01:00
Wim Taymans
b0705a89b0 filter: handle NULL param 2020-01-08 13:22:23 +01:00
Wim Taymans
aa36a72427 main: handle execv failure
Log an error, exit daemon
2020-01-08 12:38:46 +01:00
Wim Taymans
ffbb74c4af policy-node: implement video nodes
Always activate video nodes right away
Implement exclusive access again
2020-01-08 10:48:48 +01:00
Wim Taymans
fa98389fef node: copy more properties to the global
Copy media.type and category to global
Set media_class in example
2020-01-08 10:48:00 +01:00
Wim Taymans
b312e77385 Make simple node policy
Make it possible to run the session manager without endpoint
modules. Add a simple node policy that links nodes.

Move the session-manager implementation and startup of the
endpoint monitors to a separate module.

Handle async set_param on the device
2020-01-07 17:19:09 +01:00
Wim Taymans
3b05896cd6 bluez5: cleanups
Use export_device
2020-01-03 13:02:59 +01:00
Wim Taymans
8f3b2b9543 bluez5: implement sync, profile and enum_profile 2020-01-03 13:01:54 +01:00
Wim Taymans
bdc82bb94b typemap: add more video types 2020-01-03 09:33:59 +01:00
Wim Taymans
73cc2e054c examples: pause timer in PAUSED 2020-01-03 09:33:20 +01:00
Wim Taymans
df519ee3b3 avoid including private.h
Expose some more methods to make it possible to build without
including the private.h header, especially in modules.
2020-01-02 13:48:50 +01:00
Michael Tretter
8e6a5a1714 v4l2: print pixelformat as string
The pixelformats are actual 4 letter sequences. Print the letters
instead of the hex value to make the output more readable.
2019-12-19 15:43:13 +01:00
Michael Tretter
eea3bc22b7 gst: do not send UNKNOWN format
If the video format cannot be detected, GStreamer will return the
UNKNOWN format, which is translated into the Id 0 in the
Spa:Interface:TypeMap, which is added to the pod.

When the pipewire server receives the pod and tries to unmarshal the
pod, it will detect the Id 0. Unable to distinguish Id 0 from a missing
id, the server discards the message as invalid and closes the
connection.

Use the following gstreamer pipeline to reproduce (note the wrong nv12
instead of a correct NV12 format):

	gst-launch-1.0 pipewiresrc ! video/x-raw,format=nv12 ! fakesink
2019-12-19 15:43:10 +01:00
Michael Tretter
94ffe88b65 filter: return error if id cannot be dereferenced
If an ID cannot be de-referenced, e.g., because the builder buffer is
too small, spa_pod_filter() still reports success, but the result is
NULL. Any subsequent access to result will cause a segfault.

Return an error if no pod is found to properly propagate and handle the
error.

The segfault can be reproduced by using the v4l2 module with Vivid
devices [0], because the buffer for the v4l2 controls is too small.

[0] https://github.com/PipeWire/pipewire/issues/138
2019-12-19 15:43:04 +01:00
Michael Tretter
5fa7630934 gst: fix NULL pointer when listing devices
The gstdeviceprovider segfaults when listing the available devices,
because it the pointer to GList * is initialized with NULL instead of
the GList * itself. Don't use a pointer, but use the GList * directly.
2019-12-19 15:43:00 +01:00
Michael Tretter
dfa8011ed4 gst: fix log level of GStreamer debug messages
Messages that are printed for every buffer should use the LOG debug
level, while messages that happen during setup and tear down should use
the DEBUG debug level.

Therefore, use LOG in on_process and when popping buffers and DEBUG when
Pipewire adds or removes buffers.
2019-12-19 15:42:55 +01:00
Michael Tretter
d5b1ab9db4 gst: replace tabs with spaces
In general, the GStreamer elements use spaces for indentation. Replace
the tabs by spaces.
2019-12-19 15:42:42 +01:00
Wim Taymans
437b97f160 media-session: cleanup some objects 2019-12-19 15:31:55 +01:00
Wim Taymans
d3db9d12bc proxy: never free a proxy automatically
Never free a proxy without the application doing a pw_proxy_destroy.

It's hard to use when proxies are freed randomly when the server
removes the ids. You have to add destroy notify to all proxies and
deal with the arbirary order in which proxies can be freed.
Instead notify the client of the remove and let it destroy the
proxies itself in the right order. This is in line with how wayland
handles proxies.

A pw_proxy_destroy() will now send a destroy to the server and mark
the proxy as a zombie, waiting for the remove_id confirmation and
then destroy the proxy.

A server remove_id will mark the proxy as removed and emits the
removed event. The app should then pw_proxy_destroy the proxy
to free it.

Leaks all proxies in the session manager because cleanup now needs
to be handled by the app correctly.
2019-12-19 15:25:21 +01:00
Wim Taymans
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
9657486a81 alsa-seq: update duration when slaved as well 2019-12-18 13:27:29 +01:00
Wim Taymans
686a5cf47e media-session: improve shutdown
First emit a remove of all objects. Then signal a session
destroy and then destroy the context.
2019-12-18 12:59:42 +01:00
Wim Taymans
24ab22db12 audioadapter: avoid infinite loop
Rewrite the slave/converter loop a little to avoid infinite loops.
2019-12-18 12:58:42 +01:00
Wim Taymans
147f488514 media-session: improve cleanup 2019-12-18 12:15:03 +01:00
Wim Taymans
2a4c57798d client-node0: remap target node property 2019-12-17 17:55:15 +01:00
Wim Taymans
616806bec2 update some docs 2019-12-17 17:55:01 +01:00
Wim Taymans
cc0be0d606 stream: only set portconfig on audio formats 2019-12-17 17:35:46 +01:00
Wim Taymans
e9b62c0ce6 v0: set media class
Set the media class on the client-node after we know the number of
ports.
Add more type mappings
Fix change_mask on core_info
2019-12-17 17:34:10 +01:00
Wim Taymans
59c92bddba policy-ep: allow linking to nodes
When the target node or target endpoint is specified, try to
link to it.
2019-12-17 15:58:43 +01:00
Wim Taymans
d67d012362 audioadapter: loop until we have data
Keep caling the slave processing function until we have data from
the converter or until no process can be made.
2019-12-17 15:11:31 +01:00
Wim Taymans
58a7e18ed5 audioadapter: set data flags 2019-12-17 15:08:39 +01:00
Wim Taymans
096db6d87d link: set the object id correctly
Before using the param from EnumFormat as a format param, set the
object ID to PARAM_Format to avoid confusion later on. Clients might
use the object id to enumerate parameters and then fail to enumerate
the current Format because the id is wrong.
2019-12-17 11:35:28 +01:00
Wim Taymans
d3f4dda51b client-node: improve debug 2019-12-17 11:35:04 +01:00
Wim Taymans
05f93cd750 media-session: improve cleanup 2019-12-17 10:47:31 +01:00