Commit graph

7520 commits

Author SHA1 Message Date
Igor V. Kovalenko
1eb010b397 module-tunnel: Initialize auto param default value to false
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/704>
2022-05-17 23:14:49 +03:00
Georg Chini
325108e532 time-smoother-2: Fix integer type problem
The byte_count argument of pa_smoother_2_get_delay() was defined as size_t
which lead to overflow problems on 32-bit architectures. Changed type
to uint_64.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/700>
2022-05-17 11:09:29 +00:00
Georg Chini
d8b0c9ab50 module-tunnel-sink/source-new: Add PA_STREAM_ADJUST_LATENCY flag at stream creation
Without the flag, the latency on the remote server will not be configured correctly.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/699>
2022-05-16 20:40:09 +02:00
Craig Howard
17eb178f17 module-tunnel: restart module
Defer the creation of the source/sink until after the TCP connection has
been established.  Upon protocol errors, try restarting the module.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/688>
2022-05-16 18:26:16 +00:00
Craig Howard
f81bb09772 tunnel-source-new: add restart/reconnect logic
Applies the same changes as to tunnel-sink-new: defer the source
creation until after the TCP connection is restablished, then attempt to
restart the module on failure.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/688>
2022-05-16 18:26:16 +00:00
Craig Howard
a48bee4f06 tunnel-sink-new: reinit module
When configured, reinitialize the module instead of exiting.  This
allows a restart/reconnect, but the module to appear to always be alive
when the user does: "pactl list modules".  (The sink will still not
exist until the tcp connection is established.)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/688>
2022-05-16 18:26:16 +00:00
Craig Howard
34d00afc74 tunnel-sink-new: create sink *after* connection
The io thread, after connection, sends a message asking for a sink to be
created.  After the ctl thread is done with creation, it sends a message
back to the io thread so it can continue.  This ensures that the sink
only exists when it's connected to something.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/688>
2022-05-16 18:26:16 +00:00
Craig Howard
117fa0cbe5 tunnel-sink-new: refactor sink creation
Move the sink creation logic to its own function.  This is in
preparation for sinks being created async.  Store the relevant config
parameters in userdata, so create_sink() can access that data.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/688>
2022-05-16 18:26:16 +00:00
Olivier Gayot
c3c84a3691 pactl: fix invalid JSON output by overriding LC_NUMERIC
When the --format json parameter is given on the command line, we
attempt to produce a JSON output for most commands.

Our implementation of the JSON serialization uses vsnprintf to output
numbers. Unfortunately, vsnprintf is affected by the locale and more
specifically the LC_NUMERIC variable.

When LC_NUMERIC is set to, for instance, fr_FR.UTF-8, floating-point
numbers are output with a comma as the decimal separator, which is then
considered invalid JSON.

 $ LC_NUMERIC=fr_FR.UTF-8 pactl --format json list sinks | jq .
 parse error: Objects must consist of key:value pairs at line 1, column 435

