Commit graph

7688 commits

Author SHA1 Message Date
Peter Hutterer dfb63d55dd media-session: use the SESSION_PREFIX for any fallback config dir
Regression introduced in 3560f3ba2d

MEDIA_SESSION_CONFIG_PATH expects the actual directory while
PIPEWIRE_CONFIG_PATH and the built-in fallback both expect the files to
reside within the SESSION_PREFIX subdirectory.

Fixes #1725
2021-10-18 07:23:00 +00:00
Peter Hutterer 56f01a293c media-session: fix config load path
config_dir is the new MEDIA_SESSION_CONFIG_DIR environment variable (if
set), impl.config_dir is that or the fallback, whichever applies.

Fixes 00bd3b5b59
Fixes #1725
2021-10-18 07:23:00 +00:00
Peter Hutterer 6f74dc1375 ci: add a build job for the various session managers we build
We allow those jobs to fail so a theoretical issue in the session
managers doesn't prevent our pipeline from completing.
The failure could however be due to our integration of the session
managers, so failures should still be inspected nonetheless.
2021-10-18 09:19:21 +10:00
Peter Hutterer bff243d7f3 ci: clarify a debug message
Where MESON_OPTIONS is empty, the single line "Building with" is not
particularly self-explanatory.
2021-10-18 09:19:21 +10:00
Peter Hutterer 6843d1bffb ci: rebuild the ubuntu container to pick up newer ca-certificates
Otherwise git clone fails for the subprojects.
2021-10-18 08:14:56 +10:00
Wim Taymans c4e1b69df2 doc: add some more links 2021-10-15 19:26:37 +02:00
Wim Taymans e1deecc3cd impl-link: also update node id in properties
The link might have been made using the node name/nick/description but
we always want to place the id in the properties to make it easier for
apps to handle the relations between objects.

See #1723
2021-10-15 17:58:05 +02:00
Wim Taymans 061ab16415 resample: tweak params a little
Gives less aliasing in Sweep-float.wav.
2021-10-15 12:54:49 +02:00
Peter Hutterer a2856c6e0f test: silence coverity warnings about potential tmpdir being NULL 2021-10-15 14:42:26 +10:00
Peter Hutterer 00bd3b5b59 media-session: store the config dir path in our object
The media session modules need to load config files through
sm_media_session_load_conf() and that must be the same config dir as our
main configuration file's directory.
2021-10-15 10:53:32 +10:00
Barnabás Pőcze 5cfdc2620c meson.build: set MEDIA_SESSION_CONFIG_DIR in devenv
Commit 6c156cdbb4 made pw-uninstalled.sh
export the MEDIA_SESSION_CONFIG_DIR environmental variable, its value
being the location of the media-session configuration files in the
build directory.

Export this environtmental variable in the meson devenv as well.

Fixes: 6c156cdbb4 ("media-session: move the media-session config files to here")
2021-10-14 21:54:37 +02:00
Michael Olbrich d2ce51d504 stream: decrement busy counter when releasing dequeued buffers
For buffers on the 'dequeued' list, the busy counter was already
incremented in impl_node_process_input(). So it must be decremented again
when these buffers are removed.
2021-10-14 19:16:56 +00:00
Michael Olbrich 314ff82ff0 pipewiresrc: fix handling outstanding buffers when stopping
The current code has several issues if a pipewiresrc is stopped and deleted
while a buffer is still in use downstream.

 - pw_stream_queue_buffer() is never called for the corresponding
   pw_buffer. As a result, the busy counter is never decremented and
   pw_stream_dequeue_buffer() of the corresponding pipewire output will
   return NULL whenever it encounters this buffer.

 - The pipewiresrc does not own the buffer reference unless the buffer is
   queued in the source, so calling gst_buffer_unref() unconditionally
   causes refcount issues for the buffer.

 - buffer_recycle() can race with on_remove_buffer() and
   gst_pipewire_src_close(). As a result, buffer_recycle() may access pwsrc
   when it was already deleted.

