Commit graph

7436 commits

Author SHA1 Message Date
Peter Hutterer ae59185f6f pw-cli: use readline() in interactive mode
With history and a simple command completion hook this makes the
interactive mode a lot easier to deal with.
2021-09-28 07:19:13 +00:00
Peter Hutterer 7d58ce9e24 pw-cli: add a 'quit' command to exit
Slightly less confusing for new users if we have at least one
help-listed command to exit.
2021-09-28 07:19:13 +00:00
George Kiagiadakis becd76de58 bluez5: sco-sink: Add follower mode 2021-09-27 17:31:16 +00:00
Jonas Holmberg 61a2577941 pipewire-alsa: fix a memory leak
Free node_name.
2021-09-27 11:05:34 +02:00
Pauli Virtanen dc7b88e1da bluez5: fix CVSD recording on Intel AX200
Intel 8087:0029 at Firmware revision 0.0 build 191 week 21 2021 on
kernel 5.13.19 produces CVSD data stream that consists of 96-byte data
packets interleaved with 96-byte zero packets.

This seems to not occur on other adapters, which usually produce only
48-byte data packets.
2021-09-26 17:58:06 +03:00
Pauli Virtanen 9e94aafaec bluez5: fix FastStream microphone support on some devices
Some devices require the source direction bit to be selected, in order
to send data.
2021-09-25 16:27:57 +00:00
Pauli Virtanen 65f881c222 bluez5: fix kernel version regexps
5.14.x kernels do support msbc-alt1, and should not be rejected.
2021-09-25 16:27:34 +00:00
Pauli Virtanen 0af3c85806 bluez5: don't probe native backend presence
Don't do a blocking probe of native backend presence, because it may
trigger DBus activation for Bluez.  If the DBus activation fails, it
ends up blocking until timeout.

ofono/hsphfpd usually don't have DBus activation configured, so they
fail instantly (which is why this problem was not encountered, even
though they do blocking calls on startup in previous pipewire versions
too).

Instead, select the backend once we have Bluez objects listed.
2021-09-25 16:24:10 +00:00
Peter Hutterer 40487e485d daemon: only call pw_log_set_level() if -v is actually given
Previous commit 69e935e unconditionally called pw_log_set_level() after
the option parsing. If pw_init() changed the logging level based on
PIPEWIRE_DEBUG, we'd now overwrite that change.

Call pw_log_set_level() only if -v is actually given on the commandline.
This means a commandline option will override PIPEWIRE_DEBUG if set but
that is intended.