This is the token which failed to parse:

 }},"balance":0,00,"base_volume":{

Fixed by overriding the LC_NUMERIC value when we request JSON output.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/702>
2022-05-16 18:15:47 +00:00
Igor V. Kovalenko
4f2c8ec002 pa-info: Handle configuration files from .d directories
Pulseaudio reads client.conf.d/*.conf and daemon.conf.d/*.pa, print these too.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/701>
2022-05-16 18:11:47 +00:00
Igor V. Kovalenko
8bf8a98052 module-device-destore: Log restored port name
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/698>
2022-05-16 18:08:16 +00:00
Igor V. Kovalenko
bb5823a3c9 module-suspend-on-idle: Allow suspending a sink when the monitor source becomes idle
When monitor source becomes idle it may happen that monitored sink has no
uncorked inputs anymore and can now be suspended. To allow this, detect if state
is changed for monitor source and check state of monitored sink instead.

This change allows pulseaudio to suspend devices when pavucontrol volume meters
are disabled and corresponding peaks resampled streams are corked.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/697>
2022-05-16 18:05:03 +00:00
Igor V. Kovalenko
a4e690bda5 bluetooth: Make sure there is at least one SBC frame to encode
If SBC frame plus RTP header exceeds MTU size, let block size be at least one
frame to make sure bluetooth code can make progress reading and writing data.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/695>
2022-05-16 18:01:39 +00:00
Igor V. Kovalenko
a4402bb4f4 bluetooth: Limit effective SBC bitpool of incoming bluetooth connection
Turned out that SelectConfiguration is only used for outgoing connections, and
incoming connection from bluetooth headset using SBC codec ends up with a
bitpool as large as declared by headset. When resulting bitpool is so large that
SBC frame size plus RTP header size exceeds write MTU size, number of frames per
packet becomes zero causing crash dividing by zero in update_sink_buffer_size()

Fix this by limiting available bitpool value exposed for SBC endpoints.

Fixes: 89082cbfa ("bluetooth: a2dp dual channel SBC XQ codec configurations")
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/695>
2022-05-16 18:01:39 +00:00
Igor V. Kovalenko
1729e38a3e thread-test: Increase test timeout
This is not a performance test, but progress test of pa_cond_signal,
pa_cond_broadcast and pa_cond_wait in presence of multiple threads.

Increase test timeout to make it pass on slower hardware.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/696>
2022-05-09 09:34:46 +03:00
Josef Haider
852c15954e alsa-profiles: Add NI Komplete Audio 6 MK2 profiles
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/691>
2022-03-07 18:04:35 +01:00
Marijn Suijten
5af2afba85 bluetooth/gst: Timestamp encoding buffers according to PA clock
Commit c6d6ca541 ("bluetooth/gst: Replace buffer accumulation in adapter
with direct pull") removed the `timestamp` parameter from GStreamer
transcoders due to being unused, but these should instead be propagated
to the GStreamer encoding buffers.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/494>
2022-02-21 12:33:18 -05:00
Marijn Suijten
5f37914eb8 bluetooth/gst: Replace buffer accumulation in adapter with direct pull
Bluetooth codecs should always have fixed in/output and are hence able
to have their results directly read from the codec, instead of
accumulating in a buffer asynchronously that is subsequently only read
in the transcode callback.  The Bluetooth backends calling encode/decode
also expect these fixed buffer sizes.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/494>
2022-02-21 12:31:32 -05:00
Marijn Suijten
201dc6542b bluetooth/gst: Use GStreamer synchronously within PA's IO thread
Handling multiple threads does not come without overhead, especially
when the end-goal is to ping-pong them making the whole system run
serially.  This patch rips out all that thread handling and instead
"chains" buffers to be encoded/decoded directly into the pipeline,
making them execute their work on the current thread.  The resulting
buffer can be pulled out from appsink immediately without require extra
locking and signalling.  While the overhead on modern systems is found
to be negligible or unnoticable, code complexity of such locking and
signalling systems is prevalent making it the main drive behind this
refactor.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/494>
2022-02-21 12:31:32 -05:00
Sanchayan Maity
516c691f69 bluetooth: Rename rtp_sbc_payload to rtp_payload
Now that we use RTP payload structure for LDAC as well, rename
rtp_sbc_payload to rtp_payload. PipeWire also uses the same naming.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/689>
2022-02-21 12:15:47 +05:30
Sanchayan Maity
9f0a18b290 bluetooth: ldac: Fix RTP payloading of encoded packet
Drop rtpldacpay and payload the LDAC encoded output manually in the
RTP header.

The RTP payload seems to be required as it carries the frame count
information. Right now, rtpldacpay does not add this so construct
the RTP header and payload manually.

Strangely some devices like Shanling MP4 and Sony XM3 would still
work without this while some like the Sony XM4 does not.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/689>
2022-02-21 12:15:47 +05:30
guest271314
4b996e2a7b pacat: Include the special default device names in documentation
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/684>
2022-01-26 17:13:53 +00:00
Tanu Kaskinen
16f0a4d7f4 alsa-mixer: Add analog-input path to TI PCM2902 mappings
At least Behringer Xenyx 302USB doesn't have any Mic mixer elements (or
indeed any capture mixer elements), so having analog-input-mic as the
only input path caused the input mappings to not show up on this sound
card.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1325
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/685>
2022-01-26 16:57:52 +00:00
liaohanqin
b8c15e8787 pactl: optimized code
some if statements are redundant, use switch instead of it.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/686>
2022-01-25 16:09:32 +08:00
Jaroslav Kysela
bc3a07dd4f alsa: ucm - use possible mixer private device prefix for ELD controls
If UCM defines the private alsa-lib configuration, the ELD controls
are expected to use this device configuration too.

With this change:

  I: [pulseaudio] alsa-util.c: Successfully attached to mixer '_ucm0009.hw:Loopback'

Without:

  I: [pulseaudio] alsa-util.c: Successfully attached to mixer '_ucm0009.hw:Loopback'
  I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:4'

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/673>
2021-12-29 16:13:43 +00:00
Jaroslav Kysela
f5c8b82c3b alsa: mixer - more clever alias cache implementation
The hw: device can be addressed using the card index (hw:0)
or the card identifier (ASCII string - hw:Loopback). Both
mixers are equal.

The previous code was fine for the mixers without the UCM
private prefixes (_ucmXXXX). Make code more robust, create
two aliased mixer structures in the mixers array.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/673>
2021-12-29 16:13:43 +00:00
Diederik de Haas
1883355f1b conf: Note configuration snippets must end in .pa
At least on Debian (based) systems, the convention for configuration
files is .conf, but for PA they need to be .pa, so mention that.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/678>
2021-12-18 19:56:46 +01:00
BtbN
5b000acb1a channelmap: make channel map tables static
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/674>
2021-12-17 23:39:15 +00:00
Laurent Bigonville
6e45a64478 util: Fix getting the binary name for GNU/Hurd
This fixes the get-binary-name-test test

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/671>
2021-12-16 16:26:11 +01:00
Laurent Bigonville
ea20555378 iochannel: Fix FTBFS on GNU/Hurd
This is a followup patch for 0efc38e95f

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/671>
2021-12-16 16:17:13 +01:00
Jaroslav Kysela
a9cc1373e2 alsa: ucm - update the mixer path also after volume probe
The mixer path is cached in the port structure. The function
probe_volumes (alsa-ucm.c) may wipe the mixer path when
the control probe fails, so it is required to update
the mixer path for the port again.

BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/100
BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1849
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/670>
2021-12-16 14:21:00 +02:00
Jaroslav Kysela
663e41f933 alsa: ucm - fix h/w mute mixer control probe
BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/100
BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1849
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/670>
2021-12-16 12:41:11 +01:00
Jaroslav Kysela
4d98c8bbf1 alsa: ucm - remove duplicate assignment
The data pointer is already set few lines before.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/670>
2021-12-16 12:41:11 +01:00
Mathy Vanvoorden
2101078c22 jackdbus-detect: Allow to configure multiple sinks/sources
This makes it possible to define multiple sinks/sources on detection
of the jack server. This allows one to for example create a separate
sink for conferencing software and route that in jack to another
channel on their audio interface.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/669>
2021-12-16 11:25:41 +00:00
Tanu Kaskinen
ece71de3fd alsa-mixer: Improve documentation in texas-instruments-pcm2902.conf
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/667>
2021-12-16 12:48:20 +02:00
simple
741a96f20b alsa-mixer: Rename behringer-umc22.conf to texas-instruments-pcm2902.conf
The USB ID that Behringer UMC22 uses actually belongs to Texas
Instruments PCM2902, which is a generic chip used in multiple products.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/667>
2021-12-16 12:36:26 +02:00
simple
7f02f3a0c0 alsa-mixer: Fix mono input for Texas Instruments PCM2902
Even though the file name is currently behringer-umc22.conf, the USB ID
actually belongs to Texas Instruments PCM2902, which is a generic chip
used in multiple products. Some products have true mono input unlike
Behringer UMC22, which has two mono inputs combined into one stereo PCM
device.

This patch removes the "mono,mono" mapping from Behringer UMC22, which
hopefully won't be missed too much (there are still "mono,aux1" and
"aux1,mono" mappings available for mono recording).

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/667>
2021-12-16 12:36:03 +02:00
Mathy Vanvoorden
cc8df06b9d jackdbus-detect: Make it possible to disable sink or source
In some cases you might not want to enable the autogenerated sink or
source because you only have a need for the other. An argument was
added that is checked before the module-jack-{source,sink} is loaded.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/668>
2021-12-09 13:53:09 +01:00
Hui Wang
484b69863f card-restore: setting preferred ports in entry_from_card
If the preferred ports are not set in this function, the
entrys_equal() always returns false in the card_put_hook_callback().
This will make the entry be written into the metadata and the
preferred ports will be cleaned by a mistake.

And we met a hdmi audio bug which has sth to do with this issue, on
the machines with the legacy HDA audio driver, the hdmi port has lower
priority than speaker, users need to manually select the hdmi to be
active output port, then the preferred output port is hdmi for this
sound card, after reboot, the card_put_hook_callback() in the
module-card-restore.c will be called and the preferred ports are
cleaned by a mistake, then the hdmi output port or hdmi sink couldn't
switch to be active after reboot or resume automatically. That is
because the preferred ports are cleaned and hdmi port has lower
priority than speaker, the profile_good_for_output() in the
module-switch-on-port-available.c always returns false.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2021-11-18 12:04:16 +08:00
Arun Raghavan
197fda6b27 tests: Add passthrough test back to daemon tests
This got dropped during the move to meson.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/665>
2021-11-17 16:44:29 -05:00
Igor V. Kovalenko
56a9743fcb build-sys: meson: Make glib and fftw common dependencies
GSettings module (daemon) requires both gio and glib, move glib to common block.
qpaeq requires fftw, move fftw to common block.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
2021-11-17 16:06:23 +00:00
Igor V. Kovalenko
5fcc70e2e8 build-sys: meson: Fix indentation in daemon/client blocks
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
2021-11-17 16:06:23 +00:00
Igor V. Kovalenko
80c0a497d3 build-sys: meson: Rearrange dependencies under client and daemon options
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
2021-11-17 16:06:23 +00:00
Igor V. Kovalenko
6dd14ad9f1 build-sys: meson: Move remaining tests under daemon and client builds
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
2021-11-17 16:06:23 +00:00
Igor V. Kovalenko
6928714b64 build-sys: meson: change daemon-only to client
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
2021-11-17 16:06:23 +00:00
Mart Raudsepp
4cf4a1fd5b build-sys: meson: Allow building the daemon only
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
2021-11-17 16:06:23 +00:00
Igor V. Kovalenko
1a3ffd4cee bluetooth: Fix device->adapter dependency while releasing discovery
Change d7f95170a1 added a dependency on device
adapter pointer being valid while checking if bluetooth profile is supported by
device.

When adapter object is released, each device holding pointer to adapter being
released is notified to reset that to NULL. Since adapter objects are released
first when discovery object is unreferenced, each device will have adapter
pointer reset before the time device objects are released.

Fix observed crash by examining device adapter pointer. If it is NULL report
that device does not support any bluetooth profile instead of looking at UUIDs
supported by adapter.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/646>
2021-11-17 15:30:03 +00:00
Marijn Suijten
0c5672390b bluetooth/backend-native: Replace tab-indents with spaces
Fixes: 7fd89e491 ("bluetooth: Try to reconnect SCO")
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/649>
2021-11-17 15:25:00 +00:00
Georg Chini
fdf37d9a91 loopback: Add log_interval parameter
Add a log_interval parameter to control the amount of logging. Default is
no logging. Like for adjust_time, the parameter is a double to allow values
below 1s.
If the log interval is too small, logging will occur on every iteration.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/56>
2021-11-07 18:17:37 +00:00
Georg Chini
0f91b2146d loopback: Change adjust_time parameter to double to allow adjust times below 1s
The adjust_time parameter is changed to double to allow better granularity
and adjust times below 1s. This may be useful for a better latency control,
although with alsa devices and the current smoother code no significant
improvement could be found for values below 500ms.
This patch also changes the default adjust time to 1s, the old value of 10s
does not allow a tight control of the end to end latency and would lead to
unnecessary jitter.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/56>
2021-11-07 18:17:37 +00:00