The buffer has its own reference to the pool. So the pool object lock can
be used to ensure that the pwsrc, core and stream remain valid in.
buffer_recycle(). If the 'dispose' function pointer was already cleared,
then on_remove_buffer() has already finished, so abort early.

With the pool lock held, it is save to access the pipewire loop. Now the
loop lock can be used to synchronize with on_remove_buffer(). 'dispose'
must be checked again in case on_remove_buffer() was triggered by something
other than gst_pipewire_src_close().

In on_remove_buffer() unref the buffer if it is queued. Otherwise call
pw_stream_queue_buffer() to ensure that the busy counter is decremented
correctly.
2021-10-14 19:16:56 +00:00
Michael Olbrich 744a8aaeb7 gst: init last_error
Otherwise, it may be used uninitalized.
2021-10-14 19:16:56 +00:00
Wim Taymans d4207d3b0c pw-v4l2: fix script as suggested by shellcheck 2021-10-14 21:14:45 +02:00
columbarius 07d0b14955 spa: specify SPA_FORMAT_VIDEO_MODIFIER as DMA-BUF only
SPA_FORMAT_VIDEO_MODIFIER is only valid with DMA-BUF transport.
For using other types of buffers omit this property.
2021-10-14 20:19:21 +02:00
Wim Taymans 1f5396fedb stream: don't change to the error state on proxy errors
The proxy errors are really from the session manager informing us about
decisions it made (failure to link, etc). The state of the stream is not
really affected by this so just emit the error signal and let the app
decide what to do.
2021-10-14 16:00:40 +02:00
Wim Taymans 8c346ab3a7 pulse-server: list NETWORK flag on devices
Mark network sinks and sources with node.network.
2021-10-14 13:45:58 +02:00
Wim Taymans d6c1479ba0 module-zeroconf-discover: also parse the channel_map
So that we create the device with the same channel_map as the remote
end.

Fixes #1692
2021-10-14 13:28:43 +02:00
Wim Taymans 257bbb1fd5 echo-cancel: flush streams in PAUSED
so that we don't end up with old data when we resume.

Fixes #1660
2021-10-14 12:18:37 +02:00
Wim Taymans 12567ea5d8 pipewire-v4l2: add enum_framesize ioctl 2021-10-14 10:16:35 +02:00
Wim Taymans 3ee852b808 pipewire-v4l2: More improvements
Keep separate map for fd to files so we can implement dup.

Filter out duplicates in enumfmt.

tryfmt should return the closest match.

Use pthread_once to init the global state.

Make things mostly work in GStreamer.
2021-10-14 10:16:35 +02:00
Wim Taymans 8175c8276d pipewire-v4l2: more improvements
Add support for more formats.
Connect in the reqbufs ioctl so that we can negotiate the right amount
of buffers.
Keep file and buffer maps so that we can map an address to a file and
then the address to a buffer of that file. We can then also check if the
buffers were unmapped properly.
Implement some more ioctls.
Add some more checks.
2021-10-14 10:16:35 +02:00
Wim Taymans b466fe67dd pipewire-v4l2: Implement more ioctls
Collect all video/source nodes and enumerate their formats. We use this
to return the supported formats and to check if a format is supported.

Use evenfd as the even we return from open. Make the eventfd readable
when we have a new buffer ready.

Connect a stream when setting a format. Collect buffers. Implement
mmap/munmap on the buffer memory. Implement queue and dequeue of buffers.