Fixes 69e935e8a4
2021-09-25 07:21:01 +10:00
Peter Hutterer 69e935e8a4 daemon: allow for a -v, -vv, -vvv argument to increase verbosity
Sometimes that's faster than having to play with PIPEWIRE_DEBUG.
Same for pipewire-media-session.
2021-09-24 10:49:42 +00:00
Peter Hutterer 39fa2e503f man: fix an indentation issue in pipewire.1 2021-09-24 10:49:42 +00:00
Peter Hutterer 6668d5bbc4 test: fix the environment variable name to disable systemd logging
Fixes 165bc7e289
2021-09-24 12:33:15 +10:00
Peter Hutterer 49ebcfb093 spa: drop the pre-C99 checks from the log.h header
spa_log_logv was missing, so with this ifdef'd out we already fail to
compile:
spa/plugins/alsa/alsa-acp-device.c:1003: undefined reference to `spa_log_logv'

And it appears that the only requirement is __VA_ARGS__ support in the
compiler which we require in other places anyway.
2021-09-24 12:33:02 +10:00
Peter Hutterer 2b65fb36f2 test: simplify the logger test a bit
The tests using this function use the pw_log* macros which invoke
whichever logger pipewire has set. Since the default logging
implementation supports logging to a file anyway, let's just use that
instead of having to load the plugin ourselves.
2021-09-24 12:33:02 +10:00
Wim Taymans f1f5cbc0a6 support: return completion from process
HAVE_DATA|NEED_DATA signals that the graph can continue processing.
OK means that the node will continue asynchronously later. This
is needed to make the dummy driver work as a follower.
2021-09-23 16:36:32 +02:00
Wim Taymans 21616a25ad alsa: sync with pulseaudio
Fixes #1642
2021-09-23 15:02:08 +02:00
Yuri Chornoivan a118d2e625 po: Update Ukrainian translation 2021-09-23 11:21:48 +00:00
Wim Taymans cb474043fa pulse-tunnel: add pulse.latency option
Add a pulse.latency option to override the default 100ms latency.
2021-09-23 13:11:52 +02:00
Wim Taymans 88ba3014d6 pulse-tunnel: increase default latency to 100ms
20ms is too small and might be a typo from the pulseaudio 200ms default
latency.
2021-09-23 13:00:15 +02:00
Wim Taymans c41e3553bf 0.3.37 2021-09-23 10:17:19 +02:00
Wim Taymans d1484a6556 spa: fix layout defines
Fixes #1637
2021-09-23 09:58:36 +02:00
Peter Hutterer 165bc7e289 test: disable the journal logger for tests
No point spamming the journal here.
2021-09-23 15:40:47 +10:00
Peter Hutterer 29fdd10066 test: add two tests for the spa_interface callback versioning 2021-09-23 15:30:22 +10:00
Peter Hutterer f06741d6fc media-session: define NAME before including reserve.c
This ensures the log messages show up with the right module name prefix
2021-09-23 15:29:52 +10:00
Peter Hutterer 207c5796b6 pulse: print the strerror on metadata errors 2021-09-23 15:29:48 +10:00
Pauli Virtanen 717004334b bluez5: backend-native: don't use libbluetooth hci commands
BlueZ 6 is planning to make most of libbluetooth private.  In
particular, the direct hci access is planned to be removed.  This is
currently used for determining adapter msbc support.

Instead of using libbluetooth API, try to determine msbc support by
a connect() attempt, which the kernel should reject when not supported.
2021-09-22 20:18:50 +03:00
Wim Taymans 884ecab425 add SPA_EXPORT for public functions
Fixes #1638
2021-09-22 15:14:21 +02:00
George Kiagiadakis 7e8446e984 coverity: fix multiple source code parse errors
Coverity scans the source code for static analysis, but its parser
has a couple of flaws...
The most common one is the failure to parse deprecation macros in
enum definitions, like:

```
  G_PARAM_PRIVATE GLIB_DEPRECATED_ENUMERATOR_IN_2_26 = G_PARAM_STATIC_NAME,
                  ^
  SD_JOURNAL_SYSTEM_ONLY _sd_deprecated_ = SD_JOURNAL_SYSTEM /* old name */
                         ^
```

but also recent gcc built-in macros, like:

```
  #if __has_builtin(__builtin_is_constant_evaluated)
      ^
  #if _GLIBCXX_HAS_BUILTIN(__has_unique_object_representations)
      ^
```

The solution is to replace the code with regular expressions at an earlier
stage. This can be configured directly in coverity with cov-configure
2021-09-22 15:17:20 +03:00
Wim Taymans 3f032ae464 build: fix session manager path 2021-09-22 09:04:15 +02:00
Peter Hutterer e46a30562f Promote media-session to its own subdirectory
media-session is past the point of being a mere example, let's promote
it out of the subdirectory.

pw-reserve is moved to tools/
2021-09-22 08:53:08 +02:00
Peter Hutterer 6f43aba91d doc: check if the media_session_sources variable exists
When building with -Dexamples=disabled, the whole src/examples is
skipped, so we never declare that variable.

Fixes #1551
2021-09-22 13:58:11 +10:00
Peter Hutterer c6f0ac7ff0 test: fix the calls to pw_deinit()
Missing from some tests, superfluous in the other test because it was
already called in the test_log_levels() helper function
2021-09-22 12:15:35 +10:00
Peter Hutterer 48cff597a6 test: don't try to log for LOG_LEVEL_NONE
We can only log for a level below our current one if we are two above
NONE. And by the same instance, we don't expect NONE messages to show
up.
2021-09-22 12:15:34 +10:00
Peter Hutterer b00bc81929 test: fix a use-of-uninitialized-variable compiler warning
False positive, we abort in the cases where this isn't initialized.

Fixes e1672f9762
2021-09-22 12:15:33 +10:00
Anders Jonsson 93e51a85f1 po: Update Swedish translation 2021-09-21 22:30:42 +02:00
Wim Taymans 6f519d4052 pulse-server: put the channel map in the loopback args
Fixes #1486
2021-09-21 18:33:29 +02:00
Wim Taymans 59203c11b8 jack: only update buffer_size/srate when active
As long as we are inactive, don't update our internal buffer_size or
sample rate. This way, when we become active, we will emit the right
callback with the right value instead of doing nothing.

Fixes crashes in Carla.
2021-09-21 18:32:30 +02:00
Wim Taymans c8f629a0a3 pulse-server: improve module args compatibility
Boolean switches can also be true with 'y', 'yes', 't' and 'on'
2021-09-21 17:39:11 +02:00
Javier Martinez Canillas 310e6009ca
libcamera: fix a segfault caused by queueing no longer valid requests
The requests_ vector contains the requests created for a camera on start()
but the vector elements are not removed on camera stop(). This leads to a
segfault, when these requests that are no longer valid are queued again.

Also move the streamName_ map clear to LibCamera::stop() where it should
be, since its elements are added in the LibCamera::start() function.
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas 439dc8eb2a
libcamera: disconnect camera in spa_libcamera_stream_off()
The camera is connected in the spa_libcamera_stream_on() function but the
disconnect happen in LibCamera::stop(). It makes more sense to have this
two operations separated as it's done for the connection and start, since
the camera then can be stopped/started without needing to do a reconnect.

Move the camera disconnect to spa_libcamera_stream_off() for the reason
mentioned above but also to make the code more consistent and symmetric.
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas ce9f75abaa
libcamera: free the FrameBufferAllocator buffers before deleting it
The libcamera application developer guide mentions that buffers allocated
by the FrameBufferAllocator must be explicitly freed before deleting it.
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas 21c412dc49
libcamera: fix a use-after-free due an attempt to stop the camera twice
Camera is currently stopped and started in the spa_libcamera_set_format()
function, but this leads to a segfault due attempting to access a buffers
field of an already freed libcamera::FrameBufferAllocator instance.

The FrameBufferAllocator instance is freed in LibCamera::stop(), that is
called by spa_libcamera_stream_off() as handler of the node commands
SPA_NODE_COMMAND_Pause and SPA_NODE_COMMAND_Suspend.

Since the camera was already stopped, there's no need to attempt to stop
it again. In fact, the camera shouldn't be stopped/started at all in the
spa_libcamera_set_format() function but instead only as an action of the
SPA_NODE_COMMAND_{Pause,Suspend} and SPA_NODE_COMMAND_Start commands.

And same for the stop that's done in the LibCamera::close() function, it
shouldn't be needed because the camera is already stopped before closing.

Fixes #1513
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas a7a6f19815
libcamera: don't set camera configuration in LibCamera::start()
There is no need to set and validate the configuration when the camera
is started, since this was already made when the camera was opened.

The configuration only needs to be set again if the port format changes
due a SPA_PARAM_Format parameter.
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas 2d69f775de
libcamera: add a libcamera_set_config() helper function to the wrapper
The libcamera wrapper provides a set of C functions that wraps libcamera's
C++ interface. But there isn't a function to call LibCamera::set_config().
2021-09-21 14:49:08 +02:00
Wim Taymans 7c11dcf808 alsa: enumerate all passthrough formats
Don't use the audio.channels and audio.rate settings influence the
passthrough formats.

See #93
2021-09-21 13:02:48 +02:00
Wim Taymans 423e8b2f03 Revert "pipewire-alsa: Make it MT safe"
This reverts commit f22dd9d781.

Obsolete now that pw_init and factory loading/unloading has been
made thread safe.
2021-09-21 12:35:03 +02:00
Wim Taymans d8aec1c7b4 pw-play: move dsdplay into pw-cat 2021-09-21 12:29:41 +02:00
Wim Taymans 0ec77ab09c dsd: show rate in bytes per seconds. 2021-09-21 12:25:42 +02:00
Wim Taymans 1c3802bd82 spa: add SPA_ABS helper macro 2021-09-21 12:16:11 +02:00
Wim Taymans 23edb9ab2a pipewire: release lock when clearing handle
The handle might want to unload plugins and we thus need to release the
lock.
2021-09-21 10:58:07 +02:00