This is enough to make the webcam test work in firefox.
2021-10-14 10:16:35 +02:00
Wim Taymans e68fd36f90 pipewire-v4l2: the start of a v4l2 LD_PRELOAD library 2021-10-14 10:16:35 +02:00
Wim Taymans 57b3fe537e v4l2: handle discrete and stepwize frame size enumeration 2021-10-14 10:15:34 +02:00
Wim Taymans 30f8219afd stream: improve some debug 2021-10-14 10:02:13 +02:00
Peter Hutterer 40eb9578d5 media-session: make a few debug messages easier to understand
Especially with PIPEWIRE_LOG_LINE=false, those messages are too
confusing otherwise.
2021-10-14 07:51:27 +00:00
Peter Hutterer 6c156cdbb4 media-session: move the media-session config files to here 2021-10-14 07:51:27 +00:00
Peter Hutterer 3560f3ba2d media-session: add MEDIA_SESSION_CONFIG_DIR as lookup location
Use this to override the default $PIPEWIRE_CONFIG_DIR/media-session.d
directory. This allows us to have separate configuration directories for
pipewire and media-session.
2021-10-14 07:51:27 +00:00
Peter Hutterer 4bfe8fb319 Remove empty PROTOCOL file
Having a file like this that is empty is just teasing.
2021-10-14 09:44:26 +10:00
Peter Hutterer d812f32d18 Remove leftover github pages configuration
We don't seem to produce github pages, no need for a config file.
2021-10-14 09:17:26 +10:00
Peter Hutterer 4ec2a6b320 modules: fix a property fetch
Leftover from an earlier version where get() was what is now called
fetch().

Fixes d8d7e90ceb21dac3723fa3c3fd3c2983afe1372
2021-10-14 06:32:20 +10:00
Pauli Virtanen 15d1ddfc6b bluez5: fix bugs in spa_bt_player
Fix uninitialized variable, error return.
2021-10-13 18:07:29 +00:00
Wim Taymans 64d6ff4184 modules: flush and reset state in paused
So that we don't end up with previous data when we resume.

See #1660
2021-10-13 18:37:02 +02:00
Wim Taymans 6e818480c1 filter-chain: implement convoler_reset
To reset the state of the convolver.
2021-10-13 18:36:20 +02:00
Wim Taymans 0d1f7be0e9 context: the max quantum is never scaled with samplerate
Or else we could end up with a quantum > 8192 when we have a higher
samplerate than the default and we crash.

See #1702
2021-10-13 17:11:28 +02:00
Wim Taymans 058cecee7e pulse-server: remove some pw_log_info debug 2021-10-13 15:44:38 +02:00
Wim Taymans f1c29194a8 pulse-server: improve lookup of default source and sink
Make things work then there is no default input device and the default
source is actually the monitor of the default sink.

Also implement lookups of monitor sources with the monitor id as the
name.

Fixes #1691
2021-10-13 15:39:41 +02:00
Wim Taymans 1b09640b6f pulse-server: use find_device for get_info of a device
So that we also go through the same logic for finding the default
source and sink when needed.
2021-10-13 15:38:59 +02:00
Wim Taymans 54c0857d57 cpu: also pass the sse_args when compiling with SSE 2021-10-13 15:10:21 +02:00
Wim Taymans 14fd5425af cpu: use intrinsics to modify status register
For better portability. Also only use the code when we can compile with
SSE is available.
2021-10-13 15:00:09 +02:00
Peter Hutterer 027dd25980 pipewire: declare pw_proxy_ref/unref
Both are already SPA_EXPORT but missing from the public header file.
2021-10-13 09:13:12 +00:00
Peter Hutterer 55200209b5 meson.build: fix some formatting 2021-10-13 09:13:12 +00:00
Peter Hutterer ec5b8bf153 meson: use cdata.set_quoted instead of manual quoting 2021-10-13 09:13:12 +00:00
Wim Taymans d8540cc596 impl-node: always deactivate node in suspend
pause_node() will check the IDLE state of the node and will not
deactivate the node when suspending when it was already IDLE.

Fixes an issue where node.pause-on-idle=false filters would not want to
resume after a suspend.
2021-10-13 10:54:45 +02:00
Wim Taymans e77a0e8dc4 impl-node: start always need activate_node 2021-10-13 10:51:24 +02:00
Wim Taymans e0974122ce impl-node: rename pending to pending_state for clarity 2021-10-13 10:50:41 +02:00
Wim Taymans c8c4923fcb spa: use log topics 2021-10-13 10:48:23 +02:00
Peter Hutterer eabd00e012 properties: log a warning if the property type differs
If we try to fetch a property as some specific type and the parsing
fails, log a warning. This should catch any client bugs where the
properties are set wrongly.
2021-10-13 07:12:00 +00:00